diff options
Diffstat (limited to 'src/mesa/state_tracker')
-rw-r--r-- | src/mesa/state_tracker/st_atom_shader.c | 5 | ||||
-rw-r--r-- | src/mesa/state_tracker/st_program.c | 9 |
2 files changed, 8 insertions, 6 deletions
diff --git a/src/mesa/state_tracker/st_atom_shader.c b/src/mesa/state_tracker/st_atom_shader.c index 0a905fb563..8aa977179a 100644 --- a/src/mesa/state_tracker/st_atom_shader.c +++ b/src/mesa/state_tracker/st_atom_shader.c @@ -57,6 +57,8 @@ */ struct translated_vertex_program { + struct st_vertex_program *master; + /** The fragment shader "signature" this vertex shader is meant for: */ GLbitfield frag_inputs; @@ -183,7 +185,7 @@ find_translated_vp(struct st_context *st, * XXX This could be a hash lookup, using InputsRead as the key. */ for (xvp = stfp->vertex_programs; xvp; xvp = xvp->next) { - if (xvp->frag_inputs == fragInputsRead) { + if (xvp->master == stvp && xvp->frag_inputs == fragInputsRead) { break; } } @@ -192,6 +194,7 @@ find_translated_vp(struct st_context *st, if (!xvp) { xvp = CALLOC_STRUCT(translated_vertex_program); xvp->frag_inputs = fragInputsRead; + xvp->master = stvp; xvp->next = stfp->vertex_programs; stfp->vertex_programs = xvp; diff --git a/src/mesa/state_tracker/st_program.c b/src/mesa/state_tracker/st_program.c index a41b953a21..a00f296d15 100644 --- a/src/mesa/state_tracker/st_program.c +++ b/src/mesa/state_tracker/st_program.c @@ -281,12 +281,11 @@ st_translate_fragment_program(struct st_context *st, GLuint attr; GLbitfield inputsRead = stfp->Base.Base.InputsRead; - /* Check if all fragment programs need the fragment position (in order - * to do perspective-corrected interpolation). + /* For software rendering, we always need the fragment input position + * in order to calculate interpolated values. + * For i915, we always want to emit the semantic info for position. */ - /* XXX temporary! */ - if (st->pipe->get_param(st->pipe, PIPE_PARAM_FS_NEEDS_POS)) - inputsRead |= FRAG_BIT_WPOS; + inputsRead |= FRAG_BIT_WPOS; memset(&fs, 0, sizeof(fs)); |