mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-22 22:10:10 +01:00
mesa: add EXT_dsa indexed texture commands functions
Added functions:
- EnableClientStateIndexedEXT
- DisableClientStateIndexedEXT
- EnableClientStateiEXT
- DisableClientStateiEXT
Implemented using the idiom provided by the spec:
if (array == TEXTURE_COORD_ARRAY) {
int savedClientActiveTexture;
GetIntegerv(CLIENT_ACTIVE_TEXTURE, &savedClientActiveTexture);
ClientActiveTexture(TEXTURE0+index);
XXX(array);
ClientActiveTexture(savedActiveTexture);
} else {
// Invalid enum
}
This commit is contained in:
parent
7534c536ca
commit
ef84d93f3d
5 changed files with 76 additions and 2 deletions
|
|
@ -313,6 +313,16 @@
|
||||||
<param name="texture" type="GLuint" />
|
<param name="texture" type="GLuint" />
|
||||||
</function>
|
</function>
|
||||||
|
|
||||||
|
<function name="EnableClientStateIndexedEXT" alias="EnableClientStateiEXT">
|
||||||
|
<param name="array" type="GLenum" />
|
||||||
|
<param name="index" type="GLuint" />
|
||||||
|
</function>
|
||||||
|
|
||||||
|
<function name="DisableClientStateIndexedEXT" alias="DisableClientStateiEXT">
|
||||||
|
<param name="array" type="GLenum" />
|
||||||
|
<param name="index" type="GLuint" />
|
||||||
|
</function>
|
||||||
|
|
||||||
<!-- OpenGL 1.3 -->
|
<!-- OpenGL 1.3 -->
|
||||||
|
|
||||||
<function name="MatrixLoadTransposefEXT" offset="assign">
|
<function name="MatrixLoadTransposefEXT" offset="assign">
|
||||||
|
|
@ -476,5 +486,15 @@
|
||||||
<param name="pname" type="GLenum" />
|
<param name="pname" type="GLenum" />
|
||||||
<param name="params" type="GLint *" />
|
<param name="params" type="GLint *" />
|
||||||
</function>
|
</function>
|
||||||
|
|
||||||
|
<function name="EnableClientStateiEXT">
|
||||||
|
<param name="array" type="GLenum" />
|
||||||
|
<param name="index" type="GLuint" />
|
||||||
|
</function>
|
||||||
|
|
||||||
|
<function name="DisableClientStateiEXT">
|
||||||
|
<param name="array" type="GLenum" />
|
||||||
|
<param name="index" type="GLuint" />
|
||||||
|
</function>
|
||||||
</category>
|
</category>
|
||||||
</OpenGLAPI>
|
</OpenGLAPI>
|
||||||
|
|
|
||||||
|
|
@ -1514,6 +1514,8 @@ offsets = {
|
||||||
"NamedFramebufferTexture3DEXT": 1478,
|
"NamedFramebufferTexture3DEXT": 1478,
|
||||||
"NamedFramebufferRenderbufferEXT": 1479,
|
"NamedFramebufferRenderbufferEXT": 1479,
|
||||||
"GetNamedFramebufferAttachmentParameterivEXT": 1480,
|
"GetNamedFramebufferAttachmentParameterivEXT": 1480,
|
||||||
|
"EnableClientStateiEXT": 1481,
|
||||||
|
"DisableClientStateiEXT": 1482,
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -133,6 +133,38 @@ invalid_enum_error:
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* Helper for GL_EXT_direct_state_access following functions:
|
||||||
|
* - EnableClientStateIndexedEXT
|
||||||
|
* - EnableClientStateiEXT
|
||||||
|
* - DisableClientStateIndexedEXT
|
||||||
|
* - DisableClientStateiEXT
|
||||||
|
*/
|
||||||
|
static void
|
||||||
|
client_state_i(struct gl_context *ctx, GLenum cap, GLuint index, GLboolean state)
|
||||||
|
{
|
||||||
|
int saved_active;
|
||||||
|
|
||||||
|
if (cap != GL_TEXTURE_COORD_ARRAY) {
|
||||||
|
_mesa_error(ctx, GL_INVALID_ENUM, "gl%sClientStateiEXT(cap=%s)",
|
||||||
|
state ? "Enable" : "Disable",
|
||||||
|
_mesa_enum_to_string(cap));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (index >= ctx->Const.MaxTextureCoordUnits) {
|
||||||
|
_mesa_error(ctx, GL_INVALID_VALUE, "gl%sClientStateiEXT(index=%d)",
|
||||||
|
state ? "Enable" : "Disable",
|
||||||
|
index);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
saved_active = ctx->Array.ActiveTexture;
|
||||||
|
_mesa_ClientActiveTexture(GL_TEXTURE0 + index);
|
||||||
|
client_state(ctx, cap, state);
|
||||||
|
_mesa_ClientActiveTexture(GL_TEXTURE0 + saved_active);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Enable GL capability.
|
* Enable GL capability.
|
||||||
* \param cap state to enable/disable.
|
* \param cap state to enable/disable.
|
||||||
|
|
@ -148,6 +180,14 @@ _mesa_EnableClientState( GLenum cap )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void GLAPIENTRY
|
||||||
|
_mesa_EnableClientStateiEXT( GLenum cap, GLuint index )
|
||||||
|
{
|
||||||
|
GET_CURRENT_CONTEXT(ctx);
|
||||||
|
client_state_i(ctx, cap, index, GL_TRUE);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Disable GL capability.
|
* Disable GL capability.
|
||||||
* \param cap state to enable/disable.
|
* \param cap state to enable/disable.
|
||||||
|
|
@ -162,6 +202,12 @@ _mesa_DisableClientState( GLenum cap )
|
||||||
client_state( ctx, cap, GL_FALSE );
|
client_state( ctx, cap, GL_FALSE );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void GLAPIENTRY
|
||||||
|
_mesa_DisableClientStateiEXT( GLenum cap, GLuint index )
|
||||||
|
{
|
||||||
|
GET_CURRENT_CONTEXT(ctx);
|
||||||
|
client_state_i(ctx, cap, index, GL_FALSE);
|
||||||
|
}
|
||||||
|
|
||||||
#define CHECK_EXTENSION(EXTNAME) \
|
#define CHECK_EXTENSION(EXTNAME) \
|
||||||
if (!ctx->Extensions.EXTNAME) { \
|
if (!ctx->Extensions.EXTNAME) { \
|
||||||
|
|
|
||||||
|
|
@ -64,9 +64,15 @@ _mesa_IsEnabledi( GLenum cap, GLuint index );
|
||||||
extern void GLAPIENTRY
|
extern void GLAPIENTRY
|
||||||
_mesa_EnableClientState( GLenum cap );
|
_mesa_EnableClientState( GLenum cap );
|
||||||
|
|
||||||
|
extern void GLAPIENTRY
|
||||||
|
_mesa_EnableClientStateiEXT( GLenum cap, GLuint index );
|
||||||
|
|
||||||
extern void GLAPIENTRY
|
extern void GLAPIENTRY
|
||||||
_mesa_DisableClientState( GLenum cap );
|
_mesa_DisableClientState( GLenum cap );
|
||||||
|
|
||||||
|
extern void GLAPIENTRY
|
||||||
|
_mesa_DisableClientStateiEXT( GLenum cap, GLuint index );
|
||||||
|
|
||||||
extern void
|
extern void
|
||||||
_mesa_set_multisample(struct gl_context *ctx, GLboolean state);
|
_mesa_set_multisample(struct gl_context *ctx, GLboolean state);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1092,8 +1092,8 @@ const struct function common_desktop_functions_possible[] = {
|
||||||
//{ "glMultiTexImage3DEXT", 12, -1 },
|
//{ "glMultiTexImage3DEXT", 12, -1 },
|
||||||
//{ "glMultiTexSubImage3DEXT", 12, -1 },
|
//{ "glMultiTexSubImage3DEXT", 12, -1 },
|
||||||
//{ "glCopyMultiTexSubImage3DEXT", 12, -1 },
|
//{ "glCopyMultiTexSubImage3DEXT", 12, -1 },
|
||||||
//{ "glEnableClientStateIndexedEXT", 12, -1 },
|
{ "glEnableClientStateIndexedEXT", 12, -1 },
|
||||||
//{ "glDisableClientStateIndexedEXT", 12, -1 },
|
{ "glDisableClientStateIndexedEXT", 12, -1 },
|
||||||
//{ "glGetPointerIndexedvEXT", 12, -1 },
|
//{ "glGetPointerIndexedvEXT", 12, -1 },
|
||||||
/* GL_EXT_direct_state_access - ARB_vertex_program */
|
/* GL_EXT_direct_state_access - ARB_vertex_program */
|
||||||
//{ "glNamedProgramStringEXT", 10, -1 },
|
//{ "glNamedProgramStringEXT", 10, -1 },
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue