mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-08 04:48:08 +02:00
zink: don't bitcast bool deref loads/stores
a bool can only be a bool, and OpBitCast requires the src type to be
different than the dst type, so this is illegal
cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22577>
(cherry picked from commit 9bf4db8ebb)
This commit is contained in:
parent
316c217cd9
commit
3697d19ecf
2 changed files with 5 additions and 2 deletions
|
|
@ -103,7 +103,7 @@
|
|||
"description": "zink: don't bitcast bool deref loads/stores",
|
||||
"nominated": true,
|
||||
"nomination_type": 0,
|
||||
"resolution": 0,
|
||||
"resolution": 1,
|
||||
"main_sha": null,
|
||||
"because_sha": null
|
||||
},
|
||||
|
|
|
|||
|
|
@ -2486,7 +2486,8 @@ emit_load_deref(struct ntv_context *ctx, nir_intrinsic_instr *intr)
|
|||
result = spirv_builder_emit_load(&ctx->builder, type, ptr);
|
||||
unsigned num_components = nir_dest_num_components(intr->dest);
|
||||
unsigned bit_size = nir_dest_bit_size(intr->dest);
|
||||
result = bitcast_to_uvec(ctx, result, bit_size, num_components);
|
||||
if (bit_size > 1)
|
||||
result = bitcast_to_uvec(ctx, result, bit_size, num_components);
|
||||
store_dest(ctx, &intr->dest, result, nir_type_uint);
|
||||
}
|
||||
|
||||
|
|
@ -2535,6 +2536,8 @@ emit_store_deref(struct ntv_context *ctx, nir_intrinsic_instr *intr)
|
|||
src = emit_bitcast(ctx, type, src);
|
||||
/* SampleMask is always an array in spirv, so we need to construct it into one */
|
||||
result = spirv_builder_emit_composite_construct(&ctx->builder, ctx->sample_mask_type, &src, 1);
|
||||
} else if (glsl_get_base_type(glsl_without_array(gtype)) == GLSL_TYPE_BOOL) {
|
||||
result = src;
|
||||
} else
|
||||
result = emit_bitcast(ctx, type, src);
|
||||
if (nir_intrinsic_access(intr) & ACCESS_COHERENT)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue