fix bad casts, carry over r200 fix to check for null program string in r300_translate...
authorBrian Paul <brian.paul@tungstengraphics.com>
Thu, 24 Aug 2006 22:05:35 +0000 (22:05 +0000)
committerBrian Paul <brian.paul@tungstengraphics.com>
Thu, 24 Aug 2006 22:05:35 +0000 (22:05 +0000)
src/mesa/drivers/dri/r300/r300_vertexprog.c

index 45b419d..e45300b 100644 (file)
@@ -98,7 +98,7 @@ static struct{
 int r300VertexProgUpdateParams(GLcontext *ctx, struct r300_vertex_program *vp, float *dst)
 {
        int pi;
-       struct gl_vertex_program *mesa_vp=(void *)vp;
+       struct gl_vertex_program *mesa_vp = &vp->mesa_program;
        float *dst_o=dst;
         struct gl_program_parameter_list *paramList;
        
@@ -386,7 +386,7 @@ static unsigned long op_operands(enum prog_opcode opcode)
 
 void r300_translate_vertex_shader(struct r300_vertex_program *vp)
 {
-       struct gl_vertex_program *mesa_vp=(void *)vp;
+       struct gl_vertex_program *mesa_vp= &vp->mesa_program;
        struct prog_instruction *vpi;
        int i, cur_reg=0;
        VERTEX_SHADER_INSTRUCTION *o_inst;
@@ -399,6 +399,9 @@ void r300_translate_vertex_shader(struct r300_vertex_program *vp)
        int u_temp_i=VSF_MAX_FRAGMENT_TEMPS-1;
        struct prog_src_register src[3];
 
+       if (!mesa_vp->Base.String)
+               return;
+
        if (getenv("R300_VP_SAFETY")) {
                WARN_ONCE("R300_VP_SAFETY enabled.\n");