diff options
Diffstat (limited to 'src/mesa/drivers/x11')
-rw-r--r-- | src/mesa/drivers/x11/xm_api.c | 5 | ||||
-rw-r--r-- | src/mesa/drivers/x11/xm_buffer.c | 9 | ||||
-rw-r--r-- | src/mesa/drivers/x11/xmesaP.h | 2 |
3 files changed, 10 insertions, 6 deletions
diff --git a/src/mesa/drivers/x11/xm_api.c b/src/mesa/drivers/x11/xm_api.c index 261ebb90458..d2e2c7137b5 100644 --- a/src/mesa/drivers/x11/xm_api.c +++ b/src/mesa/drivers/x11/xm_api.c @@ -355,15 +355,14 @@ alloc_xmesa_buffer(XMesaVisual vis, BufferType type, XMesaColormap cmap) assert(!b->mesa_buffer.Attachment[BUFFER_BACK_LEFT].Renderbuffer); /* front renderbuffer */ - b->frontxrb = xmesa_new_renderbuffer(NULL, 0, vis->mesa_visual.rgbMode, + b->frontxrb = xmesa_new_renderbuffer(NULL, 0, &vis->mesa_visual, GL_FALSE); _mesa_add_renderbuffer(&b->mesa_buffer, BUFFER_FRONT_LEFT, &b->frontxrb->Base); /* back renderbuffer */ if (vis->mesa_visual.doubleBufferMode) { - b->backxrb = xmesa_new_renderbuffer(NULL, 0, - vis->mesa_visual.rgbMode, + b->backxrb = xmesa_new_renderbuffer(NULL, 0, &vis->mesa_visual, GL_TRUE); /* determine back buffer implementation */ b->db_mode = vis->ximage_flag ? BACK_XIMAGE : BACK_PIXMAP; diff --git a/src/mesa/drivers/x11/xm_buffer.c b/src/mesa/drivers/x11/xm_buffer.c index 8067b648407..2f20b162a7f 100644 --- a/src/mesa/drivers/x11/xm_buffer.c +++ b/src/mesa/drivers/x11/xm_buffer.c @@ -107,7 +107,7 @@ xmesa_alloc_back_storage(GLcontext *ctx, struct gl_renderbuffer *rb, struct xmesa_renderbuffer * -xmesa_new_renderbuffer(GLcontext *ctx, GLuint name, GLboolean rgbMode, +xmesa_new_renderbuffer(GLcontext *ctx, GLuint name, const GLvisual *visual, GLboolean backBuffer) { struct xmesa_renderbuffer *xrb = CALLOC_STRUCT(xmesa_renderbuffer); @@ -121,15 +121,20 @@ xmesa_new_renderbuffer(GLcontext *ctx, GLuint name, GLboolean rgbMode, else xrb->Base.AllocStorage = xmesa_alloc_front_storage; - if (rgbMode) { + if (visual->rgbMode) { xrb->Base.InternalFormat = GL_RGBA; xrb->Base._BaseFormat = GL_RGBA; xrb->Base.DataType = GL_UNSIGNED_BYTE; + xrb->Base.RedBits = visual->redBits; + xrb->Base.GreenBits = visual->greenBits; + xrb->Base.BlueBits = visual->blueBits; + xrb->Base.AlphaBits = visual->alphaBits; } else { xrb->Base.InternalFormat = GL_COLOR_INDEX; xrb->Base._BaseFormat = GL_COLOR_INDEX; xrb->Base.DataType = GL_UNSIGNED_INT; + xrb->Base.IndexBits = visual->indexBits; } /* only need to set Red/Green/EtcBits fields for user-created RBs */ } diff --git a/src/mesa/drivers/x11/xmesaP.h b/src/mesa/drivers/x11/xmesaP.h index afba40ae034..9d4e6946090 100644 --- a/src/mesa/drivers/x11/xmesaP.h +++ b/src/mesa/drivers/x11/xmesaP.h @@ -496,7 +496,7 @@ extern const int xmesa_kernel1[16]; */ extern struct xmesa_renderbuffer * -xmesa_new_renderbuffer(GLcontext *ctx, GLuint name, GLboolean rgbMode, +xmesa_new_renderbuffer(GLcontext *ctx, GLuint name, const GLvisual *visual, GLboolean backBuffer); extern unsigned long |