Commit c4a0cd46 authored by Dave Airlie's avatar Dave Airlie
Browse files

mesa/copyimage: make sure number of samples match.

This fixes
which otherwise asserts in the radeonsi driver.
Reviewed-by: Anuj Phogat's avatarAnuj Phogat <>
Signed-off-by: default avatarDave Airlie <>
parent 5989a293
......@@ -552,12 +552,26 @@ _mesa_CopyImageSubData(GLuint srcName, GLenum srcTarget, GLint srcLevel,
/* 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)");
if (srcTexImage && dstTexImage &&
srcTexImage->NumSamples != dstTexImage->NumSamples) {
_mesa_error(ctx, GL_INVALID_OPERATION,
"glCopyImageSubData(number of samples mismatch)");
/* loop over 2D slices/faces/layers */
for (i = 0; i < srcDepth; ++i) {
int newSrcZ = srcZ + i;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment