diff --git a/src/renderer_gl.cpp b/src/renderer_gl.cpp index 7b5f8fd9b..b9820492f 100644 --- a/src/renderer_gl.cpp +++ b/src/renderer_gl.cpp @@ -1051,18 +1051,18 @@ namespace bgfx { namespace gl if (isDepth(_format) ) { const ImageBlockInfo& info = getBlockInfo(_format); - if (0 < info.stencilBits) - { - attachment = GL_DEPTH_STENCIL_ATTACHMENT; - } - else if (0 == info.depthBits) + if (0 == info.depthBits) { attachment = GL_STENCIL_ATTACHMENT; } - else + else if (0 == info.stencilBits) { attachment = GL_DEPTH_ATTACHMENT; } + else + { + attachment = GL_DEPTH_STENCIL_ATTACHMENT; + } } else {