d3d12: avoid searching twice for bos

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7477>
This commit is contained in:
Erik Faye-Lund 2020-11-09 21:31:59 +01:00 committed by Marge Bot
parent bd5f928506
commit 6f3716d677
1 changed files with 3 additions and 3 deletions

View File

@ -220,10 +220,10 @@ void
d3d12_batch_reference_resource(struct d3d12_batch *batch,
struct d3d12_resource *res)
{
if (!d3d12_batch_has_references(batch, res->bo)) {
_mesa_set_add(batch->bos, res->bo);
bool found = false;
_mesa_set_search_and_add(batch->bos, res->bo, &found);
if (!found)
d3d12_bo_reference(res->bo);
}
}
void