mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-08 22:08:26 +02:00
st/glsl_to_nir: fix driver location for dual-slot packed doubles
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
This commit is contained in:
parent
47eee04556
commit
fc51fdbcde
1 changed files with 16 additions and 6 deletions
|
|
@ -141,16 +141,23 @@ st_nir_assign_var_locations(struct exec_list *var_list, unsigned *size,
|
||||||
type = glsl_get_array_element(type);
|
type = glsl_get_array_element(type);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
unsigned var_size = type_size(type);
|
||||||
|
|
||||||
/* Builtins don't allow component packing so we only need to worry about
|
/* Builtins don't allow component packing so we only need to worry about
|
||||||
* user defined varyings sharing the same location.
|
* user defined varyings sharing the same location.
|
||||||
*/
|
*/
|
||||||
bool processed = false;
|
bool processed = false;
|
||||||
if (var->data.location >= base) {
|
if (var->data.location >= base) {
|
||||||
unsigned glsl_location = var->data.location - base;
|
unsigned glsl_location = var->data.location - base;
|
||||||
if (processed_locs[var->data.index] & ((uint64_t)1 << glsl_location))
|
|
||||||
|
for (unsigned i = 0; i < var_size; i++) {
|
||||||
|
if (processed_locs[var->data.index] &
|
||||||
|
((uint64_t)1 << (glsl_location + i)))
|
||||||
processed = true;
|
processed = true;
|
||||||
else
|
else
|
||||||
processed_locs[var->data.index] |= ((uint64_t)1 << glsl_location);
|
processed_locs[var->data.index] |=
|
||||||
|
((uint64_t)1 << (glsl_location + i));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Because component packing allows varyings to share the same location
|
/* Because component packing allows varyings to share the same location
|
||||||
|
|
@ -162,9 +169,12 @@ st_nir_assign_var_locations(struct exec_list *var_list, unsigned *size,
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
assigned_locations[var->data.location] = location;
|
for (unsigned i = 0; i < var_size; i++) {
|
||||||
|
assigned_locations[var->data.location + i] = location + i;
|
||||||
|
}
|
||||||
|
|
||||||
var->data.driver_location = location;
|
var->data.driver_location = location;
|
||||||
location += type_size(type);
|
location += var_size;
|
||||||
}
|
}
|
||||||
|
|
||||||
*size += location;
|
*size += location;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue