diff options
| author | 2021-04-04 05:17:17 -0300 | |
|---|---|---|
| committer | 2021-07-22 21:51:26 -0400 | |
| commit | da6cf2632cd4dc0d2b0278353fcaee0789b418c0 (patch) | |
| tree | 90c2d6f6fa724365a4a23c888389e525e316a4fd /src/shader_recompiler/backend/spirv/emit_context.cpp | |
| parent | shader: Implement BAR and fix memory barriers (diff) | |
| download | yuzu-da6cf2632cd4dc0d2b0278353fcaee0789b418c0.tar.gz yuzu-da6cf2632cd4dc0d2b0278353fcaee0789b418c0.tar.xz yuzu-da6cf2632cd4dc0d2b0278353fcaee0789b418c0.zip | |
shader: Add subgroup masks
Diffstat (limited to 'src/shader_recompiler/backend/spirv/emit_context.cpp')
| -rw-r--r-- | src/shader_recompiler/backend/spirv/emit_context.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/shader_recompiler/backend/spirv/emit_context.cpp b/src/shader_recompiler/backend/spirv/emit_context.cpp index e70b78a28..5ef637fe7 100644 --- a/src/shader_recompiler/backend/spirv/emit_context.cpp +++ b/src/shader_recompiler/backend/spirv/emit_context.cpp | |||
| @@ -390,8 +390,16 @@ void EmitContext::DefineInputs(const Info& info) { | |||
| 390 | if (info.uses_local_invocation_id) { | 390 | if (info.uses_local_invocation_id) { |
| 391 | local_invocation_id = DefineInput(*this, U32[3], spv::BuiltIn::LocalInvocationId); | 391 | local_invocation_id = DefineInput(*this, U32[3], spv::BuiltIn::LocalInvocationId); |
| 392 | } | 392 | } |
| 393 | if (info.uses_subgroup_mask) { | ||
| 394 | subgroup_mask_eq = DefineInput(*this, U32[4], spv::BuiltIn::SubgroupEqMaskKHR); | ||
| 395 | subgroup_mask_lt = DefineInput(*this, U32[4], spv::BuiltIn::SubgroupLtMaskKHR); | ||
| 396 | subgroup_mask_le = DefineInput(*this, U32[4], spv::BuiltIn::SubgroupLeMaskKHR); | ||
| 397 | subgroup_mask_gt = DefineInput(*this, U32[4], spv::BuiltIn::SubgroupGtMaskKHR); | ||
| 398 | subgroup_mask_ge = DefineInput(*this, U32[4], spv::BuiltIn::SubgroupGeMaskKHR); | ||
| 399 | } | ||
| 393 | if (info.uses_subgroup_invocation_id || | 400 | if (info.uses_subgroup_invocation_id || |
| 394 | (profile.warp_size_potentially_larger_than_guest && info.uses_subgroup_vote)) { | 401 | (profile.warp_size_potentially_larger_than_guest && |
| 402 | (info.uses_subgroup_vote || info.uses_subgroup_mask))) { | ||
| 395 | subgroup_local_invocation_id = | 403 | subgroup_local_invocation_id = |
| 396 | DefineInput(*this, U32[1], spv::BuiltIn::SubgroupLocalInvocationId); | 404 | DefineInput(*this, U32[1], spv::BuiltIn::SubgroupLocalInvocationId); |
| 397 | } | 405 | } |