zink: add spirv_builder wrapper for vote intrinsics

these are all going to use the same mechanics, so we can simplify a bit

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:
Mike Blumenkrantz 2020-08-19 14:19:11 -04:00 committed by Marge Bot
parent cf6901809e
commit e35612e45f
2 changed files with 9 additions and 0 deletions

View File

@ -701,6 +701,13 @@ spirv_builder_emit_kill(struct spirv_builder *b)
spirv_buffer_emit_word(&b->instructions, SpvOpKill | (1 << 16));
}
SpvId
spirv_builder_emit_vote(struct spirv_builder *b, SpvOp op, SpvId src)
{
return spirv_builder_emit_binop(b, op, spirv_builder_type_bool(b),
spirv_builder_const_uint(b, 32, SpvScopeWorkgroup), src);
}
SpvId
spirv_builder_emit_image_sample(struct spirv_builder *b,
SpvId result_type,

View File

@ -256,6 +256,8 @@ spirv_builder_set_phi_operand(struct spirv_builder *b, size_t position,
void
spirv_builder_emit_kill(struct spirv_builder *b);
SpvId
spirv_builder_emit_vote(struct spirv_builder *b, SpvOp op, SpvId src);
SpvId
spirv_builder_emit_image_sample(struct spirv_builder *b,