From 00e203fe17cbf2127abc422c785cf9fad3232adb Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 1 May 2009 09:30:32 -0600 Subject: mesa: create/use a fallback texture when bound texture is incomplete When a GLSL sampler reads from an incomplete texture it should return (0,0,0,1). Instead of jumping through hoops in all the drivers to make this happen, just create/install a fallback texture with those texel values. Fixes piglit/fp-incomplete-tex on i965 and more importantly, fixes some GPU lockups when trying to sample from missing surfaces. If a binding table entry is NULL, it seems that sampling sometimes works, but not always (lockup). Todo: create a fallback texture for each type of texture target? (cherry picked from commit 3f25219c7bf0f090502489928f0f018e62c4f6cf) --- src/mesa/main/mtypes.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/mesa/main/mtypes.h') diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h index 8872c8963f..b9cb972e5f 100644 --- a/src/mesa/main/mtypes.h +++ b/src/mesa/main/mtypes.h @@ -2053,6 +2053,9 @@ struct gl_shared_state /** Default texture objects (shared by all texture units) */ struct gl_texture_object *DefaultTex[NUM_TEXTURE_TARGETS]; + /** Fallback texture used when a bound texture is incomplete */ + struct gl_texture_object *FallbackTex; + /** * \name Thread safety and statechange notification for texture * objects. -- cgit v1.2.3