#define TEXSTATE_H
-#include "compiler.h"
#include "enums.h"
#include "macros.h"
#include "mtypes.h"
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)
{
ctx->Const.MaxTextureCoordUnits);
}
-static inline struct gl_texture_unit *
-_mesa_get_tex_unit_err(struct gl_context *ctx, GLuint unit, const char *func)
-{
- if (unit < _mesa_max_tex_unit(ctx))
- return _mesa_get_tex_unit(ctx, unit);
-
- /* Note: This error is a precedent set by glBindTextures. From the GL 4.5
- * specification (30.10.2014) Section 8.1 ("Texture Objects"):
- *
- * "An INVALID_OPERATION error is generated if first + count is greater
- * than the number of texture image units supported by the
- * implementation."
- */
- _mesa_error(ctx, GL_INVALID_OPERATION, "%s(unit=%s)", func,
- _mesa_enum_to_string(GL_TEXTURE0+unit));
- return NULL;
-}
-
extern void
_mesa_copy_texture_state( const struct gl_context *src, struct gl_context *dst );
*/
/*@{*/
+extern void GLAPIENTRY
+_mesa_ActiveTexture_no_error( GLenum target );
+
extern void GLAPIENTRY
_mesa_ActiveTexture( GLenum target );
*/
/*@{*/
-extern void
-_mesa_update_texture( struct gl_context *ctx, GLuint new_state );
+extern void
+_mesa_update_texture_matrices(struct gl_context *ctx);
+
+extern void
+_mesa_update_texture_state(struct gl_context *ctx);
extern GLboolean
_mesa_init_texture( struct gl_context *ctx );