diff options
Diffstat (limited to 'src/shader_recompiler/backend/spirv/emit_spirv_warp.cpp')
| -rw-r--r-- | src/shader_recompiler/backend/spirv/emit_spirv_warp.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/shader_recompiler/backend/spirv/emit_spirv_warp.cpp b/src/shader_recompiler/backend/spirv/emit_spirv_warp.cpp index f6196653a..1c23ccc08 100644 --- a/src/shader_recompiler/backend/spirv/emit_spirv_warp.cpp +++ b/src/shader_recompiler/backend/spirv/emit_spirv_warp.cpp | |||
| @@ -49,6 +49,14 @@ Id SelectValue(EmitContext& ctx, Id in_range, Id value, Id src_thread_id) { | |||
| 49 | } | 49 | } |
| 50 | } // Anonymous namespace | 50 | } // Anonymous namespace |
| 51 | 51 | ||
| 52 | Id EmitLaneId(EmitContext& ctx) { | ||
| 53 | const Id id{ctx.OpLoad(ctx.U32[1], ctx.subgroup_local_invocation_id)}; | ||
| 54 | if (!ctx.profile.warp_size_potentially_larger_than_guest) { | ||
| 55 | return id; | ||
| 56 | } | ||
| 57 | return ctx.OpBitwiseAnd(ctx.U32[1], id, ctx.Constant(ctx.U32[1], 31U)); | ||
| 58 | } | ||
| 59 | |||
| 52 | Id EmitVoteAll(EmitContext& ctx, Id pred) { | 60 | Id EmitVoteAll(EmitContext& ctx, Id pred) { |
| 53 | if (!ctx.profile.warp_size_potentially_larger_than_guest) { | 61 | if (!ctx.profile.warp_size_potentially_larger_than_guest) { |
| 54 | return ctx.OpSubgroupAllKHR(ctx.U1, pred); | 62 | return ctx.OpSubgroupAllKHR(ctx.U1, pred); |