anv: Allow _anv_combine_address with a NULL batch

This is required in order to be able to use GenXML pack functions for
structs with addresses when you're not packing into a batch.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8637>
This commit is contained in:
Jason Ekstrand 2020-08-06 22:59:35 -05:00 committed by Marge Bot
parent f68d64dac0
commit a67d7c9dee
1 changed files with 3 additions and 0 deletions

View File

@ -1686,6 +1686,9 @@ _anv_combine_address(struct anv_batch *batch, void *location,
{
if (address.bo == NULL) {
return address.offset + delta;
} else if (batch == NULL) {
assert(address.bo->flags & EXEC_OBJECT_PINNED);
return anv_address_physical(anv_address_add(address, delta));
} else {
assert(batch->start <= location && location < batch->end);