if (nbox) {
BEGIN_RING_SIZE(NvSubCtxSurf2D,
NV10_CONTEXT_SURFACES_2D_FORMAT, 4);
- OUT_RING (6); /* X8R8G8B8 */
+ if (src->mesa._ActualFormat == GL_RGBA8)
+ OUT_RING (6); /* X8R8G8B8 */
+ else
+ OUT_RING (4); /* R5G6B5 */
OUT_RING ((dst->pitch << 16) | src->pitch);
OUT_RING (src->offset);
OUT_RING (dst->offset);
struct gl_framebuffer *fb;
const GLboolean swAccum = mesaVis->accumRedBits > 0;
const GLboolean swStencil = mesaVis->stencilBits > 0 && mesaVis->depthBits != 24;
+ GLenum color_format = screen->fbFormat == 4 ? GL_RGBA8 : GL_RGB5;
if (isPixmap)
return GL_FALSE; /* not implemented */
return GL_FALSE;
/* Front buffer */
- nrb = nouveau_renderbuffer_new(GL_RGBA,
+ nrb = nouveau_renderbuffer_new(color_format,
driScrnPriv->pFB + screen->frontOffset,
screen->frontOffset,
- screen->frontPitch * 4,
+ screen->frontPitch * screen->fbFormat,
driDrawPriv);
nouveauSpanSetFunctions(nrb, mesaVis);
_mesa_add_renderbuffer(fb, BUFFER_FRONT_LEFT, &nrb->mesa);
if (0 /* unified buffers if we choose to support them.. */) {
} else {
if (mesaVis->doubleBufferMode) {
- nrb = nouveau_renderbuffer_new(GL_RGBA, NULL,
+ nrb = nouveau_renderbuffer_new(color_format, NULL,
0, 0,
driDrawPriv);
nouveauSpanSetFunctions(nrb, mesaVis);
BEGIN_RING_SIZE(NvSub3D, NV30_TCL_PRIMITIVE_3D_VIEWPORT_COLOR_BUFFER_DIM0, 5);
OUT_RING (((w+x)<<16)|x);
OUT_RING (((h+y)<<16)|y);
- OUT_RING (0x148);
+ if (color[0]->mesa._ActualFormat == GL_RGBA8)
+ OUT_RING (0x148);
+ else
+ OUT_RING (0x143);
OUT_RING (color[0]->pitch);
OUT_RING (color[0]->offset);