System Environment: -------------------------- --Platform: FC6 --Xf86_video_intel:f089942689df622b1af00569eade4883a84eb7a3 --Mesa:3369cd9a6f943365242d7832e69788d4aede9a8f --DRM:cd19dcef4f7cc454f68618a0a1e903f159db21ad --Kernel:2.6.22 Bug detailed description: -------------------------- this issue happens in both software rendering and DRI mode specified GL_FRONT_LEFT and GL_BACK_LEFT as draw buffers, but what glGetIntegerv(GL_DRAW_BUFFER0) returns are wrong. Reproduce steps: ---------------- start X compile and run the attached test case Current result: ---------------- glGetIntegerv(GL_DRAW_BUFFER0) returns wrong buffer enum Expected result: ---------------- glGetIntegerv(GL_DRAW_BUFFER0) should return correct buffer enum
Created attachment 13602 [details] test case
seems this can fix this issue: --- a/src/mesa/main/buffers.c 2008-01-09 09:54:06.000000000 +0800 +++ b/src/mesa/main/buffers.c 2008-01-09 09:56:15.000000000 +0800 @@ -540,10 +540,12 @@ for (buf = 0; buf < n; buf++ ) { if (destMask[buf]) { fb->_ColorDrawBufferIndexes[buf] = _mesa_ffs(destMask[buf]) - 1; + fb->ColorDrawBuffer[buf] = buffers[buf]; count = buf + 1; } else { fb->_ColorDrawBufferIndexes[buf] = -1; + fb->ColorDrawBuffer[buf] = GL_NONE; } } /* set remaining outputs to -1 (GL_NONE) */
Your patch is the correct fix. I'm committing it to git.
verified
Created attachment 91486 [details] Simple Demonstration
GL_DRAW_BUFFER0 returns 1029 instead of GL_BACK_LEFT
(In reply to Benjamin Botwin from comment #6) > GL_DRAW_BUFFER0 returns 1029 instead of GL_BACK_LEFT I test it and I have not found anything wrong in Mesa. The initial value for double-buffered contexts is GL_BACK. * See: https://www.opengl.org/sdk/docs/man4/html/glDrawBuffer.xhtml * Also see: https://www.opengl.org/sdk/docs/man2/xhtml/glGet.xml Search for GL_DRAW_BUFFER. Furthermore, glClearBuffer() doc says the following: "If buffer is GL_COLOR, a particular draw buffer GL_DRAW_BUFFERi is specified by passing i as drawBuffer." As a second parameter of glClearbuffer(), you are passing the value got from glGetIntegeriv() which is wrong. For GL_DRAW_BUFFER0, you should pass a 0. If you do that, the window is cleared with red color once we swap buffers. * See https://www.opengl.org/sdk/docs/man3/xhtml/glClearBuffer.xml
I tested as well, GL_BACK is returned as specified, therefore resolving as fixed
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.