diff options
| author | Ben Skeggs <darktama@iinet.net.au> | 2006-11-17 21:58:02 +0000 | 
|---|---|---|
| committer | Ben Skeggs <darktama@iinet.net.au> | 2006-11-17 21:58:02 +0000 | 
| commit | 08020927e826068a1ebc208e63c6a0d53711e96e (patch) | |
| tree | 4de9362ed6b2f9c51084d8329f5674c4846b64ae /src | |
| parent | 10172f7485367182a5745a2114ed7e90830682f8 (diff) | |
Use RENDERINPUTS macros to access render_inputs_bitset
Diffstat (limited to 'src')
| -rw-r--r-- | src/mesa/drivers/dri/nouveau/nouveau_context.h | 2 | ||||
| -rw-r--r-- | src/mesa/drivers/dri/nouveau/nv10_swtcl.c | 24 | 
2 files changed, 15 insertions, 11 deletions
| diff --git a/src/mesa/drivers/dri/nouveau/nouveau_context.h b/src/mesa/drivers/dri/nouveau/nouveau_context.h index 85d71cb04c..09972bebac 100644 --- a/src/mesa/drivers/dri/nouveau/nouveau_context.h +++ b/src/mesa/drivers/dri/nouveau/nouveau_context.h @@ -114,7 +114,7 @@ typedef struct nouveau_context {  	/* The rendering context information */  	GLenum current_primitive; /* the current primitive enum */ -	GLuint render_inputs_bitset; /* the current render inputs */ +	DECLARE_RENDERINPUTS(render_inputs_bitset); /* the current render inputs */  	nouveauScreenRec *screen;  	drm_nouveau_sarea_t *sarea; diff --git a/src/mesa/drivers/dri/nouveau/nv10_swtcl.c b/src/mesa/drivers/dri/nouveau/nv10_swtcl.c index 510704f7d4..772a5368e9 100644 --- a/src/mesa/drivers/dri/nouveau/nv10_swtcl.c +++ b/src/mesa/drivers/dri/nouveau/nv10_swtcl.c @@ -627,10 +627,11 @@ static void nv10ChooseRenderState(GLcontext *ctx) -static inline void nv10OutputVertexFormat(struct nouveau_context* nmesa, GLuint index) +static inline void nv10OutputVertexFormat(struct nouveau_context* nmesa)  {  	GLcontext* ctx=nmesa->glCtx;  	TNLcontext *tnl = TNL_CONTEXT(ctx); +	DECLARE_RENDERINPUTS(index);  	struct vertex_buffer *VB = &tnl->vb;  	int attr_size[16];  	int default_attr_size[8]={3,3,3,4,3,1,4,4}; @@ -638,20 +639,22 @@ static inline void nv10OutputVertexFormat(struct nouveau_context* nmesa, GLuint  	int slots=0;  	int total_size=0; +	RENDERINPUTS_COPY(index, nmesa->render_inputs_bitset); +  	/*  	 * Determine attribute sizes  	 */  	for(i=0;i<8;i++)  	{ -		if (index&(1<<i)) +		if (RENDERINPUTS_TEST(index, i))  			attr_size[i]=default_attr_size[i];  		else  			attr_size[i]=0;  	}  	for(i=8;i<16;i++)  	{ -		if (index&(1<<i)) -			attr_size[i]=VB->TexCoordPtr[i]->size; +		if (RENDERINPUTS_TEST(index, i)) +			attr_size[i]=VB->TexCoordPtr[i-8]->size;  		else  			attr_size[i]=0;  	} @@ -661,7 +664,7 @@ static inline void nv10OutputVertexFormat(struct nouveau_context* nmesa, GLuint  	 */  	for(i=0;i<16;i++)  	{ -		if (index&(1<<i)) +		if (RENDERINPUTS_TEST(index, i))  		{  			slots=i+1;  			if (i==_TNL_ATTRIB_POS) @@ -752,12 +755,13 @@ static void nv10ChooseVertexState( GLcontext *ctx )  {  	struct nouveau_context *nmesa = NOUVEAU_CONTEXT(ctx);  	TNLcontext *tnl = TNL_CONTEXT(ctx); -	GLuint index = tnl->render_inputs_bitset; - -	if (index!=nmesa->render_inputs_bitset) +	DECLARE_RENDERINPUTS(index); +	 +	RENDERINPUTS_COPY(index, tnl->render_inputs_bitset); +	if (!RENDERINPUTS_EQUAL(index, nmesa->render_inputs_bitset))  	{ -		nmesa->render_inputs_bitset=index; -		nv10OutputVertexFormat(nmesa,index); +		RENDERINPUTS_COPY(nmesa->render_inputs_bitset, index); +		nv10OutputVertexFormat(nmesa);  	}  } | 
