Mesa (main): d3d12: Fix linkage for viewport index

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


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

Author: Jesse Natalie <jenatali at microsoft.com>
Date:   Fri Feb  4 07:10:23 2022 -0800

d3d12: Fix linkage for viewport index

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

---

 src/gallium/drivers/d3d12/d3d12_compiler.cpp       | 6 +++---
 src/gallium/drivers/d3d12/d3d12_pipeline_state.cpp | 3 +++
 2 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/src/gallium/drivers/d3d12/d3d12_compiler.cpp b/src/gallium/drivers/d3d12/d3d12_compiler.cpp
index aa5acd63fc5..37c705856a6 100644
--- a/src/gallium/drivers/d3d12/d3d12_compiler.cpp
+++ b/src/gallium/drivers/d3d12/d3d12_compiler.cpp
@@ -804,7 +804,7 @@ d3d12_fill_shader_key(struct d3d12_selection_context *sel_ctx,
       if (stage == PIPE_SHADER_FRAGMENT || stage == PIPE_SHADER_GEOMETRY)
          system_out_values |= VARYING_BIT_POS;
       if (stage == PIPE_SHADER_FRAGMENT)
-         system_out_values |= VARYING_BIT_PSIZ;
+         system_out_values |= VARYING_BIT_PSIZ | VARYING_BIT_VIEWPORT;
       uint64_t mask = prev->current->nir->info.outputs_written & ~system_out_values;
       fill_varyings(&key->required_varying_inputs, prev->current->nir,
                     nir_var_shader_out, mask, false);
@@ -1323,11 +1323,11 @@ d3d12_create_shader(struct d3d12_context *ctx,
    d3d12_shader_selector *next = get_next_shader(ctx, sel->stage);
 
    uint64_t in_mask = nir->info.stage == MESA_SHADER_VERTEX ?
-                         0 : VARYING_BIT_PRIMITIVE_ID;
+                         0 : (VARYING_BIT_PRIMITIVE_ID | VARYING_BIT_VIEWPORT);
 
    uint64_t out_mask = nir->info.stage == MESA_SHADER_FRAGMENT ?
                           (1ull << FRAG_RESULT_STENCIL) | (1ull << FRAG_RESULT_SAMPLE_MASK) :
-                          VARYING_BIT_PRIMITIVE_ID;
+                          (VARYING_BIT_PRIMITIVE_ID | VARYING_BIT_VIEWPORT);
 
    d3d12_fix_io_uint_type(nir, in_mask, out_mask);
    NIR_PASS_V(nir, dxil_nir_split_clip_cull_distance);
diff --git a/src/gallium/drivers/d3d12/d3d12_pipeline_state.cpp b/src/gallium/drivers/d3d12/d3d12_pipeline_state.cpp
index 35d39bce32d..e4a09b4f91f 100644
--- a/src/gallium/drivers/d3d12/d3d12_pipeline_state.cpp
+++ b/src/gallium/drivers/d3d12/d3d12_pipeline_state.cpp
@@ -65,6 +65,9 @@ get_semantic_name(int location, int driver_location, unsigned *index)
    case VARYING_SLOT_PRIMITIVE_ID:
       return "SV_PrimitiveID";
 
+   case VARYING_SLOT_VIEWPORT:
+      return "SV_ViewportArrayIndex";
+
    default: {
          *index = driver_location;
          return "TEXCOORD";



More information about the mesa-commit mailing list