| Summary: | [i965] glBitmap should not render when draw buffer is set to GL_NONE | ||
|---|---|---|---|
| Product: | Mesa | Reporter: | Shuang He <shuang.he> |
| Component: | Drivers/DRI/i965 | Assignee: | haihao <haihao.xiang> |
| Status: | VERIFIED FIXED | QA Contact: | |
| Severity: | normal | ||
| Priority: | medium | CC: | dri-devel |
| Version: | unspecified | ||
| Hardware: | Other | ||
| OS: | Linux (All) | ||
| Whiteboard: | |||
| i915 platform: | i915 features: | ||
| Attachments: | test case | ||
seems when draw buffer is set to GL_NONE, _NumColorDrawBuffers will be set to 0, so
_ColorDrawBuffers will not be updated accordingly, in update_color_draw_buffers()
this patch works for me:
--- a/src/mesa/main/framebuffer.c
+++ b/src/mesa/main/framebuffer.c
@@ -640,6 +640,10 @@ static void
update_color_draw_buffers(GLcontext *ctx, struct gl_framebuffer *fb)
{
GLuint output;
+ if (fb->_NumColorDrawBuffers == 0) {
+ fb->_ColorDrawBuffers[0] = NULL;
+ return;
+ }
for (output = 0; output < fb->_NumColorDrawBuffers; output++) {
GLint buf = fb->_ColorDrawBufferIndexes[output];
I've made a change similar to what you suggest. Also, I added checks in a few places for ctx->DrawBuffer->_ColorDrawBuffer[0] == NULL. Please test and close this bug if resolved. Thanks. verified, thanks |
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.
Created attachment 13852 [details] test case System Environment: -------------------------- --Platform: Q965 & GM965 --Architecture(32-bit,64-bit,compatiblity): 32bit kernel: 2.6.23 drm commit c6f175cbea1dba3fc26426243acc55b89b8a8064 mesa commit 02d5ba849197e19843dad164239b51f18fb16faf xf86_video_intel commit 633dbd28218fd8a746c1735fd44a14f35bd07faa Bug detailed description: -------------------------- this issue doesn't happen in software rendering mode. this issue doesn't happen on i915 specify draw buffer as GL_NONE then render with glBitmap, it should render nothing, but it still renders. it seems either _mesa_drawbuffers() or intel_drawbuf_region() should be checked to make this correct. Reproduce steps: ---------------- 1. start X 2. compile and run attached test case Current result: ---------------- still renders Expected result: ---------------- should not render