gallium/ttn: Convert inputs and outputs to derefs of variables.

This means that TTN shaders more closely resemble GTN shaders: they have
inputs and outputs as variable derefs, with the variables having their
.driver_location already set up for you.

This will be useful for v3d to do input variable DCE in NIR, which we
can't do when the TTN shaders never have a pre-nir_lower_io stage.

Acked-by: Rob Clark <robdclark@gmail.com>
This commit is contained in:
Eric Anholt
2018-09-18 15:53:54 -07:00
parent da15a0d88e
commit dda1ae9b3c
4 changed files with 64 additions and 69 deletions

View File

@@ -2487,9 +2487,6 @@ vc4_shader_state_create(struct pipe_context *pctx,
*/
s = cso->ir.nir;
NIR_PASS_V(s, nir_lower_io, nir_var_all & ~nir_var_uniform,
type_size,
(nir_lower_io_options)0);
NIR_PASS_V(s, nir_lower_io, nir_var_uniform,
uniforms_type_size,
(nir_lower_io_options)0);
@@ -2505,6 +2502,10 @@ vc4_shader_state_create(struct pipe_context *pctx,
s = tgsi_to_nir(cso->tokens, &nir_options);
}
NIR_PASS_V(s, nir_lower_io, nir_var_all & ~nir_var_uniform,
type_size,
(nir_lower_io_options)0);
NIR_PASS_V(s, nir_opt_global_to_local);
NIR_PASS_V(s, nir_lower_regs_to_ssa);
NIR_PASS_V(s, nir_normalize_cubemap_coords);