Mesa (staging/21.2): zink: add more int/float types to cast switching in ntv
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Mon Nov 1 17:38:08 UTC 2021
Module: Mesa
Branch: staging/21.2
Commit: 15011982b552bdea7b98aef659557b5afa678238
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=15011982b552bdea7b98aef659557b5afa678238
Author: Mike Blumenkrantz <michael.blumenkrantz at gmail.com>
Date: Wed Oct 27 16:58:10 2021 -0400
zink: add more int/float types to cast switching in ntv
these come from opcode results, which are not always 32bit
cc: mesa-stable
Reviewed-by: Dave Airlie <airlied at redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13562>
(cherry picked from commit c73f5a00826201f6e76854145aa823cec4f389d2)
---
.pick_status.json | 2 +-
src/gallium/drivers/zink/nir_to_spirv/nir_to_spirv.c | 16 ++++++++++++++++
2 files changed, 17 insertions(+), 1 deletion(-)
diff --git a/.pick_status.json b/.pick_status.json
index 7fd046f583f..bc3a8870336 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -22,7 +22,7 @@
"description": "zink: add more int/float types to cast switching in ntv",
"nominated": true,
"nomination_type": 0,
- "resolution": 0,
+ "resolution": 1,
"main_sha": null,
"because_sha": null
},
diff --git a/src/gallium/drivers/zink/nir_to_spirv/nir_to_spirv.c b/src/gallium/drivers/zink/nir_to_spirv/nir_to_spirv.c
index e579f1eb083..8ddfc5c3442 100644
--- a/src/gallium/drivers/zink/nir_to_spirv/nir_to_spirv.c
+++ b/src/gallium/drivers/zink/nir_to_spirv/nir_to_spirv.c
@@ -1170,10 +1170,18 @@ store_dest(struct ntv_context *ctx, nir_dest *dest, SpvId result, nir_alu_type t
break;
case nir_type_uint:
+ case nir_type_uint8:
+ case nir_type_uint16:
+ case nir_type_uint64:
break; /* nothing to do! */
case nir_type_int:
+ case nir_type_int8:
+ case nir_type_int16:
+ case nir_type_int64:
case nir_type_float:
+ case nir_type_float16:
+ case nir_type_float64:
result = bitcast_to_uvec(ctx, result, bit_size, num_components);
break;
@@ -1533,12 +1541,20 @@ get_dest_type(struct ntv_context *ctx, nir_dest *dest, nir_alu_type type)
unreachable("bool should have bit-size 1");
case nir_type_int:
+ case nir_type_int8:
+ case nir_type_int16:
+ case nir_type_int64:
return get_ivec_type(ctx, bit_size, num_components);
case nir_type_uint:
+ case nir_type_uint8:
+ case nir_type_uint16:
+ case nir_type_uint64:
return get_uvec_type(ctx, bit_size, num_components);
case nir_type_float:
+ case nir_type_float16:
+ case nir_type_float64:
return get_fvec_type(ctx, bit_size, num_components);
default:
More information about the mesa-commit
mailing list