anv: set image_read_without_format NIR option on Vulkan 1.3
authorConstantine Shablya <constantine.shablya@collabora.com>
Sat, 9 Jul 2022 13:09:28 +0000 (16:09 +0300)
committerMarge Bot <emma+marge@anholt.net>
Sun, 24 Jul 2022 17:27:10 +0000 (17:27 +0000)
VK_KHR_format_feature_flags2 is core and implicitly enabled in 1.3.

Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17442>

src/intel/vulkan/anv_pipeline.c

index 9b73c3e..37505bb 100644 (file)
@@ -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,