summaryrefslogtreecommitdiffstats
path: root/src/freedreno/ir3/ir3_shader.c
diff options
context:
space:
mode:
authorRob Clark <[email protected]>2019-04-25 12:25:02 -0700
committerRob Clark <[email protected]>2019-04-25 14:13:31 -0700
commitee2e3a07bb1d58d761bf7250e88822b6955d13bf (patch)
tree5b6634b9dc25befc6dbb1136c937186515dee3c1 /src/freedreno/ir3/ir3_shader.c
parent85949c52b493435efe22d40a12172c39b63f8d28 (diff)
freedreno/ir3: sample-shading support
The compiler support for: OES_sample_shading OES_sample_variables OES_shader_multisample_interpolation Signed-off-by: Rob Clark <[email protected]>
Diffstat (limited to 'src/freedreno/ir3/ir3_shader.c')
-rw-r--r--src/freedreno/ir3/ir3_shader.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/freedreno/ir3/ir3_shader.c b/src/freedreno/ir3/ir3_shader.c
index fa4f432e606..3f8e8abdc08 100644
--- a/src/freedreno/ir3/ir3_shader.c
+++ b/src/freedreno/ir3/ir3_shader.c
@@ -262,8 +262,15 @@ ir3_shader_from_nir(struct ir3_compiler *compiler, nir_shader *nir)
NIR_PASS_V(nir, nir_lower_io, nir_var_all, ir3_glsl_type_size,
(nir_lower_io_options)0);
- if (nir->info.stage == MESA_SHADER_FRAGMENT)
+ if (nir->info.stage == MESA_SHADER_FRAGMENT) {
+ /* NOTE: lower load_barycentric_at_sample first, since it
+ * produces load_barycentric_at_offset:
+ */
+ NIR_PASS_V(nir, ir3_nir_lower_load_barycentric_at_sample);
+ NIR_PASS_V(nir, ir3_nir_lower_load_barycentric_at_offset);
+
NIR_PASS_V(nir, ir3_nir_move_varying_inputs);
+ }
NIR_PASS_V(nir, nir_lower_io_arrays_to_elements_no_indirects, false);
@@ -409,6 +416,10 @@ ir3_shader_disasm(struct ir3_shader_variant *so, uint32_t *bin, FILE *out)
case MESA_SHADER_FRAGMENT:
dump_reg(out, "pos (ij_pixel)",
ir3_find_sysval_regid(so, SYSTEM_VALUE_BARYCENTRIC_PIXEL));
+ dump_reg(out, "pos (ij_centroid)",
+ ir3_find_sysval_regid(so, SYSTEM_VALUE_BARYCENTRIC_CENTROID));
+ dump_reg(out, "pos (ij_size)",
+ ir3_find_sysval_regid(so, SYSTEM_VALUE_BARYCENTRIC_SIZE));
dump_output(out, so, FRAG_RESULT_DEPTH, "posz");
if (so->color0_mrt) {
dump_output(out, so, FRAG_RESULT_COLOR, "color");