mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-07 20:08:06 +02:00
mesa: Move API specific context intialization into context.c
This commit is contained in:
parent
2c9cc93f2a
commit
ba34fdb5b9
4 changed files with 25 additions and 37 deletions
|
|
@ -190,24 +190,3 @@ _es_GetString(GLenum name)
|
|||
return _mesa_GetString(name);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
_mesa_initialize_context_extra(GLcontext *ctx)
|
||||
{
|
||||
GLuint i;
|
||||
|
||||
/**
|
||||
* GL_OES_texture_cube_map says
|
||||
* "Initially all texture generation modes are set to REFLECTION_MAP_OES"
|
||||
*/
|
||||
for (i = 0; i < MAX_TEXTURE_UNITS; i++) {
|
||||
struct gl_texture_unit *texUnit = &ctx->Texture.Unit[i];
|
||||
texUnit->GenS.Mode = GL_REFLECTION_MAP_NV;
|
||||
texUnit->GenT.Mode = GL_REFLECTION_MAP_NV;
|
||||
texUnit->GenR.Mode = GL_REFLECTION_MAP_NV;
|
||||
texUnit->GenS._ModeBit = TEXGEN_REFLECTION_MAP_NV;
|
||||
texUnit->GenT._ModeBit = TEXGEN_REFLECTION_MAP_NV;
|
||||
texUnit->GenR._ModeBit = TEXGEN_REFLECTION_MAP_NV;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -162,13 +162,3 @@ _es_GetString(GLenum name)
|
|||
return _mesa_GetString(name);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
_mesa_initialize_context_extra(GLcontext *ctx)
|
||||
{
|
||||
ctx->FragmentProgram._MaintainTexEnvProgram = GL_TRUE;
|
||||
ctx->VertexProgram._MaintainTnlProgram = GL_TRUE;
|
||||
|
||||
ctx->Point.PointSprite = GL_TRUE; /* always on for ES 2.x */
|
||||
}
|
||||
|
|
|
|||
|
|
@ -798,6 +798,7 @@ _mesa_initialize_context_for_api(GLcontext *ctx,
|
|||
void *driverContext)
|
||||
{
|
||||
struct gl_shared_state *shared;
|
||||
int i;
|
||||
|
||||
/*ASSERT(driverContext);*/
|
||||
assert(driverFunctions->NewTextureObject);
|
||||
|
|
@ -876,9 +877,30 @@ _mesa_initialize_context_for_api(GLcontext *ctx,
|
|||
ctx->FragmentProgram._MaintainTexEnvProgram = GL_TRUE;
|
||||
}
|
||||
|
||||
#ifdef FEATURE_extra_context_init
|
||||
_mesa_initialize_context_extra(ctx);
|
||||
#endif
|
||||
switch (ctx->API) {
|
||||
case API_OPENGL:
|
||||
break;
|
||||
case API_OPENGLES:
|
||||
/**
|
||||
* GL_OES_texture_cube_map says
|
||||
* "Initially all texture generation modes are set to REFLECTION_MAP_OES"
|
||||
*/
|
||||
for (i = 0; i < MAX_TEXTURE_UNITS; i++) {
|
||||
struct gl_texture_unit *texUnit = &ctx->Texture.Unit[i];
|
||||
texUnit->GenS.Mode = GL_REFLECTION_MAP_NV;
|
||||
texUnit->GenT.Mode = GL_REFLECTION_MAP_NV;
|
||||
texUnit->GenR.Mode = GL_REFLECTION_MAP_NV;
|
||||
texUnit->GenS._ModeBit = TEXGEN_REFLECTION_MAP_NV;
|
||||
texUnit->GenT._ModeBit = TEXGEN_REFLECTION_MAP_NV;
|
||||
texUnit->GenR._ModeBit = TEXGEN_REFLECTION_MAP_NV;
|
||||
}
|
||||
break;
|
||||
case API_OPENGLES2:
|
||||
ctx->FragmentProgram._MaintainTexEnvProgram = GL_TRUE;
|
||||
ctx->VertexProgram._MaintainTnlProgram = GL_TRUE;
|
||||
ctx->Point.PointSprite = GL_TRUE; /* always on for ES 2.x */
|
||||
break;
|
||||
}
|
||||
|
||||
ctx->FirstTimeCurrent = GL_TRUE;
|
||||
|
||||
|
|
|
|||
|
|
@ -127,9 +127,6 @@ _mesa_initialize_context_for_api(GLcontext *ctx,
|
|||
const struct dd_function_table *driverFunctions,
|
||||
void *driverContext);
|
||||
|
||||
extern void
|
||||
_mesa_initialize_context_extra(GLcontext *ctx);
|
||||
|
||||
extern void
|
||||
_mesa_free_context_data( GLcontext *ctx );
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue