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

Author: Mike Blumenkrantz <[email protected]>
Date:   Thu Dec 24 17:14:14 2020 -0500

zink: fix tess shader i/o variables

this was a mismerge during refactoring for review

Fixes: d09f9da4c4d ("zink: add ntv handling for tess shader i/o variables")

Reviewed-by: Dave Airlie <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8232>

---

 src/gallium/drivers/zink/nir_to_spirv/nir_to_spirv.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/src/gallium/drivers/zink/nir_to_spirv/nir_to_spirv.c 
b/src/gallium/drivers/zink/nir_to_spirv/nir_to_spirv.c
index c3bc7a13a77..f7501d316bb 100644
--- a/src/gallium/drivers/zink/nir_to_spirv/nir_to_spirv.c
+++ b/src/gallium/drivers/zink/nir_to_spirv/nir_to_spirv.c
@@ -309,12 +309,13 @@ handle_slot(struct ntv_context *ctx, unsigned slot)
 
 
 static inline unsigned
-handle_handle_slot(struct ntv_context *ctx, struct nir_variable *var)
+handle_handle_slot(struct ntv_context *ctx, struct nir_variable *var, bool 
output)
 {
    if (var->data.patch) {
       assert(var->data.location >= VARYING_SLOT_PATCH0);
       return var->data.location - VARYING_SLOT_PATCH0;
-   } else if (ctx->stage == MESA_SHADER_TESS_CTRL) {
+   } else if ((output && ctx->stage == MESA_SHADER_TESS_CTRL) ||
+              (!output && ctx->stage == MESA_SHADER_TESS_EVAL)) {
       assert(var->data.location >= VARYING_SLOT_VAR0);
       return var->data.location - VARYING_SLOT_VAR0;
    }
@@ -383,7 +384,7 @@ emit_input(struct ntv_context *ctx, struct nir_variable 
*var)
          break;
 
       default:
-         slot = handle_handle_slot(ctx, var);
+         slot = handle_handle_slot(ctx, var, false);
          spirv_builder_emit_location(&ctx->builder, var_id, slot);
       }
    }
@@ -442,7 +443,7 @@ emit_output(struct ntv_context *ctx, struct nir_variable 
*var)
          break;
 
       default:
-         slot = handle_handle_slot(ctx, var);
+         slot = handle_handle_slot(ctx, var, true);
          spirv_builder_emit_location(&ctx->builder, var_id, slot);
       }
       /* tcs can't do xfb */

_______________________________________________
mesa-commit mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to