Mesa (main): microsoft/compiler: Handle SV_ViewportArrayIndex

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Fri Feb 4 21:01:14 UTC 2022


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

Author: Jesse Natalie <jenatali at microsoft.com>
Date:   Fri Feb  4 06:16:05 2022 -0800

microsoft/compiler: Handle SV_ViewportArrayIndex

Reviewed-by: Sil Vilerino <sivileri at microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14881>

---

 src/microsoft/compiler/dxil_signature.c | 6 ++++++
 src/microsoft/compiler/nir_to_dxil.c    | 1 +
 2 files changed, 7 insertions(+)

diff --git a/src/microsoft/compiler/dxil_signature.c b/src/microsoft/compiler/dxil_signature.c
index 7f28267d560..25814f38fe1 100644
--- a/src/microsoft/compiler/dxil_signature.c
+++ b/src/microsoft/compiler/dxil_signature.c
@@ -315,6 +315,12 @@ get_semantic_name(nir_variable *var, struct semantic_info *info,
       info->kind = DXIL_SEM_TESS_FACTOR;
       break;
 
+   case VARYING_SLOT_VIEWPORT:
+      assert(glsl_get_components(var->type) == 1);
+      snprintf(info->name, 64, "%s", "SV_ViewportArrayIndex");
+      info->kind = DXIL_SEM_VIEWPORT_ARRAY_INDEX;
+      break;
+
    default: {
          info->index =  vulkan ?
             var->data.location - VARYING_SLOT_VAR0 :
diff --git a/src/microsoft/compiler/nir_to_dxil.c b/src/microsoft/compiler/nir_to_dxil.c
index 7d288091eb2..78644e49aee 100644
--- a/src/microsoft/compiler/nir_to_dxil.c
+++ b/src/microsoft/compiler/nir_to_dxil.c
@@ -5772,6 +5772,7 @@ nir_var_to_dxil_sysvalue_type(nir_variable *var, uint64_t other_stage_mask)
    case VARYING_SLOT_PSIZ:
    case VARYING_SLOT_TESS_LEVEL_INNER:
    case VARYING_SLOT_TESS_LEVEL_OUTER:
+   case VARYING_SLOT_VIEWPORT:
       if (!((1ull << var->data.location) & other_stage_mask))
          return DXIL_SYSVALUE;
       FALLTHROUGH;



More information about the mesa-commit mailing list