glsl/glsl_to_nir: remove unreachable code
This hack in glsl_to_nir() to clean up after the glsl ir linker should no longer be reachable. These type of linking opts are now done via a nir based linker long after GLSL IR has been coverted to nir by this pass. Reviewed-by: Emma Anholt <emma@anholt.net> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19104>
This commit is contained in:

committed by
Marge Bot

parent
c7e9268658
commit
ac7f4e0942
@@ -1886,30 +1886,20 @@ nir_visitor::visit(ir_expression *ir)
|
|||||||
|
|
||||||
deref->accept(this);
|
deref->accept(this);
|
||||||
|
|
||||||
|
assert(nir_deref_mode_is(this->deref, nir_var_shader_in));
|
||||||
nir_intrinsic_op op;
|
nir_intrinsic_op op;
|
||||||
if (nir_deref_mode_is(this->deref, nir_var_shader_in)) {
|
switch (ir->operation) {
|
||||||
switch (ir->operation) {
|
case ir_unop_interpolate_at_centroid:
|
||||||
case ir_unop_interpolate_at_centroid:
|
op = nir_intrinsic_interp_deref_at_centroid;
|
||||||
op = nir_intrinsic_interp_deref_at_centroid;
|
break;
|
||||||
break;
|
case ir_binop_interpolate_at_offset:
|
||||||
case ir_binop_interpolate_at_offset:
|
op = nir_intrinsic_interp_deref_at_offset;
|
||||||
op = nir_intrinsic_interp_deref_at_offset;
|
break;
|
||||||
break;
|
case ir_binop_interpolate_at_sample:
|
||||||
case ir_binop_interpolate_at_sample:
|
op = nir_intrinsic_interp_deref_at_sample;
|
||||||
op = nir_intrinsic_interp_deref_at_sample;
|
break;
|
||||||
break;
|
default:
|
||||||
default:
|
unreachable("Invalid interpolation intrinsic");
|
||||||
unreachable("Invalid interpolation intrinsic");
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
/* This case can happen if the vertex shader does not write the
|
|
||||||
* given varying. In this case, the linker will lower it to a
|
|
||||||
* global variable. Since interpolating a variable makes no
|
|
||||||
* sense, we'll just turn it into a load which will probably
|
|
||||||
* eventually end up as an SSA definition.
|
|
||||||
*/
|
|
||||||
assert(nir_deref_mode_is(this->deref, nir_var_shader_temp));
|
|
||||||
op = nir_intrinsic_load_deref;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
nir_intrinsic_instr *intrin = nir_intrinsic_instr_create(shader, op);
|
nir_intrinsic_instr *intrin = nir_intrinsic_instr_create(shader, op);
|
||||||
|
Reference in New Issue
Block a user