diff options
author | Timothy Arceri <[email protected]> | 2016-10-25 10:23:25 +1100 |
---|---|---|
committer | Timothy Arceri <[email protected]> | 2016-10-26 14:29:36 +1100 |
commit | 2e423ca1477bd212c01676c5e4828ebdb83310d8 (patch) | |
tree | 5ada9a6686103e678b2bd29ed80768370fdc6ea4 /src/compiler | |
parent | 4ac668616573b73a742a971bb0d7abe8234b6aa9 (diff) |
nir: stop adjusting driver location for varying packing
As of 59864e8e020 we just use the location assigned by the front-end and
no longer need this for i965.
Since there were some issues in the logic with assigning arrays the same
driver location if they didn't start at the same location just remove it
and let other drivers implement a solution if needed when they add
ARB_enhanced_layouts support.
Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/compiler')
-rw-r--r-- | src/compiler/nir/nir.h | 1 | ||||
-rw-r--r-- | src/compiler/nir/nir_lower_io.c | 48 |
2 files changed, 2 insertions, 47 deletions
diff --git a/src/compiler/nir/nir.h b/src/compiler/nir/nir.h index 54302f82a9a..92647632462 100644 --- a/src/compiler/nir/nir.h +++ b/src/compiler/nir/nir.h @@ -2321,7 +2321,6 @@ void nir_lower_io_to_temporaries(nir_shader *shader, void nir_shader_gather_info(nir_shader *shader, nir_function_impl *entrypoint); void nir_assign_var_locations(struct exec_list *var_list, unsigned *size, - unsigned base_offset, int (*type_size)(const struct glsl_type *)); typedef enum { diff --git a/src/compiler/nir/nir_lower_io.c b/src/compiler/nir/nir_lower_io.c index d77cb134533..25cca186193 100644 --- a/src/compiler/nir/nir_lower_io.c +++ b/src/compiler/nir/nir_lower_io.c @@ -44,18 +44,10 @@ struct lower_io_state { void nir_assign_var_locations(struct exec_list *var_list, unsigned *size, - unsigned base_offset, int (*type_size)(const struct glsl_type *)) { unsigned location = 0; - /* There are 32 regular and 32 patch varyings allowed */ - int locations[64][2]; - for (unsigned i = 0; i < 64; i++) { - for (unsigned j = 0; j < 2; j++) - locations[i][j] = -1; - } - nir_foreach_variable(var, var_list) { /* * UBO's have their own address spaces, so don't count them towards the @@ -65,44 +57,8 @@ nir_assign_var_locations(struct exec_list *var_list, unsigned *size, var->interface_type != NULL) continue; - /* Make sure we give the same location to varyings packed with - * ARB_enhanced_layouts. - */ - int idx = var->data.location - base_offset; - if (base_offset && idx >= 0) { - assert(idx < ARRAY_SIZE(locations)); - - if (locations[idx][var->data.index] == -1) { - var->data.driver_location = location; - locations[idx][var->data.index] = location; - - /* A dvec3 can be packed with a double we need special handling - * for this as we are packing across two locations. - */ - if (glsl_get_base_type(var->type) == GLSL_TYPE_DOUBLE && - glsl_get_vector_elements(var->type) == 3) { - /* Hack around type_size functions that expect vectors to be - * padded out to vec4. If a float type is the same size as a - * double then the type size is padded to vec4, otherwise - * set the offset to two doubles which offsets the location - * past the first two components in dvec3 which were stored at - * the previous location. - */ - unsigned dsize = type_size(glsl_double_type()); - unsigned offset = - dsize == type_size(glsl_float_type()) ? dsize : dsize * 2; - - locations[idx + 1][var->data.index] = location + offset; - } - - location += type_size(var->type); - } else { - var->data.driver_location = locations[idx][var->data.index]; - } - } else { - var->data.driver_location = location; - location += type_size(var->type); - } + var->data.driver_location = location; + location += type_size(var->type); } *size = location; |