Mesa (staging/22.0): zink: avoid creating ssbo variable types with multiple runtime arrays
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Thu Apr 14 06:01:30 UTC 2022
Module: Mesa
Branch: staging/22.0
Commit: e0f251ac266e3ad7378b5cde97f1ba152f461ae9
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=e0f251ac266e3ad7378b5cde97f1ba152f461ae9
Author: Mike Blumenkrantz <michael.blumenkrantz at gmail.com>
Date: Tue Apr 12 09:47:03 2022 -0400
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: Dave Airlie <airlied at redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15894>
(cherry picked from commit fcd6b2a47a9bff248a35edbeef5ae27a3ca643e0)
---
.pick_status.json | 2 +-
src/gallium/drivers/zink/zink_compiler.c | 5 +++--
2 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/.pick_status.json b/.pick_status.json
index 1cb0c821141..bcb32426e85 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -148,7 +148,7 @@
"description": "zink: avoid creating ssbo variable types with multiple runtime arrays",
"nominated": true,
"nomination_type": 0,
- "resolution": 0,
+ "resolution": 1,
"because_sha": null
},
{
diff --git a/src/gallium/drivers/zink/zink_compiler.c b/src/gallium/drivers/zink/zink_compiler.c
index 099434a698d..78d030bfa1b 100644
--- a/src/gallium/drivers/zink/zink_compiler.c
+++ b/src/gallium/drivers/zink/zink_compiler.c
@@ -1357,12 +1357,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;
}
More information about the mesa-commit
mailing list