Mesa (master): radeons: use dp4 for position invariant vertex programs

Roland Scheidegger sroland at kemper.freedesktop.org
Fri Jun 19 18:01:32 UTC 2009


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

Author: Roland Scheidegger <sroland at vmware.com>
Date:   Fri Jun 19 20:00:55 2009 +0200

radeons: use dp4 for position invariant vertex programs

Fixes #22181. R200 requires this since DP4 is used in hw tnl mode.
R300 prefers it (should be faster due to no instruction dependencies), but
both methods should be correct (when sw tcl is used though, MUL/MAD might
be faster). Probably doesn't make much difference for R100 since vertex progs
are executed in software anyway, but let's just keep it the same there too.

---

 src/mesa/drivers/dri/r200/r200_context.c     |    2 ++
 src/mesa/drivers/dri/r300/r300_context.c     |    2 ++
 src/mesa/drivers/dri/radeon/radeon_context.c |    2 ++
 3 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/src/mesa/drivers/dri/r200/r200_context.c b/src/mesa/drivers/dri/r200/r200_context.c
index 8924849..241390c 100644
--- a/src/mesa/drivers/dri/r200/r200_context.c
+++ b/src/mesa/drivers/dri/r200/r200_context.c
@@ -388,6 +388,8 @@ GLboolean r200CreateContext( const __GLcontextModes *glVisual,
 
    ctx->Const.MaxDrawBuffers = 1;
 
+   _mesa_set_mvp_with_dp4( ctx, GL_TRUE );
+
    /* Initialize the software rasterizer and helper modules.
     */
    _swrast_CreateContext( ctx );
diff --git a/src/mesa/drivers/dri/r300/r300_context.c b/src/mesa/drivers/dri/r300/r300_context.c
index 76881e4..7aa8075 100644
--- a/src/mesa/drivers/dri/r300/r300_context.c
+++ b/src/mesa/drivers/dri/r300/r300_context.c
@@ -410,6 +410,8 @@ GLboolean r300CreateContext(const __GLcontextModes * glVisual,
 
 	r300InitConstValues(ctx, screen);
 
+	_mesa_set_mvp_with_dp4( ctx, GL_TRUE );
+
 	/* Initialize the software rasterizer and helper modules.
 	 */
 	_swrast_CreateContext(ctx);
diff --git a/src/mesa/drivers/dri/radeon/radeon_context.c b/src/mesa/drivers/dri/radeon/radeon_context.c
index 8f780c4..229b438 100644
--- a/src/mesa/drivers/dri/radeon/radeon_context.c
+++ b/src/mesa/drivers/dri/radeon/radeon_context.c
@@ -316,6 +316,8 @@ r100CreateContext( const __GLcontextModes *glVisual,
 
    ctx->Const.MaxDrawBuffers = 1;
 
+   _mesa_set_mvp_with_dp4( ctx, GL_TRUE );
+
    /* Initialize the software rasterizer and helper modules.
     */
    _swrast_CreateContext( ctx );




More information about the mesa-commit mailing list