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:
authorAntonis Ryakiotakis <kalast@gmail.com>2022-02-07 21:37:15 +0300
committerAntonis Ryakiotakis <kalast@gmail.com>2022-02-07 21:37:15 +0300
commitd8c05502272990173381bfd2590884bbc95aa5f5 (patch)
tree8bd65efacbe6484b838d4550597d0f4a54ddddd9 /source/blender/gpu/opengl/gl_framebuffer.cc
parentb64d551f3b2fa409b4eeefb641fc581eb6cd0bd6 (diff)
parentfe1816f67fbc6aaf383ec77847d668367335d093 (diff)
Merge branch 'master' into KTX_supportKTX_support
Diffstat (limited to 'source/blender/gpu/opengl/gl_framebuffer.cc')
-rw-r--r--source/blender/gpu/opengl/gl_framebuffer.cc7
1 files changed, 7 insertions, 0 deletions
diff --git a/source/blender/gpu/opengl/gl_framebuffer.cc b/source/blender/gpu/opengl/gl_framebuffer.cc
index 13f03195437..106a12bfefd 100644
--- a/source/blender/gpu/opengl/gl_framebuffer.cc
+++ b/source/blender/gpu/opengl/gl_framebuffer.cc
@@ -429,8 +429,15 @@ void GLFrameBuffer::read(eGPUFrameBufferBits plane,
switch (plane) {
case GPU_DEPTH_BIT:
format = GL_DEPTH_COMPONENT;
+ BLI_assert_msg(
+ this->attachments_[GPU_FB_DEPTH_ATTACHMENT].tex != nullptr ||
+ this->attachments_[GPU_FB_DEPTH_STENCIL_ATTACHMENT].tex != nullptr,
+ "GPUFramebuffer: Error: Trying to read depth without a depth buffer attached.");
break;
case GPU_COLOR_BIT:
+ BLI_assert_msg(
+ mode != GL_NONE,
+ "GPUFramebuffer: Error: Trying to read a color slot without valid attachment.");
format = channel_len_to_gl(channel_len);
/* TODO: needed for selection buffers to work properly, this should be handled better. */
if (format == GL_RED && type == GL_UNSIGNED_INT) {