diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h index 6096bcb9328..c86bb603bec 100644 --- a/src/mesa/main/mtypes.h +++ b/src/mesa/main/mtypes.h @@ -2187,11 +2187,7 @@ struct gl_program /** Map from sampler unit to texture unit (set by glUniform1i()) */ GLubyte SamplerUnits[MAX_SAMPLERS]; - /* FIXME: We should be able to make this struct a union. However some - * drivers (i915/fragment_programs, swrast/prog_execute) mix the use of - * these fields, we should fix this. - */ - struct { + union { /** Fields used by GLSL programs */ struct { /** Data shared by gl_program and gl_shader_program */ diff --git a/src/mesa/state_tracker/st_program.c b/src/mesa/state_tracker/st_program.c index b8b0c760d6c..45554b99a11 100644 --- a/src/mesa/state_tracker/st_program.c +++ b/src/mesa/state_tracker/st_program.c @@ -588,11 +588,11 @@ st_translate_vertex_program(struct st_context *st, ubyte output_semantic_name[VARYING_SLOT_MAX] = {0}; ubyte output_semantic_index[VARYING_SLOT_MAX] = {0}; - if (stp->Base.arb.IsPositionInvariant) - _mesa_insert_mvp_code(st->ctx, &stp->Base); - /* ARB_vp: */ if (!stp->glsl_to_tgsi) { + if (stp->Base.arb.IsPositionInvariant) + _mesa_insert_mvp_code(st->ctx, &stp->Base); + _mesa_remove_output_reads(&stp->Base, PROGRAM_OUTPUT); /* This determines which states will be updated when the assembly