[Mesa-dev] [PATCH 8/9] st/mesa: update sampler states when shaders are changed

Marek Olšák maraeo at gmail.com
Mon Jul 18 13:11:54 UTC 2016


From: Marek Olšák <marek.olsak at amd.com>

This bug seems to have always been there. Applications changing shaders
but not textures between draw calls would have gotten undefined behavior.
---
 src/mesa/state_tracker/st_atom.h | 18 ++++++++++++------
 1 file changed, 12 insertions(+), 6 deletions(-)

diff --git a/src/mesa/state_tracker/st_atom.h b/src/mesa/state_tracker/st_atom.h
index 961c395..febd7ce 100644
--- a/src/mesa/state_tracker/st_atom.h
+++ b/src/mesa/state_tracker/st_atom.h
@@ -97,7 +97,8 @@ enum {
                                  ST_NEW_VS_SSBOS | \
                                  ST_NEW_VERTEX_ARRAYS | \
                                  ST_NEW_CLIP_STATE | \
-                                 ST_NEW_RASTERIZER)
+                                 ST_NEW_RASTERIZER | \
+                                 ST_NEW_RENDER_SAMPLERS)
 
 #define ST_NEW_TCS_RESOURCES    (ST_NEW_TCS_SAMPLER_VIEWS | \
                                  ST_NEW_TCS_IMAGES | \
@@ -107,7 +108,8 @@ enum {
                                  ST_NEW_TCS_SSBOS)
 
 #define ST_NEW_TESSCTRL_PROGRAM (ST_NEW_TCS_STATE | \
-                                 ST_NEW_TCS_RESOURCES)
+                                 ST_NEW_TCS_RESOURCES | \
+                                 ST_NEW_RENDER_SAMPLERS)
 
 #define ST_NEW_TES_RESOURCES    (ST_NEW_TES_SAMPLER_VIEWS | \
                                  ST_NEW_TES_IMAGES | \
@@ -118,7 +120,8 @@ enum {
 
 #define ST_NEW_TESSEVAL_PROGRAM (ST_NEW_TES_STATE | \
                                  ST_NEW_TES_RESOURCES | \
-                                 ST_NEW_RASTERIZER)
+                                 ST_NEW_RASTERIZER | \
+                                 ST_NEW_RENDER_SAMPLERS)
 
 #define ST_NEW_GS_RESOURCES     (ST_NEW_GS_SAMPLER_VIEWS | \
                                  ST_NEW_GS_IMAGES | \
@@ -129,7 +132,8 @@ enum {
 
 #define ST_NEW_GEOMETRY_PROGRAM (ST_NEW_GS_STATE | \
                                  ST_NEW_GS_RESOURCES | \
-                                 ST_NEW_RASTERIZER)
+                                 ST_NEW_RASTERIZER | \
+                                 ST_NEW_RENDER_SAMPLERS)
 
 #define ST_NEW_FRAGMENT_PROGRAM (ST_NEW_FS_STATE | \
                                  ST_NEW_FS_SAMPLER_VIEWS | \
@@ -138,7 +142,8 @@ enum {
                                  ST_NEW_FS_UBOS | \
                                  ST_NEW_FS_ATOMICS | \
                                  ST_NEW_FS_SSBOS | \
-                                 ST_NEW_SAMPLE_SHADING)
+                                 ST_NEW_SAMPLE_SHADING | \
+                                 ST_NEW_RENDER_SAMPLERS)
 
 #define ST_NEW_COMPUTE_PROGRAM  (ST_NEW_CS_STATE | \
                                  ST_NEW_CS_SAMPLER_VIEWS | \
@@ -146,7 +151,8 @@ enum {
                                  ST_NEW_CS_CONSTANTS | \
                                  ST_NEW_CS_UBOS | \
                                  ST_NEW_CS_ATOMICS | \
-                                 ST_NEW_CS_SSBOS)
+                                 ST_NEW_CS_SSBOS | \
+                                 ST_NEW_CS_SAMPLERS)
 
 #define ST_NEW_CONSTANTS        (ST_NEW_VS_CONSTANTS | \
                                  ST_NEW_TCS_CONSTANTS | \
-- 
2.7.4



More information about the mesa-dev mailing list