Summary: | [Mesa core] glGetIntegerv(GL_DRAW_BUFFER0) returns wrong buffer enum | ||
---|---|---|---|
Product: | Mesa | Reporter: | Shuang He <shuang.he> |
Component: | Mesa core | Assignee: | mesa-dev |
Status: | RESOLVED FIXED | QA Contact: | |
Severity: | normal | ||
Priority: | medium | CC: | christophe.prigent, haihao.xiang |
Version: | unspecified | ||
Hardware: | Other | ||
OS: | Linux (All) | ||
Whiteboard: | |||
i915 platform: | i915 features: | ||
Attachments: |
test case
Simple Demonstration |
Description
Shuang He
2008-01-08 17:36:59 UTC
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.