diff options
| author | 2021-05-21 21:31:41 -0400 | |
|---|---|---|
| committer | 2021-07-22 21:51:36 -0400 | |
| commit | 266a3d60e3d8ee4b67a4a6b3e69d8632509b7a43 (patch) | |
| tree | 0e08734f5b94c2517d054d05aebe832aef2fbed7 /src/shader_recompiler/backend/glsl | |
| parent | glsl: Implement a few Integer instructions (diff) | |
| download | yuzu-266a3d60e3d8ee4b67a4a6b3e69d8632509b7a43.tar.gz yuzu-266a3d60e3d8ee4b67a4a6b3e69d8632509b7a43.tar.xz yuzu-266a3d60e3d8ee4b67a4a6b3e69d8632509b7a43.zip | |
glsl: Implement BF*
Diffstat (limited to 'src/shader_recompiler/backend/glsl')
3 files changed, 10 insertions, 9 deletions
diff --git a/src/shader_recompiler/backend/glsl/emit_glsl_instructions.h b/src/shader_recompiler/backend/glsl/emit_glsl_instructions.h index 51dbeb2c1..5370af0c5 100644 --- a/src/shader_recompiler/backend/glsl/emit_glsl_instructions.h +++ b/src/shader_recompiler/backend/glsl/emit_glsl_instructions.h | |||
| @@ -204,8 +204,8 @@ void EmitSelectU8(EmitContext& ctx, std::string_view cond, std::string_view true | |||
| 204 | std::string_view false_value); | 204 | std::string_view false_value); |
| 205 | void EmitSelectU16(EmitContext& ctx, std::string_view cond, std::string_view true_value, | 205 | void EmitSelectU16(EmitContext& ctx, std::string_view cond, std::string_view true_value, |
| 206 | std::string_view false_value); | 206 | std::string_view false_value); |
| 207 | void EmitSelectU32(EmitContext& ctx, std::string_view cond, std::string_view true_value, | 207 | void EmitSelectU32(EmitContext& ctx, IR::Inst& inst, std::string_view cond, |
| 208 | std::string_view false_value); | 208 | std::string_view true_value, std::string_view false_value); |
| 209 | void EmitSelectU64(EmitContext& ctx, std::string_view cond, std::string_view true_value, | 209 | void EmitSelectU64(EmitContext& ctx, std::string_view cond, std::string_view true_value, |
| 210 | std::string_view false_value); | 210 | std::string_view false_value); |
| 211 | void EmitSelectF16(EmitContext& ctx, std::string_view cond, std::string_view true_value, | 211 | void EmitSelectF16(EmitContext& ctx, std::string_view cond, std::string_view true_value, |
diff --git a/src/shader_recompiler/backend/glsl/emit_glsl_integer.cpp b/src/shader_recompiler/backend/glsl/emit_glsl_integer.cpp index 016bccd39..3f1b56a05 100644 --- a/src/shader_recompiler/backend/glsl/emit_glsl_integer.cpp +++ b/src/shader_recompiler/backend/glsl/emit_glsl_integer.cpp | |||
| @@ -22,7 +22,7 @@ void EmitIAdd64([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& in | |||
| 22 | 22 | ||
| 23 | void EmitISub32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst, | 23 | void EmitISub32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst, |
| 24 | [[maybe_unused]] std::string_view a, [[maybe_unused]] std::string_view b) { | 24 | [[maybe_unused]] std::string_view a, [[maybe_unused]] std::string_view b) { |
| 25 | throw NotImplementedException("GLSL Instruction"); | 25 | ctx.AddU32("{}={}-{};", inst, a, b); |
| 26 | } | 26 | } |
| 27 | 27 | ||
| 28 | void EmitISub64([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst, | 28 | void EmitISub64([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst, |
| @@ -111,26 +111,26 @@ void EmitBitFieldInsert([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR:: | |||
| 111 | [[maybe_unused]] std::string_view insert, | 111 | [[maybe_unused]] std::string_view insert, |
| 112 | [[maybe_unused]] std::string_view offset, | 112 | [[maybe_unused]] std::string_view offset, |
| 113 | [[maybe_unused]] std::string_view count) { | 113 | [[maybe_unused]] std::string_view count) { |
| 114 | throw NotImplementedException("GLSL Instruction"); | 114 | ctx.AddU32("{}=bitfieldInsert({}, {}, int({}), int({}));", inst, base, insert, offset, count); |
| 115 | } | 115 | } |
| 116 | 116 | ||
| 117 | void EmitBitFieldSExtract([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst, | 117 | void EmitBitFieldSExtract([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst, |
| 118 | [[maybe_unused]] std::string_view base, | 118 | [[maybe_unused]] std::string_view base, |
| 119 | [[maybe_unused]] std::string_view offset, | 119 | [[maybe_unused]] std::string_view offset, |
| 120 | [[maybe_unused]] std::string_view count) { | 120 | [[maybe_unused]] std::string_view count) { |
| 121 | throw NotImplementedException("GLSL Instruction"); | 121 | ctx.AddU32("{}=bitfieldExtract(int({}), int({}), int({}));", inst, base, offset, count); |
| 122 | } | 122 | } |
| 123 | 123 | ||
| 124 | void EmitBitFieldUExtract([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst, | 124 | void EmitBitFieldUExtract([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst, |
| 125 | [[maybe_unused]] std::string_view base, | 125 | [[maybe_unused]] std::string_view base, |
| 126 | [[maybe_unused]] std::string_view offset, | 126 | [[maybe_unused]] std::string_view offset, |
| 127 | [[maybe_unused]] std::string_view count) { | 127 | [[maybe_unused]] std::string_view count) { |
| 128 | throw NotImplementedException("GLSL Instruction"); | 128 | ctx.AddU32("{}=bitfieldExtract({}, int({}), int({}));", inst, base, offset, count); |
| 129 | } | 129 | } |
| 130 | 130 | ||
| 131 | void EmitBitReverse32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst, | 131 | void EmitBitReverse32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst, |
| 132 | [[maybe_unused]] std::string_view value) { | 132 | [[maybe_unused]] std::string_view value) { |
| 133 | throw NotImplementedException("GLSL Instruction"); | 133 | ctx.AddU32("{}=bitfieldReverse({});", inst, value); |
| 134 | } | 134 | } |
| 135 | 135 | ||
| 136 | void EmitBitCount32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst, | 136 | void EmitBitCount32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst, |
diff --git a/src/shader_recompiler/backend/glsl/emit_glsl_select.cpp b/src/shader_recompiler/backend/glsl/emit_glsl_select.cpp index 86d38da98..4455b0f9f 100644 --- a/src/shader_recompiler/backend/glsl/emit_glsl_select.cpp +++ b/src/shader_recompiler/backend/glsl/emit_glsl_select.cpp | |||
| @@ -28,10 +28,11 @@ void EmitSelectU16([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::stri | |||
| 28 | throw NotImplementedException("GLSL Instruction"); | 28 | throw NotImplementedException("GLSL Instruction"); |
| 29 | } | 29 | } |
| 30 | 30 | ||
| 31 | void EmitSelectU32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string_view cond, | 31 | void EmitSelectU32([[maybe_unused]] EmitContext& ctx, IR::Inst& inst, |
| 32 | [[maybe_unused]] std::string_view cond, | ||
| 32 | [[maybe_unused]] std::string_view true_value, | 33 | [[maybe_unused]] std::string_view true_value, |
| 33 | [[maybe_unused]] std::string_view false_value) { | 34 | [[maybe_unused]] std::string_view false_value) { |
| 34 | throw NotImplementedException("GLSL Instruction"); | 35 | ctx.AddU32("{}={}?{}:{};", inst, cond, true_value, false_value); |
| 35 | } | 36 | } |
| 36 | 37 | ||
| 37 | void EmitSelectU64([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string_view cond, | 38 | void EmitSelectU64([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string_view cond, |