diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2020-09-03 22:52:30 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2020-09-05 18:49:14 +0300 |
commit | db21c12abedd7606a3aaf50f70e506a24d9f0e7a (patch) | |
tree | 31b928b9a14f8b801a1d792c5dcd1825855b30b7 /source/blender/gpu/intern | |
parent | 22a84a673a9fd9942b54a584cbbbab5d0861cbd5 (diff) |
GPUFramebuffer: Encapsulate single attachement clear
This is in preparation of using it to clear single texture.
Also includes minor cleanups about not using tex target in
assert and adding enum operators.
Diffstat (limited to 'source/blender/gpu/intern')
-rw-r--r-- | source/blender/gpu/intern/gpu_framebuffer.cc | 5 | ||||
-rw-r--r-- | source/blender/gpu/intern/gpu_framebuffer_private.hh | 3 |
2 files changed, 4 insertions, 4 deletions
diff --git a/source/blender/gpu/intern/gpu_framebuffer.cc b/source/blender/gpu/intern/gpu_framebuffer.cc index bb17ee8edf4..742fdc6d8b3 100644 --- a/source/blender/gpu/intern/gpu_framebuffer.cc +++ b/source/blender/gpu/intern/gpu_framebuffer.cc @@ -96,10 +96,7 @@ void FrameBuffer::attachment_set(GPUAttachmentType type, const GPUAttachment &ne if (new_attachment.tex) { if (new_attachment.layer > 0) { - BLI_assert(ELEM(GPU_texture_target(new_attachment.tex), - GL_TEXTURE_2D_ARRAY, - GL_TEXTURE_CUBE_MAP, - GL_TEXTURE_CUBE_MAP_ARRAY_ARB)); + BLI_assert(GPU_texture_cube(new_attachment.tex) || GPU_texture_array(new_attachment.tex)); } if (GPU_texture_stencil(new_attachment.tex)) { BLI_assert(ELEM(type, GPU_FB_DEPTH_STENCIL_ATTACHMENT)); diff --git a/source/blender/gpu/intern/gpu_framebuffer_private.hh b/source/blender/gpu/intern/gpu_framebuffer_private.hh index 0f442ff2b34..58ee841c076 100644 --- a/source/blender/gpu/intern/gpu_framebuffer_private.hh +++ b/source/blender/gpu/intern/gpu_framebuffer_private.hh @@ -115,6 +115,9 @@ class FrameBuffer { float clear_depth, uint clear_stencil) = 0; virtual void clear_multi(const float (*clear_col)[4]) = 0; + virtual void clear_attachment(GPUAttachmentType type, + eGPUDataFormat data_format, + const void *clear_value) = 0; virtual void read(eGPUFrameBufferBits planes, eGPUDataFormat format, |