summaryrefslogtreecommitdiffstats
path: root/src/mesa
diff options
context:
space:
mode:
authorDaniel Scharrer <[email protected]>2015-08-28 11:45:36 +0200
committerFredrik Höglund <[email protected]>2015-08-28 18:08:39 +0200
commit05161596137994ab4b31e054d5afbff877c0a074 (patch)
treedadc4aeccee55b78a1405af51df2f9bb67ad7b14 /src/mesa
parent5aaaaebf22c920745d577c49e463d23b90ba5ea8 (diff)
mesa: return old name for deleted samplers for SAMPLER_BINDING queries
If the sampler object has been deleted in the same context the binding will have been cleared. If it has been deleted in another context, the spec does not say what should returned. None of the other binding point queries check for deletion in another context. Also, as names of deleted objects are free for reuse, the current code didn't even work reliably. Reviewed-by: Fredrik Höglund <[email protected]> Signed-off-by: Fredrik Höglund <[email protected]>
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/main/get.c11
1 files changed, 1 insertions, 10 deletions
diff --git a/src/mesa/main/get.c b/src/mesa/main/get.c
index 976bff6653e..4855187aa6f 100644
--- a/src/mesa/main/get.c
+++ b/src/mesa/main/get.c
@@ -994,16 +994,7 @@ find_custom_value(struct gl_context *ctx, const struct value_desc *d, union valu
{
struct gl_sampler_object *samp =
ctx->Texture.Unit[ctx->Texture.CurrentUnit].Sampler;
-
- /*
- * The sampler object may have been deleted on another context,
- * so we try to lookup the sampler object before returning its Name.
- */
- if (samp && _mesa_lookup_samplerobj(ctx, samp->Name)) {
- v->value_int = samp->Name;
- } else {
- v->value_int = 0;
- }
+ v->value_int = samp ? samp->Name : 0;
}
break;
/* GL_ARB_uniform_buffer_object */