summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Yuri Kunde Schlesner2014-12-28 18:20:33 -0200
committerGravatar Yuri Kunde Schlesner2014-12-29 02:08:09 -0200
commitd151d797b1c281d5813ca705722f43b4be20ca6d (patch)
treedddce524fe7d6a1325af881a39b87c8a26a23275
parentMerge pull request #347 from bunnei/frameskip (diff)
downloadyuzu-d151d797b1c281d5813ca705722f43b4be20ca6d.tar.gz
yuzu-d151d797b1c281d5813ca705722f43b4be20ca6d.tar.xz
yuzu-d151d797b1c281d5813ca705722f43b4be20ca6d.zip
Vertex Shader: Zero OutputVertex to avoid denormals
Unused OutputVertex attributes were being left un-initialized. The leftover garbage sometimes decoded as floating-point denormalized values, causing fallbacks to microcode and massive slowdowns in the rest of the rasterization pipeline even though the results were unused. By zeroing the structure we ensure these attributes only contain harmless zeros.
-rw-r--r--src/video_core/vertex_shader.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/video_core/vertex_shader.cpp b/src/video_core/vertex_shader.cpp
index e31bc3bc7..bed5081a0 100644
--- a/src/video_core/vertex_shader.cpp
+++ b/src/video_core/vertex_shader.cpp
@@ -469,6 +469,10 @@ OutputVertex RunShader(const InputVertex& input, int num_attributes)
469 469
470 // Setup output register table 470 // Setup output register table
471 OutputVertex ret; 471 OutputVertex ret;
472 // Zero output so that attributes which aren't output won't have denormals in them, which will
473 // slow us down later.
474 memset(&ret, 0, sizeof(ret));
475
472 for (int i = 0; i < 7; ++i) { 476 for (int i = 0; i < 7; ++i) {
473 const auto& output_register_map = registers.vs_output_attributes[i]; 477 const auto& output_register_map = registers.vs_output_attributes[i];
474 478