summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason Ekstrand <[email protected]>2018-03-27 09:15:54 -0700
committerJason Ekstrand <[email protected]>2018-06-22 20:54:00 -0700
commita3589bb01f73e7b9c23ffb15ee78f21fe4c846a0 (patch)
tree2d8d8b0070a678108cdadf935dba8b8bcbe9ca3b
parent3992665c52733f9e7630726ae3596d4c7c08b9d5 (diff)
nir: Remove deref chain support from lower_wpos_ytransform
Acked-by: Rob Clark <[email protected]> Acked-by: Bas Nieuwenhuizen <[email protected]> Acked-by: Dave Airlie <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
-rw-r--r--src/compiler/nir/nir_lower_wpos_ytransform.c38
1 files changed, 2 insertions, 36 deletions
diff --git a/src/compiler/nir/nir_lower_wpos_ytransform.c b/src/compiler/nir/nir_lower_wpos_ytransform.c
index 6212702b0e9..7b20f8a3b1a 100644
--- a/src/compiler/nir/nir_lower_wpos_ytransform.c
+++ b/src/compiler/nir/nir_lower_wpos_ytransform.c
@@ -272,24 +272,6 @@ lower_interp_deref_at_offset(lower_wpos_ytransform_state *state,
}
static void
-lower_interp_var_at_offset(lower_wpos_ytransform_state *state,
- nir_intrinsic_instr *interp)
-{
- nir_builder *b = &state->b;
- nir_ssa_def *offset;
- nir_ssa_def *flip_y;
-
- b->cursor = nir_before_instr(&interp->instr);
-
- offset = nir_ssa_for_src(b, interp->src[0], 2);
- flip_y = nir_fmul(b, nir_channel(b, offset, 1),
- nir_channel(b, get_transform(state), 0));
- nir_instr_rewrite_src(&interp->instr, &interp->src[0],
- nir_src_for_ssa(nir_vec2(b, nir_channel(b, offset, 0),
- flip_y)));
-}
-
-static void
lower_load_sample_pos(lower_wpos_ytransform_state *state,
nir_intrinsic_instr *intr)
{
@@ -329,30 +311,12 @@ lower_wpos_ytransform_block(lower_wpos_ytransform_state *state, nir_block *block
var->data.location == SYSTEM_VALUE_SAMPLE_POS) {
lower_load_sample_pos(state, intr);
}
- } else if (intr->intrinsic == nir_intrinsic_load_var) {
- nir_deref_var *dvar = intr->variables[0];
- nir_variable *var = dvar->var;
-
- if ((var->data.mode == nir_var_shader_in &&
- var->data.location == VARYING_SLOT_POS) ||
- (var->data.mode == nir_var_system_value &&
- var->data.location == SYSTEM_VALUE_FRAG_COORD)) {
- /* gl_FragCoord should not have array/struct derefs: */
- assert(dvar->deref.child == NULL);
- lower_fragcoord(state, intr, var);
- } else if (var->data.mode == nir_var_system_value &&
- var->data.location == SYSTEM_VALUE_SAMPLE_POS) {
- assert(dvar->deref.child == NULL);
- lower_load_sample_pos(state, intr);
- }
} else if (intr->intrinsic == nir_intrinsic_load_frag_coord) {
lower_fragcoord(state, intr, NULL);
} else if (intr->intrinsic == nir_intrinsic_load_sample_pos) {
lower_load_sample_pos(state, intr);
} else if (intr->intrinsic == nir_intrinsic_interp_deref_at_offset) {
lower_interp_deref_at_offset(state, intr);
- } else if (intr->intrinsic == nir_intrinsic_interp_var_at_offset) {
- lower_interp_var_at_offset(state, intr);
}
} else if (instr->type == nir_instr_type_alu) {
nir_alu_instr *alu = nir_instr_as_alu(instr);
@@ -385,6 +349,8 @@ nir_lower_wpos_ytransform(nir_shader *shader,
.shader = shader,
};
+ nir_assert_unlowered_derefs(shader, nir_lower_load_store_derefs);
+
assert(shader->info.stage == MESA_SHADER_FRAGMENT);
nir_foreach_function(function, shader) {