VERY experimental Nintendo Switch 2 emulator
C++
glsl: Enable early fragment tests
ameerj42ac60591e35
diff --git a/src/shader_recompiler/backend/glsl/emit_context.cpp b/src/shader_recompiler/backend/glsl/emit_context.cppindex e0d6785545..a24fa46c5b 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 Profilecase Stage::Fragment:stage_name = "fs";position_name = "gl_FragCoord";+ if (runtime_info.force_early_z) {+ header += "layout(early_fragment_tests)in;";+ }break;case Stage::Compute: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.cppindex adeafdd3d8..fbf66015f9 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& ivoid EmitFPAdd32(EmitContext& ctx, IR::Inst& inst, std::string_view a, std::string_view b) {if (Precise(inst)) {- ctx.AddPrecF32("{}=float({})+float({});", inst, a, b);+ ctx.AddPrecF32("{}={}+{};", inst, a, b);} else {- ctx.AddF32("{}=float({})+float({});", inst, a, b);+ ctx.AddF32("{}={}+{};", inst, a, b);}}void EmitFPAdd64(EmitContext& ctx, IR::Inst& inst, std::string_view a, std::string_view b) {if (Precise(inst)) {- ctx.AddPrecF64("{}=double({})+double({});", inst, a, b);+ ctx.AddPrecF64("{}={}+{};", inst, a, b);} else {- ctx.AddF64("{}=double({})+double({});", inst, a, b);+ ctx.AddF64("{}={}+{};", inst, a, b);}}