aboutsummaryrefslogtreecommitdiffstats
path: root/src/glsl/nir/nir_lower_io.c
diff options
context:
space:
mode:
authorJason Ekstrand <[email protected]>2015-03-18 15:04:15 -0700
committerJason Ekstrand <[email protected]>2015-03-19 13:18:39 -0700
commit25db44a84597960a6aea6b252bcf2c3d7e17fc74 (patch)
tree81f3bda89f306267ae3034a06f80eb09b15a4bfb /src/glsl/nir/nir_lower_io.c
parent639115123efe7f71d432e24b1719adda7d23e97e (diff)
nir/lower_io: Make variable location assignment a manual operation
Previously, we just assigned variable locations in nir_lower_io. Now, we force the user to assign variable locations for us. This gives the backend a bit more control over where variables are placed. v2: Rename from _packed to _scalar Reviewed-by: Connor Abbott <[email protected]>
Diffstat (limited to 'src/glsl/nir/nir_lower_io.c')
-rw-r--r--src/glsl/nir/nir_lower_io.c14
1 files changed, 2 insertions, 12 deletions
diff --git a/src/glsl/nir/nir_lower_io.c b/src/glsl/nir/nir_lower_io.c
index 37c357e893b..602b8c95b8e 100644
--- a/src/glsl/nir/nir_lower_io.c
+++ b/src/glsl/nir/nir_lower_io.c
@@ -76,8 +76,8 @@ type_size(const struct glsl_type *type)
return 0;
}
-static void
-assign_var_locations(struct exec_list *var_list, unsigned *size)
+void
+nir_assign_var_locations_scalar(struct exec_list *var_list, unsigned *size)
{
unsigned location = 0;
@@ -96,14 +96,6 @@ assign_var_locations(struct exec_list *var_list, unsigned *size)
*size = location;
}
-static void
-assign_var_locations_shader(nir_shader *shader)
-{
- assign_var_locations(&shader->inputs, &shader->num_inputs);
- assign_var_locations(&shader->outputs, &shader->num_outputs);
- assign_var_locations(&shader->uniforms, &shader->num_uniforms);
-}
-
static bool
deref_has_indirect(nir_deref_var *deref)
{
@@ -304,8 +296,6 @@ nir_lower_io_impl(nir_function_impl *impl)
void
nir_lower_io(nir_shader *shader)
{
- assign_var_locations_shader(shader);
-
nir_foreach_overload(shader, overload) {
if (overload->impl)
nir_lower_io_impl(overload->impl);