[Mesa-dev] [PATCH 12/13] mesa: allow CopyTexSubImage on integer formats
Jordan Justen
jordan.l.justen at intel.com
Mon Jun 25 17:34:43 PDT 2012
Signed-off-by: Jordan Justen <jordan.l.justen at intel.com>
---
src/mesa/drivers/common/meta.c | 15 +++++++--------
1 file changed, 7 insertions(+), 8 deletions(-)
diff --git a/src/mesa/drivers/common/meta.c b/src/mesa/drivers/common/meta.c
index be7141a..252b081 100644
--- a/src/mesa/drivers/common/meta.c
+++ b/src/mesa/drivers/common/meta.c
@@ -3144,8 +3144,12 @@ _mesa_meta_GenerateMipmap(struct gl_context *ctx, GLenum target,
* ReadPixels() and passed to Tex[Sub]Image().
*/
static GLenum
-get_temp_image_type(struct gl_context *ctx, GLenum baseFormat)
+get_temp_image_type(struct gl_context *ctx, gl_format format)
{
+ GLenum baseFormat, type;
+
+ baseFormat = _mesa_get_format_base_format(format);
+
switch (baseFormat) {
case GL_RGBA:
case GL_RGB:
@@ -3160,7 +3164,7 @@ get_temp_image_type(struct gl_context *ctx, GLenum baseFormat)
else if (ctx->DrawBuffer->Visual.redBits <= 16)
return GL_UNSIGNED_SHORT;
else
- return GL_FLOAT;
+ return _mesa_get_format_datatype(format);
case GL_DEPTH_COMPONENT:
return GL_UNSIGNED_INT;
case GL_DEPTH_STENCIL:
@@ -3202,12 +3206,7 @@ _mesa_meta_CopyTexSubImage(struct gl_context *ctx, GLuint dims,
format = GL_RGBA;
}
- if (_mesa_is_format_integer_color(texImage->TexFormat)) {
- _mesa_problem(ctx, "unsupported integer color copyteximage");
- return;
- }
-
- type = get_temp_image_type(ctx, format);
+ type = get_temp_image_type(ctx, texImage->TexFormat);
bpp = _mesa_bytes_per_pixel(format, type);
if (bpp <= 0) {
_mesa_problem(ctx, "Bad bpp in _mesa_meta_CopyTexSubImage()");
--
1.7.9.5
More information about the mesa-dev
mailing list