diff options
author | Mathias Fröhlich <[email protected]> | 2018-02-02 21:31:27 +0100 |
---|---|---|
committer | Mathias Fröhlich <[email protected]> | 2018-02-23 05:33:30 +0100 |
commit | 92d76a169127a6b8b4e2027a95425b592d0ca3db (patch) | |
tree | 59bda0fe66dd075475717cf249fa9c797fff2b9e /src/mesa/main/shaderapi.c | |
parent | d73f1f2ad879d0c6712931b75f2bfb995c2c9fcb (diff) |
mesa: Provide an alternative to get_vp_mode()
To get equivalent information than get_vp_mode(), track the vertex
processing mode in a per context variable at
gl_vertex_program_state::_VPMode.
This aims to replace get_vp_mode() as seen in the vbo module.
But instead of the get_vp_mode() implementation which only gives correct
answers past calling _mesa_update_state() this context variable is
immediately tracked when the vertex processing state is modified. The
correctness of this value is asserted on state validation.
With this in place we should be able to untangle the dependency with
varying_vp_inputs and state invalidation.
Signed-off-by: Mathias Fröhlich <[email protected]>
Reviewed-by: Brian Paul <[email protected]>
Diffstat (limited to 'src/mesa/main/shaderapi.c')
-rw-r--r-- | src/mesa/main/shaderapi.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/mesa/main/shaderapi.c b/src/mesa/main/shaderapi.c index d0d2ef9a0f0..d8a3031a386 100644 --- a/src/mesa/main/shaderapi.c +++ b/src/mesa/main/shaderapi.c @@ -50,6 +50,7 @@ #include "main/program_binary.h" #include "main/shaderapi.h" #include "main/shaderobj.h" +#include "main/state.h" #include "main/transformfeedback.h" #include "main/uniforms.h" #include "compiler/glsl/glsl_parser_extras.h" @@ -1258,6 +1259,8 @@ link_program(struct gl_context *ctx, struct gl_shader_program *shProg, shProg->Name, shProg->data->InfoLog); } + _mesa_update_vertex_processing_mode(ctx); + /* debug code */ if (0) { GLuint i; @@ -2432,6 +2435,8 @@ _mesa_use_program(struct gl_context *ctx, gl_shader_stage stage, &shTarget->ReferencedPrograms[stage], shProg); _mesa_reference_program(ctx, target, prog); + if (stage == MESA_SHADER_VERTEX) + _mesa_update_vertex_processing_mode(ctx); return; } |