zink: add spirv_builder support for is_helper_invocation

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18272>
This commit is contained in:
Erik Faye-Lund 2022-08-30 13:52:05 +02:00 committed by Marge Bot
parent 332ff54425
commit 7a48657a06
2 changed files with 17 additions and 0 deletions

View file

@ -765,6 +765,20 @@ spirv_builder_emit_demote(struct spirv_builder *b)
spirv_buffer_emit_word(&b->instructions, SpvOpDemoteToHelperInvocation | (1 << 16));
}
SpvId
spirv_is_helper_invocation(struct spirv_builder *b)
{
SpvId result = spirv_builder_new_id(b);
SpvId result_type = spirv_builder_type_bool(b);
int words = 3;
spirv_buffer_prepare(&b->instructions, b->mem_ctx, words);
spirv_buffer_emit_word(&b->instructions, SpvOpIsHelperInvocationEXT | (words << 16));
spirv_buffer_emit_word(&b->instructions, result_type);
spirv_buffer_emit_word(&b->instructions, result);
return result;
}
SpvId
spirv_builder_emit_vote(struct spirv_builder *b, SpvOp op, SpvId src)
{

View file

@ -271,6 +271,9 @@ spirv_builder_emit_kill(struct spirv_builder *b);
void
spirv_builder_emit_demote(struct spirv_builder *b);
SpvId
spirv_is_helper_invocation(struct spirv_builder *b);
SpvId
spirv_builder_emit_vote(struct spirv_builder *b, SpvOp op, SpvId src);