meta: Detect currently-unsupported integer CopyTexSubImage and complain.
authorEric Anholt <eric@anholt.net>
Fri, 20 Jan 2012 21:59:37 +0000 (13:59 -0800)
committerEric Anholt <eric@anholt.net>
Wed, 25 Jan 2012 00:37:10 +0000 (16:37 -0800)
This code is unprepared for handling integer (particularly, the
baseFormat of the TexFormat comes out as GL_RGBA, not GL_RGBA_INTEGER,
so the direct call of Driver.ReadPixels crashes due to the int vs
non-int error checking not having happened).  I'm frankly tempted to
convert this code to MapRenderbuffer/MapTexImage rather than doing it
as meta ops, now that we have that support.

Improves the remaining crash in Intel oglconform for int-textures to
just a rendering failure.

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: Brian Paul <brianp@vmware.com>
src/mesa/drivers/common/meta.c

index 05cc712..aa5fef8 100644 (file)
@@ -3131,6 +3131,11 @@ copy_tex_sub_image(struct gl_context *ctx,
       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);
    bpp = _mesa_bytes_per_pixel(format, type);
    if (bpp <= 0) {