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.cpp174
-rw-r--r--src/shader_recompiler/backend/glsl/emit_glsl_select.cpp13
3 files changed, 72 insertions, 119 deletions
diff --git a/src/shader_recompiler/backend/glsl/emit_glsl_instructions.h b/src/shader_recompiler/backend/glsl/emit_glsl_instructions.h
index 5370af0c5..39c0ba859 100644
--- a/src/shader_recompiler/backend/glsl/emit_glsl_instructions.h
+++ b/src/shader_recompiler/backend/glsl/emit_glsl_instructions.h
@@ -210,8 +210,8 @@ void EmitSelectU64(EmitContext& ctx, std::string_view cond, std::string_view tru
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,
212 std::string_view false_value); 212 std::string_view false_value);
213void EmitSelectF32(EmitContext& ctx, std::string_view cond, std::string_view true_value, 213void EmitSelectF32(EmitContext& ctx, IR::Inst& inst, std::string_view cond,
214 std::string_view false_value); 214 std::string_view true_value, std::string_view false_value);
215void EmitSelectF64(EmitContext& ctx, std::string_view cond, std::string_view true_value, 215void EmitSelectF64(EmitContext& ctx, std::string_view cond, std::string_view true_value,
216 std::string_view false_value); 216 std::string_view false_value);
217void EmitBitCastU16F16(EmitContext& ctx); 217void EmitBitCastU16F16(EmitContext& ctx);
diff --git a/src/shader_recompiler/backend/glsl/emit_glsl_integer.cpp b/src/shader_recompiler/backend/glsl/emit_glsl_integer.cpp
index 3f1b56a05..083d81ccb 100644
--- a/src/shader_recompiler/backend/glsl/emit_glsl_integer.cpp
+++ b/src/shader_recompiler/backend/glsl/emit_glsl_integer.cpp
@@ -10,136 +10,108 @@
10#include "shader_recompiler/profile.h" 10#include "shader_recompiler/profile.h"
11 11
12namespace Shader::Backend::GLSL { 12namespace Shader::Backend::GLSL {
13void EmitIAdd32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst, 13void EmitIAdd32(EmitContext& ctx, IR::Inst& inst, std::string_view a, std::string_view b) {
14 [[maybe_unused]] std::string_view a, [[maybe_unused]] std::string_view b) {
15 ctx.AddU32("{}={}+{};", inst, a, b); 14 ctx.AddU32("{}={}+{};", inst, a, b);
16} 15}
17 16
18void EmitIAdd64([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst, 17void EmitIAdd64(EmitContext& ctx, IR::Inst& inst, std::string_view a, std::string_view b) {
19 [[maybe_unused]] std::string_view a, [[maybe_unused]] std::string_view b) { 18 ctx.AddU64("{}={}+{};", inst, a, b);
20 throw NotImplementedException("GLSL Instruction");
21} 19}
22 20
23void EmitISub32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst, 21void EmitISub32(EmitContext& ctx, IR::Inst& inst, std::string_view a, std::string_view b) {
24 [[maybe_unused]] std::string_view a, [[maybe_unused]] std::string_view b) {
25 ctx.AddU32("{}={}-{};", inst, a, b); 22 ctx.AddU32("{}={}-{};", inst, a, b);
26} 23}
27 24
28void EmitISub64([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst, 25void EmitISub64(EmitContext& ctx, IR::Inst& inst, std::string_view a, std::string_view b) {
29 [[maybe_unused]] std::string_view a, [[maybe_unused]] std::string_view b) { 26 ctx.AddU64("{}={}-{};", inst, a, b);
30 throw NotImplementedException("GLSL Instruction");
31} 27}
32 28
33void EmitIMul32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst, 29void EmitIMul32(EmitContext& ctx, IR::Inst& inst, std::string_view a, std::string_view b) {
34 [[maybe_unused]] std::string_view a, [[maybe_unused]] std::string_view b) { 30 ctx.AddU32("{}={}*{};", inst, a, b);
35 throw NotImplementedException("GLSL Instruction");
36} 31}
37 32
38void EmitINeg32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst, 33void EmitINeg32(EmitContext& ctx, IR::Inst& inst, std::string_view value) {
39 [[maybe_unused]] std::string_view value) {
40 ctx.AddU32("{}=-{};", inst, value); 34 ctx.AddU32("{}=-{};", inst, value);
41} 35}
42 36
43void EmitINeg64([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst, 37void EmitINeg64(EmitContext& ctx, IR::Inst& inst, std::string_view value) {
44 [[maybe_unused]] std::string_view value) { 38 ctx.AddU64("{}=-{};", inst, value);
45 throw NotImplementedException("GLSL Instruction");
46} 39}
47 40
48void EmitIAbs32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst, 41void EmitIAbs32(EmitContext& ctx, IR::Inst& inst, std::string_view value) {
49 [[maybe_unused]] std::string_view value) {
50 ctx.AddU32("{}=abs({});", inst, value); 42 ctx.AddU32("{}=abs({});", inst, value);
51} 43}
52 44
53void EmitIAbs64([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst, 45void EmitIAbs64(EmitContext& ctx, IR::Inst& inst, std::string_view value) {
54 [[maybe_unused]] std::string_view value) { 46 ctx.AddU64("{}=abs({});", inst, value);
55 throw NotImplementedException("GLSL Instruction");
56} 47}
57 48
58void EmitShiftLeftLogical32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst, 49void EmitShiftLeftLogical32(EmitContext& ctx, IR::Inst& inst, std::string_view base,
59 [[maybe_unused]] std::string_view base, 50 std::string_view shift) {
60 [[maybe_unused]] std::string_view shift) {
61 ctx.AddU32("{}={}<<{};", inst, base, shift); 51 ctx.AddU32("{}={}<<{};", inst, base, shift);
62} 52}
63 53
64void EmitShiftLeftLogical64([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst, 54void EmitShiftLeftLogical64(EmitContext& ctx, IR::Inst& inst, std::string_view base,
65 [[maybe_unused]] std::string_view base, 55 std::string_view shift) {
66 [[maybe_unused]] std::string_view shift) {
67 ctx.AddU64("{}={}<<{};", inst, base, shift); 56 ctx.AddU64("{}={}<<{};", inst, base, shift);
68} 57}
69 58
70void EmitShiftRightLogical32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst, 59void EmitShiftRightLogical32(EmitContext& ctx, IR::Inst& inst, std::string_view base,
71 [[maybe_unused]] std::string_view base, 60 std::string_view shift) {
72 [[maybe_unused]] std::string_view shift) {
73 ctx.AddU32("{}={}>>{};", inst, base, shift); 61 ctx.AddU32("{}={}>>{};", inst, base, shift);
74} 62}
75 63
76void EmitShiftRightLogical64([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst, 64void EmitShiftRightLogical64(EmitContext& ctx, IR::Inst& inst, std::string_view base,
77 [[maybe_unused]] std::string_view base, 65 std::string_view shift) {
78 [[maybe_unused]] std::string_view shift) {
79 ctx.AddU64("{}={}>>{};", inst, base, shift); 66 ctx.AddU64("{}={}>>{};", inst, base, shift);
80} 67}
81 68
82void EmitShiftRightArithmetic32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst, 69void EmitShiftRightArithmetic32(EmitContext& ctx, IR::Inst& inst, std::string_view base,
83 [[maybe_unused]] std::string_view base, 70 std::string_view shift) {
84 [[maybe_unused]] std::string_view shift) {
85 ctx.AddS32("{}=int({})>>{};", inst, base, shift); 71 ctx.AddS32("{}=int({})>>{};", inst, base, shift);
86} 72}
87 73
88void EmitShiftRightArithmetic64([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst, 74void EmitShiftRightArithmetic64(EmitContext& ctx, IR::Inst& inst, std::string_view base,
89 [[maybe_unused]] std::string_view base, 75 std::string_view shift) {
90 [[maybe_unused]] std::string_view shift) {
91 ctx.AddU64("{}=int64_t({})>>{};", inst, base, shift); 76 ctx.AddU64("{}=int64_t({})>>{};", inst, base, shift);
92} 77}
93 78
94void EmitBitwiseAnd32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst, 79void EmitBitwiseAnd32(EmitContext& ctx, IR::Inst& inst, std::string_view a, std::string_view b) {
95 [[maybe_unused]] std::string_view a, [[maybe_unused]] std::string_view b) {
96 ctx.AddU32("{}={}&{};", inst, a, b); 80 ctx.AddU32("{}={}&{};", inst, a, b);
97} 81}
98 82
99void EmitBitwiseOr32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst, 83void EmitBitwiseOr32(EmitContext& ctx, IR::Inst& inst, std::string_view a, std::string_view b) {
100 [[maybe_unused]] std::string_view a, [[maybe_unused]] std::string_view b) {
101 ctx.AddU32("{}={}|{};", inst, a, b); 84 ctx.AddU32("{}={}|{};", inst, a, b);
102} 85}
103 86
104void EmitBitwiseXor32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst, 87void EmitBitwiseXor32(EmitContext& ctx, IR::Inst& inst, std::string_view a, std::string_view b) {
105 [[maybe_unused]] std::string_view a, [[maybe_unused]] std::string_view b) {
106 ctx.AddU32("{}={}^{};", inst, a, b); 88 ctx.AddU32("{}={}^{};", inst, a, b);
107} 89}
108 90
109void EmitBitFieldInsert([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst, 91void EmitBitFieldInsert(EmitContext& ctx, IR::Inst& inst, std::string_view base,
110 [[maybe_unused]] std::string_view base, 92 std::string_view insert, std::string_view offset, std::string_view count) {
111 [[maybe_unused]] std::string_view insert,
112 [[maybe_unused]] std::string_view offset,
113 [[maybe_unused]] std::string_view count) {
114 ctx.AddU32("{}=bitfieldInsert({}, {}, int({}), int({}));", inst, base, insert, offset, count); 93 ctx.AddU32("{}=bitfieldInsert({}, {}, int({}), int({}));", inst, base, insert, offset, count);
115} 94}
116 95
117void EmitBitFieldSExtract([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst, 96void EmitBitFieldSExtract(EmitContext& ctx, IR::Inst& inst, std::string_view base,
118 [[maybe_unused]] std::string_view base, 97 std::string_view offset, std::string_view count) {
119 [[maybe_unused]] std::string_view offset,
120 [[maybe_unused]] std::string_view count) {
121 ctx.AddU32("{}=bitfieldExtract(int({}), int({}), int({}));", inst, base, offset, count); 98 ctx.AddU32("{}=bitfieldExtract(int({}), int({}), int({}));", inst, base, offset, count);
122} 99}
123 100
124void EmitBitFieldUExtract([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst, 101void EmitBitFieldUExtract(EmitContext& ctx, IR::Inst& inst, std::string_view base,
125 [[maybe_unused]] std::string_view base, 102 std::string_view offset, std::string_view count) {
126 [[maybe_unused]] std::string_view offset,
127 [[maybe_unused]] std::string_view count) {
128 ctx.AddU32("{}=bitfieldExtract({}, int({}), int({}));", inst, base, offset, count); 103 ctx.AddU32("{}=bitfieldExtract({}, int({}), int({}));", inst, base, offset, count);
129} 104}
130 105
131void EmitBitReverse32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst, 106void EmitBitReverse32(EmitContext& ctx, IR::Inst& inst, std::string_view value) {
132 [[maybe_unused]] std::string_view value) {
133 ctx.AddU32("{}=bitfieldReverse({});", inst, value); 107 ctx.AddU32("{}=bitfieldReverse({});", inst, value);
134} 108}
135 109
136void EmitBitCount32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst, 110void EmitBitCount32(EmitContext& ctx, IR::Inst& inst, std::string_view value) {
137 [[maybe_unused]] std::string_view value) { 111 ctx.AddU32("{}=bitCount({});", inst, value);
138 throw NotImplementedException("GLSL Instruction");
139} 112}
140 113
141void EmitBitwiseNot32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst, 114void EmitBitwiseNot32(EmitContext& ctx, IR::Inst& inst, std::string_view value) {
142 [[maybe_unused]] std::string_view value) {
143 ctx.AddU32("{}=~{};", inst, value); 115 ctx.AddU32("{}=~{};", inst, value);
144} 116}
145 117
@@ -153,91 +125,75 @@ void EmitFindUMsb32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst
153 throw NotImplementedException("GLSL Instruction"); 125 throw NotImplementedException("GLSL Instruction");
154} 126}
155 127
156void EmitSMin32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst, 128void EmitSMin32(EmitContext& ctx, IR::Inst& inst, std::string_view a, std::string_view b) {
157 [[maybe_unused]] std::string_view a, [[maybe_unused]] std::string_view b) {
158 ctx.AddU32("{}=min(int({}), int({}));", inst, a, b); 129 ctx.AddU32("{}=min(int({}), int({}));", inst, a, b);
159} 130}
160 131
161void EmitUMin32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst, 132void EmitUMin32(EmitContext& ctx, IR::Inst& inst, std::string_view a, std::string_view b) {
162 [[maybe_unused]] std::string_view a, [[maybe_unused]] std::string_view b) {
163 ctx.AddU32("{}=min(uint({}), uint({}));", inst, a, b); 133 ctx.AddU32("{}=min(uint({}), uint({}));", inst, a, b);
164} 134}
165 135
166void EmitSMax32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst, 136void EmitSMax32(EmitContext& ctx, IR::Inst& inst, std::string_view a, std::string_view b) {
167 [[maybe_unused]] std::string_view a, [[maybe_unused]] std::string_view b) {
168 ctx.AddU32("{}=max(int({}), int({}));", inst, a, b); 137 ctx.AddU32("{}=max(int({}), int({}));", inst, a, b);
169} 138}
170 139
171void EmitUMax32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst, 140void EmitUMax32(EmitContext& ctx, IR::Inst& inst, std::string_view a, std::string_view b) {
172 [[maybe_unused]] std::string_view a, [[maybe_unused]] std::string_view b) {
173 ctx.AddU32("{}=max(uint({}), uint({}));", inst, a, b); 141 ctx.AddU32("{}=max(uint({}), uint({}));", inst, a, b);
174} 142}
175 143
176void EmitSClamp32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst, 144void EmitSClamp32(EmitContext& ctx, IR::Inst& inst, std::string_view value, std::string_view min,
177 [[maybe_unused]] std::string_view value, [[maybe_unused]] std::string_view min, 145 std::string_view max) {
178 [[maybe_unused]] std::string_view max) { 146 ctx.AddU32("{}=clamp(int({}), int({}), int({}));", inst, value, min, max);
179 throw NotImplementedException("GLSL Instruction");
180} 147}
181 148
182void EmitUClamp32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst, 149void EmitUClamp32(EmitContext& ctx, IR::Inst& inst, std::string_view value, std::string_view min,
183 [[maybe_unused]] std::string_view value, [[maybe_unused]] std::string_view min, 150 std::string_view max) {
184 [[maybe_unused]] std::string_view max) { 151 ctx.AddU32("{}=clamp(uint({}), uint({}), uint({}));", inst, value, min, max);
185 throw NotImplementedException("GLSL Instruction");
186} 152}
187 153
188void EmitSLessThan([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst, 154void EmitSLessThan(EmitContext& ctx, IR::Inst& inst, std::string_view lhs, std::string_view rhs) {
189 [[maybe_unused]] std::string_view lhs, [[maybe_unused]] std::string_view rhs) {
190 ctx.AddU1("{}=int({})<int({});", inst, lhs, rhs); 155 ctx.AddU1("{}=int({})<int({});", inst, lhs, rhs);
191} 156}
192 157
193void EmitULessThan([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst, 158void EmitULessThan(EmitContext& ctx, IR::Inst& inst, std::string_view lhs, std::string_view rhs) {
194 [[maybe_unused]] std::string_view lhs, [[maybe_unused]] std::string_view rhs) {
195 ctx.AddU1("{}=uint({})<uint({)};", inst, lhs, rhs); 159 ctx.AddU1("{}=uint({})<uint({)};", inst, lhs, rhs);
196} 160}
197 161
198void EmitIEqual([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst, 162void EmitIEqual(EmitContext& ctx, IR::Inst& inst, std::string_view lhs, std::string_view rhs) {
199 [[maybe_unused]] std::string_view lhs, [[maybe_unused]] std::string_view rhs) {
200 ctx.AddU1("{}={}=={};", inst, lhs, rhs); 163 ctx.AddU1("{}={}=={};", inst, lhs, rhs);
201} 164}
202 165
203void EmitSLessThanEqual([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst, 166void EmitSLessThanEqual(EmitContext& ctx, IR::Inst& inst, std::string_view lhs,
204 [[maybe_unused]] std::string_view lhs, 167 std::string_view rhs) {
205 [[maybe_unused]] std::string_view rhs) {
206 ctx.AddU1("{}=int({})<=int({});", inst, lhs, rhs); 168 ctx.AddU1("{}=int({})<=int({});", inst, lhs, rhs);
207} 169}
208 170
209void EmitULessThanEqual([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst, 171void EmitULessThanEqual(EmitContext& ctx, IR::Inst& inst, std::string_view lhs,
210 [[maybe_unused]] std::string_view lhs, 172 std::string_view rhs) {
211 [[maybe_unused]] std::string_view rhs) {
212 ctx.AddU1("{}=uint({})<=uint({});", inst, lhs, rhs); 173 ctx.AddU1("{}=uint({})<=uint({});", inst, lhs, rhs);
213} 174}
214 175
215void EmitSGreaterThan([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst, 176void EmitSGreaterThan(EmitContext& ctx, IR::Inst& inst, std::string_view lhs,
216 [[maybe_unused]] std::string_view lhs, 177 std::string_view rhs) {
217 [[maybe_unused]] std::string_view rhs) {
218 ctx.AddU1("{}=int({})>int({});", inst, lhs, rhs); 178 ctx.AddU1("{}=int({})>int({});", inst, lhs, rhs);
219} 179}
220 180
221void EmitUGreaterThan([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst, 181void EmitUGreaterThan(EmitContext& ctx, IR::Inst& inst, std::string_view lhs,
222 [[maybe_unused]] std::string_view lhs, 182 std::string_view rhs) {
223 [[maybe_unused]] std::string_view rhs) {
224 ctx.AddU1("{}=uint({})>uint({});", inst, lhs, rhs); 183 ctx.AddU1("{}=uint({})>uint({});", inst, lhs, rhs);
225} 184}
226 185
227void EmitINotEqual([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst, 186void EmitINotEqual(EmitContext& ctx, IR::Inst& inst, std::string_view lhs, std::string_view rhs) {
228 [[maybe_unused]] std::string_view lhs, [[maybe_unused]] std::string_view rhs) {
229 ctx.AddU1("{}={}!={};", inst, lhs, rhs); 187 ctx.AddU1("{}={}!={};", inst, lhs, rhs);
230} 188}
231 189
232void EmitSGreaterThanEqual([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst, 190void EmitSGreaterThanEqual(EmitContext& ctx, IR::Inst& inst, std::string_view lhs,
233 [[maybe_unused]] std::string_view lhs, 191 std::string_view rhs) {
234 [[maybe_unused]] std::string_view rhs) {
235 ctx.AddU1("{}=int({})>=int({});", inst, lhs, rhs); 192 ctx.AddU1("{}=int({})>=int({});", inst, lhs, rhs);
236} 193}
237 194
238void EmitUGreaterThanEqual([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst, 195void EmitUGreaterThanEqual(EmitContext& ctx, IR::Inst& inst, std::string_view lhs,
239 [[maybe_unused]] std::string_view lhs, 196 std::string_view rhs) {
240 [[maybe_unused]] std::string_view rhs) {
241 ctx.AddU1("{}=uint({})>=uint({});", inst, lhs, rhs); 197 ctx.AddU1("{}=uint({})>=uint({});", inst, lhs, rhs);
242} 198}
243} // namespace Shader::Backend::GLSL 199} // namespace Shader::Backend::GLSL
diff --git a/src/shader_recompiler/backend/glsl/emit_glsl_select.cpp b/src/shader_recompiler/backend/glsl/emit_glsl_select.cpp
index 4455b0f9f..a6bf18fb1 100644
--- a/src/shader_recompiler/backend/glsl/emit_glsl_select.cpp
+++ b/src/shader_recompiler/backend/glsl/emit_glsl_select.cpp
@@ -28,10 +28,8 @@ 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, IR::Inst& inst, 31void EmitSelectU32(EmitContext& ctx, IR::Inst& inst, std::string_view cond,
32 [[maybe_unused]] std::string_view cond, 32 std::string_view true_value, std::string_view false_value) {
33 [[maybe_unused]] std::string_view true_value,
34 [[maybe_unused]] std::string_view false_value) {
35 ctx.AddU32("{}={}?{}:{};", inst, cond, true_value, false_value); 33 ctx.AddU32("{}={}?{}:{};", inst, cond, true_value, false_value);
36} 34}
37 35
@@ -47,10 +45,9 @@ void EmitSelectF16([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::stri
47 throw NotImplementedException("GLSL Instruction"); 45 throw NotImplementedException("GLSL Instruction");
48} 46}
49 47
50void EmitSelectF32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string_view cond, 48void EmitSelectF32(EmitContext& ctx, IR::Inst& inst, std::string_view cond,
51 [[maybe_unused]] std::string_view true_value, 49 std::string_view true_value, std::string_view false_value) {
52 [[maybe_unused]] std::string_view false_value) { 50 ctx.AddF32("{}={}?{}:{};", inst, cond, true_value, false_value);
53 throw NotImplementedException("GLSL Instruction");
54} 51}
55 52
56void EmitSelectF64([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string_view cond, 53void EmitSelectF64([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string_view cond,