diff options
author | Kenneth Graunke <[email protected]> | 2012-09-10 13:42:20 -0700 |
---|---|---|
committer | Kenneth Graunke <[email protected]> | 2012-09-10 13:42:20 -0700 |
commit | 77e711cfca1a1e8908be7e4a744b2306094c65e0 (patch) | |
tree | 0bcb58a8cf19cbad567b07e39847950fc7942820 | |
parent | d788066575828ecd7e9bf6dacc705b50612c6406 (diff) |
i965/fs: Initialize output_components[] by filling it with zeros.
Prior to commit afaf5b59e, emit_fb_writes() looped from 0 to 3, writing
all four components of a vec4 color output. However, that broke for
smaller output types (float, vec2, or vec3). To fix that, I introduced
a new variable (output_components[]) containing the size of the output
type for each render target.
Unfortunately, I forgot to actually initialize it in the constructor,
which meant that unless a shader wrote to gl_FragColor, or the specific
output for each render target, output_components would contain a garbage
value, and we'd loop for a completely non-deterministic amount of time.
Not actually emitting any color writes seems like the right approach.
We may still need to emit a render target write (to terminate the
thread), but don't have to put in any sensible values (the shader didn't
write anything, after all).
Fixes a regression since afaf5b59e45b914be39e141209ed71308039774d.
Backported from master commit 6928bea7ca1f2ed308d8255c6816f44467306255.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=54193
Signed-off-by: Kenneth Graunke <[email protected]>
Reviewed-by: Paul Berry <[email protected]>
Tested-by: Ian Romanick <[email protected]>
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_fs.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_fs.h b/src/mesa/drivers/dri/i965/brw_fs.h index bb42de14ac3..f557138a49a 100644 --- a/src/mesa/drivers/dri/i965/brw_fs.h +++ b/src/mesa/drivers/dri/i965/brw_fs.h @@ -410,6 +410,7 @@ public: this->frag_depth = NULL; memset(this->outputs, 0, sizeof(this->outputs)); + memset(this->output_components, 0, sizeof(this->output_components)); this->first_non_payload_grf = 0; this->max_grf = intel->gen >= 7 ? GEN7_MRF_HACK_START : BRW_MAX_GRF; |