aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/zink/nir_to_spirv
diff options
context:
space:
mode:
authorErik Faye-Lund <[email protected]>2019-07-19 17:04:50 +0200
committerErik Faye-Lund <[email protected]>2019-10-28 08:51:47 +0000
commit3ed41e3bb64ef9ab0260092d3e2d1f42aef69a4e (patch)
tree974ffdb25e7b0b62a99f341c579f2bddf849ad3d /src/gallium/drivers/zink/nir_to_spirv
parentc24c3da00a73216b7002a6b877a852c2266e48f5 (diff)
zink/spirv: prepare for 1-bit booleans
Acked-by: Jordan Justen <[email protected]>
Diffstat (limited to 'src/gallium/drivers/zink/nir_to_spirv')
-rw-r--r--src/gallium/drivers/zink/nir_to_spirv/nir_to_spirv.c12
1 files changed, 6 insertions, 6 deletions
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 5fd403dd28c..74eda10f93f 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
@@ -127,9 +127,9 @@ get_fvec_type(struct ntv_context *ctx, unsigned bit_size, unsigned num_component
static SpvId
get_ivec_type(struct ntv_context *ctx, unsigned bit_size, unsigned num_components)
{
- assert(bit_size == 32); // only 32-bit ints supported so far
+ assert(bit_size == 1 || bit_size == 32); // only 32-bit ints supported so far
- SpvId int_type = spirv_builder_type_int(&ctx->builder, bit_size);
+ SpvId int_type = spirv_builder_type_int(&ctx->builder, MAX2(bit_size, 32));
if (num_components > 1)
return spirv_builder_type_vector(&ctx->builder, int_type,
num_components);
@@ -141,9 +141,9 @@ get_ivec_type(struct ntv_context *ctx, unsigned bit_size, unsigned num_component
static SpvId
get_uvec_type(struct ntv_context *ctx, unsigned bit_size, unsigned num_components)
{
- assert(bit_size == 32); // only 32-bit uints supported so far
+ assert(bit_size == 1 || bit_size == 32); // only 32-bit uints supported so far
- SpvId uint_type = spirv_builder_type_uint(&ctx->builder, bit_size);
+ SpvId uint_type = spirv_builder_type_uint(&ctx->builder, MAX2(bit_size, 32));
if (num_components > 1)
return spirv_builder_type_vector(&ctx->builder, uint_type,
num_components);
@@ -498,9 +498,9 @@ get_alu_src_uint(struct ntv_context *ctx, nir_alu_instr *alu, unsigned src)
return def;
int bit_size = nir_src_bit_size(alu->src[src].src);
- assert(bit_size == 32);
+ assert(bit_size == 1 || bit_size == 32);
- SpvId uint_type = spirv_builder_type_uint(&ctx->builder, bit_size);
+ SpvId uint_type = spirv_builder_type_uint(&ctx->builder, MAX2(bit_size, 32));
if (used_channels == 1) {
uint32_t indices[] = { alu->src[src].swizzle[0] };
return spirv_builder_emit_composite_extract(&ctx->builder, uint_type,