Skip to content
Snippets Groups Projects
Commit 16a25a5a authored by Mike Blumenkrantz's avatar Mike Blumenkrantz :lifter: Committed by Dylan Baker
Browse files

zink: avoid creating ssbo variable types with multiple runtime arrays


this is illegal

affects:
KHR-GL46.shader_storage_buffer_object.advanced-unsizedArrayLength-cs-packed-matC

cc: mesa-stable

Reviewed-by: default avatarDave Airlie <airlied@redhat.com>
Part-of: <mesa/mesa!15894>
(cherry picked from commit fcd6b2a4)
parent c3b8e592
No related branches found
No related tags found
No related merge requests found
......@@ -2220,7 +2220,7 @@
"description": "zink: avoid creating ssbo variable types with multiple runtime arrays",
"nominated": true,
"nomination_type": 0,
"resolution": 0,
"resolution": 1,
"because_sha": null
},
{
......
......@@ -1359,12 +1359,13 @@ unbreak_bos(nir_shader *shader)
u_foreach_bit(slot, ssbo_used) {
char buf[64];
snprintf(buf, sizeof(buf), "ssbo_slot_%u", slot);
if (ssbo_sizes[slot])
bool use_runtime = ssbo_sizes[slot] && max_ssbo_size;
if (use_runtime)
fields[1].type = unsized;
else
fields[1].type = NULL;
nir_variable *var = nir_variable_create(shader, nir_var_mem_ssbo,
glsl_struct_type(fields, 1 + !!ssbo_sizes[slot], "struct", false), buf);
glsl_struct_type(fields, 1 + use_runtime, "struct", false), buf);
var->interface_type = var->type;
var->data.driver_location = slot;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment