diff options
author | Eric Anholt <[email protected]> | 2012-03-26 16:49:23 -0700 |
---|---|---|
committer | Eric Anholt <[email protected]> | 2012-04-09 14:34:30 -0700 |
commit | 18c2ee0df5fa6679996e40c574d37475be230bd7 (patch) | |
tree | 8100bc1ed8c225c3c629fc98cdd7cde6989ce9ee /src | |
parent | bb430ced7fb2aa26007637a0907d886716e8ddd6 (diff) |
mesa: Create the default (name==0) buffer texture.
All that should be needed is that it exists. Fixes segfaults on first
_mesa_update_context() with a samplerBuffer-using shader active but
without a particular buffer texture enabled.
Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src')
-rw-r--r-- | src/mesa/main/texobj.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/mesa/main/texobj.c b/src/mesa/main/texobj.c index d7dee4f1b66..88dc3b195e7 100644 --- a/src/mesa/main/texobj.c +++ b/src/mesa/main/texobj.c @@ -756,6 +756,9 @@ _mesa_get_fallback_texture(struct gl_context *ctx, gl_texture_index tex) target = GL_TEXTURE_1D; break; case TEXTURE_BUFFER_INDEX: + dims = 0; + target = GL_TEXTURE_BUFFER; + break; case TEXTURE_EXTERNAL_INDEX: default: /* no-op */ @@ -794,6 +797,8 @@ _mesa_get_fallback_texture(struct gl_context *ctx, gl_texture_index tex) GL_RGBA, texFormat); switch (dims) { + case 0: + break; case 1: ctx->Driver.TexImage1D(ctx, texImage, GL_RGBA, width, 0, |