mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-24 19:40:10 +01:00
zink: handle vote intrinsics in ntv
these are super simple and straightforward Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8950>
This commit is contained in:
parent
e35612e45f
commit
bf5713d736
1 changed files with 30 additions and 0 deletions
|
|
@ -2462,6 +2462,29 @@ emit_image_intrinsic(struct ntv_context *ctx, nir_intrinsic_instr *intr)
|
|||
handle_atomic_op(ctx, intr, texel, param, param2);
|
||||
}
|
||||
|
||||
static void
|
||||
emit_vote(struct ntv_context *ctx, nir_intrinsic_instr *intr)
|
||||
{
|
||||
SpvOp op;
|
||||
|
||||
switch (intr->intrinsic) {
|
||||
case nir_intrinsic_vote_all:
|
||||
op = SpvOpGroupNonUniformAll;
|
||||
break;
|
||||
case nir_intrinsic_vote_any:
|
||||
op = SpvOpGroupNonUniformAny;
|
||||
break;
|
||||
case nir_intrinsic_vote_ieq:
|
||||
case nir_intrinsic_vote_feq:
|
||||
op = SpvOpGroupNonUniformAllEqual;
|
||||
break;
|
||||
default:
|
||||
unreachable("unknown vote intrinsic");
|
||||
}
|
||||
SpvId result = spirv_builder_emit_vote(&ctx->builder, op, get_src(ctx, &intr->src[0]));
|
||||
store_dest_raw(ctx, &intr->dest, result);
|
||||
}
|
||||
|
||||
static void
|
||||
emit_intrinsic(struct ntv_context *ctx, nir_intrinsic_instr *intr)
|
||||
{
|
||||
|
|
@ -2806,6 +2829,13 @@ emit_intrinsic(struct ntv_context *ctx, nir_intrinsic_instr *intr)
|
|||
emit_store_shared(ctx, intr);
|
||||
break;
|
||||
|
||||
case nir_intrinsic_vote_all:
|
||||
case nir_intrinsic_vote_any:
|
||||
case nir_intrinsic_vote_ieq:
|
||||
case nir_intrinsic_vote_feq:
|
||||
emit_vote(ctx, intr);
|
||||
break;
|
||||
|
||||
default:
|
||||
fprintf(stderr, "emit_intrinsic: not implemented (%s)\n",
|
||||
nir_intrinsic_infos[intr->intrinsic].name);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue