From: Stephane Marchesin Date: Tue, 21 Nov 2006 13:07:48 +0000 (+0000) Subject: Remaining state cache changes X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=fb6545070418820609a57f4dd975b41c93d499a9;p=mesa.git Remaining state cache changes --- diff --git a/src/mesa/drivers/dri/nouveau/nouveau_fifo.h b/src/mesa/drivers/dri/nouveau/nouveau_fifo.h index 259e5a1dc76..ce465cdca50 100644 --- a/src/mesa/drivers/dri/nouveau/nouveau_fifo.h +++ b/src/mesa/drivers/dri/nouveau/nouveau_fifo.h @@ -112,6 +112,11 @@ extern void nouveau_state_cache_init(nouveauContextPtr nmesa); nmesa->state_cache.current_pos++; \ }while(0) +#define OUT_RING_CACHEp(ptr,sz) do { \ +uint32_t* p=(uint32_t*)(ptr); \ +int i; for(i=0;ififo.free <= (size)) \ diff --git a/src/mesa/drivers/dri/nouveau/nv30_state.c b/src/mesa/drivers/dri/nouveau/nv30_state.c index 7b50cbc4611..0fc3d16751b 100644 --- a/src/mesa/drivers/dri/nouveau/nv30_state.c +++ b/src/mesa/drivers/dri/nouveau/nv30_state.c @@ -477,19 +477,19 @@ static void nv30PolygonMode(GLcontext *ctx, GLenum face, GLenum mode) static void nv30PolygonOffset(GLcontext *ctx, GLfloat factor, GLfloat units) { nouveauContextPtr nmesa = NOUVEAU_CONTEXT(ctx); - BEGIN_RING_SIZE(NvSub3D, NV30_TCL_PRIMITIVE_3D_POLYGON_OFFSET_FACTOR, 2); - OUT_RINGf(factor); + BEGIN_RING_CACHE(NvSub3D, NV30_TCL_PRIMITIVE_3D_POLYGON_OFFSET_FACTOR, 2); + OUT_RING_CACHEf(factor); /* Looks like we always multiply units by 2.0... according to the dumps.*/ - OUT_RINGf(units * 2.0); + OUT_RING_CACHEf(units * 2.0); } /** Set the polygon stippling pattern */ static void nv30PolygonStipple(GLcontext *ctx, const GLubyte *mask ) { nouveauContextPtr nmesa = NOUVEAU_CONTEXT(ctx); - BEGIN_RING_SIZE(NvSub3D, NV30_TCL_PRIMITIVE_3D_POLYGON_STIPPLE_PATTERN(0), 32); - OUT_RINGp(mask, 32); + BEGIN_RING_CACHE(NvSub3D, NV30_TCL_PRIMITIVE_3D_POLYGON_STIPPLE_PATTERN(0), 32); + OUT_RING_CACHEp(mask, 32); } /* Specifies the current buffer for reading */ @@ -501,9 +501,9 @@ void (*RenderMode)(GLcontext *ctx, GLenum mode ); static void nv30Scissor(GLcontext *ctx, GLint x, GLint y, GLsizei w, GLsizei h) { nouveauContextPtr nmesa = NOUVEAU_CONTEXT(ctx); - BEGIN_RING_SIZE(NvSub3D, NV30_TCL_PRIMITIVE_3D_SCISSOR_WIDTH_XPOS, 2); - OUT_RING((w << 16) | x); - OUT_RING((y << 16) | y); + BEGIN_RING_CACHE(NvSub3D, NV30_TCL_PRIMITIVE_3D_SCISSOR_WIDTH_XPOS, 2); + OUT_RING_CACHE((w << 16) | x); + OUT_RING_CACHE((y << 16) | y); } /** Select flat or smooth shading */ @@ -584,9 +584,9 @@ void (*TexParameter)(GLcontext *ctx, GLenum target, static void nv30TextureMatrix(GLcontext *ctx, GLuint unit, const GLmatrix *mat) { nouveauContextPtr nmesa = NOUVEAU_CONTEXT(ctx); - BEGIN_RING_SIZE(NvSub3D, NV30_TCL_PRIMITIVE_3D_TX_MATRIX(unit, 0), 16); + BEGIN_RING_CACHE(NvSub3D, NV30_TCL_PRIMITIVE_3D_TX_MATRIX(unit, 0), 16); /*XXX: This SHOULD work.*/ - OUT_RINGp(mat->m, 16); + OUT_RING_CACHEp(mat->m, 16); } /** Set the viewport */