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,8 +1886,8 @@ 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;
|
||||||
@@ -1901,16 +1901,6 @@ nir_visitor::visit(ir_expression *ir)
|
|||||||
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);
|
||||||
intrin->num_components = deref->type->vector_elements;
|
intrin->num_components = deref->type->vector_elements;
|
||||||
|
Reference in New Issue
Block a user