From: Ian Romanick <ian.d.roman...@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 <alexdeuc...@gmail.com>
Cc: Dave Airlie <airl...@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

_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to