summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/swrast/swrast.c
diff options
context:
space:
mode:
authorMarc Pignat <[email protected]>2011-06-24 15:19:32 +0200
committerBrian Paul <[email protected]>2011-06-24 09:38:24 -0600
commitc0c0bb6cb140825f5bab3c40c0c9c0ec575fbc76 (patch)
treeb476b6e1154a25b9ce96a10b9f935452eb9015a1 /src/mesa/drivers/dri/swrast/swrast.c
parent08183357c036352b7f143ad1f4be2b8e79333a98 (diff)
Fix 24bpp software rendering
This patch add the support for 24bpp in the dri/swrast implementation. Signed-off-by: Marc Pignat <[email protected]> Signed-off-by: Brian Paul <[email protected]>
Diffstat (limited to 'src/mesa/drivers/dri/swrast/swrast.c')
-rw-r--r--src/mesa/drivers/dri/swrast/swrast.c22
1 files changed, 18 insertions, 4 deletions
diff --git a/src/mesa/drivers/dri/swrast/swrast.c b/src/mesa/drivers/dri/swrast/swrast.c
index 719b406ec05..90b5ef0fc21 100644
--- a/src/mesa/drivers/dri/swrast/swrast.c
+++ b/src/mesa/drivers/dri/swrast/swrast.c
@@ -233,10 +233,17 @@ choose_pixel_format(const struct gl_config *v)
&& v->blueMask == 0x0000ff)
return PF_A8R8G8B8;
else if (depth == 24
- && v->redMask == 0xff0000
- && v->greenMask == 0x00ff00
- && v->blueMask == 0x0000ff)
- return PF_X8R8G8B8;
+ && v->depthBits == 32
+ && v->redMask == 0xff0000
+ && v->greenMask == 0x00ff00
+ && v->blueMask == 0x0000ff)
+ return PF_X8R8G8B8;
+ else if (depth == 24
+ && v->depthBits == 24
+ && v->redMask == 0xff0000
+ && v->greenMask == 0x00ff00
+ && v->blueMask == 0x0000ff)
+ return PF_R8G8B8;
else if (depth == 16
&& v->redMask == 0xf800
&& v->greenMask == 0x07e0
@@ -344,6 +351,13 @@ swrast_new_renderbuffer(const struct gl_config *visual, GLboolean front)
xrb->Base.DataType = GL_UNSIGNED_BYTE;
xrb->bpp = 32;
break;
+ case PF_R8G8B8:
+ xrb->Base.Format = MESA_FORMAT_RGB888;
+ xrb->Base.InternalFormat = GL_RGB;
+ xrb->Base._BaseFormat = GL_RGB;
+ xrb->Base.DataType = GL_UNSIGNED_BYTE;
+ xrb->bpp = 24;
+ break;
case PF_R5G6B5:
xrb->Base.Format = MESA_FORMAT_RGB565;
xrb->Base.InternalFormat = GL_RGB;