summaryrefslogtreecommitdiffstats
path: root/src/mesa/state_tracker/st_texture.h
diff options
context:
space:
mode:
authorBrian Paul <brianp@vmware.com>2016-09-30 16:41:46 -0600
committerBrian Paul <brianp@vmware.com>2016-10-06 11:29:32 -0600
commite5cc84dd43be066c1dd418e32f5ad258e31a150a (patch)
treefc693054ebad7517d3c63f1796e3bbc9b68e63b9 /src/mesa/state_tracker/st_texture.h
parent0f3aee888efa820cb9875cfebc83cf8cc855f599 (diff)
downloadexternal_mesa3d-e5cc84dd43be066c1dd418e32f5ad258e31a150a.zip
external_mesa3d-e5cc84dd43be066c1dd418e32f5ad258e31a150a.tar.gz
external_mesa3d-e5cc84dd43be066c1dd418e32f5ad258e31a150a.tar.bz2
st/mesa: optimize pipe_sampler_view validation
Before, st_get_texture_sampler_view_from_stobj() did a lot of work to check if the texture parameters matched the sampler view (format, swizzle, min/max lod, first/last layer, etc). We did this every time we validated the texture state. Now, we use a ctx->Driver.TexParameter() callback and a couple other checks to proactively release texture views when we know that view-related parameters have changed. Then, the validation step is simplified: - Search the texture's list of sampler views (just match the context). - If found, we're done. - Else, create a new sampler view. There will never be old, out-of-date sampler views attached to texture objects that we have to test. Most apps create textures and set the texture parameters once. This make sampler view validation much cheaper for that case. Note that the old texture/sampler comparison code has been converted into a set of assertions to verify that the sampler view is in fact consistent with the texture parameters. This should help to spot any potential regressions. Reviewed-by: Edward O'Callaghan <funfunctor@folklore1984.net> Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com> Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Diffstat (limited to 'src/mesa/state_tracker/st_texture.h')
-rw-r--r--src/mesa/state_tracker/st_texture.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/mesa/state_tracker/st_texture.h b/src/mesa/state_tracker/st_texture.h
index d2c4f3f..9c9a05b 100644
--- a/src/mesa/state_tracker/st_texture.h
+++ b/src/mesa/state_tracker/st_texture.h
@@ -107,6 +107,11 @@ struct st_texture_object
* views and surfaces instead of pt->format.
*/
enum pipe_format surface_format;
+
+ /** The glsl version of the shader seen during the previous validation */
+ unsigned prev_glsl_version;
+ /** The value of the sampler's sRGBDecode state at the previous validation */
+ GLenum prev_sRGBDecode;
};