summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason Ekstrand <[email protected]>2015-08-18 14:45:35 -0700
committerJason Ekstrand <[email protected]>2015-08-25 10:18:27 -0700
commitc999a58f50578a826a66e2d95334245b6c4c9559 (patch)
tree57edda4938892a8442e4add2cc1bb88c3c8a1103
parent259f7291de2387aa3ac5f856b39b7b934a1d8e7d (diff)
nir/lower_io: Remove assign_var_locations_direct_first
This is no longer used so we might as well get rid of it. Reviewed-by: Kenneth Graunke <[email protected]>
-rw-r--r--src/glsl/nir/nir.h8
-rw-r--r--src/glsl/nir/nir_lower_io.c74
2 files changed, 0 insertions, 82 deletions
diff --git a/src/glsl/nir/nir.h b/src/glsl/nir/nir.h
index e357f933aa4..011a80aed97 100644
--- a/src/glsl/nir/nir.h
+++ b/src/glsl/nir/nir.h
@@ -1474,9 +1474,6 @@ typedef struct nir_shader {
* access plus one
*/
unsigned num_inputs, num_uniforms, num_outputs;
-
- /** the number of uniforms that are only accessed directly */
- unsigned num_direct_uniforms;
} nir_shader;
#define nir_foreach_overload(shader, overload) \
@@ -1633,11 +1630,6 @@ void nir_lower_locals_to_regs(nir_shader *shader);
void nir_assign_var_locations(struct exec_list *var_list,
unsigned *size,
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,
- int (*type_size)(const struct glsl_type *));
void nir_lower_io(nir_shader *shader,
int (*type_size)(const struct glsl_type *));
diff --git a/src/glsl/nir/nir_lower_io.c b/src/glsl/nir/nir_lower_io.c
index 70645b65246..c9697e7845e 100644
--- a/src/glsl/nir/nir_lower_io.c
+++ b/src/glsl/nir/nir_lower_io.c
@@ -76,80 +76,6 @@ deref_has_indirect(nir_deref_var *deref)
return false;
}
-static bool
-mark_indirect_uses_block(nir_block *block, void *void_state)
-{
- struct set *indirect_set = void_state;
-
- nir_foreach_instr(block, instr) {
- if (instr->type != nir_instr_type_intrinsic)
- continue;
-
- nir_intrinsic_instr *intrin = nir_instr_as_intrinsic(instr);
-
- for (unsigned i = 0;
- i < nir_intrinsic_infos[intrin->intrinsic].num_variables; i++) {
- if (deref_has_indirect(intrin->variables[i]))
- _mesa_set_add(indirect_set, intrin->variables[i]->var);
- }
- }
-
- return true;
-}
-
-/* Identical to nir_assign_var_locations_packed except that it assigns
- * locations to the variables that are used 100% directly first and then
- * assigns locations to variables that are used indirectly.
- */
-void
-nir_assign_var_locations_direct_first(nir_shader *shader,
- struct exec_list *var_list,
- unsigned *direct_size,
- unsigned *size,
- int (*type_size)(const struct glsl_type *))
-{
- struct set *indirect_set = _mesa_set_create(NULL, _mesa_hash_pointer,
- _mesa_key_pointer_equal);
-
- nir_foreach_overload(shader, overload) {
- if (overload->impl)
- nir_foreach_block(overload->impl, mark_indirect_uses_block,
- indirect_set);
- }
-
- unsigned location = 0;
-
- foreach_list_typed(nir_variable, var, node, var_list) {
- if ((var->data.mode == nir_var_uniform || var->data.mode == nir_var_shader_storage) &&
- var->interface_type != NULL)
- continue;
-
- if (_mesa_set_search(indirect_set, var))
- continue;
-
- var->data.driver_location = location;
- location += type_size(var->type);
- }
-
- *direct_size = location;
-
- foreach_list_typed(nir_variable, var, node, var_list) {
- if ((var->data.mode == nir_var_uniform || var->data.mode == nir_var_shader_storage) &&
- var->interface_type != NULL)
- continue;
-
- if (!_mesa_set_search(indirect_set, var))
- continue;
-
- var->data.driver_location = location;
- location += type_size(var->type);
- }
-
- *size = location;
-
- _mesa_set_destroy(indirect_set, NULL);
-}
-
static unsigned
get_io_offset(nir_deref_var *deref, nir_instr *instr, nir_src *indirect,
struct lower_io_state *state)