diff options
Diffstat (limited to 'src/mesa/swrast_setup/ss_context.c')
-rw-r--r-- | src/mesa/swrast_setup/ss_context.c | 30 |
1 files changed, 13 insertions, 17 deletions
diff --git a/src/mesa/swrast_setup/ss_context.c b/src/mesa/swrast_setup/ss_context.c index 5da2e1eabee..9c013a45400 100644 --- a/src/mesa/swrast_setup/ss_context.c +++ b/src/mesa/swrast_setup/ss_context.c @@ -118,38 +118,35 @@ setup_vertex_format(struct gl_context *ctx) && CHAN_TYPE != GL_FLOAT; if (intColors != swsetup->intColors || - !RENDERINPUTS_EQUAL(tnl->render_inputs_bitset, - swsetup->last_index_bitset)) { - DECLARE_RENDERINPUTS(index_bitset); + tnl->render_inputs_bitset != swsetup->last_index_bitset) { + GLbitfield64 index_bitset = tnl->render_inputs_bitset; struct tnl_attr_map map[_TNL_ATTRIB_MAX]; unsigned int i, e = 0; swsetup->intColors = intColors; - RENDERINPUTS_COPY( index_bitset, tnl->render_inputs_bitset ); - EMIT_ATTR( _TNL_ATTRIB_POS, EMIT_4F_VIEWPORT, attrib[FRAG_ATTRIB_WPOS] ); - if (RENDERINPUTS_TEST( index_bitset, _TNL_ATTRIB_COLOR0 )) { + if (index_bitset & BITFIELD64_BIT(_TNL_ATTRIB_COLOR0)) { if (swsetup->intColors) EMIT_ATTR( _TNL_ATTRIB_COLOR0, EMIT_4CHAN_4F_RGBA, color ); else EMIT_ATTR( _TNL_ATTRIB_COLOR0, EMIT_4F, attrib[FRAG_ATTRIB_COL0]); } - if (RENDERINPUTS_TEST( index_bitset, _TNL_ATTRIB_COLOR1 )) { + if (index_bitset & BITFIELD64_BIT(_TNL_ATTRIB_COLOR1)) { EMIT_ATTR( _TNL_ATTRIB_COLOR1, EMIT_4F, attrib[FRAG_ATTRIB_COL1]); } - if (RENDERINPUTS_TEST( index_bitset, _TNL_ATTRIB_FOG )) { + if (index_bitset & BITFIELD64_BIT(_TNL_ATTRIB_FOG)) { const GLint emit = ctx->FragmentProgram._Current ? EMIT_4F : EMIT_1F; EMIT_ATTR( _TNL_ATTRIB_FOG, emit, attrib[FRAG_ATTRIB_FOGC]); } - if (RENDERINPUTS_TEST_RANGE(index_bitset, _TNL_FIRST_TEX, _TNL_LAST_TEX)) + if (index_bitset & BITFIELD64_RANGE(_TNL_ATTRIB_TEX0, _TNL_NUM_TEX)) { for (i = 0; i < MAX_TEXTURE_COORD_UNITS; i++) { - if (RENDERINPUTS_TEST( index_bitset, _TNL_ATTRIB_TEX(i) )) { + if (index_bitset & BITFIELD64_BIT(_TNL_ATTRIB_TEX(i))) { EMIT_ATTR( _TNL_ATTRIB_TEX(i), EMIT_4F, attrib[FRAG_ATTRIB_TEX0 + i] ); } @@ -157,24 +154,23 @@ setup_vertex_format(struct gl_context *ctx) } /* shader varying vars */ - if (RENDERINPUTS_TEST_RANGE( index_bitset, - _TNL_FIRST_GENERIC, _TNL_LAST_GENERIC )) { + if (index_bitset & BITFIELD64_RANGE(_TNL_ATTRIB_GENERIC0, _TNL_NUM_GENERIC)) { for (i = 0; i < ctx->Const.MaxVarying; i++) { - if (RENDERINPUTS_TEST( index_bitset, _TNL_ATTRIB_GENERIC(i) )) { + if (index_bitset & BITFIELD64_BIT(_TNL_ATTRIB_GENERIC(i))) { EMIT_ATTR( _TNL_ATTRIB_GENERIC(i), VARYING_EMIT_STYLE, attrib[FRAG_ATTRIB_VAR0 + i] ); } } } - if (RENDERINPUTS_TEST( index_bitset, _TNL_ATTRIB_POINTSIZE )) + if (index_bitset & BITFIELD64_BIT(_TNL_ATTRIB_POINTSIZE)) EMIT_ATTR( _TNL_ATTRIB_POINTSIZE, EMIT_1F, pointSize ); _tnl_install_attrs( ctx, map, e, ctx->Viewport._WindowMap.m, sizeof(SWvertex) ); - RENDERINPUTS_COPY( swsetup->last_index_bitset, index_bitset ); + swsetup->last_index_bitset = index_bitset; } } @@ -195,7 +191,7 @@ _swsetup_RenderStart( struct gl_context *ctx ) } if (swsetup->NewState & _NEW_PROGRAM) { - RENDERINPUTS_ZERO( swsetup->last_index_bitset ); + swsetup->last_index_bitset = 0; } swsetup->NewState = 0; @@ -259,7 +255,7 @@ _swsetup_Wakeup( struct gl_context *ctx ) _swsetup_InvalidateState( ctx, ~0 ); swsetup->verts = (SWvertex *)tnl->clipspace.vertex_buf; - RENDERINPUTS_ZERO( swsetup->last_index_bitset ); + swsetup->last_index_bitset = 0; } |