diff options
Diffstat (limited to 'src/shader_recompiler')
3 files changed, 106 insertions, 94 deletions
diff --git a/src/shader_recompiler/backend/glsl/emit_glsl_instructions.h b/src/shader_recompiler/backend/glsl/emit_glsl_instructions.h index 16e01c81c..550193dc3 100644 --- a/src/shader_recompiler/backend/glsl/emit_glsl_instructions.h +++ b/src/shader_recompiler/backend/glsl/emit_glsl_instructions.h | |||
| @@ -317,52 +317,54 @@ void EmitFPIsNan16(EmitContext& ctx, std::string value); | |||
| 317 | void EmitFPIsNan32(EmitContext& ctx, std::string value); | 317 | void EmitFPIsNan32(EmitContext& ctx, std::string value); |
| 318 | void EmitFPIsNan64(EmitContext& ctx, std::string value); | 318 | void EmitFPIsNan64(EmitContext& ctx, std::string value); |
| 319 | void EmitIAdd32(EmitContext& ctx, IR::Inst* inst, std::string a, std::string b); | 319 | void EmitIAdd32(EmitContext& ctx, IR::Inst* inst, std::string a, std::string b); |
| 320 | void EmitIAdd64(EmitContext& ctx, std::string a, std::string b); | 320 | void EmitIAdd64(EmitContext& ctx, IR::Inst* inst, std::string a, std::string b); |
| 321 | void EmitISub32(EmitContext& ctx, std::string a, std::string b); | 321 | void EmitISub32(EmitContext& ctx, IR::Inst* inst, std::string a, std::string b); |
| 322 | void EmitISub64(EmitContext& ctx, std::string a, std::string b); | 322 | void EmitISub64(EmitContext& ctx, IR::Inst* inst, std::string a, std::string b); |
| 323 | void EmitIMul32(EmitContext& ctx, std::string a, std::string b); | 323 | void EmitIMul32(EmitContext& ctx, IR::Inst* inst, std::string a, std::string b); |
| 324 | void EmitINeg32(EmitContext& ctx, std::string value); | 324 | void EmitINeg32(EmitContext& ctx, IR::Inst* inst, std::string value); |
| 325 | void EmitINeg64(EmitContext& ctx, std::string value); | 325 | void EmitINeg64(EmitContext& ctx, IR::Inst* inst, std::string value); |
| 326 | void EmitIAbs32(EmitContext& ctx, std::string value); | 326 | void EmitIAbs32(EmitContext& ctx, IR::Inst* inst, std::string value); |
| 327 | void EmitIAbs64(EmitContext& ctx, std::string value); | 327 | void EmitIAbs64(EmitContext& ctx, IR::Inst* inst, std::string value); |
| 328 | void EmitShiftLeftLogical32(EmitContext& ctx, std::string base, std::string shift); | 328 | void EmitShiftLeftLogical32(EmitContext& ctx, IR::Inst* inst, std::string base, std::string shift); |
| 329 | void EmitShiftLeftLogical64(EmitContext& ctx, std::string base, std::string shift); | 329 | void EmitShiftLeftLogical64(EmitContext& ctx, IR::Inst* inst, std::string base, std::string shift); |
| 330 | void EmitShiftRightLogical32(EmitContext& ctx, std::string base, std::string shift); | 330 | void EmitShiftRightLogical32(EmitContext& ctx, IR::Inst* inst, std::string base, std::string shift); |
| 331 | void EmitShiftRightLogical64(EmitContext& ctx, std::string base, std::string shift); | 331 | void EmitShiftRightLogical64(EmitContext& ctx, IR::Inst* inst, std::string base, std::string shift); |
| 332 | void EmitShiftRightArithmetic32(EmitContext& ctx, std::string base, std::string shift); | 332 | void EmitShiftRightArithmetic32(EmitContext& ctx, IR::Inst* inst, std::string base, |
| 333 | void EmitShiftRightArithmetic64(EmitContext& ctx, std::string base, std::string shift); | 333 | std::string shift); |
| 334 | void EmitShiftRightArithmetic64(EmitContext& ctx, IR::Inst* inst, std::string base, | ||
| 335 | std::string shift); | ||
| 334 | void EmitBitwiseAnd32(EmitContext& ctx, IR::Inst* inst, std::string a, std::string b); | 336 | void EmitBitwiseAnd32(EmitContext& ctx, IR::Inst* inst, std::string a, std::string b); |
| 335 | void EmitBitwiseOr32(EmitContext& ctx, IR::Inst* inst, std::string a, std::string b); | 337 | void EmitBitwiseOr32(EmitContext& ctx, IR::Inst* inst, std::string a, std::string b); |
| 336 | void EmitBitwiseXor32(EmitContext& ctx, IR::Inst* inst, std::string a, std::string b); | 338 | void EmitBitwiseXor32(EmitContext& ctx, IR::Inst* inst, std::string a, std::string b); |
| 337 | void EmitBitFieldInsert(EmitContext& ctx, std::string base, std::string insert, std::string offset, | 339 | void EmitBitFieldInsert(EmitContext& ctx, IR::Inst* inst, std::string base, std::string insert, |
| 338 | std::string count); | 340 | std::string offset, std::string count); |
| 339 | void EmitBitFieldSExtract(EmitContext& ctx, IR::Inst* inst, std::string base, std::string offset, | 341 | void EmitBitFieldSExtract(EmitContext& ctx, IR::Inst* inst, std::string base, std::string offset, |
| 340 | std::string count); | 342 | std::string count); |
| 341 | void EmitBitFieldUExtract(EmitContext& ctx, IR::Inst* inst, std::string base, std::string offset, | 343 | void EmitBitFieldUExtract(EmitContext& ctx, IR::Inst* inst, std::string base, std::string offset, |
| 342 | std::string count); | 344 | std::string count); |
| 343 | void EmitBitReverse32(EmitContext& ctx, std::string value); | 345 | void EmitBitReverse32(EmitContext& ctx, IR::Inst* inst, std::string value); |
| 344 | void EmitBitCount32(EmitContext& ctx, std::string value); | 346 | void EmitBitCount32(EmitContext& ctx, IR::Inst* inst, std::string value); |
| 345 | void EmitBitwiseNot32(EmitContext& ctx, std::string value); | 347 | void EmitBitwiseNot32(EmitContext& ctx, IR::Inst* inst, std::string value); |
| 346 | void EmitFindSMsb32(EmitContext& ctx, std::string value); | 348 | void EmitFindSMsb32(EmitContext& ctx, IR::Inst* inst, std::string value); |
| 347 | void EmitFindUMsb32(EmitContext& ctx, std::string value); | 349 | void EmitFindUMsb32(EmitContext& ctx, IR::Inst* inst, std::string value); |
| 348 | void EmitSMin32(EmitContext& ctx, std::string a, std::string b); | 350 | void EmitSMin32(EmitContext& ctx, IR::Inst* inst, std::string a, std::string b); |
| 349 | void EmitUMin32(EmitContext& ctx, std::string a, std::string b); | 351 | void EmitUMin32(EmitContext& ctx, IR::Inst* inst, std::string a, std::string b); |
| 350 | void EmitSMax32(EmitContext& ctx, std::string a, std::string b); | 352 | void EmitSMax32(EmitContext& ctx, IR::Inst* inst, std::string a, std::string b); |
| 351 | void EmitUMax32(EmitContext& ctx, std::string a, std::string b); | 353 | void EmitUMax32(EmitContext& ctx, IR::Inst* inst, std::string a, std::string b); |
| 352 | void EmitSClamp32(EmitContext& ctx, IR::Inst* inst, std::string value, std::string min, | 354 | void EmitSClamp32(EmitContext& ctx, IR::Inst* inst, std::string value, std::string min, |
| 353 | std::string max); | 355 | std::string max); |
| 354 | void EmitUClamp32(EmitContext& ctx, IR::Inst* inst, std::string value, std::string min, | 356 | void EmitUClamp32(EmitContext& ctx, IR::Inst* inst, std::string value, std::string min, |
| 355 | std::string max); | 357 | std::string max); |
| 356 | void EmitSLessThan(EmitContext& ctx, std::string lhs, std::string rhs); | 358 | void EmitSLessThan(EmitContext& ctx, IR::Inst* inst, std::string lhs, std::string rhs); |
| 357 | void EmitULessThan(EmitContext& ctx, std::string lhs, std::string rhs); | 359 | void EmitULessThan(EmitContext& ctx, IR::Inst* inst, std::string lhs, std::string rhs); |
| 358 | void EmitIEqual(EmitContext& ctx, std::string lhs, std::string rhs); | 360 | void EmitIEqual(EmitContext& ctx, IR::Inst* inst, std::string lhs, std::string rhs); |
| 359 | void EmitSLessThanEqual(EmitContext& ctx, std::string lhs, std::string rhs); | 361 | void EmitSLessThanEqual(EmitContext& ctx, IR::Inst* inst, std::string lhs, std::string rhs); |
| 360 | void EmitULessThanEqual(EmitContext& ctx, std::string lhs, std::string rhs); | 362 | void EmitULessThanEqual(EmitContext& ctx, IR::Inst* inst, std::string lhs, std::string rhs); |
| 361 | void EmitSGreaterThan(EmitContext& ctx, std::string lhs, std::string rhs); | 363 | void EmitSGreaterThan(EmitContext& ctx, IR::Inst* inst, std::string lhs, std::string rhs); |
| 362 | void EmitUGreaterThan(EmitContext& ctx, std::string lhs, std::string rhs); | 364 | void EmitUGreaterThan(EmitContext& ctx, IR::Inst* inst, std::string lhs, std::string rhs); |
| 363 | void EmitINotEqual(EmitContext& ctx, std::string lhs, std::string rhs); | 365 | void EmitINotEqual(EmitContext& ctx, IR::Inst* inst, std::string lhs, std::string rhs); |
| 364 | void EmitSGreaterThanEqual(EmitContext& ctx, std::string lhs, std::string rhs); | 366 | void EmitSGreaterThanEqual(EmitContext& ctx, IR::Inst* inst, std::string lhs, std::string rhs); |
| 365 | void EmitUGreaterThanEqual(EmitContext& ctx, std::string lhs, std::string rhs); | 367 | void EmitUGreaterThanEqual(EmitContext& ctx, IR::Inst* inst, std::string lhs, std::string rhs); |
| 366 | void EmitSharedAtomicIAdd32(EmitContext& ctx, std::string pointer_offset, std::string value); | 368 | void EmitSharedAtomicIAdd32(EmitContext& ctx, std::string pointer_offset, std::string value); |
| 367 | void EmitSharedAtomicSMin32(EmitContext& ctx, std::string pointer_offset, std::string value); | 369 | void EmitSharedAtomicSMin32(EmitContext& ctx, std::string pointer_offset, std::string value); |
| 368 | void EmitSharedAtomicUMin32(EmitContext& ctx, std::string pointer_offset, std::string value); | 370 | void EmitSharedAtomicUMin32(EmitContext& ctx, std::string pointer_offset, std::string value); |
diff --git a/src/shader_recompiler/backend/glsl/emit_glsl_integer.cpp b/src/shader_recompiler/backend/glsl/emit_glsl_integer.cpp index 6977f74f9..f03b2dba9 100644 --- a/src/shader_recompiler/backend/glsl/emit_glsl_integer.cpp +++ b/src/shader_recompiler/backend/glsl/emit_glsl_integer.cpp | |||
| @@ -16,69 +16,75 @@ void EmitIAdd32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst* in | |||
| 16 | ctx.AddU32("{}={}+{};", *inst, a, b); | 16 | ctx.AddU32("{}={}+{};", *inst, a, b); |
| 17 | } | 17 | } |
| 18 | 18 | ||
| 19 | void EmitIAdd64([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string a, | 19 | void EmitIAdd64([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst* inst, |
| 20 | [[maybe_unused]] std::string b) { | 20 | [[maybe_unused]] std::string a, [[maybe_unused]] std::string b) { |
| 21 | throw NotImplementedException("GLSL Instruction"); | 21 | throw NotImplementedException("GLSL Instruction"); |
| 22 | } | 22 | } |
| 23 | 23 | ||
| 24 | void EmitISub32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string a, | 24 | void EmitISub32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst* inst, |
| 25 | [[maybe_unused]] std::string b) { | 25 | [[maybe_unused]] std::string a, [[maybe_unused]] std::string b) { |
| 26 | throw NotImplementedException("GLSL Instruction"); | 26 | throw NotImplementedException("GLSL Instruction"); |
| 27 | } | 27 | } |
| 28 | 28 | ||
| 29 | void EmitISub64([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string a, | 29 | void EmitISub64([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst* inst, |
| 30 | [[maybe_unused]] std::string b) { | 30 | [[maybe_unused]] std::string a, [[maybe_unused]] std::string b) { |
| 31 | throw NotImplementedException("GLSL Instruction"); | 31 | throw NotImplementedException("GLSL Instruction"); |
| 32 | } | 32 | } |
| 33 | 33 | ||
| 34 | void EmitIMul32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string a, | 34 | void EmitIMul32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst* inst, |
| 35 | [[maybe_unused]] std::string b) { | 35 | [[maybe_unused]] std::string a, [[maybe_unused]] std::string b) { |
| 36 | throw NotImplementedException("GLSL Instruction"); | 36 | throw NotImplementedException("GLSL Instruction"); |
| 37 | } | 37 | } |
| 38 | 38 | ||
| 39 | void EmitINeg32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string value) { | 39 | void EmitINeg32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst* inst, |
| 40 | throw NotImplementedException("GLSL Instruction"); | 40 | [[maybe_unused]] std::string value) { |
| 41 | ctx.AddU32("{}=-{};", *inst, value); | ||
| 41 | } | 42 | } |
| 42 | 43 | ||
| 43 | void EmitINeg64([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string value) { | 44 | void EmitINeg64([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst* inst, |
| 45 | [[maybe_unused]] std::string value) { | ||
| 44 | throw NotImplementedException("GLSL Instruction"); | 46 | throw NotImplementedException("GLSL Instruction"); |
| 45 | } | 47 | } |
| 46 | 48 | ||
| 47 | void EmitIAbs32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string value) { | 49 | void EmitIAbs32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst* inst, |
| 50 | [[maybe_unused]] std::string value) { | ||
| 48 | throw NotImplementedException("GLSL Instruction"); | 51 | throw NotImplementedException("GLSL Instruction"); |
| 49 | } | 52 | } |
| 50 | 53 | ||
| 51 | void EmitIAbs64([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string value) { | 54 | void EmitIAbs64([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst* inst, |
| 55 | [[maybe_unused]] std::string value) { | ||
| 52 | throw NotImplementedException("GLSL Instruction"); | 56 | throw NotImplementedException("GLSL Instruction"); |
| 53 | } | 57 | } |
| 54 | 58 | ||
| 55 | void EmitShiftLeftLogical32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string base, | 59 | void EmitShiftLeftLogical32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst* inst, |
| 56 | [[maybe_unused]] std::string shift) { | 60 | [[maybe_unused]] std::string base, [[maybe_unused]] std::string shift) { |
| 57 | throw NotImplementedException("GLSL Instruction"); | 61 | throw NotImplementedException("GLSL Instruction"); |
| 58 | } | 62 | } |
| 59 | 63 | ||
| 60 | void EmitShiftLeftLogical64([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string base, | 64 | void EmitShiftLeftLogical64([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst* inst, |
| 61 | [[maybe_unused]] std::string shift) { | 65 | [[maybe_unused]] std::string base, [[maybe_unused]] std::string shift) { |
| 62 | throw NotImplementedException("GLSL Instruction"); | 66 | throw NotImplementedException("GLSL Instruction"); |
| 63 | } | 67 | } |
| 64 | 68 | ||
| 65 | void EmitShiftRightLogical32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string base, | 69 | void EmitShiftRightLogical32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst* inst, |
| 70 | [[maybe_unused]] std::string base, | ||
| 66 | [[maybe_unused]] std::string shift) { | 71 | [[maybe_unused]] std::string shift) { |
| 67 | throw NotImplementedException("GLSL Instruction"); | 72 | throw NotImplementedException("GLSL Instruction"); |
| 68 | } | 73 | } |
| 69 | 74 | ||
| 70 | void EmitShiftRightLogical64([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string base, | 75 | void EmitShiftRightLogical64([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst* inst, |
| 76 | [[maybe_unused]] std::string base, | ||
| 71 | [[maybe_unused]] std::string shift) { | 77 | [[maybe_unused]] std::string shift) { |
| 72 | throw NotImplementedException("GLSL Instruction"); | 78 | throw NotImplementedException("GLSL Instruction"); |
| 73 | } | 79 | } |
| 74 | 80 | ||
| 75 | void EmitShiftRightArithmetic32([[maybe_unused]] EmitContext& ctx, | 81 | void EmitShiftRightArithmetic32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst* inst, |
| 76 | [[maybe_unused]] std::string base, | 82 | [[maybe_unused]] std::string base, |
| 77 | [[maybe_unused]] std::string shift) { | 83 | [[maybe_unused]] std::string shift) { |
| 78 | throw NotImplementedException("GLSL Instruction"); | 84 | throw NotImplementedException("GLSL Instruction"); |
| 79 | } | 85 | } |
| 80 | 86 | ||
| 81 | void EmitShiftRightArithmetic64([[maybe_unused]] EmitContext& ctx, | 87 | void EmitShiftRightArithmetic64([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst* inst, |
| 82 | [[maybe_unused]] std::string base, | 88 | [[maybe_unused]] std::string base, |
| 83 | [[maybe_unused]] std::string shift) { | 89 | [[maybe_unused]] std::string shift) { |
| 84 | throw NotImplementedException("GLSL Instruction"); | 90 | throw NotImplementedException("GLSL Instruction"); |
| @@ -99,9 +105,9 @@ void EmitBitwiseXor32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::In | |||
| 99 | throw NotImplementedException("GLSL Instruction"); | 105 | throw NotImplementedException("GLSL Instruction"); |
| 100 | } | 106 | } |
| 101 | 107 | ||
| 102 | void EmitBitFieldInsert([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string base, | 108 | void EmitBitFieldInsert([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst* inst, |
| 103 | [[maybe_unused]] std::string insert, [[maybe_unused]] std::string offset, | 109 | [[maybe_unused]] std::string base, [[maybe_unused]] std::string insert, |
| 104 | std::string count) { | 110 | [[maybe_unused]] std::string offset, std::string count) { |
| 105 | throw NotImplementedException("GLSL Instruction"); | 111 | throw NotImplementedException("GLSL Instruction"); |
| 106 | } | 112 | } |
| 107 | 113 | ||
| @@ -117,43 +123,48 @@ void EmitBitFieldUExtract([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR | |||
| 117 | throw NotImplementedException("GLSL Instruction"); | 123 | throw NotImplementedException("GLSL Instruction"); |
| 118 | } | 124 | } |
| 119 | 125 | ||
| 120 | void EmitBitReverse32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string value) { | 126 | void EmitBitReverse32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst* inst, |
| 127 | [[maybe_unused]] std::string value) { | ||
| 121 | throw NotImplementedException("GLSL Instruction"); | 128 | throw NotImplementedException("GLSL Instruction"); |
| 122 | } | 129 | } |
| 123 | 130 | ||
| 124 | void EmitBitCount32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string value) { | 131 | void EmitBitCount32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst* inst, |
| 132 | [[maybe_unused]] std::string value) { | ||
| 125 | throw NotImplementedException("GLSL Instruction"); | 133 | throw NotImplementedException("GLSL Instruction"); |
| 126 | } | 134 | } |
| 127 | 135 | ||
| 128 | void EmitBitwiseNot32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string value) { | 136 | void EmitBitwiseNot32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst* inst, |
| 137 | [[maybe_unused]] std::string value) { | ||
| 129 | throw NotImplementedException("GLSL Instruction"); | 138 | throw NotImplementedException("GLSL Instruction"); |
| 130 | } | 139 | } |
| 131 | 140 | ||
| 132 | void EmitFindSMsb32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string value) { | 141 | void EmitFindSMsb32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst* inst, |
| 142 | [[maybe_unused]] std::string value) { | ||
| 133 | throw NotImplementedException("GLSL Instruction"); | 143 | throw NotImplementedException("GLSL Instruction"); |
| 134 | } | 144 | } |
| 135 | 145 | ||
| 136 | void EmitFindUMsb32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string value) { | 146 | void EmitFindUMsb32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst* inst, |
| 147 | [[maybe_unused]] std::string value) { | ||
| 137 | throw NotImplementedException("GLSL Instruction"); | 148 | throw NotImplementedException("GLSL Instruction"); |
| 138 | } | 149 | } |
| 139 | 150 | ||
| 140 | void EmitSMin32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string a, | 151 | void EmitSMin32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst* inst, |
| 141 | [[maybe_unused]] std::string b) { | 152 | [[maybe_unused]] std::string a, [[maybe_unused]] std::string b) { |
| 142 | throw NotImplementedException("GLSL Instruction"); | 153 | throw NotImplementedException("GLSL Instruction"); |
| 143 | } | 154 | } |
| 144 | 155 | ||
| 145 | void EmitUMin32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string a, | 156 | void EmitUMin32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst* inst, |
| 146 | [[maybe_unused]] std::string b) { | 157 | [[maybe_unused]] std::string a, [[maybe_unused]] std::string b) { |
| 147 | throw NotImplementedException("GLSL Instruction"); | 158 | throw NotImplementedException("GLSL Instruction"); |
| 148 | } | 159 | } |
| 149 | 160 | ||
| 150 | void EmitSMax32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string a, | 161 | void EmitSMax32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst* inst, |
| 151 | [[maybe_unused]] std::string b) { | 162 | [[maybe_unused]] std::string a, [[maybe_unused]] std::string b) { |
| 152 | throw NotImplementedException("GLSL Instruction"); | 163 | throw NotImplementedException("GLSL Instruction"); |
| 153 | } | 164 | } |
| 154 | 165 | ||
| 155 | void EmitUMax32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string a, | 166 | void EmitUMax32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst* inst, |
| 156 | [[maybe_unused]] std::string b) { | 167 | [[maybe_unused]] std::string a, [[maybe_unused]] std::string b) { |
| 157 | throw NotImplementedException("GLSL Instruction"); | 168 | throw NotImplementedException("GLSL Instruction"); |
| 158 | } | 169 | } |
| 159 | 170 | ||
| @@ -169,53 +180,53 @@ void EmitUClamp32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst* | |||
| 169 | throw NotImplementedException("GLSL Instruction"); | 180 | throw NotImplementedException("GLSL Instruction"); |
| 170 | } | 181 | } |
| 171 | 182 | ||
| 172 | void EmitSLessThan([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string lhs, | 183 | void EmitSLessThan([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst* inst, |
| 173 | [[maybe_unused]] std::string rhs) { | 184 | [[maybe_unused]] std::string lhs, [[maybe_unused]] std::string rhs) { |
| 174 | throw NotImplementedException("GLSL Instruction"); | 185 | throw NotImplementedException("GLSL Instruction"); |
| 175 | } | 186 | } |
| 176 | 187 | ||
| 177 | void EmitULessThan([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string lhs, | 188 | void EmitULessThan([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst* inst, |
| 178 | [[maybe_unused]] std::string rhs) { | 189 | [[maybe_unused]] std::string lhs, [[maybe_unused]] std::string rhs) { |
| 179 | throw NotImplementedException("GLSL Instruction"); | 190 | throw NotImplementedException("GLSL Instruction"); |
| 180 | } | 191 | } |
| 181 | 192 | ||
| 182 | void EmitIEqual([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string lhs, | 193 | void EmitIEqual([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst* inst, |
| 183 | [[maybe_unused]] std::string rhs) { | 194 | [[maybe_unused]] std::string lhs, [[maybe_unused]] std::string rhs) { |
| 184 | throw NotImplementedException("GLSL Instruction"); | 195 | throw NotImplementedException("GLSL Instruction"); |
| 185 | } | 196 | } |
| 186 | 197 | ||
| 187 | void EmitSLessThanEqual([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string lhs, | 198 | void EmitSLessThanEqual([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst* inst, |
| 188 | [[maybe_unused]] std::string rhs) { | 199 | [[maybe_unused]] std::string lhs, [[maybe_unused]] std::string rhs) { |
| 189 | throw NotImplementedException("GLSL Instruction"); | 200 | throw NotImplementedException("GLSL Instruction"); |
| 190 | } | 201 | } |
| 191 | 202 | ||
| 192 | void EmitULessThanEqual([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string lhs, | 203 | void EmitULessThanEqual([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst* inst, |
| 193 | [[maybe_unused]] std::string rhs) { | 204 | [[maybe_unused]] std::string lhs, [[maybe_unused]] std::string rhs) { |
| 194 | throw NotImplementedException("GLSL Instruction"); | 205 | throw NotImplementedException("GLSL Instruction"); |
| 195 | } | 206 | } |
| 196 | 207 | ||
| 197 | void EmitSGreaterThan([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string lhs, | 208 | void EmitSGreaterThan([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst* inst, |
| 198 | [[maybe_unused]] std::string rhs) { | 209 | [[maybe_unused]] std::string lhs, [[maybe_unused]] std::string rhs) { |
| 199 | throw NotImplementedException("GLSL Instruction"); | 210 | throw NotImplementedException("GLSL Instruction"); |
| 200 | } | 211 | } |
| 201 | 212 | ||
| 202 | void EmitUGreaterThan([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string lhs, | 213 | void EmitUGreaterThan([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst* inst, |
| 203 | [[maybe_unused]] std::string rhs) { | 214 | [[maybe_unused]] std::string lhs, [[maybe_unused]] std::string rhs) { |
| 204 | throw NotImplementedException("GLSL Instruction"); | 215 | throw NotImplementedException("GLSL Instruction"); |
| 205 | } | 216 | } |
| 206 | 217 | ||
| 207 | void EmitINotEqual([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string lhs, | 218 | void EmitINotEqual([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst* inst, |
| 208 | [[maybe_unused]] std::string rhs) { | 219 | [[maybe_unused]] std::string lhs, [[maybe_unused]] std::string rhs) { |
| 209 | throw NotImplementedException("GLSL Instruction"); | 220 | throw NotImplementedException("GLSL Instruction"); |
| 210 | } | 221 | } |
| 211 | 222 | ||
| 212 | void EmitSGreaterThanEqual([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string lhs, | 223 | void EmitSGreaterThanEqual([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst* inst, |
| 213 | [[maybe_unused]] std::string rhs) { | 224 | [[maybe_unused]] std::string lhs, [[maybe_unused]] std::string rhs) { |
| 214 | throw NotImplementedException("GLSL Instruction"); | 225 | throw NotImplementedException("GLSL Instruction"); |
| 215 | } | 226 | } |
| 216 | 227 | ||
| 217 | void EmitUGreaterThanEqual([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string lhs, | 228 | void EmitUGreaterThanEqual([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst* inst, |
| 218 | [[maybe_unused]] std::string rhs) { | 229 | [[maybe_unused]] std::string lhs, [[maybe_unused]] std::string rhs) { |
| 219 | throw NotImplementedException("GLSL Instruction"); | 230 | throw NotImplementedException("GLSL Instruction"); |
| 220 | } | 231 | } |
| 221 | } // namespace Shader::Backend::GLSL | 232 | } // namespace Shader::Backend::GLSL |
diff --git a/src/shader_recompiler/backend/glsl/reg_alloc.cpp b/src/shader_recompiler/backend/glsl/reg_alloc.cpp index 5ad1872db..f4886dbfd 100644 --- a/src/shader_recompiler/backend/glsl/reg_alloc.cpp +++ b/src/shader_recompiler/backend/glsl/reg_alloc.cpp | |||
| @@ -51,8 +51,7 @@ std::string RegAlloc::Define(IR::Inst& inst, Type type) { | |||
| 51 | } | 51 | } |
| 52 | 52 | ||
| 53 | std::string RegAlloc::Consume(const IR::Value& value) { | 53 | std::string RegAlloc::Consume(const IR::Value& value) { |
| 54 | const auto result = value.IsImmediate() ? MakeImm(value) : Consume(*value.InstRecursive()); | 54 | return value.IsImmediate() ? MakeImm(value) : Consume(*value.InstRecursive()); |
| 55 | return result; | ||
| 56 | } | 55 | } |
| 57 | 56 | ||
| 58 | std::string RegAlloc::Consume(IR::Inst& inst) { | 57 | std::string RegAlloc::Consume(IR::Inst& inst) { |