r600g: Implement GL_ARB_texture_gather
[mesa.git] / src / mesa / state_tracker / st_cb_drawtex.c
index c4efce02f21b181d41b78dc0d423217c2527ce25..f997e6b000786eac325ecb36a5534f57d92ab954 100644 (file)
@@ -1,6 +1,6 @@
 /**************************************************************************
  * 
- * Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
+ * Copyright 2008 VMware, Inc.
  * All Rights Reserved.
  *
  **************************************************************************/
@@ -15,7 +15,6 @@
 #include "main/imports.h"
 #include "main/image.h"
 #include "main/macros.h"
-#include "main/mfeatures.h"
 #include "program/program.h"
 #include "program/prog_print.h"
 
@@ -124,7 +123,8 @@ st_DrawTex(struct gl_context *ctx, GLfloat x, GLfloat y, GLfloat z,
    /* determine how many enabled sets of texcoords */
    numTexCoords = 0;
    for (i = 0; i < ctx->Const.MaxTextureUnits; i++) {
-      if (ctx->Texture.Unit[i]._ReallyEnabled & TEXTURE_2D_BIT) {
+      if (ctx->Texture.Unit[i]._Current &&
+          ctx->Texture.Unit[i]._Current->Target == GL_TEXTURE_2D) {
          numTexCoords++;
       }
    }
@@ -193,7 +193,8 @@ st_DrawTex(struct gl_context *ctx, GLfloat x, GLfloat y, GLfloat z,
 
       /* texcoords */
       for (i = 0; i < ctx->Const.MaxTextureUnits; i++) {
-         if (ctx->Texture.Unit[i]._ReallyEnabled & TEXTURE_2D_BIT) {
+         if (ctx->Texture.Unit[i]._Current &&
+             ctx->Texture.Unit[i]._Current->Target == GL_TEXTURE_2D) {
             struct gl_texture_object *obj = ctx->Texture.Unit[i]._Current;
             struct gl_texture_image *img = obj->Image[0][obj->BaseLevel];
             const GLfloat wt = (GLfloat) img->Width;
@@ -245,7 +246,7 @@ st_DrawTex(struct gl_context *ctx, GLfloat x, GLfloat y, GLfloat z,
       velements[i].src_format = PIPE_FORMAT_R32G32B32A32_FLOAT;
    }
    cso_set_vertex_elements(cso, numAttribs, velements);
-   cso_set_stream_outputs(st->cso_context, 0, NULL, 0);
+   cso_set_stream_outputs(st->cso_context, 0, NULL, NULL);
 
    /* viewport state: viewport matching window dims */
    {