Mesa (master): i965/vs: Set the PreferDP4 shader compiler option.

Kenneth Graunke kwg at kemper.freedesktop.org
Mon May 13 06:38:38 UTC 2013


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

Author: Kenneth Graunke <kenneth at whitecape.org>
Date:   Wed Apr 17 17:30:24 2013 -0700

i965/vs: Set the PreferDP4 shader compiler option.

Doing matrix multiplies with DP4s is fewer instructions than MUL/ADD,
especially since we don't support MAD in the vertex shader.

Not observed to improve performance in any fixed function applications,
but is useful for the next patch.

I've left this unset for the fragment shader because the scalar backend
can't use DP4 and does have MAD support.

Signed-off-by: Kenneth Graunke <kenneth at whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick at intel.com>
Reviewed-by: Eric Anholt <eric at anholt.net>

---

 src/mesa/drivers/dri/i965/brw_context.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/brw_context.c b/src/mesa/drivers/dri/i965/brw_context.c
index 745a117..69b7e4d 100644
--- a/src/mesa/drivers/dri/i965/brw_context.c
+++ b/src/mesa/drivers/dri/i965/brw_context.c
@@ -232,6 +232,8 @@ brwCreateContext(int api,
       ctx->ShaderCompilerOptions[i].LowerClipDistance = true;
    }
 
+   ctx->ShaderCompilerOptions[MESA_SHADER_VERTEX].PreferDP4 = true;
+
    ctx->Const.VertexProgram.MaxNativeInstructions = (16 * 1024);
    ctx->Const.VertexProgram.MaxAluInstructions = 0;
    ctx->Const.VertexProgram.MaxTexInstructions = 0;




More information about the mesa-commit mailing list