summaryrefslogtreecommitdiff
path: root/src/shader_recompiler
diff options
context:
space:
mode:
Diffstat (limited to 'src/shader_recompiler')
-rw-r--r--src/shader_recompiler/backend/glsl/emit_glsl_instructions.h4
-rw-r--r--src/shader_recompiler/backend/glsl/emit_glsl_integer.cpp10
-rw-r--r--src/shader_recompiler/backend/glsl/emit_glsl_select.cpp5
3 files changed, 10 insertions, 9 deletions
diff --git a/src/shader_recompiler/backend/glsl/emit_glsl_instructions.h b/src/shader_recompiler/backend/glsl/emit_glsl_instructions.h
index 51dbeb2c1..5370af0c5 100644
--- a/src/shader_recompiler/backend/glsl/emit_glsl_instructions.h
+++ b/src/shader_recompiler/backend/glsl/emit_glsl_instructions.h
@@ -204,8 +204,8 @@ void EmitSelectU8(EmitContext& ctx, std::string_view cond, std::string_view true
204 std::string_view false_value); 204 std::string_view false_value);
205void EmitSelectU16(EmitContext& ctx, std::string_view cond, std::string_view true_value, 205void EmitSelectU16(EmitContext& ctx, std::string_view cond, std::string_view true_value,
206 std::string_view false_value); 206 std::string_view false_value);
207void EmitSelectU32(EmitContext& ctx, std::string_view cond, std::string_view true_value, 207void EmitSelectU32(EmitContext& ctx, IR::Inst& inst, std::string_view cond,
208 std::string_view false_value); 208 std::string_view true_value, std::string_view false_value);
209void EmitSelectU64(EmitContext& ctx, std::string_view cond, std::string_view true_value, 209void EmitSelectU64(EmitContext& ctx, std::string_view cond, std::string_view true_value,
210 std::string_view false_value); 210 std::string_view false_value);
211void EmitSelectF16(EmitContext& ctx, std::string_view cond, std::string_view true_value, 211void EmitSelectF16(EmitContext& ctx, std::string_view cond, std::string_view true_value,
diff --git a/src/shader_recompiler/backend/glsl/emit_glsl_integer.cpp b/src/shader_recompiler/backend/glsl/emit_glsl_integer.cpp
index 016bccd39..3f1b56a05 100644
--- a/src/shader_recompiler/backend/glsl/emit_glsl_integer.cpp
+++ b/src/shader_recompiler/backend/glsl/emit_glsl_integer.cpp
@@ -22,7 +22,7 @@ void EmitIAdd64([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& in
22 22
23void EmitISub32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst, 23void EmitISub32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst,
24 [[maybe_unused]] std::string_view a, [[maybe_unused]] std::string_view b) { 24 [[maybe_unused]] std::string_view a, [[maybe_unused]] std::string_view b) {
25 throw NotImplementedException("GLSL Instruction"); 25 ctx.AddU32("{}={}-{};", inst, a, b);
26} 26}
27 27
28void EmitISub64([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst, 28void EmitISub64([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst,
@@ -111,26 +111,26 @@ void EmitBitFieldInsert([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::
111 [[maybe_unused]] std::string_view insert, 111 [[maybe_unused]] std::string_view insert,
112 [[maybe_unused]] std::string_view offset, 112 [[maybe_unused]] std::string_view offset,
113 [[maybe_unused]] std::string_view count) { 113 [[maybe_unused]] std::string_view count) {
114 throw NotImplementedException("GLSL Instruction"); 114 ctx.AddU32("{}=bitfieldInsert({}, {}, int({}), int({}));", inst, base, insert, offset, count);
115} 115}
116 116
117void EmitBitFieldSExtract([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst, 117void EmitBitFieldSExtract([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst,
118 [[maybe_unused]] std::string_view base, 118 [[maybe_unused]] std::string_view base,
119 [[maybe_unused]] std::string_view offset, 119 [[maybe_unused]] std::string_view offset,
120 [[maybe_unused]] std::string_view count) { 120 [[maybe_unused]] std::string_view count) {
121 throw NotImplementedException("GLSL Instruction"); 121 ctx.AddU32("{}=bitfieldExtract(int({}), int({}), int({}));", inst, base, offset, count);
122} 122}
123 123
124void EmitBitFieldUExtract([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst, 124void EmitBitFieldUExtract([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst,
125 [[maybe_unused]] std::string_view base, 125 [[maybe_unused]] std::string_view base,
126 [[maybe_unused]] std::string_view offset, 126 [[maybe_unused]] std::string_view offset,
127 [[maybe_unused]] std::string_view count) { 127 [[maybe_unused]] std::string_view count) {
128 throw NotImplementedException("GLSL Instruction"); 128 ctx.AddU32("{}=bitfieldExtract({}, int({}), int({}));", inst, base, offset, count);
129} 129}
130 130
131void EmitBitReverse32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst, 131void EmitBitReverse32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst,
132 [[maybe_unused]] std::string_view value) { 132 [[maybe_unused]] std::string_view value) {
133 throw NotImplementedException("GLSL Instruction"); 133 ctx.AddU32("{}=bitfieldReverse({});", inst, value);
134} 134}
135 135
136void EmitBitCount32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst, 136void EmitBitCount32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst,
diff --git a/src/shader_recompiler/backend/glsl/emit_glsl_select.cpp b/src/shader_recompiler/backend/glsl/emit_glsl_select.cpp
index 86d38da98..4455b0f9f 100644
--- a/src/shader_recompiler/backend/glsl/emit_glsl_select.cpp
+++ b/src/shader_recompiler/backend/glsl/emit_glsl_select.cpp
@@ -28,10 +28,11 @@ void EmitSelectU16([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::stri
28 throw NotImplementedException("GLSL Instruction"); 28 throw NotImplementedException("GLSL Instruction");
29} 29}
30 30
31void EmitSelectU32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string_view cond, 31void EmitSelectU32([[maybe_unused]] EmitContext& ctx, IR::Inst& inst,
32 [[maybe_unused]] std::string_view cond,
32 [[maybe_unused]] std::string_view true_value, 33 [[maybe_unused]] std::string_view true_value,
33 [[maybe_unused]] std::string_view false_value) { 34 [[maybe_unused]] std::string_view false_value) {
34 throw NotImplementedException("GLSL Instruction"); 35 ctx.AddU32("{}={}?{}:{};", inst, cond, true_value, false_value);
35} 36}
36 37
37void EmitSelectU64([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string_view cond, 38void EmitSelectU64([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string_view cond,