summaryrefslogtreecommitdiff
path: root/src/shader_recompiler/backend/glsl
diff options
context:
space:
mode:
Diffstat (limited to 'src/shader_recompiler/backend/glsl')
-rw-r--r--src/shader_recompiler/backend/glsl/emit_context.cpp3
-rw-r--r--src/shader_recompiler/backend/glsl/emit_glsl_floating_point.cpp8
2 files changed, 7 insertions, 4 deletions
diff --git a/src/shader_recompiler/backend/glsl/emit_context.cpp b/src/shader_recompiler/backend/glsl/emit_context.cpp
index e0d678554..a24fa46c5 100644
--- a/src/shader_recompiler/backend/glsl/emit_context.cpp
+++ b/src/shader_recompiler/backend/glsl/emit_context.cpp
@@ -266,6 +266,9 @@ EmitContext::EmitContext(IR::Program& program, Bindings& bindings, const Profile
266 case Stage::Fragment: 266 case Stage::Fragment:
267 stage_name = "fs"; 267 stage_name = "fs";
268 position_name = "gl_FragCoord"; 268 position_name = "gl_FragCoord";
269 if (runtime_info.force_early_z) {
270 header += "layout(early_fragment_tests)in;";
271 }
269 break; 272 break;
270 case Stage::Compute: 273 case Stage::Compute:
271 stage_name = "cs"; 274 stage_name = "cs";
diff --git a/src/shader_recompiler/backend/glsl/emit_glsl_floating_point.cpp b/src/shader_recompiler/backend/glsl/emit_glsl_floating_point.cpp
index adeafdd3d..fbf66015f 100644
--- a/src/shader_recompiler/backend/glsl/emit_glsl_floating_point.cpp
+++ b/src/shader_recompiler/backend/glsl/emit_glsl_floating_point.cpp
@@ -47,17 +47,17 @@ void EmitFPAdd16([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& i
47 47
48void EmitFPAdd32(EmitContext& ctx, IR::Inst& inst, std::string_view a, std::string_view b) { 48void EmitFPAdd32(EmitContext& ctx, IR::Inst& inst, std::string_view a, std::string_view b) {
49 if (Precise(inst)) { 49 if (Precise(inst)) {
50 ctx.AddPrecF32("{}=float({})+float({});", inst, a, b); 50 ctx.AddPrecF32("{}={}+{};", inst, a, b);
51 } else { 51 } else {
52 ctx.AddF32("{}=float({})+float({});", inst, a, b); 52 ctx.AddF32("{}={}+{};", inst, a, b);
53 } 53 }
54} 54}
55 55
56void EmitFPAdd64(EmitContext& ctx, IR::Inst& inst, std::string_view a, std::string_view b) { 56void EmitFPAdd64(EmitContext& ctx, IR::Inst& inst, std::string_view a, std::string_view b) {
57 if (Precise(inst)) { 57 if (Precise(inst)) {
58 ctx.AddPrecF64("{}=double({})+double({});", inst, a, b); 58 ctx.AddPrecF64("{}={}+{};", inst, a, b);
59 } else { 59 } else {
60 ctx.AddF64("{}=double({})+double({});", inst, a, b); 60 ctx.AddF64("{}={}+{};", inst, a, b);
61 } 61 }
62} 62}
63 63