summaryrefslogtreecommitdiff
path: root/src/freedreno/vulkan/tu_shader.c
diff options
context:
space:
mode:
authorJonathan Marek <jonathan@marek.ca>2019-12-15 18:55:39 -0500
committerJonathan Marek <jonathan@marek.ca>2020-01-21 20:36:08 -0500
commitc17176522338256d93696f04289c210f4635599b (patch)
tree8af571b8536465d7603499a611c76e7fd56e0cd2 /src/freedreno/vulkan/tu_shader.c
parent1736447f27e815405ed6a08e939d9c418678f195 (diff)
downloadmesa-c17176522338256d93696f04289c210f4635599b.tar.gz
turnip: remove tu_sort_variables_by_location
nir_assign_io_var_locations already does sorting. Signed-off-by: Jonathan Marek <jonathan@marek.ca> Reviewed-by: Eric Anholt <eric@anholt.net> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3109>
Diffstat (limited to 'src/freedreno/vulkan/tu_shader.c')
-rw-r--r--src/freedreno/vulkan/tu_shader.c48
1 files changed, 0 insertions, 48 deletions
diff --git a/src/freedreno/vulkan/tu_shader.c b/src/freedreno/vulkan/tu_shader.c
index 6303f222264..13481b8d214 100644
--- a/src/freedreno/vulkan/tu_shader.c
+++ b/src/freedreno/vulkan/tu_shader.c
@@ -80,34 +80,6 @@ tu_spirv_to_nir(struct ir3_compiler *compiler,
return nir;
}
-static void
-tu_sort_variables_by_location(struct exec_list *variables)
-{
- struct exec_list sorted;
- exec_list_make_empty(&sorted);
-
- nir_foreach_variable_safe(var, variables)
- {
- exec_node_remove(&var->node);
-
- /* insert the variable into the sorted list */
- nir_variable *next = NULL;
- nir_foreach_variable(tmp, &sorted)
- {
- if (var->data.location < tmp->data.location) {
- next = tmp;
- break;
- }
- }
- if (next)
- exec_node_insert_node_before(&next->node, &var->node);
- else
- exec_list_push_tail(&sorted, &var->node);
- }
-
- exec_list_move_nodes_to(&sorted, variables);
-}
-
static unsigned
map_add(struct tu_descriptor_map *map, int set, int binding, int value,
int array_size)
@@ -475,26 +447,6 @@ tu_shader_create(struct tu_device *dev,
/* ir3 doesn't support indirect input/output */
NIR_PASS_V(nir, nir_lower_indirect_derefs, nir_var_shader_in | nir_var_shader_out);
- switch (stage) {
- case MESA_SHADER_VERTEX:
- tu_sort_variables_by_location(&nir->outputs);
- break;
- case MESA_SHADER_TESS_CTRL:
- case MESA_SHADER_TESS_EVAL:
- case MESA_SHADER_GEOMETRY:
- tu_sort_variables_by_location(&nir->inputs);
- tu_sort_variables_by_location(&nir->outputs);
- break;
- case MESA_SHADER_FRAGMENT:
- tu_sort_variables_by_location(&nir->inputs);
- break;
- case MESA_SHADER_COMPUTE:
- break;
- default:
- unreachable("invalid gl_shader_stage");
- break;
- }
-
nir_assign_io_var_locations(&nir->inputs, &nir->num_inputs, stage);
nir_assign_io_var_locations(&nir->outputs, &nir->num_outputs, stage);