瀏覽代碼

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.
Yuri Kunde Schlesner 11 年之前
父節點
當前提交
d151d797b1
共有 1 個文件被更改,包括 4 次插入0 次删除
  1. 4 0
      src/video_core/vertex_shader.cpp

+ 4 - 0
src/video_core/vertex_shader.cpp

@@ -469,6 +469,10 @@ OutputVertex RunShader(const InputVertex& input, int num_attributes)
 
     // Setup output register table
     OutputVertex ret;
+    // Zero output so that attributes which aren't output won't have denormals in them, which will
+    // slow us down later.
+    memset(&ret, 0, sizeof(ret));
+
     for (int i = 0; i < 7; ++i) {
         const auto& output_register_map = registers.vs_output_attributes[i];