On 29 August 2012 02:30, Kenneth Graunke <span dir="ltr"><<a href="mailto:kenneth@whitecape.org" target="_blank">kenneth@whitecape.org</a>></span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Prior to commit 2f1869822, emit_fb_writes() looped from 0 to 3, writing<br>
all four components of a vec4 color output. However, that broke for<br>
smaller output types (float, vec2, or vec3). To fix that, I introduced<br>
a new variable (output_components[]) containing the size of the output<br>
type for each render target.<br>
<br>
Unfortunately, I forgot to actually initialize it in the constructor,<br>
which meant that unless a shader wrote to gl_FragColor, or the specific<br>
output for each render target, output_components would contain a garbage<br>
value, and we'd loop for a completely non-deterministic amount of time.<br>
<br>
Not actually emitting any color writes seems like the right approach.<br>
We may still need to emit a render target write (to terminate the<br>
thread), but don't have to put in any sensible values (the shader didn't<br>
write anything, after all).<br>
<br>
Fixes a regression since 2f18698220d8b27991fab550c4721590d17278e0.<br>
NOTE: This is a candidate for stable release branches.<br>
<br>
Bugzilla: <a href="https://bugs.freedesktop.org/show_bug.cgi?id=54193" target="_blank">https://bugs.freedesktop.org/show_bug.cgi?id=54193</a><br>
Signed-off-by: Kenneth Graunke <<a href="mailto:kenneth@whitecape.org">kenneth@whitecape.org</a>><br></blockquote><div><br>Reviewed-by: Paul Berry <<a href="mailto:stereotype441@gmail.com">stereotype441@gmail.com</a>><br>
</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
---<br>
src/mesa/drivers/dri/i965/brw_fs_visitor.cpp | 1 +<br>
1 file changed, 1 insertion(+)<br>
<br>
diff --git a/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp b/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp<br>
index e8f64b2..d3cbde3 100644<br>
--- a/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp<br>
+++ b/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp<br>
@@ -2277,6 +2277,7 @@ fs_visitor::fs_visitor(struct brw_wm_compile *c, struct gl_shader_program *prog,<br>
<br>
this->frag_depth = NULL;<br>
memset(this->outputs, 0, sizeof(this->outputs));<br>
+ memset(this->output_components, 0, sizeof(this->output_components));<br>
this->first_non_payload_grf = 0;<br>
this->max_grf = intel->gen >= 7 ? GEN7_MRF_HACK_START : BRW_MAX_GRF;<br>
<span class="HOEnZb"><font color="#888888"><br>
--<br>
1.7.11.4<br>
<br>
_______________________________________________<br>
mesa-dev mailing list<br>
<a href="mailto:mesa-dev@lists.freedesktop.org">mesa-dev@lists.freedesktop.org</a><br>
<a href="http://lists.freedesktop.org/mailman/listinfo/mesa-dev" target="_blank">http://lists.freedesktop.org/mailman/listinfo/mesa-dev</a><br>
</font></span></blockquote></div><br>