From 85c3cea96f58f494d81777afe011569ed26800b1 Mon Sep 17 00:00:00 2001 From: Constantine Shablya Date: Sat, 9 Jul 2022 16:09:28 +0300 Subject: [PATCH] anv: set image_read_without_format NIR option on Vulkan 1.3 VK_KHR_format_feature_flags2 is core and implicitly enabled in 1.3. Reviewed-by: Jason Ekstrand Reviewed-by: Lionel Landwerlin Part-of: --- src/intel/vulkan/anv_pipeline.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/intel/vulkan/anv_pipeline.c b/src/intel/vulkan/anv_pipeline.c index 9b73c3e00d2..37505bb8a09 100644 --- a/src/intel/vulkan/anv_pipeline.c +++ b/src/intel/vulkan/anv_pipeline.c @@ -54,6 +54,7 @@ anv_shader_stage_to_nir(struct anv_device *device, void *mem_ctx) { const struct anv_physical_device *pdevice = device->physical; + const struct anv_instance *instance = pdevice->instance; const struct brw_compiler *compiler = pdevice->compiler; gl_shader_stage stage = vk_to_mesa_shader_stage(stage_info->stage); const nir_shader_compiler_options *nir_options = @@ -76,11 +77,11 @@ anv_shader_stage_to_nir(struct anv_device *device, .fragment_shader_sample_interlock = pdevice->info.ver >= 9, .fragment_shader_pixel_interlock = pdevice->info.ver >= 9, .geometry_streams = true, - /* When KHR_format_feature_flags2 is enabled, the read/write without - * format is per format, so just report true. It's up to the - * application to check. + /* When using Vulkan 1.3 or KHR_format_feature_flags2 is enabled, the + * read/write without format is per format, so just report true. It's + * up to the application to check. */ - .image_read_without_format = device->vk.enabled_extensions.KHR_format_feature_flags2, + .image_read_without_format = instance->vk.app_info.api_version >= VK_API_VERSION_1_3 || device->vk.enabled_extensions.KHR_format_feature_flags2, .image_write_without_format = true, .int8 = pdevice->info.ver >= 8, .int16 = pdevice->info.ver >= 8,