i965: Enable GL_ARB_texture_rg

This commit is contained in:
Ian Romanick
2009-11-20 10:45:36 -08:00
parent 9ef390dc14
commit c77cd9ec10
4 changed files with 91 additions and 0 deletions

View File

@@ -107,6 +107,24 @@ intel_alloc_renderbuffer_storage(GLcontext * ctx, struct gl_renderbuffer *rb,
ASSERT(rb->Name != 0);
switch (internalFormat) {
case GL_RED:
case GL_R8:
rb->Format = MESA_FORMAT_R8;
rb->DataType = GL_UNSIGNED_BYTE;
break;
case GL_R16:
rb->Format = MESA_FORMAT_R16;
rb->DataType = GL_UNSIGNED_SHORT;
break;
case GL_RG:
case GL_RG8:
rb->Format = MESA_FORMAT_RG88;
rb->DataType = GL_UNSIGNED_BYTE;
break;
case GL_RG16:
rb->Format = MESA_FORMAT_RG1616;
rb->DataType = GL_UNSIGNED_SHORT;
break;
case GL_R3_G3_B2:
case GL_RGB4:
case GL_RGB5:
@@ -346,6 +364,14 @@ intel_create_renderbuffer(gl_format format)
irb->Base._BaseFormat = GL_ALPHA;
irb->Base.DataType = GL_UNSIGNED_BYTE;
break;
case MESA_FORMAT_R8:
irb->Base._BaseFormat = GL_RED;
irb->Base.DataType = GL_UNSIGNED_BYTE;
break;
case MESA_FORMAT_RG88:
irb->Base._BaseFormat = GL_RG;
irb->Base.DataType = GL_UNSIGNED_BYTE;
break;
default:
_mesa_problem(NULL,
"Unexpected intFormat in intel_create_renderbuffer");
@@ -459,6 +485,22 @@ intel_update_wrapper(GLcontext *ctx, struct intel_renderbuffer *irb,
irb->Base.DataType = GL_UNSIGNED_BYTE;
DBG("Render to A8 texture OK\n");
}
else if (texImage->TexFormat == MESA_FORMAT_R8) {
irb->Base.DataType = GL_UNSIGNED_BYTE;
DBG("Render to R8 texture OK\n");
}
else if (texImage->TexFormat == MESA_FORMAT_RG88) {
irb->Base.DataType = GL_UNSIGNED_BYTE;
DBG("Render to RG88 texture OK\n");
}
else if (texImage->TexFormat == MESA_FORMAT_R16) {
irb->Base.DataType = GL_UNSIGNED_SHORT;
DBG("Render to R8 texture OK\n");
}
else if (texImage->TexFormat == MESA_FORMAT_RG1616) {
irb->Base.DataType = GL_UNSIGNED_SHORT;
DBG("Render to RG88 texture OK\n");
}
else if (texImage->TexFormat == MESA_FORMAT_Z16) {
irb->Base.DataType = GL_UNSIGNED_SHORT;
DBG("Render to DEPTH16 texture OK\n");
@@ -673,6 +715,10 @@ intel_validate_framebuffer(GLcontext *ctx, struct gl_framebuffer *fb)
case MESA_FORMAT_ARGB1555:
case MESA_FORMAT_ARGB4444:
case MESA_FORMAT_A8:
case MESA_FORMAT_R8:
case MESA_FORMAT_R16:
case MESA_FORMAT_RG88:
case MESA_FORMAT_RG1616:
break;
default:
fb->_Status = GL_FRAMEBUFFER_UNSUPPORTED_EXT;