summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorameerj <52414509+ameerj@users.noreply.github.com>2021-06-09 07:16:25 +0200
committerameerj <52414509+ameerj@users.noreply.github.com>2021-07-23 03:51:37 +0200
commit14bd73db360c0cec61dd2e211dcde49b2197e425 (patch)
tree5f5783a61e43afe3811888e6063cb471372b50fe
parentgl_rasterizer: Add texture fetch barrier for fragments (diff)
downloadyuzu-14bd73db360c0cec61dd2e211dcde49b2197e425.tar
yuzu-14bd73db360c0cec61dd2e211dcde49b2197e425.tar.gz
yuzu-14bd73db360c0cec61dd2e211dcde49b2197e425.tar.bz2
yuzu-14bd73db360c0cec61dd2e211dcde49b2197e425.tar.lz
yuzu-14bd73db360c0cec61dd2e211dcde49b2197e425.tar.xz
yuzu-14bd73db360c0cec61dd2e211dcde49b2197e425.tar.zst
yuzu-14bd73db360c0cec61dd2e211dcde49b2197e425.zip
-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
case 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.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
void 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);
}
}