mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-08 04:48:08 +02:00
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 <fredrik@kde.org> Signed-off-by: Fredrik Höglund <fredrik@kde.org>
This commit is contained in:
parent
5aaaaebf22
commit
0516159613
1 changed files with 1 additions and 10 deletions
|
|
@ -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 */
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue