Explorar el Código

GL: Fixed depth/stencil attachemnt logic.

Branimir Karadžić hace 10 años
padre
commit
d0b4657e15
Se han modificado 1 ficheros con 5 adiciones y 5 borrados
  1. 5 5
      src/renderer_gl.cpp

+ 5 - 5
src/renderer_gl.cpp

@@ -1051,17 +1051,17 @@ namespace bgfx { namespace gl
 		if (isDepth(_format) )
 		{
 			const ImageBlockInfo& info = getBlockInfo(_format);
-			if (0 < info.stencilBits)
+			if (0 == info.depthBits)
 			{
-				attachment = GL_DEPTH_STENCIL_ATTACHMENT;
+				attachment = GL_STENCIL_ATTACHMENT;
 			}
-			else if (0 == info.depthBits)
+			else if (0 == info.stencilBits)
 			{
-				attachment = GL_STENCIL_ATTACHMENT;
+				attachment = GL_DEPTH_ATTACHMENT;
 			}
 			else
 			{
-				attachment = GL_DEPTH_ATTACHMENT;
+				attachment = GL_DEPTH_STENCIL_ATTACHMENT;
 			}
 		}
 		else