zink: always use 32bit sample ops

while some (tg4) sample ops can use different bit sizes in spirv, most
cannot, and all the shader variables are always emitted as 32bit, so
ensure the 32bit type is always what's being used for sampling

cc: mesa-stable

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17427>
This commit is contained in:
Mike Blumenkrantz 2022-07-05 13:07:01 -04:00 committed by Marge Bot
parent 35a4b8989f
commit 49d5fa12f2

View file

@ -3588,9 +3588,7 @@ emit_tex(struct ntv_context *ctx, nir_tex_instr *tex)
}
SpvId actual_dest_type;
if (dref && tex->op != nir_texop_tg4)
actual_dest_type =
spirv_builder_type_float(&ctx->builder,
nir_dest_bit_size(tex->dest));
actual_dest_type = spirv_builder_type_float(&ctx->builder, 32);
else {
unsigned num_components = nir_dest_num_components(tex->dest);
switch (nir_alu_type_get_base_type(tex->dest_type)) {
@ -3624,10 +3622,10 @@ emit_tex(struct ntv_context *ctx, nir_tex_instr *tex)
if (tex->op == nir_texop_tg4) {
if (const_offset)
spirv_builder_emit_cap(&ctx->builder, SpvCapabilityImageGatherExtended);
actual_dest_type = dest_type;
result = spirv_builder_emit_image_gather(&ctx->builder, dest_type,
result = spirv_builder_emit_image_gather(&ctx->builder, actual_dest_type,
load, coord, emit_uint_const(ctx, 32, tex->component),
lod, sample, const_offset, offset, dref, tex->is_sparse);
actual_dest_type = dest_type;
} else
result = spirv_builder_emit_image_fetch(&ctx->builder, actual_dest_type,
image, coord, lod, sample, const_offset, offset, tex->is_sparse);