summaryrefslogtreecommitdiff
path: root/src/shader_recompiler/backend/glsl/emit_glsl_warp.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/shader_recompiler/backend/glsl/emit_glsl_warp.cpp')
-rw-r--r--src/shader_recompiler/backend/glsl/emit_glsl_warp.cpp53
1 files changed, 53 insertions, 0 deletions
diff --git a/src/shader_recompiler/backend/glsl/emit_glsl_warp.cpp b/src/shader_recompiler/backend/glsl/emit_glsl_warp.cpp
index 1c212ec05..e462c977c 100644
--- a/src/shader_recompiler/backend/glsl/emit_glsl_warp.cpp
+++ b/src/shader_recompiler/backend/glsl/emit_glsl_warp.cpp
@@ -7,6 +7,7 @@
7#include "shader_recompiler/backend/glsl/emit_context.h" 7#include "shader_recompiler/backend/glsl/emit_context.h"
8#include "shader_recompiler/backend/glsl/emit_glsl_instructions.h" 8#include "shader_recompiler/backend/glsl/emit_glsl_instructions.h"
9#include "shader_recompiler/frontend/ir/value.h" 9#include "shader_recompiler/frontend/ir/value.h"
10#include "shader_recompiler/profile.h"
10 11
11namespace Shader::Backend::GLSL { 12namespace Shader::Backend::GLSL {
12namespace { 13namespace {
@@ -36,6 +37,58 @@ std::string GetMaxThreadId(std::string_view thread_id, std::string_view clamp,
36} 37}
37} // namespace 38} // namespace
38 39
40void EmitLaneId([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst) {
41 throw NotImplementedException("GLSL Instruction");
42}
43
44void EmitVoteAll(EmitContext& ctx, IR::Inst& inst, std::string_view pred) {
45 ctx.AddU1("{}=allInvocationsEqualARB({});", inst, pred);
46 // TODO:
47 // if (ctx.profile.warp_size_potentially_larger_than_guest) {
48 // }
49}
50
51void EmitVoteAny(EmitContext& ctx, IR::Inst& inst, std::string_view pred) {
52 ctx.AddU1("{}=anyInvocationARB({});", inst, pred);
53 // TODO:
54 // if (ctx.profile.warp_size_potentially_larger_than_guest) {
55 // }
56}
57
58void EmitVoteEqual(EmitContext& ctx, IR::Inst& inst, std::string_view pred) {
59 ctx.AddU1("{}=allInvocationsEqualARB({});", inst, pred);
60 // TODO:
61 // if (ctx.profile.warp_size_potentially_larger_than_guest) {
62 // }
63}
64
65void EmitSubgroupBallot(EmitContext& ctx, IR::Inst& inst, std::string_view pred) {
66 ctx.AddU32("{}=uvec2(ballotARB({})).x;", inst, pred);
67 // TODO:
68 // if (ctx.profile.warp_size_potentially_larger_than_guest) {
69 // }
70}
71
72void EmitSubgroupEqMask(EmitContext& ctx, IR::Inst& inst) {
73 ctx.AddU32("{}=uvec2(gl_SubGroupEqMaskARB).x;", inst);
74}
75
76void EmitSubgroupLtMask(EmitContext& ctx, IR::Inst& inst) {
77 ctx.AddU32("{}=uvec2(gl_SubGroupLtMaskARB).x;", inst);
78}
79
80void EmitSubgroupLeMask(EmitContext& ctx, IR::Inst& inst) {
81 ctx.AddU32("{}=uvec2(gl_SubGroupLeMaskARB).x;", inst);
82}
83
84void EmitSubgroupGtMask(EmitContext& ctx, IR::Inst& inst) {
85 ctx.AddU32("{}=uvec2(gl_SubGroupGtMaskARB).x;", inst);
86}
87
88void EmitSubgroupGeMask(EmitContext& ctx, IR::Inst& inst) {
89 ctx.AddU32("{}=uvec2(gl_SubGroupGeMaskARB).x;", inst);
90}
91
39void EmitShuffleIndex(EmitContext& ctx, IR::Inst& inst, std::string_view value, 92void EmitShuffleIndex(EmitContext& ctx, IR::Inst& inst, std::string_view value,
40 std::string_view index, std::string_view clamp, 93 std::string_view index, std::string_view clamp,
41 std::string_view segmentation_mask) { 94 std::string_view segmentation_mask) {