This fixes a performance issue with the shader cache that delayed Gallium
shader create calls until draw calls.
I'd like this in stable, but it's not a showstopper.
Cc: 17.1 <mesa-stable@lists.freedesktop.org>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
*/
#include <stdio.h>
-
+#include "st_debug.h"
#include "st_program.h"
#include "st_shader_cache.h"
#include "compiler/glsl/program.h"
_mesa_associate_uniform_storage(ctx, prog, glprog->Parameters,
false);
+ /* Create Gallium shaders now instead of on demand. */
+ if (ST_DEBUG & DEBUG_PRECOMPILE ||
+ st->shader_has_one_variant[glprog->info.stage])
+ st_precompile_shader_variant(st, glprog);
+
free(buffer);
} else {
/* Failed to find a matching cached shader so fallback to recompile.