aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa
diff options
context:
space:
mode:
authorDave Airlie <[email protected]>2016-05-03 16:09:38 +1000
committerDave Airlie <[email protected]>2016-05-03 20:13:29 +1000
commitc4a0cd4662efe32e95c3f1e68b2f058b60bdcb52 (patch)
treee7705d226eb85f6d27654f0ea9c575ee30aadc4a /src/mesa
parent5989a2937f6a77e8f32ccc30cc7f9b3bd7bed9eb (diff)
mesa/copyimage: make sure number of samples match.
This fixes GL43-CTS.copy_image.samples_missmatch which otherwise asserts in the radeonsi driver. Reviewed-by: Anuj Phogat <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/main/copyimage.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/mesa/main/copyimage.c b/src/mesa/main/copyimage.c
index a0f1c691220..63ce13ad72c 100644
--- a/src/mesa/main/copyimage.c
+++ b/src/mesa/main/copyimage.c
@@ -552,12 +552,26 @@ _mesa_CopyImageSubData(GLuint srcName, GLenum srcTarget, GLint srcLevel,
"dst"))
return;
+ /* Section 18.3.2 (Copying Between Images) of the OpenGL 4.5 Core Profile
+ * spec says:
+ *
+ * An INVALID_OPERATION error is generated if either object is a texture
+ * and the texture is not complete, if the source and destination internal
+ * formats are not compatible, or if the number of samples do not match.
+ */
if (!copy_format_compatible(ctx, srcIntFormat, dstIntFormat)) {
_mesa_error(ctx, GL_INVALID_OPERATION,
"glCopyImageSubData(internalFormat mismatch)");
return;
}
+ if (srcTexImage && dstTexImage &&
+ srcTexImage->NumSamples != dstTexImage->NumSamples) {
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "glCopyImageSubData(number of samples mismatch)");
+ return;
+ }
+
/* loop over 2D slices/faces/layers */
for (i = 0; i < srcDepth; ++i) {
int newSrcZ = srcZ + i;