nir: Add an IO scalarizing pass using the intrinsic's first_component.

vc4 wants to have per-scalar IO load/stores so that dead code elimination
can happen on a more granular basis, which it has been doing in the
backend using a multiplication by 4 of the intrinsic's driver_location.
We can represent it properly in the NIR using the first_component field,
though.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
This commit is contained in:
Eric Anholt
2016-08-04 12:42:45 -07:00
parent c35f979220
commit 9f1411d1ec
3 changed files with 131 additions and 0 deletions

View File

@@ -2395,6 +2395,7 @@ void nir_lower_alu_to_scalar(nir_shader *shader);
void nir_lower_load_const_to_scalar(nir_shader *shader);
void nir_lower_phis_to_scalar(nir_shader *shader);
void nir_lower_io_to_scalar(nir_shader *shader, nir_variable_mode mask);
void nir_lower_samplers(nir_shader *shader,
const struct gl_shader_program *shader_program);