r600/sfn: Fix loading TES gl_PatchVerticesIn
authorGert Wollny <gert.wollny@collabora.com>
Sun, 28 Feb 2021 20:41:28 +0000 (21:41 +0100)
committerGert Wollny <gert.wollny@collabora.com>
Tue, 2 Mar 2021 17:46:17 +0000 (18:46 +0100)
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9330>

src/gallium/drivers/r600/sfn/sfn_nir_lower_tess_io.cpp

index d8fb6a6..2f0e0e4 100644 (file)
@@ -233,7 +233,13 @@ r600_lower_tess_io_impl(nir_builder *b, nir_instr *instr, enum pipe_prim_type pr
 
    switch (op->intrinsic) {
    case nir_intrinsic_load_patch_vertices_in: {
-      auto vertices_in = nir_channel(b, load_in_param_base, 2);
+      nir_ssa_def *vertices_in;
+      if (b->shader->info.stage == MESA_SHADER_TESS_CTRL)
+         vertices_in = nir_channel(b, load_in_param_base, 2);
+      else {
+         auto base = emit_load_param_base(b, nir_intrinsic_load_tcs_in_param_base_r600);
+         vertices_in = nir_channel(b, base, 2);
+      }
       nir_ssa_def_rewrite_uses(&op->dest.ssa, nir_src_for_ssa(vertices_in));
       nir_instr_remove(&op->instr);
       return true;