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.
This commit is contained in:
@@ -323,6 +323,15 @@ intel_create_renderbuffer(GLenum intFormat)
|
||||
irb->Base.BlueBits = 5;
|
||||
irb->Base.DataType = GL_UNSIGNED_BYTE;
|
||||
break;
|
||||
case GL_RGB8:
|
||||
irb->Base._ActualFormat = GL_RGB8;
|
||||
irb->Base._BaseFormat = GL_RGB;
|
||||
irb->Base.RedBits = 8;
|
||||
irb->Base.GreenBits = 8;
|
||||
irb->Base.BlueBits = 8;
|
||||
irb->Base.AlphaBits = 0;
|
||||
irb->Base.DataType = GL_UNSIGNED_BYTE;
|
||||
break;
|
||||
case GL_RGBA8:
|
||||
irb->Base._ActualFormat = GL_RGBA8;
|
||||
irb->Base._BaseFormat = GL_RGBA;
|
||||
|
@@ -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,
|
||||
|
Reference in New Issue
Block a user