st/mesa: don't mark the program as in cache_fallback when there is cache miss
authorTimothy Arceri <tarceri@itsqueeze.com>
Thu, 18 May 2017 05:10:08 +0000 (15:10 +1000)
committerTimothy Arceri <tarceri@itsqueeze.com>
Fri, 19 May 2017 22:35:51 +0000 (08:35 +1000)
commit80e643345ed0d8d3263b4ee23dd2998f0da170a8
treed7c837a0f6d1e105bbd68cfb932dd2647d60a81d
parenta74300c7ff256b417079134f7bd9aea91153025b
st/mesa: don't mark the program as in cache_fallback when there is cache miss

When we fallback currently the gl_program objects are re-allocated.

This is likely to change when the i965 cache lands, but for now
this fixes a crash when using MESA_GLSL=cache_fb. This env var
simulates the fallback path taken when a tgsi cache item doesn't
exist due to being evicted previously or some kind of error.

Unlike i965 we are always falling back at link time so it's safe to
just re-allocate everything. We will be unnecessarily freeing and
re-allocate a bunch of things here but it's probably not a huge deal,
and can be changed when the i965 code lands.

Fixes: 0e9991f957e2 ("glsl: don't reference shader prog data during cache fallback")
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
src/compiler/glsl/shader_cache.cpp
src/mesa/main/mtypes.h
src/mesa/state_tracker/st_shader_cache.c