diff options
| author | 2021-06-10 00:29:19 -0400 | |
|---|---|---|
| committer | 2021-07-22 21:51:37 -0400 | |
| commit | 85399e119d6d61375fd9304d69bdfb3a85522d2a (patch) | |
| tree | 6b89d199c729ace799392a97268e228d81d9422e /src/shader_recompiler/backend/glsl/emit_glsl_convert.cpp | |
| parent | glsl: Implement SampleId and SetSampleMask (diff) | |
| download | yuzu-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.cpp | 66 |
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 | ||
| 17 | void EmitConvertS16F32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst, | 17 | void 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 | ||
| 32 | void EmitConvertS32F32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst, | 31 | void 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 | ||
| 37 | void EmitConvertS32F64([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst, | 35 | void 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 | ||
| 47 | void EmitConvertS64F32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst, | 44 | void 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 | ||
| 52 | void EmitConvertS64F64([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst, | 48 | void 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 | ||
| 77 | void EmitConvertU32F32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst, | 72 | void 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 | ||
| 82 | void EmitConvertU32F64([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst, | 76 | void 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 | ||
| 92 | void EmitConvertU64F32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst, | 85 | void 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 | ||
| 97 | void EmitConvertU64F64([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst, | 89 | void 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 | ||
| 102 | void EmitConvertU64U32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst, | 93 | void 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 | ||
| 107 | void EmitConvertU32U64([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst, | 97 | void 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 | ||
| 122 | void EmitConvertF32F64([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst, | 111 | void 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 | ||
| 127 | void EmitConvertF64F32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst, | 115 | void 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 | ||
| 182 | void EmitConvertF32S32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst, | 169 | void 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 | ||
| 187 | void EmitConvertF32S64([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst, | 173 | void 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 | ||
| 197 | void EmitConvertF32U16([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst, | 182 | void 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 | ||
| 202 | void EmitConvertF32U32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst, | 186 | void 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 | ||
| 207 | void EmitConvertF32U64([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst, | 190 | void 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 | ||
| 222 | void EmitConvertF64S32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst, | 204 | void 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 | ||
| 227 | void EmitConvertF64S64([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst, | 208 | void 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 | ||
| 242 | void EmitConvertF64U32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst, | 222 | void 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 | ||
| 247 | void EmitConvertF64U64([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst, | 226 | void 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 | ||