st/mesa: implement "zombie" shaders list
authorBrian Paul <brianp@vmware.com>
Tue, 12 Mar 2019 22:01:56 +0000 (16:01 -0600)
committerBrian Paul <brianp@vmware.com>
Mon, 18 Mar 2019 02:07:22 +0000 (20:07 -0600)
commit41c4c49463f65cd6c564b2a66634ba6572a824fb
tree3c1850d8cdd5602aa9e4ce3f92336f64576e0ef7
parent593e36f9561d3665cc12ed1fc8a07dd8612c004e
st/mesa: implement "zombie" shaders list

As with the preceding patch for sampler views, this patch does
basically the same thing but for shaders.  However, reference counting
isn't needed here (instead of calling cso_delete_XXX_shader() we call
st_save_zombie_shader().

The Redway3D Watch is one app/demo that needs this change.  Otherwise,
the vmwgfx driver generates an error about trying to destroy a shader
ID that doesn't exist in the context.

Note that if PIPE_CAP_SHAREABLE_SHADERS = TRUE, then we can use/delete
any shader with any context and this mechanism is not used.

Tested with: google-chrome, google earth, Redway3D Watch/Turbine demos
and a few Linux games.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Reviewed-by: Neha Bhende <bhenden@vmware.com>
Reviewed-by: Mathias Fröhlich <Mathias.Froehlich@web.de>
Reviewed-By: Jose Fonseca <jfonseca@vmware.com>
src/mesa/state_tracker/st_context.c
src/mesa/state_tracker/st_context.h
src/mesa/state_tracker/st_program.c