From 372ca9f7df7ac1e846408d9860e2d92a8d8c6f6f 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..22661e55696 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