summaryrefslogtreecommitdiffstats
path: root/src/glsl/nir/nir.h
diff options
context:
space:
mode:
authorKenneth Graunke <[email protected]>2015-08-12 14:29:25 -0700
committerJason Ekstrand <[email protected]>2015-08-25 10:18:27 -0700
commit6c33d6bbf9b54784e4498a81c73b712dca5dd737 (patch)
tree0aa1a052d8fabbf8f23f7818028b168937628a18 /src/glsl/nir/nir.h
parenta23f82053d18c2f7d78e28551368437ded4c1a03 (diff)
nir: Pass a type_size() function pointer into nir_lower_io().
Previously, there were four type_size() functions in play - the i965 compiler backend defined scalar and vec4 type_size() functions, and nir_lower_io contained its own similar functions. In fact, the i965 driver used nir_lower_io() and then looped over the components using its own type_size - meaning both were in play. The two are /basically/ the same, but not exactly in obscure cases like subroutines and images. This patch removes nir_lower_io's functions, and instead makes the driver supply a function pointer. This gives the driver ultimate flexibility in deciding how it wants to count things, reduces code duplication, and improves consistency. v2 (Jason Ekstrand): - One side-effect of passing in a function pointer is that nir_lower_io is now aware of and properly allocates space for image uniforms, allowing us to drop hacks in the backend Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]> v2 Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/glsl/nir/nir.h')
-rw-r--r--src/glsl/nir/nir.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/glsl/nir/nir.h b/src/glsl/nir/nir.h
index d19a1907d47..e357f933aa4 100644
--- a/src/glsl/nir/nir.h
+++ b/src/glsl/nir/nir.h
@@ -1632,15 +1632,15 @@ void nir_lower_locals_to_regs(nir_shader *shader);
void nir_assign_var_locations(struct exec_list *var_list,
unsigned *size,
- bool is_scalar);
+ int (*type_size)(const struct glsl_type *));
void nir_assign_var_locations_direct_first(nir_shader *shader,
struct exec_list *var_list,
unsigned *direct_size,
unsigned *size,
- bool is_scalar);
-
-void nir_lower_io(nir_shader *shader, bool is_scalar);
+ int (*type_size)(const struct glsl_type *));
+void nir_lower_io(nir_shader *shader,
+ int (*type_size)(const struct glsl_type *));
void nir_lower_vars_to_ssa(nir_shader *shader);
void nir_remove_dead_variables(nir_shader *shader);