aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/mesa/tnl/t_context.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2012-03-05 10:23:14 +0100
committermarha <marha@users.sourceforge.net>2012-03-05 10:23:14 +0100
commit8db4c7567d495ef6f6162406394ac192e6c2cfe7 (patch)
tree9d8233b2f54ad198da3354aa9dbd8d0082156a9c /mesalib/src/mesa/tnl/t_context.c
parentc14f2432d6bfb3de6c6289efd0471f038a289327 (diff)
parent50ace52bb8308fd62b8bad9ae912dc18c4ae32ff (diff)
downloadvcxsrv-8db4c7567d495ef6f6162406394ac192e6c2cfe7.tar.gz
vcxsrv-8db4c7567d495ef6f6162406394ac192e6c2cfe7.tar.bz2
vcxsrv-8db4c7567d495ef6f6162406394ac192e6c2cfe7.zip
Merge remote-tracking branch 'origin/released'
Diffstat (limited to 'mesalib/src/mesa/tnl/t_context.c')
-rw-r--r--mesalib/src/mesa/tnl/t_context.c24
1 files changed, 21 insertions, 3 deletions
diff --git a/mesalib/src/mesa/tnl/t_context.c b/mesalib/src/mesa/tnl/t_context.c
index 1ded44ccf..dbda7a5fc 100644
--- a/mesalib/src/mesa/tnl/t_context.c
+++ b/mesalib/src/mesa/tnl/t_context.c
@@ -46,6 +46,7 @@ GLboolean
_tnl_CreateContext( struct gl_context *ctx )
{
TNLcontext *tnl;
+ GLuint i;
/* Create the TNLcontext structure
*/
@@ -76,10 +77,21 @@ _tnl_CreateContext( struct gl_context *ctx )
*/
tnl->Driver.Render.PrimTabElts = _tnl_render_tab_elts;
tnl->Driver.Render.PrimTabVerts = _tnl_render_tab_verts;
- tnl->Driver.NotifyMaterialChange = _mesa_validate_all_lighting_tables;
+ tnl->Driver.NotifyMaterialChange = _tnl_validate_shine_tables;
tnl->nr_blocks = 0;
+ /* Lighting miscellaneous */
+ tnl->_ShineTabList = MALLOC_STRUCT( tnl_shine_tab );
+ make_empty_list( tnl->_ShineTabList );
+ /* Allocate 10 (arbitrary) shininess lookup tables */
+ for (i = 0 ; i < 10 ; i++) {
+ struct tnl_shine_tab *s = MALLOC_STRUCT( tnl_shine_tab );
+ s->shininess = -1;
+ s->refcount = 0;
+ insert_at_tail( tnl->_ShineTabList, s );
+ }
+
/* plug in the VBO drawing function */
vbo_set_draw_func(ctx, _tnl_vbo_draw_prims);
@@ -93,8 +105,15 @@ _tnl_CreateContext( struct gl_context *ctx )
void
_tnl_DestroyContext( struct gl_context *ctx )
{
+ struct tnl_shine_tab *s, *tmps;
TNLcontext *tnl = TNL_CONTEXT(ctx);
+ /* Free lighting shininess exponentiation table */
+ foreach_s( s, tmps, tnl->_ShineTabList ) {
+ free( s );
+ }
+ free( tnl->_ShineTabList );
+
_tnl_destroy_pipeline( ctx );
FREE(tnl);
@@ -151,8 +170,7 @@ _tnl_InvalidateState( struct gl_context *ctx, GLuint new_state )
if (ctx->RenderMode == GL_FEEDBACK)
tnl->render_inputs_bitset |= BITFIELD64_BIT(_TNL_ATTRIB_TEX0);
- if (ctx->Point._Attenuated ||
- (ctx->VertexProgram._Enabled && ctx->VertexProgram.PointSizeEnabled))
+ if (ctx->Point._Attenuated || ctx->VertexProgram.PointSizeEnabled)
tnl->render_inputs_bitset |= BITFIELD64_BIT(_TNL_ATTRIB_POINTSIZE);
/* check for varying vars which are written by the vertex program */