st/mesa: update sampler states when shaders are changed
authorMarek Olšák <marek.olsak@amd.com>
Sun, 17 Jul 2016 19:37:58 +0000 (21:37 +0200)
committerMarek Olšák <marek.olsak@amd.com>
Sat, 30 Jul 2016 13:02:14 +0000 (15:02 +0200)
This bug seems to have always been there. Applications changing shaders
but not textures between draw calls would have gotten undefined behavior.

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
src/mesa/state_tracker/st_atom.h

index 961c395b89db6eafaf46576cee7abd5eba1bc7e2..febd7ce6596bc998005c98d597eb5766ca197c00 100644 (file)
@@ -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 | \