Mesa (staging/20.1): spirv: Allow block-decorated struct types for constants
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Mon Jul 13 22:00:00 UTC 2020
Module: Mesa
Branch: staging/20.1
Commit: 181c0c50a2712384e6f35df0cc978d42f691de94
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=181c0c50a2712384e6f35df0cc978d42f691de94
Author: Jason Ekstrand <jason at jlekstrand.net>
Date: Fri Jul 10 15:58:39 2020 -0500
spirv: Allow block-decorated struct types for constants
Whenever a struct type is decorated Block or BufferBlock we turn that
into a GLSL_TYPE_INTERFACE. Since these decorations can end up random
places, we should allow them for constants.
Closes: #3252
Fixes: 9d0ae777dd6 "spirv: Use interface type for block and buffer..."
Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira at intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5855>
(cherry picked from commit 351b5137d71b8dc944bad6dcb83cd93e6d38c44e)
---
.pick_status.json | 2 +-
src/compiler/nir/nir_print.c | 1 +
src/compiler/spirv/spirv_to_nir.c | 3 ++-
3 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/.pick_status.json b/.pick_status.json
index 023b4a11808..98c42eac381 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -616,7 +616,7 @@
"description": "spirv: Allow block-decorated struct types for constants",
"nominated": true,
"nomination_type": 1,
- "resolution": 0,
+ "resolution": 1,
"master_sha": null,
"because_sha": "9d0ae777dd68dad682dcc7768726996639ae2684"
},
diff --git a/src/compiler/nir/nir_print.c b/src/compiler/nir/nir_print.c
index 6fc8fc9b5c1..d1959d4d5f5 100644
--- a/src/compiler/nir/nir_print.c
+++ b/src/compiler/nir/nir_print.c
@@ -399,6 +399,7 @@ print_constant(nir_constant *c, const struct glsl_type *type, print_state *state
break;
case GLSL_TYPE_STRUCT:
+ case GLSL_TYPE_INTERFACE:
for (i = 0; i < c->num_elements; i++) {
if (i > 0) fprintf(fp, ", ");
fprintf(fp, "{ ");
diff --git a/src/compiler/spirv/spirv_to_nir.c b/src/compiler/spirv/spirv_to_nir.c
index 795f4c8bdcf..ed11b19e6b7 100644
--- a/src/compiler/spirv/spirv_to_nir.c
+++ b/src/compiler/spirv/spirv_to_nir.c
@@ -256,7 +256,8 @@ vtn_const_ssa_value(struct vtn_builder *b, nir_constant *constant,
break;
}
- case GLSL_TYPE_STRUCT: {
+ case GLSL_TYPE_STRUCT:
+ case GLSL_TYPE_INTERFACE: {
unsigned elems = glsl_get_length(val->type);
val->elems = ralloc_array(b, struct vtn_ssa_value *, elems);
for (unsigned i = 0; i < elems; i++) {
More information about the mesa-commit
mailing list