From 4d33de7f79e5dd1f2257bb34f224a79cf1dbf5ce Mon Sep 17 00:00:00 2001 From: Kenneth Graunke Date: Mon, 24 Apr 2017 16:38:24 -0700 Subject: [PATCH] mesa: Ignore format-based completeness rules in CopyImageSubData(). --- src/mesa/main/copyimage.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/mesa/main/copyimage.c b/src/mesa/main/copyimage.c index 877c8ac246d..320a5d15459 100644 --- a/src/mesa/main/copyimage.c +++ b/src/mesa/main/copyimage.c @@ -154,6 +154,10 @@ prepare_target(struct gl_context *ctx, GLuint name, GLenum target, * "INVALID_OPERATION is generated if either object is a texture and * the texture is not complete (as defined in section 3.9.14)" * + * However, games appear to call glCopyImageSubData with integer + * textures and the default mipmap filters of GL_LINEAR and + * GL_NEAREST_MIPMAP_LINEAR, so we ignore rules based on format. + * * The cited section says: * * "Using the preceding definitions, a texture is complete unless any @@ -172,7 +176,10 @@ prepare_target(struct gl_context *ctx, GLuint name, GLenum target, * See https://cvs.khronos.org/bugzilla/show_bug.cgi?id=16224. */ _mesa_test_texobj_completeness(ctx, texObj); - if (!_mesa_is_texture_complete(texObj, &texObj->Sampler)) { + bool texture_mostly_complete = + _mesa_is_mipmap_filter(texObj->Sampler) ? texObj->_MipmapComplete + : texObj->_BaseComplete; + if (!texture_mostly_complete) { _mesa_error(ctx, GL_INVALID_OPERATION, "glCopyImageSubData(%sName incomplete)", dbg_prefix); return false; -- 2.12.2