Mesa (main): dzn: Retrieve validator version

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Sat Jul 23 15:39:15 UTC 2022


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

Author: Jesse Natalie <jenatali at microsoft.com>
Date:   Sun Jul 17 11:10:29 2022 -0700

dzn: Retrieve validator version

For platforms where there's no validator available, leave the field zero-initialized
to let the DXIL backend choose whatever target validator version it wants.

Reviewed-by: Erik Faye-Lund <erik.faye-lund at collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17603>

---

 src/microsoft/vulkan/dzn_meta.c     | 4 +++-
 src/microsoft/vulkan/dzn_pipeline.c | 4 +++-
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/src/microsoft/vulkan/dzn_meta.c b/src/microsoft/vulkan/dzn_meta.c
index d9ff20184b1..0a894eb8681 100644
--- a/src/microsoft/vulkan/dzn_meta.c
+++ b/src/microsoft/vulkan/dzn_meta.c
@@ -46,7 +46,9 @@ dzn_meta_compile_shader(struct dzn_device *device, nir_shader *nir,
    struct nir_to_dxil_options opts = {
       .environment = DXIL_ENVIRONMENT_VULKAN,
       .shader_model_max = SHADER_MODEL_6_2,
-      .validator_version_max = DXIL_VALIDATOR_1_4,
+#ifdef _WIN32
+      .validator_version_max = dxil_get_validator_version(instance->dxil_validator),
+#endif
    };
    struct blob dxil_blob;
    ASSERTED bool ret = nir_to_dxil(nir, &opts, &dxil_blob);
diff --git a/src/microsoft/vulkan/dzn_pipeline.c b/src/microsoft/vulkan/dzn_pipeline.c
index 97986880980..447d82a4660 100644
--- a/src/microsoft/vulkan/dzn_pipeline.c
+++ b/src/microsoft/vulkan/dzn_pipeline.c
@@ -348,7 +348,9 @@ dzn_pipeline_compile_shader(struct dzn_device *device,
    struct nir_to_dxil_options opts = {
       .environment = DXIL_ENVIRONMENT_VULKAN,
       .shader_model_max = SHADER_MODEL_6_2,
-      .validator_version_max = DXIL_VALIDATOR_1_4,
+#ifdef _WIN32
+      .validator_version_max = dxil_get_validator_version(instance->dxil_validator),
+#endif
    };
    struct blob dxil_blob;
    VkResult result = VK_SUCCESS;



More information about the mesa-commit mailing list