summaryrefslogtreecommitdiff
path: root/src/shader_recompiler/backend/glsl/emit_glsl_convert.cpp
diff options
context:
space:
mode:
authorGravatar ameerj2021-06-10 00:29:19 -0400
committerGravatar ameerj2021-07-22 21:51:37 -0400
commit85399e119d6d61375fd9304d69bdfb3a85522d2a (patch)
tree6b89d199c729ace799392a97268e228d81d9422e /src/shader_recompiler/backend/glsl/emit_glsl_convert.cpp
parentglsl: Implement SampleId and SetSampleMask (diff)
downloadyuzu-85399e119d6d61375fd9304d69bdfb3a85522d2a.tar.gz
yuzu-85399e119d6d61375fd9304d69bdfb3a85522d2a.tar.xz
yuzu-85399e119d6d61375fd9304d69bdfb3a85522d2a.zip
glsl: Reorganize backend code, remove unneeded [[maybe_unused]]
Diffstat (limited to 'src/shader_recompiler/backend/glsl/emit_glsl_convert.cpp')
-rw-r--r--src/shader_recompiler/backend/glsl/emit_glsl_convert.cpp66
1 files changed, 22 insertions, 44 deletions
diff --git a/src/shader_recompiler/backend/glsl/emit_glsl_convert.cpp b/src/shader_recompiler/backend/glsl/emit_glsl_convert.cpp
index 9ed5bb319..8d823e466 100644
--- a/src/shader_recompiler/backend/glsl/emit_glsl_convert.cpp
+++ b/src/shader_recompiler/backend/glsl/emit_glsl_convert.cpp
@@ -14,8 +14,7 @@ void EmitConvertS16F16([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::I
14 NotImplemented(); 14 NotImplemented();
15} 15}
16 16
17void EmitConvertS16F32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst, 17void EmitConvertS16F32(EmitContext& ctx, IR::Inst& inst, std::string_view value) {
18 [[maybe_unused]] std::string_view value) {
19 ctx.AddS32("{}=int(float({}))&0xffff;", inst, value); 18 ctx.AddS32("{}=int(float({}))&0xffff;", inst, value);
20} 19}
21 20
@@ -29,13 +28,11 @@ void EmitConvertS32F16([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::I
29 NotImplemented(); 28 NotImplemented();
30} 29}
31 30
32void EmitConvertS32F32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst, 31void EmitConvertS32F32(EmitContext& ctx, IR::Inst& inst, std::string_view value) {
33 [[maybe_unused]] std::string_view value) {
34 ctx.AddS32("{}=int(float({}));", inst, value); 32 ctx.AddS32("{}=int(float({}));", inst, value);
35} 33}
36 34
37void EmitConvertS32F64([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst, 35void EmitConvertS32F64(EmitContext& ctx, IR::Inst& inst, std::string_view value) {
38 [[maybe_unused]] std::string_view value) {
39 ctx.AddS32("{}=int(double({}));", inst, value); 36 ctx.AddS32("{}=int(double({}));", inst, value);
40} 37}
41 38
@@ -44,13 +41,11 @@ void EmitConvertS64F16([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::I
44 NotImplemented(); 41 NotImplemented();
45} 42}
46 43
47void EmitConvertS64F32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst, 44void EmitConvertS64F32(EmitContext& ctx, IR::Inst& inst, std::string_view value) {
48 [[maybe_unused]] std::string_view value) {
49 ctx.AddS64("{}=int64_t(double(float({})));", inst, value); 45 ctx.AddS64("{}=int64_t(double(float({})));", inst, value);
50} 46}
51 47
52void EmitConvertS64F64([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst, 48void EmitConvertS64F64(EmitContext& ctx, IR::Inst& inst, std::string_view value) {
53 [[maybe_unused]] std::string_view value) {
54 ctx.AddS64("{}=int64_t(double({}));", inst, value); 49 ctx.AddS64("{}=int64_t(double({}));", inst, value);
55} 50}
56 51
@@ -74,13 +69,11 @@ void EmitConvertU32F16([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::I
74 NotImplemented(); 69 NotImplemented();
75} 70}
76 71
77void EmitConvertU32F32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst, 72void EmitConvertU32F32(EmitContext& ctx, IR::Inst& inst, std::string_view value) {
78 [[maybe_unused]] std::string_view value) {
79 ctx.AddU32("{}=uint(float({}));", inst, value); 73 ctx.AddU32("{}=uint(float({}));", inst, value);
80} 74}
81 75
82void EmitConvertU32F64([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst, 76void EmitConvertU32F64(EmitContext& ctx, IR::Inst& inst, std::string_view value) {
83 [[maybe_unused]] std::string_view value) {
84 ctx.AddU32("{}=uint(double({}));", inst, value); 77 ctx.AddU32("{}=uint(double({}));", inst, value);
85} 78}
86 79
@@ -89,23 +82,19 @@ void EmitConvertU64F16([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::I
89 NotImplemented(); 82 NotImplemented();
90} 83}
91 84
92void EmitConvertU64F32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst, 85void EmitConvertU64F32(EmitContext& ctx, IR::Inst& inst, std::string_view value) {
93 [[maybe_unused]] std::string_view value) {
94 ctx.AddU64("{}=uint64_t(float({}));", inst, value); 86 ctx.AddU64("{}=uint64_t(float({}));", inst, value);
95} 87}
96 88
97void EmitConvertU64F64([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst, 89void EmitConvertU64F64(EmitContext& ctx, IR::Inst& inst, std::string_view value) {
98 [[maybe_unused]] std::string_view value) {
99 ctx.AddU64("{}=uint64_t(double({}));", inst, value); 90 ctx.AddU64("{}=uint64_t(double({}));", inst, value);
100} 91}
101 92
102void EmitConvertU64U32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst, 93void EmitConvertU64U32(EmitContext& ctx, IR::Inst& inst, std::string_view value) {
103 [[maybe_unused]] std::string_view value) {
104 ctx.AddU64("{}=uint64_t(uint({}));", inst, value); 94 ctx.AddU64("{}=uint64_t(uint({}));", inst, value);
105} 95}
106 96
107void EmitConvertU32U64([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst, 97void EmitConvertU32U64(EmitContext& ctx, IR::Inst& inst, std::string_view value) {
108 [[maybe_unused]] std::string_view value) {
109 ctx.AddU32("{}=uint(uint64_t({}));", inst, value); 98 ctx.AddU32("{}=uint(uint64_t({}));", inst, value);
110} 99}
111 100
@@ -119,13 +108,11 @@ void EmitConvertF32F16([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::I
119 NotImplemented(); 108 NotImplemented();
120} 109}
121 110
122void EmitConvertF32F64([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst, 111void EmitConvertF32F64(EmitContext& ctx, IR::Inst& inst, std::string_view value) {
123 [[maybe_unused]] std::string_view value) {
124 ctx.AddF32("{}=float(double({}));", inst, value); 112 ctx.AddF32("{}=float(double({}));", inst, value);
125} 113}
126 114
127void EmitConvertF64F32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst, 115void EmitConvertF64F32(EmitContext& ctx, IR::Inst& inst, std::string_view value) {
128 [[maybe_unused]] std::string_view value) {
129 ctx.AddF64("{}=double(float({}));", inst, value); 116 ctx.AddF64("{}=double(float({}));", inst, value);
130} 117}
131 118
@@ -179,13 +166,11 @@ void EmitConvertF32S16([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::I
179 NotImplemented(); 166 NotImplemented();
180} 167}
181 168
182void EmitConvertF32S32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst, 169void EmitConvertF32S32(EmitContext& ctx, IR::Inst& inst, std::string_view value) {
183 [[maybe_unused]] std::string_view value) {
184 ctx.AddF32("{}=float(int({}));", inst, value); 170 ctx.AddF32("{}=float(int({}));", inst, value);
185} 171}
186 172
187void EmitConvertF32S64([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst, 173void EmitConvertF32S64(EmitContext& ctx, IR::Inst& inst, std::string_view value) {
188 [[maybe_unused]] std::string_view value) {
189 ctx.AddF32("{}=float(double(int64_t({})));", inst, value); 174 ctx.AddF32("{}=float(double(int64_t({})));", inst, value);
190} 175}
191 176
@@ -194,18 +179,15 @@ void EmitConvertF32U8([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::In
194 NotImplemented(); 179 NotImplemented();
195} 180}
196 181
197void EmitConvertF32U16([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst, 182void EmitConvertF32U16(EmitContext& ctx, IR::Inst& inst, std::string_view value) {
198 [[maybe_unused]] std::string_view value) {
199 ctx.AddF32("{}=float(uint({}&0xffff));", inst, value); 183 ctx.AddF32("{}=float(uint({}&0xffff));", inst, value);
200} 184}
201 185
202void EmitConvertF32U32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst, 186void EmitConvertF32U32(EmitContext& ctx, IR::Inst& inst, std::string_view value) {
203 [[maybe_unused]] std::string_view value) {
204 ctx.AddF32("{}=float(uint({}));", inst, value); 187 ctx.AddF32("{}=float(uint({}));", inst, value);
205} 188}
206 189
207void EmitConvertF32U64([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst, 190void EmitConvertF32U64(EmitContext& ctx, IR::Inst& inst, std::string_view value) {
208 [[maybe_unused]] std::string_view value) {
209 ctx.AddF32("{}=float(double(uint64_t({})));", inst, value); 191 ctx.AddF32("{}=float(double(uint64_t({})));", inst, value);
210} 192}
211 193
@@ -219,13 +201,11 @@ void EmitConvertF64S16([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::I
219 NotImplemented(); 201 NotImplemented();
220} 202}
221 203
222void EmitConvertF64S32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst, 204void EmitConvertF64S32(EmitContext& ctx, IR::Inst& inst, std::string_view value) {
223 [[maybe_unused]] std::string_view value) {
224 ctx.AddF64("{}=double(int({}));", inst, value); 205 ctx.AddF64("{}=double(int({}));", inst, value);
225} 206}
226 207
227void EmitConvertF64S64([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst, 208void EmitConvertF64S64(EmitContext& ctx, IR::Inst& inst, std::string_view value) {
228 [[maybe_unused]] std::string_view value) {
229 ctx.AddF64("{}=double(int64_t({}));", inst, value); 209 ctx.AddF64("{}=double(int64_t({}));", inst, value);
230} 210}
231 211
@@ -239,13 +219,11 @@ void EmitConvertF64U16([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::I
239 NotImplemented(); 219 NotImplemented();
240} 220}
241 221
242void EmitConvertF64U32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst, 222void EmitConvertF64U32(EmitContext& ctx, IR::Inst& inst, std::string_view value) {
243 [[maybe_unused]] std::string_view value) {
244 ctx.AddF64("{}=double(uint({}));", inst, value); 223 ctx.AddF64("{}=double(uint({}));", inst, value);
245} 224}
246 225
247void EmitConvertF64U64([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst, 226void EmitConvertF64U64(EmitContext& ctx, IR::Inst& inst, std::string_view value) {
248 [[maybe_unused]] std::string_view value) {
249 ctx.AddF64("{}=double(uint64_t({}));", inst, value); 227 ctx.AddF64("{}=double(uint64_t({}));", inst, value);
250} 228}
251 229