From: Brian Paul Date: Thu, 24 Aug 2006 22:05:35 +0000 (+0000) Subject: fix bad casts, carry over r200 fix to check for null program string in r300_translate... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=beb32c4a5905d2a5347f49d2941e8340d6959206;p=mesa.git fix bad casts, carry over r200 fix to check for null program string in r300_translate_vertex_shader() --- diff --git a/src/mesa/drivers/dri/r300/r300_vertexprog.c b/src/mesa/drivers/dri/r300/r300_vertexprog.c index 45b419d04ec..e45300b106b 100644 --- a/src/mesa/drivers/dri/r300/r300_vertexprog.c +++ b/src/mesa/drivers/dri/r300/r300_vertexprog.c @@ -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");