summaryrefslogtreecommitdiffstats
path: root/src/mesa/state_tracker/st_texture.h
diff options
context:
space:
mode:
authorNicolai Hähnle <[email protected]>2017-10-05 14:08:04 +0200
committerNicolai Hähnle <[email protected]>2017-10-11 23:16:20 +0200
commitbce3055c69b9fddf951fa1d80fc5894570fc00a3 (patch)
tree2839555171b19cacd3634db52b459b9fbef9a6a7 /src/mesa/state_tracker/st_texture.h
parente4848053528ee108755652acc9763f904677bfd3 (diff)
st/mesa: store state that affects sampler views per context
This fixes sequences like: 1. Context 1 samples from texture with sRGB decode enabled 2. Context 2 samples from texture with sRGB decode disabled 3. Context 1 samples from texture with sRGB decode disabled Previously, step 3 would see the prev_sRGBDecode value from context 2 and would incorrectly use the old sampler view with sRGB decode enabled. 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.h20
1 files changed, 14 insertions, 6 deletions
diff --git a/src/mesa/state_tracker/st_texture.h b/src/mesa/state_tracker/st_texture.h
index ea459bf6e24..4f41aac53cf 100644
--- a/src/mesa/state_tracker/st_texture.h
+++ b/src/mesa/state_tracker/st_texture.h
@@ -49,6 +49,19 @@ struct st_texture_image_transfer {
/**
+ * Container for one context's validated sampler view.
+ */
+struct st_sampler_view {
+ struct pipe_sampler_view *view;
+
+ /** The glsl version of the shader seen during validation */
+ bool glsl130_or_later;
+ /** The value of the sampler's sRGBDecode state during validation */
+ GLenum sRGBDecode;
+};
+
+
+/**
* Subclass of gl_texure_image.
*/
struct st_texture_image
@@ -98,7 +111,7 @@ struct st_texture_object
/* Array of sampler views (one per context) attached to this texture
* object. Created lazily on first binding in context.
*/
- struct pipe_sampler_view **sampler_views;
+ struct st_sampler_view *sampler_views;
/* True if this texture comes from the window system. Such a texture
* cannot be reallocated and the format can only be changed with a sampler
@@ -129,11 +142,6 @@ struct st_texture_object
*/
uint layer_override;
- /** The glsl version of the shader seen during the previous validation */
- bool prev_glsl130_or_later;
- /** The value of the sampler's sRGBDecode state at the previous validation */
- GLenum prev_sRGBDecode;
-
/**
* Set when the texture images of this texture object might not all be in
* the pipe_resource *pt above.