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 ccbf49efb27..6c0177dd7e1 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 @@ -710,6 +710,15 @@ emit_builtin_binop(struct ntv_context *ctx, enum GLSLstd450 op, SpvId type, op, args, ARRAY_SIZE(args)); } +static SpvId +emit_builtin_triop(struct ntv_context *ctx, enum GLSLstd450 op, SpvId type, + SpvId src0, SpvId src1, SpvId src2) +{ + SpvId args[] = { src0, src1, src2 }; + return spirv_builder_emit_ext_inst(&ctx->builder, type, ctx->GLSL_std_450, + op, args, ARRAY_SIZE(args)); +} + static SpvId get_fvec_constant(struct ntv_context *ctx, unsigned bit_size, unsigned num_components, float value) @@ -1013,6 +1022,12 @@ emit_alu(struct ntv_context *ctx, nir_alu_instr *alu) } break; + case nir_op_flrp: + assert(nir_op_infos[alu->op].num_inputs == 3); + result = emit_builtin_triop(ctx, GLSLstd450FMix, dest_type, + src[0], src[1], src[2]); + break; + case nir_op_fcsel: result = emit_binop(ctx, SpvOpFOrdGreaterThan, get_bvec_type(ctx, num_components),