mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-03 20:10:17 +01:00
mesa: trivial simplifications in _mesa_reference_buffer_object_
The else statement conditions were tautological. Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18828>
This commit is contained in:
parent
17b7212930
commit
1885608184
1 changed files with 4 additions and 7 deletions
|
|
@ -1079,25 +1079,22 @@ _mesa_reference_buffer_object_(struct gl_context *ctx,
|
|||
if (p_atomic_dec_zero(&oldObj->RefCount)) {
|
||||
_mesa_delete_buffer_object(ctx, oldObj);
|
||||
}
|
||||
} else if (ctx == oldObj->Ctx) {
|
||||
} else {
|
||||
/* Update the private ref count. */
|
||||
assert(oldObj->CtxRefCount >= 1);
|
||||
oldObj->CtxRefCount--;
|
||||
}
|
||||
|
||||
*ptr = NULL;
|
||||
}
|
||||
assert(!*ptr);
|
||||
|
||||
if (bufObj) {
|
||||
/* reference new buffer */
|
||||
if (shared_binding || ctx != bufObj->Ctx)
|
||||
p_atomic_inc(&bufObj->RefCount);
|
||||
else if (ctx == bufObj->Ctx)
|
||||
else
|
||||
bufObj->CtxRefCount++;
|
||||
|
||||
*ptr = bufObj;
|
||||
}
|
||||
|
||||
*ptr = bufObj;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue