summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKonstantin Seurer <konstantin.seurer@gmail.com>2023-11-17 13:39:52 +0100
committerEric Engestrom <eric@engestrom.ch>2024-01-10 10:28:59 +0000
commita53c9acd822f9f9e31cc295be6c01bae388b3e98 (patch)
tree22480eb6fbbe99811991bf3042a2db32dcfc3e9e
parent1c476c7742d562181f8684cf20eab4aa2d6ce755 (diff)
downloadmesa-a53c9acd822f9f9e31cc295be6c01bae388b3e98.tar.gz
mesa-a53c9acd822f9f9e31cc295be6c01bae388b3e98.tar.bz2
mesa-a53c9acd822f9f9e31cc295be6c01bae388b3e98.zip
vtn: Allow for OpCopyLogical with different but compatible types
> Result Type must not equal the type of Operand (see OpCopyObject), > but Result Type must logically match the Operand type. Allow for this by setting the expected type and making sure, that both types match. cc: mesa-stable Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/10163 Reviewed-by: Georg Lehmann <dadschoorse@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26252> (cherry picked from commit 4c363acf94a04a9a885ed4025e628520354186dc)
-rw-r--r--.pick_status.json2
-rw-r--r--src/compiler/spirv/spirv_to_nir.c6
2 files changed, 6 insertions, 2 deletions
diff --git a/.pick_status.json b/.pick_status.json
index e8838595de7..ba9a2edf7b5 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -174,7 +174,7 @@
"description": "vtn: Allow for OpCopyLogical with different but compatible types",
"nominated": true,
"nomination_type": 0,
- "resolution": 0,
+ "resolution": 1,
"main_sha": null,
"because_sha": null,
"notes": null
diff --git a/src/compiler/spirv/spirv_to_nir.c b/src/compiler/spirv/spirv_to_nir.c
index 2587c866723..5f36118c704 100644
--- a/src/compiler/spirv/spirv_to_nir.c
+++ b/src/compiler/spirv/spirv_to_nir.c
@@ -4375,9 +4375,13 @@ vtn_handle_composite(struct vtn_builder *b, SpvOp opcode,
w + 5, count - 5);
break;
- case SpvOpCopyLogical:
+ case SpvOpCopyLogical: {
ssa = vtn_composite_copy(b, vtn_ssa_value(b, w[3]));
+ struct vtn_type *dst_type = vtn_get_value_type(b, w[2]);
+ vtn_assert(vtn_types_compatible(b, type, dst_type));
+ ssa->type = glsl_get_bare_type(dst_type->type);
break;
+ }
case SpvOpCopyObject:
vtn_copy_value(b, w[3], w[2]);
return;