zink: process ubos with location values set as long as they're actually ubos
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8514>
This commit is contained in:
parent
9eec52c67e
commit
5ebfb9cd60
|
@ -669,7 +669,7 @@ emit_ubo(struct ntv_context *ctx, struct nir_variable *var)
|
||||||
/* variables accessed inside a uniform block will get merged into a big
|
/* variables accessed inside a uniform block will get merged into a big
|
||||||
* memory blob and accessed by offset
|
* memory blob and accessed by offset
|
||||||
*/
|
*/
|
||||||
if (var->data.location && !is_ubo_array)
|
if (var->data.location && !is_ubo_array && var->type != var->interface_type)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
uint32_t size = glsl_count_attribute_slots(var->interface_type, false);
|
uint32_t size = glsl_count_attribute_slots(var->interface_type, false);
|
||||||
|
|
|
@ -466,7 +466,7 @@ zink_shader_create(struct zink_screen *screen, struct nir_shader *nir,
|
||||||
if (var->data.mode == nir_var_mem_ubo) {
|
if (var->data.mode == nir_var_mem_ubo) {
|
||||||
/* ignore variables being accessed if they aren't the base of the UBO */
|
/* ignore variables being accessed if they aren't the base of the UBO */
|
||||||
bool ubo_array = glsl_type_is_array(var->type) && glsl_type_is_interface(glsl_without_array(var->type));
|
bool ubo_array = glsl_type_is_array(var->type) && glsl_type_is_interface(glsl_without_array(var->type));
|
||||||
if (var->data.location && !ubo_array)
|
if (var->data.location && !ubo_array && var->type != var->interface_type)
|
||||||
continue;
|
continue;
|
||||||
var->data.binding = cur_ubo;
|
var->data.binding = cur_ubo;
|
||||||
/* if this is a ubo array, create a binding point for each array member:
|
/* if this is a ubo array, create a binding point for each array member:
|
||||||
|
|
Loading…
Reference in New Issue