summaryrefslogtreecommitdiffstats
path: root/src/mesa/main
diff options
context:
space:
mode:
authorEduardo Lima Mitev <[email protected]>2017-02-02 17:07:24 +0100
committerEduardo Lima Mitev <[email protected]>2017-02-03 00:43:46 +0100
commite198a64e3532af9b30d7c3fac4d092ecea7d2e41 (patch)
treed73d466779780cc3398b6440a19003c96513a826 /src/mesa/main
parentdfe111368d11aaffae7f8738c858c335cdec1e9d (diff)
texgetimage: Add check for the effective target to GetTextureSubImage
OpenGL 4.5 spec, section "8.11.4 Texture Image Queries", page 233 of the PDF states: "An INVALID_OPERATION error is generated if texture is the name of a buffer or multisample texture." This is currently not being checked and e.g a multisample texture image can be passed down to the driver hook. On i965, it is crashing the driver with an assertion: intel_mipmap_tree.c:3125: intel_miptree_map: Assertion `mt->num_samples <= 1' failed. v2: (Ilia Mirkin) Move the check from gettextimage_error_check() to GetTextureSubImage() and use the texObj target. Reviewed-by: Ilia Mirkin <[email protected]>
Diffstat (limited to 'src/mesa/main')
-rw-r--r--src/mesa/main/texgetimage.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/mesa/main/texgetimage.c b/src/mesa/main/texgetimage.c
index d5cb1636605..b0ced1eac0f 100644
--- a/src/mesa/main/texgetimage.c
+++ b/src/mesa/main/texgetimage.c
@@ -1465,6 +1465,12 @@ _mesa_GetTextureSubImage(GLuint texture, GLint level,
return;
}
+ if (!legal_getteximage_target(ctx, texObj->Target, true)) {
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "%s(buffer/multisample texture)", caller);
+ return;
+ }
+
if (getteximage_error_check(ctx, texObj, texObj->Target, level,
xoffset, yoffset, zoffset, width, height, depth,
format, type, bufSize, pixels, caller)) {