[4/6] mesa: Fix test for setting the _NEW_VARYING_VP_INPUTS flag.

Submitted by Mathias Fröhlich on May 12, 2019, 1:05 p.m.

Details

Message ID d17df8a33c143504c5a409bd340734297be1fc22.1557653318.git.Mathias.Froehlich@gmx.net
State New
Headers show
Series "Update mesa state handling past VAO changes." ( rev: 1 ) in Mesa

Not browsing as part of any series.

Commit Message

Mathias Fröhlich May 12, 2019, 1:05 p.m.
From: Mathias Fröhlich <mathias.froehlich@web.de>

The precondition stated in the comment is not true. The values mentioned are
only set from _mesa_update_state which in turn may not yet be called.
For now set the _NEW_VARYING_VP_INPUTS flag a bit more often, we will narrow
that down to a minimum again in a later patch.

Signed-off-by: Mathias Fröhlich <Mathias.Froehlich@web.de>
---
 src/mesa/main/state.c | 11 +++--------
 1 file changed, 3 insertions(+), 8 deletions(-)

--
2.21.0

Patch hide | download patch | download mbox

diff --git a/src/mesa/main/state.c b/src/mesa/main/state.c
index 217232bcdad..3ca6f58c6a6 100644
--- a/src/mesa/main/state.c
+++ b/src/mesa/main/state.c
@@ -430,14 +430,9 @@  set_varying_vp_inputs(struct gl_context *ctx, GLbitfield varying_inputs)
    if (ctx->varying_vp_inputs != varying_inputs) {
       ctx->varying_vp_inputs = varying_inputs;

-      /* Only the fixed-func generated programs need to use the flag
-       * and the fixed-func fragment program uses it only if there is also
-       * a fixed-func vertex program, so this only depends on the latter.
-       *
-       * It's okay to check the VP pointer here, because this is called after
-       * _mesa_update_state in the vbo module. */
-      if (ctx->VertexProgram._TnlProgram ||
-          ctx->FragmentProgram._TexEnvProgram) {
+      /* Only fixed-func generated programs ever use varying_vp_inputs. */
+      if (ctx->VertexProgram._MaintainTnlProgram ||
+          ctx->FragmentProgram._MaintainTexEnvProgram) {
          ctx->NewState |= _NEW_VARYING_VP_INPUTS;
       }
       /*printf("%s %x\n", __func__, varying_inputs);*/