diff options
Diffstat (limited to 'src/mesa')
-rw-r--r-- | src/mesa/main/enable.c | 45 | ||||
-rw-r--r-- | src/mesa/main/get.c | 29 |
2 files changed, 74 insertions, 0 deletions
diff --git a/src/mesa/main/enable.c b/src/mesa/main/enable.c index c4c3a0c27fb..ffdd3d8783a 100644 --- a/src/mesa/main/enable.c +++ b/src/mesa/main/enable.c @@ -1246,6 +1246,28 @@ _mesa_set_enablei(struct gl_context *ctx, GLenum cap, ctx->Scissor.EnableFlags &= ~(1 << index); } break; + /* EXT_direct_state_access */ + case GL_TEXTURE_1D: + case GL_TEXTURE_2D: + case GL_TEXTURE_3D: + case GL_TEXTURE_CUBE_MAP: + case GL_TEXTURE_GEN_S: + case GL_TEXTURE_GEN_T: + case GL_TEXTURE_GEN_R: + case GL_TEXTURE_GEN_Q: + case GL_TEXTURE_RECTANGLE_ARB: { + const GLuint curTexUnitSave = ctx->Texture.CurrentUnit; + if (index >= MAX2(ctx->Const.MaxCombinedTextureImageUnits, + ctx->Const.MaxTextureCoordUnits)) { + _mesa_error(ctx, GL_INVALID_VALUE, "%s(index=%u)", + state ? "glEnablei" : "glDisablei", index); + return; + } + _mesa_ActiveTexture(GL_TEXTURE0 + index); + _mesa_set_enable( ctx, cap, state ); + _mesa_ActiveTexture(GL_TEXTURE0 + curTexUnitSave); + break; + } default: goto invalid_enum_error; } @@ -1294,6 +1316,29 @@ _mesa_IsEnabledi( GLenum cap, GLuint index ) return GL_FALSE; } return (ctx->Scissor.EnableFlags >> index) & 1; + /* EXT_direct_state_access */ + case GL_TEXTURE_1D: + case GL_TEXTURE_2D: + case GL_TEXTURE_3D: + case GL_TEXTURE_CUBE_MAP: + case GL_TEXTURE_GEN_S: + case GL_TEXTURE_GEN_T: + case GL_TEXTURE_GEN_R: + case GL_TEXTURE_GEN_Q: + case GL_TEXTURE_RECTANGLE_ARB: { + GLboolean state; + const GLuint curTexUnitSave = ctx->Texture.CurrentUnit; + if (index >= MAX2(ctx->Const.MaxCombinedTextureImageUnits, + ctx->Const.MaxTextureCoordUnits)) { + _mesa_error(ctx, GL_INVALID_VALUE, "glIsEnabledIndexed(index=%u)", + index); + return GL_FALSE; + } + _mesa_ActiveTexture(GL_TEXTURE0 + index); + state = _mesa_IsEnabled(cap); + _mesa_ActiveTexture(GL_TEXTURE0 + curTexUnitSave); + return state; + } default: _mesa_error(ctx, GL_INVALID_ENUM, "glIsEnabledIndexed(cap=%s)", _mesa_enum_to_string(cap)); diff --git a/src/mesa/main/get.c b/src/mesa/main/get.c index 3fbacb3d735..f213002d9f8 100644 --- a/src/mesa/main/get.c +++ b/src/mesa/main/get.c @@ -2742,6 +2742,35 @@ find_value_indexed(const char *func, GLenum pname, GLuint index, union value *v) goto invalid_value; _mesa_get_device_uuid(ctx, v->value_int_4); return TYPE_INT_4; + /* GL_EXT_direct_state_access */ + case GL_TEXTURE_1D: + case GL_TEXTURE_2D: + case GL_TEXTURE_3D: + case GL_TEXTURE_CUBE_MAP: + case GL_TEXTURE_GEN_S: + case GL_TEXTURE_GEN_T: + case GL_TEXTURE_GEN_R: + case GL_TEXTURE_GEN_Q: + case GL_TEXTURE_RECTANGLE_ARB: { + GLuint curTexUnitSave; + if (index >= _mesa_max_tex_unit(ctx)) + goto invalid_enum; + curTexUnitSave = ctx->Texture.CurrentUnit; + _mesa_ActiveTexture_no_error(GL_TEXTURE0 + index); + v->value_int = _mesa_IsEnabled(pname); + _mesa_ActiveTexture_no_error(GL_TEXTURE0 + curTexUnitSave); + return TYPE_INT; + } + case GL_TEXTURE_COORD_ARRAY: { + GLuint curTexUnitSave; + if (index >= ctx->Const.MaxTextureCoordUnits) + goto invalid_enum; + curTexUnitSave = ctx->Array.ActiveTexture; + _mesa_ClientActiveTexture(GL_TEXTURE0 + index); + v->value_int = _mesa_IsEnabled(pname); + _mesa_ClientActiveTexture(GL_TEXTURE0 + curTexUnitSave); + return TYPE_INT; + } } invalid_enum: |