Skip ARL while we dont implement it. Fix broken nv vps but do it with software for...
authorAapo Tahkola <aet@rasterburn.org>
Thu, 16 Feb 2006 19:50:40 +0000 (19:50 +0000)
committerAapo Tahkola <aet@rasterburn.org>
Thu, 16 Feb 2006 19:50:40 +0000 (19:50 +0000)
src/mesa/drivers/dri/r300/r300_vertexprog.c

index aff5d793d2b2f6b9b0c09e9498aa1a0878cb8c6e..60d580a5f2aca4fe546f675e985828a5f28758cb 100644 (file)
@@ -107,19 +107,21 @@ int r300VertexProgUpdateParams(GLcontext *ctx, struct r300_vertex_program *vp, f
        float *dst_o=dst;
         struct program_parameter_list *paramList;
        
-       _mesa_load_state_parameters(ctx, mesa_vp->Base.Parameters);
-       if (mesa_vp->Base.Parameters == NULL) {
-               static int once=0;
-               
-               WARN_ONCE("mesa_vp->Base.Parameters NULL\n");
+       if (mesa_vp->IsNVProgram) {
+               _mesa_init_vp_per_primitive_registers(ctx);
                
-               if (once == 0) {
-                       _mesa_print_program(&vp->mesa_program.Base);
-                       once++;
+               for (pi=0; pi < MAX_NV_VERTEX_PROGRAM_PARAMS; pi++) {
+                       *dst++=ctx->VertexProgram.Parameters[pi][0];
+                       *dst++=ctx->VertexProgram.Parameters[pi][1];
+                       *dst++=ctx->VertexProgram.Parameters[pi][2];
+                       *dst++=ctx->VertexProgram.Parameters[pi][3];
                }
-               return 0;
+               return dst - dst_o;
        }
        
+       assert(mesa_vp->Base.Parameters);
+       _mesa_load_state_parameters(ctx, mesa_vp->Base.Parameters);
+       
        if(mesa_vp->Base.Parameters->NumParameters * 4 > VSF_MAX_FRAGMENT_LENGTH){
                fprintf(stderr, "%s:Params exhausted\n", __FUNCTION__);
                exit(-1);
@@ -867,6 +869,9 @@ void translate_vertex_shader(struct r300_vertex_program *vp)
                        goto next;
 
                case OPCODE_ARL:
+                       WARN_ONCE("ARL not implemented yet!\n");
+                       goto next;
+                       
                case OPCODE_RCC:
                        fprintf(stderr, "Dont know how to handle op %d yet\n", vpi->Opcode);
                        exit(-1);
@@ -949,5 +954,8 @@ void translate_vertex_shader(struct r300_vertex_program *vp)
                vp->translated=GL_TRUE;
                vp->native = GL_TRUE;
        }
+       
+       if (mesa_vp->IsNVProgram)
+               vp->native = GL_FALSE;
 }