mesa: Avoid setting _NEW_VARYING_VP_INPUTS in non fixed function mode.
authorMathias Fröhlich <mathias.froehlich@web.de>
Sun, 12 May 2019 08:35:52 +0000 (10:35 +0200)
committerMathias Fröhlich <Mathias.Froehlich@gmx.net>
Tue, 14 May 2019 16:09:49 +0000 (18:09 +0200)
commitb4b1df5a1750e42307a18b660c6e162df5907535
tree20977c7d7658e786222220231e10875f107dba88
parent663f93c8691e09902376aec8901ff1df123d9f2a
mesa: Avoid setting _NEW_VARYING_VP_INPUTS in non fixed function mode.

Instead of checking the API variant on entry of set_varying_vp_inputs
to check if we can ever be interrested in fixed function processing
or not, we can check if we are actually fixed function processing.
To check this we can use the immediately updated
gl_context::VertexProgram._VPMode value that tells us if we have a
user provided shader program or if we are in fixed function processing
either through an internal TNL shader of directly through hardware.
When doing so, we also need to recheck the varying_vp_inputs variable
at the time gl_context::VertexProgram._VPMode is set to VP_MODE_FF.
Put asserts at the consumers of gl_context::varying_vp_inputs to make
sure gl_context::VertexProgram._VPMode is set to VP_MODE_FF. By that
gl_context::varying_vp_inputs should be up to date then.

By not looking at the opengl api for this decision we should actually
catch more cases where we can avoid setting a state change flag, including
the ones where we cannot get into VP_MODE_FF by the choice of the api.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Mathias Fröhlich <Mathias.Froehlich@web.de>
src/mesa/main/ff_fragment_shader.cpp
src/mesa/main/ffvertex_prog.c
src/mesa/main/state.c