aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/intel/intel_screen.c
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2009-02-25 22:54:51 -0800
committerEric Anholt <[email protected]>2009-02-25 23:01:57 -0800
commit119f34e2a52d7e074ea51d49acf6c11d83142ccc (patch)
tree06dc47c905e2fa5d732f4baf1c8e368089e29381 /src/mesa/drivers/dri/intel/intel_screen.c
parent53b373451142aeea9111143d7902bf8f5716ef75 (diff)
intel: Fix up x8r8g8b8 renderbuffer format so that alpha=1 spans code happens.
I was lured into a false sense of security by the fact that the spans code was already there, and a bunch of tests didn't catch the problem. oglconform's mask.c did, though. Bug #19970.
Diffstat (limited to 'src/mesa/drivers/dri/intel/intel_screen.c')
-rw-r--r--src/mesa/drivers/dri/intel/intel_screen.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/mesa/drivers/dri/intel/intel_screen.c b/src/mesa/drivers/dri/intel/intel_screen.c
index d6110b8163a..df404695bcb 100644
--- a/src/mesa/drivers/dri/intel/intel_screen.c
+++ b/src/mesa/drivers/dri/intel/intel_screen.c
@@ -323,7 +323,7 @@ intelCreateBuffer(__DRIscreenPrivate * driScrnPriv,
else {
GLboolean swStencil = (mesaVis->stencilBits > 0 &&
mesaVis->depthBits != 24);
- GLenum rgbFormat = (mesaVis->redBits == 5 ? GL_RGB5 : GL_RGBA8);
+ GLenum rgbFormat;
struct intel_framebuffer *intel_fb = CALLOC_STRUCT(intel_framebuffer);
@@ -332,6 +332,13 @@ intelCreateBuffer(__DRIscreenPrivate * driScrnPriv,
_mesa_initialize_framebuffer(&intel_fb->Base, mesaVis);
+ if (mesaVis->redBits == 5)
+ rgbFormat = GL_RGB5;
+ else if (mesaVis->alphaBits == 0)
+ rgbFormat = GL_RGB8;
+ else
+ rgbFormat = GL_RGBA8;
+
/* setup the hardware-based renderbuffers */
intel_fb->color_rb[0] = intel_create_renderbuffer(rgbFormat);
_mesa_add_renderbuffer(&intel_fb->Base, BUFFER_FRONT_LEFT,