Handle stencil-only backbuffers

This commit is contained in:
baldurk
2019-05-13 18:59:23 +01:00
parent 886c20f580
commit fe2aaa60dc
+5 -1
View File
@@ -671,6 +671,8 @@ void WrappedOpenGL::CreateReplayBackbuffer(const GLInitParams &params, ResourceI
depthfmt = eGL_DEPTH32F_STENCIL8;
else if(params.depthBits == 24)
depthfmt = eGL_DEPTH24_STENCIL8;
else if(params.depthBits == 0)
depthfmt = eGL_STENCIL_INDEX8;
else
RDCERR("Unexpected combination of depth & stencil bits: %d & %d", params.depthBits,
params.stencilBits);
@@ -704,7 +706,9 @@ void WrappedOpenGL::CreateReplayBackbuffer(const GLInitParams &params, ResourceI
GetBaseFormat(depthfmt), GetDataType(depthfmt), NULL);
}
if(stencil)
if(stencil && params.depthBits == 0)
drv.glFramebufferTexture2D(eGL_FRAMEBUFFER, eGL_STENCIL_ATTACHMENT, target, depth, 0);
else if(stencil)
drv.glFramebufferTexture2D(eGL_FRAMEBUFFER, eGL_DEPTH_STENCIL_ATTACHMENT, target, depth, 0);
else
drv.glFramebufferTexture2D(eGL_FRAMEBUFFER, eGL_DEPTH_ATTACHMENT, target, depth, 0);