nir: update ubo locations in nir_lower_uniforms_to_ubo
locations are important for these because they provide info about how many block indices each ubo takes up UBO arrays have nonzero values here. all non-array UBOs have either 0 for the base or nonzero for an io lowered block at an offset, but only arrays need to be changed here because they're the only ones with absolute values, whereas all the others are relative. Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6272>
This commit is contained in:
parent
47c358233d
commit
c31ababae3
|
@ -128,8 +128,13 @@ nir_lower_uniforms_to_ubo(nir_shader *shader, int multiplier)
|
||||||
|
|
||||||
if (progress) {
|
if (progress) {
|
||||||
if (!shader->info.first_ubo_is_default_ubo) {
|
if (!shader->info.first_ubo_is_default_ubo) {
|
||||||
nir_foreach_variable_with_modes(var, shader, nir_var_mem_ubo)
|
nir_foreach_variable_with_modes(var, shader, nir_var_mem_ubo) {
|
||||||
var->data.binding++;
|
var->data.binding++;
|
||||||
|
/* only increment location for ubo arrays */
|
||||||
|
if (glsl_without_array(var->type) == var->interface_type &&
|
||||||
|
glsl_type_is_array(var->type))
|
||||||
|
var->data.location++;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
shader->info.num_ubos++;
|
shader->info.num_ubos++;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue