mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-20 22:30:12 +01:00
anv: add capture/replay support for image with descriptor buffers
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Reviewed-by: Ivan Briano <ivan.briano@intel.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28708>
This commit is contained in:
parent
4fadc2edb7
commit
43b57ee8a5
1 changed files with 18 additions and 3 deletions
|
|
@ -1567,7 +1567,8 @@ anv_image_finish_sparse_bindings(struct anv_image *image)
|
||||||
}
|
}
|
||||||
|
|
||||||
static VkResult MUST_CHECK
|
static VkResult MUST_CHECK
|
||||||
anv_image_init_sparse_bindings(struct anv_image *image)
|
anv_image_init_sparse_bindings(struct anv_image *image,
|
||||||
|
const struct anv_image_create_info *create_info)
|
||||||
{
|
{
|
||||||
struct anv_device *device =
|
struct anv_device *device =
|
||||||
container_of(image->vk.base.device, struct anv_device, vk);
|
container_of(image->vk.base.device, struct anv_device, vk);
|
||||||
|
|
@ -1575,6 +1576,18 @@ anv_image_init_sparse_bindings(struct anv_image *image)
|
||||||
|
|
||||||
assert(anv_image_is_sparse(image));
|
assert(anv_image_is_sparse(image));
|
||||||
|
|
||||||
|
enum anv_bo_alloc_flags alloc_flags = 0;
|
||||||
|
uint64_t explicit_address = 0;
|
||||||
|
if (image->vk.create_flags & VK_IMAGE_CREATE_DESCRIPTOR_BUFFER_CAPTURE_REPLAY_BIT_EXT) {
|
||||||
|
alloc_flags |= ANV_BO_ALLOC_FIXED_ADDRESS;
|
||||||
|
|
||||||
|
const VkOpaqueCaptureDescriptorDataCreateInfoEXT *opaque_info =
|
||||||
|
vk_find_struct_const(create_info->vk_info->pNext,
|
||||||
|
OPAQUE_CAPTURE_DESCRIPTOR_DATA_CREATE_INFO_EXT);
|
||||||
|
if (opaque_info)
|
||||||
|
explicit_address = *((const uint64_t *)opaque_info->opaqueCaptureDescriptorData);
|
||||||
|
}
|
||||||
|
|
||||||
for (int i = 0; i < ANV_IMAGE_MEMORY_BINDING_END; i++) {
|
for (int i = 0; i < ANV_IMAGE_MEMORY_BINDING_END; i++) {
|
||||||
struct anv_image_binding *b = &image->bindings[i];
|
struct anv_image_binding *b = &image->bindings[i];
|
||||||
|
|
||||||
|
|
@ -1592,7 +1605,9 @@ anv_image_init_sparse_bindings(struct anv_image *image)
|
||||||
|
|
||||||
result = anv_init_sparse_bindings(device,
|
result = anv_init_sparse_bindings(device,
|
||||||
b->memory_range.size,
|
b->memory_range.size,
|
||||||
&b->sparse_data, 0, 0,
|
&b->sparse_data,
|
||||||
|
alloc_flags,
|
||||||
|
explicit_address,
|
||||||
&b->address);
|
&b->address);
|
||||||
if (result != VK_SUCCESS) {
|
if (result != VK_SUCCESS) {
|
||||||
anv_image_finish_sparse_bindings(image);
|
anv_image_finish_sparse_bindings(image);
|
||||||
|
|
@ -1767,7 +1782,7 @@ anv_image_init(struct anv_device *device, struct anv_image *image,
|
||||||
}
|
}
|
||||||
|
|
||||||
if (anv_image_is_sparse(image)) {
|
if (anv_image_is_sparse(image)) {
|
||||||
r = anv_image_init_sparse_bindings(image);
|
r = anv_image_init_sparse_bindings(image, create_info);
|
||||||
if (r != VK_SUCCESS)
|
if (r != VK_SUCCESS)
|
||||||
goto fail;
|
goto fail;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue