From 4bd864c4876f11cf5ae2cb635521da83131c0d0a Mon Sep 17 00:00:00 2001 From: Lionel Landwerlin Date: Wed, 8 Mar 2023 13:33:21 +0200 Subject: [PATCH] anv: handle new VkBufferViewUsageCreateInfoKHR MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Lionel Landwerlin Reviewed-by: José Roberto de Souza Part-of: --- src/intel/vulkan/anv_image.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/intel/vulkan/anv_image.c b/src/intel/vulkan/anv_image.c index a0760d2..d2d01d6 100644 --- a/src/intel/vulkan/anv_image.c +++ b/src/intel/vulkan/anv_image.c @@ -2951,6 +2951,11 @@ anv_CreateBufferView(VkDevice _device, if (!view) return vk_error(device, VK_ERROR_OUT_OF_HOST_MEMORY); + const VkBufferUsageFlags2CreateInfoKHR *view_usage_info = + vk_find_struct_const(pCreateInfo->pNext, BUFFER_USAGE_FLAGS_2_CREATE_INFO_KHR); + const VkBufferUsageFlags buffer_usage = + view_usage_info != NULL ? view_usage_info->usage : buffer->vk.usage; + struct anv_format_plane format; format = anv_get_format_plane(device->info, pCreateInfo->format, 0, VK_IMAGE_TILING_LINEAR); @@ -2961,7 +2966,7 @@ anv_CreateBufferView(VkDevice _device, view->address = anv_address_add(buffer->address, pCreateInfo->offset); - if (buffer->vk.usage & VK_BUFFER_USAGE_UNIFORM_TEXEL_BUFFER_BIT) { + if (buffer_usage & VK_BUFFER_USAGE_UNIFORM_TEXEL_BUFFER_BIT) { view->general.state = maybe_alloc_surface_state(device); anv_fill_buffer_view_surface_state(device, @@ -2974,7 +2979,7 @@ anv_CreateBufferView(VkDevice _device, view->general.state = ANV_STATE_NULL; } - if (buffer->vk.usage & VK_BUFFER_USAGE_STORAGE_TEXEL_BUFFER_BIT) { + if (buffer_usage & VK_BUFFER_USAGE_STORAGE_TEXEL_BUFFER_BIT) { view->storage.state = maybe_alloc_surface_state(device); anv_fill_buffer_view_surface_state(device, -- 2.7.4