Merge branch 'gallium-docs'
[mesa.git] / src / mesa / state_tracker / st_atom_texture.c
index 18ffc08c6b129f5fe2f141412adafd0332d65989..0b68447d2122364daf4ab5402ddfac344faba5af 100644 (file)
   */
  
 
+#include "main/macros.h"
+
 #include "st_context.h"
 #include "st_atom.h"
 #include "st_texture.h"
 #include "st_cb_texture.h"
 #include "pipe/p_context.h"
-#include "pipe/p_inlines.h"
 #include "cso_cache/cso_context.h"
 
 
@@ -53,7 +54,7 @@ update_textures(struct st_context *st)
    st->state.num_textures = 0;
 
    /* loop over sampler units (aka tex image units) */
-   for (su = 0; su < st->ctx->Const.MaxTextureCoordUnits; su++) {
+   for (su = 0; su < st->ctx->Const.MaxTextureImageUnits; su++) {
       struct pipe_texture *pt = NULL;
 
       if (samplersUsed & (1 << su)) {
@@ -100,6 +101,12 @@ update_textures(struct st_context *st)
    cso_set_sampler_textures(st->cso_context,
                             st->state.num_textures,
                             st->state.sampler_texture);
+   if (st->ctx->Const.MaxVertexTextureImageUnits > 0) {
+      cso_set_vertex_sampler_textures(st->cso_context,
+                                      MIN2(st->state.num_textures,
+                                           st->ctx->Const.MaxVertexTextureImageUnits),
+                                      st->state.sampler_texture);
+   }
 }