summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/vc4
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2018-09-18 15:53:54 -0700
committerEric Anholt <eric@anholt.net>2018-10-15 17:16:43 -0700
commitdda1ae9b3cb9ea39c9435fba01c6c31a99c4d35e (patch)
tree6d57a596152835d5b68e3cad5148ba410bdec659 /src/gallium/drivers/vc4
parentda15a0d88ea1a29968ee624186d895fe5ff0f574 (diff)
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>
Diffstat (limited to 'src/gallium/drivers/vc4')
-rw-r--r--src/gallium/drivers/vc4/vc4_program.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/gallium/drivers/vc4/vc4_program.c b/src/gallium/drivers/vc4/vc4_program.c
index 3c439806d36..f734d121052 100644
--- a/src/gallium/drivers/vc4/vc4_program.c
+++ b/src/gallium/drivers/vc4/vc4_program.c
@@ -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);