Mesa (main): anv: set image_read_without_format NIR option on Vulkan 1.3

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Sun Jul 24 17:52:36 UTC 2022


Module: Mesa
Branch: main
Commit: 85c3cea96f58f494d81777afe011569ed26800b1
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=85c3cea96f58f494d81777afe011569ed26800b1

Author: Constantine Shablya <constantine.shablya at collabora.com>
Date:   Sat Jul  9 16:09:28 2022 +0300

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 <jason.ekstrand at collabora.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin at intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17442>

---

 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,



More information about the mesa-commit mailing list