r600/sfn: Lower FS pos input w-transform in NIR
authorGert Wollny <gert.wollny@collabora.com>
Fri, 30 Apr 2021 18:12:19 +0000 (20:12 +0200)
committerGert Wollny <gert.wollny@collabora.com>
Tue, 18 May 2021 20:07:10 +0000 (22:07 +0200)
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10608>

src/gallium/drivers/r600/sfn/sfn_nir.cpp
src/gallium/drivers/r600/sfn/sfn_shader_fragment.cpp

index f1c6638..76310f9 100644 (file)
@@ -892,6 +892,7 @@ int r600_shader_from_nir(struct r600_context *rctx,
       NIR_PASS_V(sel->nir, r600_vectorize_vs_inputs);
 
    if (sel->nir->info.stage == MESA_SHADER_FRAGMENT) {
+      NIR_PASS_V(sel->nir, nir_lower_fragcoord_wtrans);
       NIR_PASS_V(sel->nir, r600_lower_fs_out_to_vector);
    }
 
index b13cb8a..9cb15d9 100644 (file)
@@ -400,8 +400,6 @@ void FragmentShaderFromNir::emit_shader_start()
          auto v = new GPRValue(m_frag_pos_index, i);
          v->set_as_input();
          auto reg = PValue(v);
-         if (i == 3)
-            emit_instruction(new AluInstruction(op1_recip_ieee, reg, reg, {alu_write, alu_last_instr}));
          m_frag_pos[i] = reg;
       }
    }