[Mesa-dev] [PATCH 16/21] r200: Don't fallback to SW TNL for NV vertex programs

Ian Romanick idr at freedesktop.org
Sat Aug 27 00:57:06 PDT 2011


From: Ian Romanick <ian.d.romanick at intel.com>

As far as I (and piglit) can tell, this is the only remaining relevant
difference in the vertex program support for this driver.  Take the
same approach as the i965 driver: instruct the compiler to emit extra
instructions to initialize the temporaries to 0.0.  The only extra
instructions that won't get optimized away are the ones that actually
need to be there.

Cc: Alex Deucher <alexdeucher at gmail.com>
Cc: Dave Airlie <airlied at redhat.com>
---
 src/mesa/drivers/dri/r200/r200_context.c  |    6 ++++++
 src/mesa/drivers/dri/r200/r200_vertprog.c |    5 -----
 2 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/src/mesa/drivers/dri/r200/r200_context.c b/src/mesa/drivers/dri/r200/r200_context.c
index 456f7d8..9ebf099 100644
--- a/src/mesa/drivers/dri/r200/r200_context.c
+++ b/src/mesa/drivers/dri/r200/r200_context.c
@@ -290,6 +290,12 @@ GLboolean r200CreateContext( gl_api api,
 
    ctx->Const.MaxTextureMaxAnisotropy = 16.0;
 
+   /* Instruct the NV_vertex_program assembler to generate extra instructions
+    * to initialize all temporary registers to 0.0, as required by that spec.
+    */
+   ctx->ShaderCompilerOptions[MESA_SHADER_VERTEX].EmitNVTempInitialization =
+      GL_TRUE;
+
    /* No wide AA points.
     */
    ctx->Const.MinPointSize = 1.0;
diff --git a/src/mesa/drivers/dri/r200/r200_vertprog.c b/src/mesa/drivers/dri/r200/r200_vertprog.c
index cf44d7f..ee3ed2a 100644
--- a/src/mesa/drivers/dri/r200/r200_vertprog.c
+++ b/src/mesa/drivers/dri/r200/r200_vertprog.c
@@ -443,11 +443,6 @@ static GLboolean r200_translate_vertex_program(struct gl_context *ctx, struct r2
       return GL_FALSE;
    }
 
-   if (mesa_vp->IsNVProgram) {
-   /* subtle differences in spec like guaranteed initialized regs could cause
-      headaches. Might want to remove the driconf option to enable it completely */
-      return GL_FALSE;
-   }
    /* Initial value should be last tmp reg that hw supports.
       Strangely enough r300 doesnt mind even though these would be out of range.
       Smart enough to realize that it doesnt need it? */
-- 
1.7.4.4



More information about the mesa-dev mailing list