mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-04 22:10:11 +01:00
anv: Fast-path surface relocs when we have softpin
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11236>
This commit is contained in:
parent
6afc3f97b6
commit
921bd2d1c7
1 changed files with 14 additions and 6 deletions
|
|
@ -243,13 +243,21 @@ static void
|
|||
add_surface_reloc(struct anv_cmd_buffer *cmd_buffer,
|
||||
struct anv_state state, struct anv_address addr)
|
||||
{
|
||||
const struct isl_device *isl_dev = &cmd_buffer->device->isl_dev;
|
||||
VkResult result;
|
||||
|
||||
VkResult result =
|
||||
anv_reloc_list_add(&cmd_buffer->surface_relocs, &cmd_buffer->pool->alloc,
|
||||
state.offset + isl_dev->ss.addr_offset,
|
||||
addr.bo, addr.offset, NULL);
|
||||
if (result != VK_SUCCESS)
|
||||
if (anv_use_softpin(cmd_buffer->device->physical)) {
|
||||
result = anv_reloc_list_add_bo(&cmd_buffer->surface_relocs,
|
||||
&cmd_buffer->pool->alloc,
|
||||
addr.bo);
|
||||
} else {
|
||||
const struct isl_device *isl_dev = &cmd_buffer->device->isl_dev;
|
||||
result = anv_reloc_list_add(&cmd_buffer->surface_relocs,
|
||||
&cmd_buffer->pool->alloc,
|
||||
state.offset + isl_dev->ss.addr_offset,
|
||||
addr.bo, addr.offset, NULL);
|
||||
}
|
||||
|
||||
if (unlikely(result != VK_SUCCESS))
|
||||
anv_batch_set_error(&cmd_buffer->batch, result);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue