mesa/swrast: fix GL_TEXTURE_2D_ARRAY texture fetches for latc/rgtc formats
[mesa.git] / src / mesa / swrast / s_context.c
index 63350b2e798838bf7b49c4f81b7cd41e1f003865..4ed7b94c7bf0831665a20b1d9e7a505dfedf0d23 100644 (file)
@@ -30,6 +30,7 @@
 #include "main/bufferobj.h"
 #include "main/colormac.h"
 #include "main/mtypes.h"
+#include "main/samplerobj.h"
 #include "main/teximage.h"
 #include "program/prog_parameter.h"
 #include "program/prog_statevars.h"
@@ -312,7 +313,7 @@ _swrast_update_specular_vertex_add(struct gl_context *ctx)
                               _SWRAST_NEW_RASTERMASK|          \
                               _NEW_LIGHT|                      \
                               _NEW_FOG |                       \
-                             _DD_NEW_SEPARATE_SPECULAR)
+                             _MESA_NEW_SEPARATE_SPECULAR)
 
 #define _SWRAST_NEW_LINE (_SWRAST_NEW_DERIVED |                \
                          _NEW_RENDERMODE|              \
@@ -321,7 +322,7 @@ _swrast_update_specular_vertex_add(struct gl_context *ctx)
                           _NEW_LIGHT|                  \
                           _NEW_FOG|                    \
                           _NEW_DEPTH |                 \
-                          _DD_NEW_SEPARATE_SPECULAR)
+                          _MESA_NEW_SEPARATE_SPECULAR)
 
 #define _SWRAST_NEW_POINT (_SWRAST_NEW_DERIVED |       \
                           _NEW_RENDERMODE |            \
@@ -329,7 +330,7 @@ _swrast_update_specular_vertex_add(struct gl_context *ctx)
                           _NEW_TEXTURE |               \
                           _NEW_LIGHT |                 \
                           _NEW_FOG |                   \
-                           _DD_NEW_SEPARATE_SPECULAR)
+                           _MESA_NEW_SEPARATE_SPECULAR)
 
 #define _SWRAST_NEW_TEXTURE_SAMPLE_FUNC _NEW_TEXTURE
 
@@ -479,10 +480,10 @@ _swrast_update_texture_samplers(struct gl_context *ctx)
       /* Note: If tObj is NULL, the sample function will be a simple
        * function that just returns opaque black (0,0,0,1).
        */
-      if (tObj) {
-         _mesa_update_fetch_functions(tObj);
-      }
-      swrast->TextureSample[u] = _swrast_choose_texture_sample_func(ctx, tObj);
+      _mesa_update_fetch_functions(ctx, u);
+      swrast->TextureSample[u] =
+         _swrast_choose_texture_sample_func(ctx, tObj,
+                                            _mesa_get_samplerobj(ctx, u));
    }
 }