mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-23 08:20:25 +01:00
zink: handle f2f16_rtz
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19212>
This commit is contained in:
parent
813b76aeb6
commit
e2d67765fa
3 changed files with 18 additions and 0 deletions
|
|
@ -2057,6 +2057,12 @@ emit_alu(struct ntv_context *ctx, nir_alu_instr *alu)
|
|||
UNOP(nir_op_bit_count, SpvOpBitCount)
|
||||
#undef UNOP
|
||||
|
||||
case nir_op_f2f16_rtz:
|
||||
assert(nir_op_infos[alu->op].num_inputs == 1);
|
||||
result = emit_unop(ctx, SpvOpFConvert, dest_type, src[0]);
|
||||
spirv_builder_emit_rounding_mode(&ctx->builder, result, SpvFPRoundingModeRTZ);
|
||||
break;
|
||||
|
||||
case nir_op_inot:
|
||||
if (bit_size == 1)
|
||||
result = emit_unop(ctx, SpvOpLogicalNot, dest_type, src[0]);
|
||||
|
|
|
|||
|
|
@ -216,6 +216,14 @@ spirv_builder_emit_decoration(struct spirv_builder *b, SpvId target,
|
|||
emit_decoration(b, target, decoration, NULL, 0);
|
||||
}
|
||||
|
||||
void
|
||||
spirv_builder_emit_rounding_mode(struct spirv_builder *b, SpvId target,
|
||||
SpvFPRoundingMode rounding)
|
||||
{
|
||||
uint32_t args[] = { rounding };
|
||||
emit_decoration(b, target, SpvDecorationFPRoundingMode, args, ARRAY_SIZE(args));
|
||||
}
|
||||
|
||||
void
|
||||
spirv_builder_emit_input_attachment_index(struct spirv_builder *b, SpvId target, uint32_t id)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -89,6 +89,10 @@ void
|
|||
spirv_builder_emit_decoration(struct spirv_builder *b, SpvId target,
|
||||
SpvDecoration decoration);
|
||||
|
||||
void
|
||||
spirv_builder_emit_rounding_mode(struct spirv_builder *b, SpvId target,
|
||||
SpvFPRoundingMode rounding);
|
||||
|
||||
void
|
||||
spirv_builder_emit_input_attachment_index(struct spirv_builder *b, SpvId target, uint32_t id);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue