Mesa (master): i965/fs: Guess nr_color_regions better in precompile

Chris Forbes chrisf at kemper.freedesktop.org
Wed Feb 5 21:57:56 UTC 2014


Module: Mesa
Branch: master
Commit: 046f8d8a6fcae641ed0e7e06e24ab5da39a57c86
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=046f8d8a6fcae641ed0e7e06e24ab5da39a57c86

Author: Chris Forbes <chrisf at ijw.co.nz>
Date:   Sun Jan 26 11:03:33 2014 +1300

i965/fs: Guess nr_color_regions better in precompile

Signed-off-by: Chris Forbes <chrisf at ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>

---

 src/mesa/drivers/dri/i965/brw_fs.cpp |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp b/src/mesa/drivers/dri/i965/brw_fs.cpp
index d7301dd..c2fa06b 100644
--- a/src/mesa/drivers/dri/i965/brw_fs.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs.cpp
@@ -3590,7 +3590,9 @@ brw_fs_precompile(struct gl_context *ctx, struct gl_shader_program *prog)
       key.render_to_fbo = _mesa_is_user_fbo(ctx->DrawBuffer);
    }
 
-   key.nr_color_regions = 1;
+   key.nr_color_regions = _mesa_bitcount_64(fp->Base.OutputsWritten &
+         ~(BITFIELD64_BIT(FRAG_RESULT_DEPTH) |
+         BITFIELD64_BIT(FRAG_RESULT_SAMPLE_MASK)));
 
    /* GL_FRAGMENT_SHADER_DERIVATIVE_HINT is almost always GL_DONT_CARE.  The
     * quality of the derivatives is likely to be determined by the driconf




More information about the mesa-commit mailing list