i965: Add support for rendering to SARGB8 FBOs.

Tested with fbo-generatemipmap-formats GL_EXT_texture_srgb.  The test
still fails on SLA8, though.
This commit is contained in:
Eric Anholt 2010-09-24 16:11:40 -07:00
parent 836803df79
commit 1946b81e70
3 changed files with 9 additions and 0 deletions

View File

@ -429,6 +429,9 @@ brw_update_renderbuffer_surface(struct brw_context *brw,
case MESA_FORMAT_XRGB8888:
key.surface_format = BRW_SURFACEFORMAT_B8G8R8A8_UNORM;
break;
case MESA_FORMAT_SARGB8:
key.surface_format = BRW_SURFACEFORMAT_B8G8R8A8_UNORM_SRGB;
break;
case MESA_FORMAT_RGB565:
key.surface_format = BRW_SURFACEFORMAT_B5G6R5_UNORM;
break;

View File

@ -433,6 +433,10 @@ intel_update_wrapper(GLcontext *ctx, struct intel_renderbuffer *irb,
irb->Base.DataType = GL_UNSIGNED_BYTE;
DBG("Render to XGBA8 texture OK\n");
}
else if (texImage->TexFormat == MESA_FORMAT_SARGB8) {
irb->Base.DataType = GL_UNSIGNED_BYTE;
DBG("Render to SARGB8 texture OK\n");
}
else if (texImage->TexFormat == MESA_FORMAT_RGB565) {
irb->Base.DataType = GL_UNSIGNED_BYTE;
DBG("Render to RGB5 texture OK\n");
@ -659,6 +663,7 @@ intel_validate_framebuffer(GLcontext *ctx, struct gl_framebuffer *fb)
switch (irb->Base.Format) {
case MESA_FORMAT_ARGB8888:
case MESA_FORMAT_XRGB8888:
case MESA_FORMAT_SARGB8:
case MESA_FORMAT_RGB565:
case MESA_FORMAT_ARGB1555:
case MESA_FORMAT_ARGB4444:

View File

@ -366,6 +366,7 @@ intel_set_span_functions(struct intel_context *intel,
intel_InitPointers_xRGB8888(rb);
break;
case MESA_FORMAT_ARGB8888:
case MESA_FORMAT_SARGB8:
intel_InitPointers_ARGB8888(rb);
break;
case MESA_FORMAT_Z16: