mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-04 22:49:13 +02:00
zink: add spirv builder for unops with a const operand
Reviewed-by: Dave Airlie <airlied@redhat.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10510>
This commit is contained in:
parent
73210e3a99
commit
0fba3bc236
2 changed files with 16 additions and 0 deletions
|
|
@ -467,6 +467,19 @@ spirv_builder_emit_interlock(struct spirv_builder *b, bool end)
|
|||
spirv_buffer_emit_word(&b->instructions, (end ? SpvOpEndInvocationInterlockEXT : SpvOpBeginInvocationInterlockEXT) | (1 << 16));
|
||||
}
|
||||
|
||||
|
||||
SpvId
|
||||
spirv_builder_emit_unop_const(struct spirv_builder *b, SpvOp op, SpvId result_type, uint64_t operand)
|
||||
{
|
||||
SpvId result = spirv_builder_new_id(b);
|
||||
spirv_buffer_prepare(&b->instructions, b->mem_ctx, 4);
|
||||
spirv_buffer_emit_word(&b->instructions, op | (4 << 16));
|
||||
spirv_buffer_emit_word(&b->instructions, result_type);
|
||||
spirv_buffer_emit_word(&b->instructions, result);
|
||||
spirv_buffer_emit_word(&b->instructions, spirv_builder_const_uint(b, 32, operand));
|
||||
return result;
|
||||
}
|
||||
|
||||
SpvId
|
||||
spirv_builder_emit_unop(struct spirv_builder *b, SpvOp op, SpvId result_type,
|
||||
SpvId operand)
|
||||
|
|
|
|||
|
|
@ -190,6 +190,9 @@ spirv_builder_emit_access_chain(struct spirv_builder *b, SpvId result_type,
|
|||
void
|
||||
spirv_builder_emit_interlock(struct spirv_builder *b, bool end);
|
||||
|
||||
SpvId
|
||||
spirv_builder_emit_unop_const(struct spirv_builder *b, SpvOp op, SpvId result_type, uint64_t operand);
|
||||
|
||||
SpvId
|
||||
spirv_builder_emit_unop(struct spirv_builder *b, SpvOp op, SpvId result_type,
|
||||
SpvId operand);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue