nir: support lowering clipdist to arrays
[mesa.git] / src / mesa / main / texstate.h
index 7c74329a64ec68f990599e5d28e004376f3edd2e..f2e55f1a4af3fcf5742fe08caebf8f44cf1d8ac5 100644 (file)
@@ -32,7 +32,6 @@
 #define TEXSTATE_H
 
 
-#include "compiler.h"
 #include "enums.h"
 #include "macros.h"
 #include "mtypes.h"
@@ -55,6 +54,22 @@ _mesa_get_current_tex_unit(struct gl_context *ctx)
    return _mesa_get_tex_unit(ctx, ctx->Texture.CurrentUnit);
 }
 
+
+/**
+ * Return pointer to current fixed-func texture unit.
+ * This the texture unit set by glActiveTexture(), not glClientActiveTexture().
+ * \return NULL if the current unit is not a fixed-func texture unit
+ */
+static inline struct gl_fixedfunc_texture_unit *
+_mesa_get_fixedfunc_tex_unit(struct gl_context *ctx, GLuint unit)
+{
+   if (unit >= ARRAY_SIZE(ctx->Texture.FixedFuncUnit))
+      return NULL;
+
+   return &ctx->Texture.FixedFuncUnit[unit];
+}
+
+
 static inline GLuint
 _mesa_max_tex_unit(struct gl_context *ctx)
 {