Skip to content

Commit 0fb3d46

Browse files
committed
Cocoa Port: Fix potential issues for OpenGL display views running their fetched video processing on ancient GPUs that really really want to clear the framebuffer for stability. (Regression from commit 1670e3a.)
1 parent 1670e3a commit 0fb3d46

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

desmume/src/frontend/cocoa/OGLDisplayOutput.cpp

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5092,6 +5092,12 @@ void OGLClientSharedData::InitOGL(const NDSDisplayInfo *displayInfoList, const N
50925092

50935093
if (this->_canProcessFetchOnGPU)
50945094
{
5095+
// Set up rendering states
5096+
glDisable(GL_DEPTH_TEST);
5097+
glDisable(GL_STENCIL_TEST);
5098+
glDisable(GL_BLEND);
5099+
glClearColor(0.0f, 0.0f, 0.0f, 1.0f);
5100+
50955101
// Set up VBOs
50965102
glGenBuffers(1, &this->_vboVideoProcVtxID);
50975103
glGenBuffers(1, &this->_vboVideoProcTexCoordNativeID);
@@ -5427,9 +5433,7 @@ GLuint OGLClientSharedData::_FetchFromDisplayID_OGL(const NDSDisplayInfo &curren
54275433
glUseProgram(programID);
54285434

54295435
glViewport(0, 0, (GLsizei)currentDisplayInfo.renderedWidth[displayID], (GLsizei)currentDisplayInfo.renderedHeight[displayID]);
5430-
glDisable(GL_DEPTH_TEST);
5431-
glDisable(GL_STENCIL_TEST);
5432-
glDisable(GL_BLEND);
5436+
glClear(GL_COLOR_BUFFER_BIT);
54335437

54345438
glActiveTexture(GL_TEXTURE0);
54355439
glBindTexture(GL_TEXTURE_RECTANGLE_ARB, texVideoID);

0 commit comments

Comments
 (0)