aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/main/shared.c
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2012-01-04 14:55:32 -0700
committerBrian Paul <[email protected]>2012-02-15 14:07:43 -0700
commitc04db7f7fad883891084d7f2e9a0040a17c48fe8 (patch)
tree94580cf15b55b6e017a8cd200a60dc2f687550e0 /src/mesa/main/shared.c
parent447071cfb01cf52e3e6591c71684a689f7e900fa (diff)
mesa: fix _mesa_get_fallback_texture() to handle all texture targets
Previously, this function only handled 2D textures. The fallback texture is used when we try to sample from an incomplete texture object. GLSL says sampling an incomplete texture should return (0,0,0,1). v2: use a 1-texel texture image, per José. Reviewed-by: Jose Fonseca <[email protected]>
Diffstat (limited to 'src/mesa/main/shared.c')
-rw-r--r--src/mesa/main/shared.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/mesa/main/shared.c b/src/mesa/main/shared.c
index c07ce823846..226947638ca 100644
--- a/src/mesa/main/shared.c
+++ b/src/mesa/main/shared.c
@@ -307,9 +307,11 @@ free_shared_state(struct gl_context *ctx, struct gl_shared_state *shared)
{
GLuint i;
- /* Free the dummy/fallback texture object */
- if (shared->FallbackTex)
- ctx->Driver.DeleteTexture(ctx, shared->FallbackTex);
+ /* Free the dummy/fallback texture objects */
+ for (i = 0; i < NUM_TEXTURE_TARGETS; i++) {
+ if (shared->FallbackTex[i])
+ ctx->Driver.DeleteTexture(ctx, shared->FallbackTex[i]);
+ }
/*
* Free display lists