glasm: Implement shuffle and vote instructions on GLASM
This commit is contained in:
parent
decda4a2c7
commit
c4fd6b55bc
10 changed files with 166 additions and 100 deletions
|
@ -1168,7 +1168,7 @@ void EmitContext::DefineInputs(const Info& info) {
|
|||
subgroup_mask_gt = DefineInput(*this, U32[4], false, spv::BuiltIn::SubgroupGtMaskKHR);
|
||||
subgroup_mask_ge = DefineInput(*this, U32[4], false, spv::BuiltIn::SubgroupGeMaskKHR);
|
||||
}
|
||||
if (info.uses_subgroup_invocation_id ||
|
||||
if (info.uses_subgroup_invocation_id || info.uses_subgroup_shuffles ||
|
||||
(profile.warp_size_potentially_larger_than_guest &&
|
||||
(info.uses_subgroup_vote || info.uses_subgroup_mask))) {
|
||||
subgroup_local_invocation_id =
|
||||
|
|
|
@ -318,7 +318,9 @@ void SetupCapabilities(const Profile& profile, const Info& info, EmitContext& ct
|
|||
ctx.AddExtension("SPV_KHR_shader_draw_parameters");
|
||||
ctx.AddCapability(spv::Capability::DrawParameters);
|
||||
}
|
||||
if ((info.uses_subgroup_vote || info.uses_subgroup_invocation_id) && profile.support_vote) {
|
||||
if ((info.uses_subgroup_vote || info.uses_subgroup_invocation_id ||
|
||||
info.uses_subgroup_shuffles) &&
|
||||
profile.support_vote) {
|
||||
ctx.AddExtension("SPV_KHR_shader_ballot");
|
||||
ctx.AddCapability(spv::Capability::SubgroupBallotKHR);
|
||||
if (!profile.warp_size_potentially_larger_than_guest) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue