mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-08-10 08:41:04 +00:00
In case drawbuffers is set to GL_BACK, just set to COLOR_ATTACHMENT0
* This is invalid since we are talking about real FBOs, not the default FBO, but it might come up in compatibility context programs and it's harmless to correct to try and replay correctly.
This commit is contained in:
@@ -1336,9 +1336,14 @@ void GLResourceManager::Apply_InitialState(GLResource live, InitialContentData i
|
||||
|
||||
FramebufferInitialData *data = (FramebufferInitialData *)initial.blob;
|
||||
|
||||
// set invalid caps to GL_COLOR_ATTACHMENT0
|
||||
for(int i=0; i < (int)ARRAY_COUNT(data->DrawBuffers); i++)
|
||||
gl.glDrawBuffers(ARRAY_COUNT(data->DrawBuffers), data->DrawBuffers);
|
||||
if(data->DrawBuffers[i] == eGL_BACK || data->DrawBuffers[i] == eGL_FRONT)
|
||||
data->DrawBuffers[i] = eGL_COLOR_ATTACHMENT0;
|
||||
if(data->ReadBuffer == eGL_BACK || data->ReadBuffer == eGL_FRONT) data->ReadBuffer = eGL_COLOR_ATTACHMENT0;
|
||||
|
||||
gl.glDrawBuffers(ARRAY_COUNT(data->DrawBuffers), data->DrawBuffers);
|
||||
|
||||
gl.glReadBuffer(data->ReadBuffer);
|
||||
|
||||
gl.glBindFramebuffer(eGL_DRAW_FRAMEBUFFER, prevdraw);
|
||||
|
||||
Reference in New Issue
Block a user