summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYuri Kunde Schlesner <yuriks@yuriks.net>2015-07-21 06:24:27 +0200
committerYuri Kunde Schlesner <yuriks@yuriks.net>2015-07-23 21:51:24 +0200
commit4e092022267e4f232429013653ba1bd4ac8b0a05 (patch)
treeb24f12735d533f342e0a1e026fdb9c8fec7283c8
parentMerge pull request #977 from yuriks/glenable-tex2d (diff)
downloadyuzu-4e092022267e4f232429013653ba1bd4ac8b0a05.tar
yuzu-4e092022267e4f232429013653ba1bd4ac8b0a05.tar.gz
yuzu-4e092022267e4f232429013653ba1bd4ac8b0a05.tar.bz2
yuzu-4e092022267e4f232429013653ba1bd4ac8b0a05.tar.lz
yuzu-4e092022267e4f232429013653ba1bd4ac8b0a05.tar.xz
yuzu-4e092022267e4f232429013653ba1bd4ac8b0a05.tar.zst
yuzu-4e092022267e4f232429013653ba1bd4ac8b0a05.zip
-rw-r--r--src/video_core/vertex_shader.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/video_core/vertex_shader.cpp b/src/video_core/vertex_shader.cpp
index b77503806..ff114fc3a 100644
--- a/src/video_core/vertex_shader.cpp
+++ b/src/video_core/vertex_shader.cpp
@@ -610,6 +610,12 @@ OutputVertex RunShader(const InputVertex& input, int num_attributes, const Regs:
}
}
+ // The hardware takes the absolute and saturates vertex colors like this, *before* doing interpolation
+ for (int i = 0; i < 4; ++i) {
+ ret.color[i] = float24::FromFloat32(
+ std::fmin(std::fabs(ret.color[i].ToFloat32()), 1.0f));
+ }
+
LOG_TRACE(Render_Software, "Output vertex: pos (%.2f, %.2f, %.2f, %.2f), col(%.2f, %.2f, %.2f, %.2f), tc0(%.2f, %.2f)",
ret.pos.x.ToFloat32(), ret.pos.y.ToFloat32(), ret.pos.z.ToFloat32(), ret.pos.w.ToFloat32(),
ret.color.x.ToFloat32(), ret.color.y.ToFloat32(), ret.color.z.ToFloat32(), ret.color.w.ToFloat32(),