aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/state_tracker/st_texture.h
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2016-09-30 16:41:46 -0600
committerBrian Paul <[email protected]>2016-10-06 11:29:32 -0600
commite5cc84dd43be066c1dd418e32f5ad258e31a150a (patch)
treefc693054ebad7517d3c63f1796e3bbc9b68e63b9 /src/mesa/state_tracker/st_texture.h
parent0f3aee888efa820cb9875cfebc83cf8cc855f599 (diff)
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 <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
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 d2c4f3f880c..9c9a05b5605 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;
};