Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClément Foucault <foucault.clem@gmail.com>2020-09-05 18:37:01 +0300
committerClément Foucault <foucault.clem@gmail.com>2020-09-05 18:49:14 +0300
commit895ec052128dba7b319e07af40fb91fdd50aff19 (patch)
tree2a4cdc85cd14f256df280ea80a44c7d14d56da3b /source/blender/gpu/intern/gpu_texture_private.hh
parent13305fb5138a6d1df1ac1edd5bd7da5d1a0b54dd (diff)
Cleanup: GPUTexture: Clean framebuffer attachment
Diffstat (limited to 'source/blender/gpu/intern/gpu_texture_private.hh')
-rw-r--r--source/blender/gpu/intern/gpu_texture_private.hh12
1 files changed, 7 insertions, 5 deletions
diff --git a/source/blender/gpu/intern/gpu_texture_private.hh b/source/blender/gpu/intern/gpu_texture_private.hh
index e3872c4d4b5..207f3919a50 100644
--- a/source/blender/gpu/intern/gpu_texture_private.hh
+++ b/source/blender/gpu/intern/gpu_texture_private.hh
@@ -74,9 +74,6 @@ class Texture {
int refcount = 1;
/** Width & Height (of source data), optional. */
int src_w = 0, src_h = 0;
- /** Framebuffer references to update on deletion. */
- GPUAttachmentType fb_attachment[GPU_TEX_MAX_FBO_ATTACHED];
- FrameBuffer *fb[GPU_TEX_MAX_FBO_ATTACHED];
protected:
/* ---- Texture format (immutable after init). ---- */
@@ -96,6 +93,11 @@ class Texture {
/** For debugging */
char name_[DEBUG_NAME_LEN];
+ private:
+ /** Framebuffer references to update on deletion. */
+ GPUAttachmentType fb_attachment_[GPU_TEX_MAX_FBO_ATTACHED];
+ FrameBuffer *fb_[GPU_TEX_MAX_FBO_ATTACHED];
+
public:
Texture(const char *name);
virtual ~Texture();
@@ -114,9 +116,9 @@ class Texture {
virtual void mip_range_set(int min, int max) = 0;
virtual void *read(int mip, eGPUDataFormat format) = 0;
- void attach_to(FrameBuffer *fb);
+ void attach_to(FrameBuffer *fb, GPUAttachmentType type);
+ void detach_from(FrameBuffer *fb);
void update(eGPUDataFormat format, const void *data);
- void update_mip(int mip, eGPUDataFormat format, const void *data);
virtual void update_sub(
int mip, int offset[3], int extent[3], eGPUDataFormat format, const void *data) = 0;