i965/fs: Only read output_components many components when writing an output
authorJason Ekstrand <jason.ekstrand@intel.com>
Mon, 14 Sep 2015 21:18:13 +0000 (14:18 -0700)
committerJason Ekstrand <jason.ekstrand@intel.com>
Tue, 15 Sep 2015 18:08:12 +0000 (11:08 -0700)
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
src/mesa/drivers/dri/i965/brw_fs_visitor.cpp

index cea16e0b32557fc07b4ec7721f2d216c923f321a..8b61c8676028f4e30c7d249c348f6a297e141585 100644 (file)
@@ -974,8 +974,10 @@ fs_visitor::emit_urb_writes()
                sources[length++] = reg;
             }
          } else {
-            for (int i = 0; i < 4; i++)
+            for (int i = 0; i < output_components[varying]; i++)
                sources[length++] = offset(this->outputs[varying], bld, i);
+            for (int i = output_components[varying]; i < 4; i++)
+               sources[length++] = fs_reg(0);
          }
          break;
       }