diff options
Diffstat (limited to 'src/shader_recompiler/backend/glsl/emit_glsl_integer.cpp')
| -rw-r--r-- | src/shader_recompiler/backend/glsl/emit_glsl_integer.cpp | 221 |
1 files changed, 221 insertions, 0 deletions
diff --git a/src/shader_recompiler/backend/glsl/emit_glsl_integer.cpp b/src/shader_recompiler/backend/glsl/emit_glsl_integer.cpp index e69de29bb..6977f74f9 100644 --- a/src/shader_recompiler/backend/glsl/emit_glsl_integer.cpp +++ b/src/shader_recompiler/backend/glsl/emit_glsl_integer.cpp | |||
| @@ -0,0 +1,221 @@ | |||
| 1 | |||
| 2 | // Copyright 2021 yuzu Emulator Project | ||
| 3 | // Licensed under GPLv2 or any later version | ||
| 4 | // Refer to the license.txt file included. | ||
| 5 | |||
| 6 | #include <string_view> | ||
| 7 | |||
| 8 | #include "shader_recompiler/backend/glsl/emit_context.h" | ||
| 9 | #include "shader_recompiler/backend/glsl/emit_glsl_instructions.h" | ||
| 10 | #include "shader_recompiler/frontend/ir/value.h" | ||
| 11 | #include "shader_recompiler/profile.h" | ||
| 12 | |||
| 13 | namespace Shader::Backend::GLSL { | ||
| 14 | void EmitIAdd32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst* inst, | ||
| 15 | [[maybe_unused]] std::string a, [[maybe_unused]] std::string b) { | ||
| 16 | ctx.AddU32("{}={}+{};", *inst, a, b); | ||
| 17 | } | ||
| 18 | |||
| 19 | void EmitIAdd64([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string a, | ||
| 20 | [[maybe_unused]] std::string b) { | ||
| 21 | throw NotImplementedException("GLSL Instruction"); | ||
| 22 | } | ||
| 23 | |||
| 24 | void EmitISub32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string a, | ||
| 25 | [[maybe_unused]] std::string b) { | ||
| 26 | throw NotImplementedException("GLSL Instruction"); | ||
| 27 | } | ||
| 28 | |||
| 29 | void EmitISub64([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string a, | ||
| 30 | [[maybe_unused]] std::string b) { | ||
| 31 | throw NotImplementedException("GLSL Instruction"); | ||
| 32 | } | ||
| 33 | |||
| 34 | void EmitIMul32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string a, | ||
| 35 | [[maybe_unused]] std::string b) { | ||
| 36 | throw NotImplementedException("GLSL Instruction"); | ||
| 37 | } | ||
| 38 | |||
| 39 | void EmitINeg32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string value) { | ||
| 40 | throw NotImplementedException("GLSL Instruction"); | ||
| 41 | } | ||
| 42 | |||
| 43 | void EmitINeg64([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string value) { | ||
| 44 | throw NotImplementedException("GLSL Instruction"); | ||
| 45 | } | ||
| 46 | |||
| 47 | void EmitIAbs32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string value) { | ||
| 48 | throw NotImplementedException("GLSL Instruction"); | ||
| 49 | } | ||
| 50 | |||
| 51 | void EmitIAbs64([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string value) { | ||
| 52 | throw NotImplementedException("GLSL Instruction"); | ||
| 53 | } | ||
| 54 | |||
| 55 | void EmitShiftLeftLogical32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string base, | ||
| 56 | [[maybe_unused]] std::string shift) { | ||
| 57 | throw NotImplementedException("GLSL Instruction"); | ||
| 58 | } | ||
| 59 | |||
| 60 | void EmitShiftLeftLogical64([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string base, | ||
| 61 | [[maybe_unused]] std::string shift) { | ||
| 62 | throw NotImplementedException("GLSL Instruction"); | ||
| 63 | } | ||
| 64 | |||
| 65 | void EmitShiftRightLogical32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string base, | ||
| 66 | [[maybe_unused]] std::string shift) { | ||
| 67 | throw NotImplementedException("GLSL Instruction"); | ||
| 68 | } | ||
| 69 | |||
| 70 | void EmitShiftRightLogical64([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string base, | ||
| 71 | [[maybe_unused]] std::string shift) { | ||
| 72 | throw NotImplementedException("GLSL Instruction"); | ||
| 73 | } | ||
| 74 | |||
| 75 | void EmitShiftRightArithmetic32([[maybe_unused]] EmitContext& ctx, | ||
| 76 | [[maybe_unused]] std::string base, | ||
| 77 | [[maybe_unused]] std::string shift) { | ||
| 78 | throw NotImplementedException("GLSL Instruction"); | ||
| 79 | } | ||
| 80 | |||
| 81 | void EmitShiftRightArithmetic64([[maybe_unused]] EmitContext& ctx, | ||
| 82 | [[maybe_unused]] std::string base, | ||
| 83 | [[maybe_unused]] std::string shift) { | ||
| 84 | throw NotImplementedException("GLSL Instruction"); | ||
| 85 | } | ||
| 86 | |||
| 87 | void EmitBitwiseAnd32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst* inst, | ||
| 88 | [[maybe_unused]] std::string a, [[maybe_unused]] std::string b) { | ||
| 89 | throw NotImplementedException("GLSL Instruction"); | ||
| 90 | } | ||
| 91 | |||
| 92 | void EmitBitwiseOr32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst* inst, | ||
| 93 | [[maybe_unused]] std::string a, [[maybe_unused]] std::string b) { | ||
| 94 | throw NotImplementedException("GLSL Instruction"); | ||
| 95 | } | ||
| 96 | |||
| 97 | void EmitBitwiseXor32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst* inst, | ||
| 98 | [[maybe_unused]] std::string a, [[maybe_unused]] std::string b) { | ||
| 99 | throw NotImplementedException("GLSL Instruction"); | ||
| 100 | } | ||
| 101 | |||
| 102 | void EmitBitFieldInsert([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string base, | ||
| 103 | [[maybe_unused]] std::string insert, [[maybe_unused]] std::string offset, | ||
| 104 | std::string count) { | ||
| 105 | throw NotImplementedException("GLSL Instruction"); | ||
| 106 | } | ||
| 107 | |||
| 108 | void EmitBitFieldSExtract([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst* inst, | ||
| 109 | [[maybe_unused]] std::string base, [[maybe_unused]] std::string offset, | ||
| 110 | std::string count) { | ||
| 111 | throw NotImplementedException("GLSL Instruction"); | ||
| 112 | } | ||
| 113 | |||
| 114 | void EmitBitFieldUExtract([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst* inst, | ||
| 115 | [[maybe_unused]] std::string base, [[maybe_unused]] std::string offset, | ||
| 116 | std::string count) { | ||
| 117 | throw NotImplementedException("GLSL Instruction"); | ||
| 118 | } | ||
| 119 | |||
| 120 | void EmitBitReverse32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string value) { | ||
| 121 | throw NotImplementedException("GLSL Instruction"); | ||
| 122 | } | ||
| 123 | |||
| 124 | void EmitBitCount32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string value) { | ||
| 125 | throw NotImplementedException("GLSL Instruction"); | ||
| 126 | } | ||
| 127 | |||
| 128 | void EmitBitwiseNot32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string value) { | ||
| 129 | throw NotImplementedException("GLSL Instruction"); | ||
| 130 | } | ||
| 131 | |||
| 132 | void EmitFindSMsb32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string value) { | ||
| 133 | throw NotImplementedException("GLSL Instruction"); | ||
| 134 | } | ||
| 135 | |||
| 136 | void EmitFindUMsb32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string value) { | ||
| 137 | throw NotImplementedException("GLSL Instruction"); | ||
| 138 | } | ||
| 139 | |||
| 140 | void EmitSMin32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string a, | ||
| 141 | [[maybe_unused]] std::string b) { | ||
| 142 | throw NotImplementedException("GLSL Instruction"); | ||
| 143 | } | ||
| 144 | |||
| 145 | void EmitUMin32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string a, | ||
| 146 | [[maybe_unused]] std::string b) { | ||
| 147 | throw NotImplementedException("GLSL Instruction"); | ||
| 148 | } | ||
| 149 | |||
| 150 | void EmitSMax32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string a, | ||
| 151 | [[maybe_unused]] std::string b) { | ||
| 152 | throw NotImplementedException("GLSL Instruction"); | ||
| 153 | } | ||
| 154 | |||
| 155 | void EmitUMax32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string a, | ||
| 156 | [[maybe_unused]] std::string b) { | ||
| 157 | throw NotImplementedException("GLSL Instruction"); | ||
| 158 | } | ||
| 159 | |||
| 160 | void EmitSClamp32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst* inst, | ||
| 161 | [[maybe_unused]] std::string value, [[maybe_unused]] std::string min, | ||
| 162 | std::string max) { | ||
| 163 | throw NotImplementedException("GLSL Instruction"); | ||
| 164 | } | ||
| 165 | |||
| 166 | void EmitUClamp32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst* inst, | ||
| 167 | [[maybe_unused]] std::string value, [[maybe_unused]] std::string min, | ||
| 168 | std::string max) { | ||
| 169 | throw NotImplementedException("GLSL Instruction"); | ||
| 170 | } | ||
| 171 | |||
| 172 | void EmitSLessThan([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string lhs, | ||
| 173 | [[maybe_unused]] std::string rhs) { | ||
| 174 | throw NotImplementedException("GLSL Instruction"); | ||
| 175 | } | ||
| 176 | |||
| 177 | void EmitULessThan([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string lhs, | ||
| 178 | [[maybe_unused]] std::string rhs) { | ||
| 179 | throw NotImplementedException("GLSL Instruction"); | ||
| 180 | } | ||
| 181 | |||
| 182 | void EmitIEqual([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string lhs, | ||
| 183 | [[maybe_unused]] std::string rhs) { | ||
| 184 | throw NotImplementedException("GLSL Instruction"); | ||
| 185 | } | ||
| 186 | |||
| 187 | void EmitSLessThanEqual([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string lhs, | ||
| 188 | [[maybe_unused]] std::string rhs) { | ||
| 189 | throw NotImplementedException("GLSL Instruction"); | ||
| 190 | } | ||
| 191 | |||
| 192 | void EmitULessThanEqual([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string lhs, | ||
| 193 | [[maybe_unused]] std::string rhs) { | ||
| 194 | throw NotImplementedException("GLSL Instruction"); | ||
| 195 | } | ||
| 196 | |||
| 197 | void EmitSGreaterThan([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string lhs, | ||
| 198 | [[maybe_unused]] std::string rhs) { | ||
| 199 | throw NotImplementedException("GLSL Instruction"); | ||
| 200 | } | ||
| 201 | |||
| 202 | void EmitUGreaterThan([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string lhs, | ||
| 203 | [[maybe_unused]] std::string rhs) { | ||
| 204 | throw NotImplementedException("GLSL Instruction"); | ||
| 205 | } | ||
| 206 | |||
| 207 | void EmitINotEqual([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string lhs, | ||
| 208 | [[maybe_unused]] std::string rhs) { | ||
| 209 | throw NotImplementedException("GLSL Instruction"); | ||
| 210 | } | ||
| 211 | |||
| 212 | void EmitSGreaterThanEqual([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string lhs, | ||
| 213 | [[maybe_unused]] std::string rhs) { | ||
| 214 | throw NotImplementedException("GLSL Instruction"); | ||
| 215 | } | ||
| 216 | |||
| 217 | void EmitUGreaterThanEqual([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string lhs, | ||
| 218 | [[maybe_unused]] std::string rhs) { | ||
| 219 | throw NotImplementedException("GLSL Instruction"); | ||
| 220 | } | ||
| 221 | } // namespace Shader::Backend::GLSL | ||