zink/nir-to-spirv: Make sure sampleid for InterpolateAtSample is int

This fixes the validation error

  VUID-VkShaderModuleCreateInfo-pCode-08737

triggered by piglit:
  spec@arb_gpu_shader5@execution@built-in-functions@fs-interpolateatsample-block-array:

  GLSL.std.450 InterpolateAtSample: expected Sample to be 32-bit integer
    %47 = OpExtInst %float %1 InterpolateAtSample %45 %float_0

Fixes: 9f6be8effb
   zink: store and use alu types for ntv defs

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28043>
This commit is contained in:
Gert Wollny 2024-03-07 14:11:34 +01:00 committed by Marge Bot
parent dea8b02b03
commit b7d6d90dab

View File

@ -2739,6 +2739,8 @@ emit_interpolate(struct ntv_context *ctx, nir_intrinsic_instr *intr)
case nir_intrinsic_interp_deref_at_sample:
op = GLSLstd450InterpolateAtSample;
src1 = get_src(ctx, &intr->src[1], &atype);
if (atype != nir_type_int)
src1 = emit_bitcast(ctx, get_ivec_type(ctx, 32, 1), src1);
break;
case nir_intrinsic_interp_deref_at_offset:
op = GLSLstd450InterpolateAtOffset;