Merge remote-tracking branch 'origin/master' into pipe-video
[mesa.git] / src / gallium / drivers / softpipe / sp_state_derived.c
index 4c6d4909f5baa08e19bd0e1052de447fe80b5d5c..f9590eb0b24c97b3799d03712da7e1d5cf66f059 100644 (file)
@@ -197,11 +197,11 @@ update_tgsi_samplers( struct softpipe_context *softpipe )
 {
    unsigned i;
 
-   softpipe_reset_sampler_varients( softpipe );
+   softpipe_reset_sampler_variants( softpipe );
 
    for (i = 0; i < PIPE_MAX_SAMPLERS; i++) {
-      struct softpipe_tex_tile_cache *tc = softpipe->tex_cache[i];
-      if (tc->texture) {
+      struct softpipe_tex_tile_cache *tc = softpipe->fragment_tex_cache[i];
+      if (tc && tc->texture) {
          struct softpipe_resource *spt = softpipe_resource(tc->texture);
          if (spt->timestamp != tc->timestamp) {
            sp_tex_tile_cache_validate_texture( tc );
@@ -216,7 +216,20 @@ update_tgsi_samplers( struct softpipe_context *softpipe )
    for (i = 0; i < PIPE_MAX_VERTEX_SAMPLERS; i++) {
       struct softpipe_tex_tile_cache *tc = softpipe->vertex_tex_cache[i];
 
-      if (tc->texture) {
+      if (tc && tc->texture) {
+         struct softpipe_resource *spt = softpipe_resource(tc->texture);
+
+         if (spt->timestamp != tc->timestamp) {
+           sp_tex_tile_cache_validate_texture(tc);
+            tc->timestamp = spt->timestamp;
+         }
+      }
+   }
+
+   for (i = 0; i < PIPE_MAX_GEOMETRY_SAMPLERS; i++) {
+      struct softpipe_tex_tile_cache *tc = softpipe->geometry_tex_cache[i];
+
+      if (tc && tc->texture) {
          struct softpipe_resource *spt = softpipe_resource(tc->texture);
 
          if (spt->timestamp != tc->timestamp) {