diff options
author | Pierre-Eric Pelloux-Prayer <[email protected]> | 2019-04-26 16:50:57 +0200 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2019-07-19 20:04:07 -0400 |
commit | b1efc9d05f0f70a0e7d3e91c2f31084bfb09581b (patch) | |
tree | ac5c90e180717c9d1c55535e7e6817367c7ca01a /src/mesa/main/get.c | |
parent | ff0cafc8f3ae85b9bc604334082da999a0abb2a0 (diff) |
mesa: add EXT_dsa glEnabledIndexedEXT
The implementation uses _mesa_ActiveTexture to change the active texture unit and
then reset it.
It causes an unnecessary _NEW_TEXTURE_STATE but:
- adding an index argument to _mesa_set_enable causes a lot of changes (~140 callers)
- enable_texture (called by _mesa_set_enable) might cause a _NEW_TEXTURE_STATE
anyway.
Reviewed-by: Marek Olšák <[email protected]>
Diffstat (limited to 'src/mesa/main/get.c')
-rw-r--r-- | src/mesa/main/get.c | 29 |
1 files changed, 29 insertions, 0 deletions
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: |