mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-24 13:10:10 +01:00
zink: add util function for emitting ntv atomic ops
these all need specific memory params, but otherwise they're the same as normal ops, so we can just make a helper function here to add in the memory params Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8330>
This commit is contained in:
parent
621fb6a72a
commit
2fa1cf99b9
1 changed files with 19 additions and 0 deletions
|
|
@ -1054,6 +1054,25 @@ emit_so_outputs(struct ntv_context *ctx,
|
|||
}
|
||||
}
|
||||
|
||||
static SpvId
|
||||
emit_atomic(struct ntv_context *ctx, SpvId op, SpvId type, SpvId src0, SpvId src1)
|
||||
{
|
||||
if (!type) //AtomicStore
|
||||
return spirv_builder_emit_triop(&ctx->builder, op, src0,
|
||||
emit_uint_const(ctx, 32, SpvScopeWorkgroup),
|
||||
emit_uint_const(ctx, 32, SpvMemorySemanticsUniformMemoryMask | SpvMemorySemanticsReleaseMask),
|
||||
src1);
|
||||
if (src1)
|
||||
return spirv_builder_emit_quadop(&ctx->builder, op, type, src0,
|
||||
emit_uint_const(ctx, 32, SpvScopeWorkgroup),
|
||||
emit_uint_const(ctx, 32, SpvMemorySemanticsUniformMemoryMask | SpvMemorySemanticsReleaseMask),
|
||||
src1);
|
||||
//AtomicLoad
|
||||
return spirv_builder_emit_triop(&ctx->builder, op, type, src0,
|
||||
emit_uint_const(ctx, 32, SpvScopeWorkgroup),
|
||||
emit_uint_const(ctx, 32, SpvMemorySemanticsUniformMemoryMask | SpvMemorySemanticsAcquireMask));
|
||||
}
|
||||
|
||||
static SpvId
|
||||
emit_binop(struct ntv_context *ctx, SpvOp op, SpvId type,
|
||||
SpvId src0, SpvId src1)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue