summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/enable.c
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2017-11-15 22:02:51 +0100
committerMarek Olšák <[email protected]>2018-02-13 01:00:45 +0100
commit07c10cc59c164ddd0109e061dac8edf47437d8ca (patch)
treead38e5e0408a4fe07fb41a77b0bacef2e19a7100 /src/mesa/main/enable.c
parent79aca14f5f37de32140fb710970133c72886a0f2 (diff)
mesa: separate legacy stuff from gl_texture_unit into gl_fixedfunc_texture_unit
Reviewed-by: Brian Paul <[email protected]>
Diffstat (limited to 'src/mesa/main/enable.c')
-rw-r--r--src/mesa/main/enable.c23
1 files changed, 14 insertions, 9 deletions
diff --git a/src/mesa/main/enable.c b/src/mesa/main/enable.c
index 967d23080c7..4c5f9dce5e4 100644
--- a/src/mesa/main/enable.c
+++ b/src/mesa/main/enable.c
@@ -186,7 +186,7 @@ _mesa_DisableClientState( GLenum cap )
* Note that we'll set GL_INVALID_OPERATION and return NULL if the active
* texture unit is higher than the number of supported coordinate units.
*/
-static struct gl_texture_unit *
+static struct gl_fixedfunc_texture_unit *
get_texcoord_unit(struct gl_context *ctx)
{
if (ctx->Texture.CurrentUnit >= ctx->Const.MaxTextureCoordUnits) {
@@ -194,7 +194,7 @@ get_texcoord_unit(struct gl_context *ctx)
return NULL;
}
else {
- return &ctx->Texture.Unit[ctx->Texture.CurrentUnit];
+ return &ctx->Texture.FixedFuncUnit[ctx->Texture.CurrentUnit];
}
}
@@ -207,7 +207,9 @@ get_texcoord_unit(struct gl_context *ctx)
static GLboolean
enable_texture(struct gl_context *ctx, GLboolean state, GLbitfield texBit)
{
- struct gl_texture_unit *texUnit = _mesa_get_current_tex_unit(ctx);
+ struct gl_fixedfunc_texture_unit *texUnit =
+ _mesa_get_current_fixedfunc_tex_unit(ctx);
+
const GLbitfield newenabled = state
? (texUnit->Enabled | texBit) : (texUnit->Enabled & ~texBit);
@@ -748,7 +750,7 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state)
case GL_TEXTURE_GEN_R:
case GL_TEXTURE_GEN_Q:
{
- struct gl_texture_unit *texUnit = get_texcoord_unit(ctx);
+ struct gl_fixedfunc_texture_unit *texUnit = get_texcoord_unit(ctx);
if (ctx->API != API_OPENGL_COMPAT)
goto invalid_enum_error;
@@ -769,7 +771,7 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state)
case GL_TEXTURE_GEN_STR_OES:
/* disable S, T, and R at the same time */
{
- struct gl_texture_unit *texUnit = get_texcoord_unit(ctx);
+ struct gl_fixedfunc_texture_unit *texUnit = get_texcoord_unit(ctx);
if (ctx->API != API_OPENGLES)
goto invalid_enum_error;
@@ -1288,8 +1290,9 @@ _mesa_IsEnabledi( GLenum cap, GLuint index )
static GLboolean
is_texture_enabled(struct gl_context *ctx, GLbitfield bit)
{
- const struct gl_texture_unit *const texUnit =
- &ctx->Texture.Unit[ctx->Texture.CurrentUnit];
+ const struct gl_fixedfunc_texture_unit *const texUnit =
+ _mesa_get_current_fixedfunc_tex_unit(ctx);
+
return (texUnit->Enabled & bit) ? GL_TRUE : GL_FALSE;
}
@@ -1506,7 +1509,8 @@ _mesa_IsEnabled( GLenum cap )
case GL_TEXTURE_GEN_R:
case GL_TEXTURE_GEN_Q:
{
- const struct gl_texture_unit *texUnit = get_texcoord_unit(ctx);
+ const struct gl_fixedfunc_texture_unit *texUnit =
+ get_texcoord_unit(ctx);
if (ctx->API != API_OPENGL_COMPAT)
goto invalid_enum_error;
@@ -1519,7 +1523,8 @@ _mesa_IsEnabled( GLenum cap )
return GL_FALSE;
case GL_TEXTURE_GEN_STR_OES:
{
- const struct gl_texture_unit *texUnit = get_texcoord_unit(ctx);
+ const struct gl_fixedfunc_texture_unit *texUnit =
+ get_texcoord_unit(ctx);
if (ctx->API != API_OPENGLES)
goto invalid_enum_error;