mesa: optimize set_varying_vp_inputs by precomputing the conditions

set_varying_vp_inputs is called every draw call, which checks
_Maintain*Program. Let's move that checking out of there.

This adds a new flag that determines whether set_varying_vp_inputs
should do anything.

All code that changes _Maintain*Program must now reinitialize the new
flag. This is done by new function _mesa_reset_vertex_processing_mode.

Reviewed-by: Zoltán Böszörményi <zboszor@gmail.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8798>
This commit is contained in:
Marek Olšák
2021-01-25 16:47:38 -05:00
committed by Marge Bot
parent 4cea48437d
commit 99e25d183d
9 changed files with 33 additions and 14 deletions

View File

@@ -35,6 +35,7 @@
#include "main/hash.h"
#include "main/macros.h"
#include "main/shaderobj.h"
#include "main/state.h"
#include "program.h"
#include "prog_cache.h"
#include "prog_parameter.h"
@@ -100,7 +101,7 @@ _mesa_init_program(struct gl_context *ctx)
ctx->Shared->DefaultFragmentProgram);
assert(ctx->FragmentProgram.Current);
ctx->FragmentProgram.Cache = _mesa_new_program_cache();
ctx->VertexProgram._VPMode = VP_MODE_FF;
_mesa_reset_vertex_processing_mode(ctx);
/* XXX probably move this stuff */
ctx->ATIFragmentShader.Enabled = GL_FALSE;