From: Christoph Bumiller Date: Fri, 11 Mar 2011 09:00:32 +0000 (+0100) Subject: nvc0: move sprite coord replace state into cso X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=d9f1310e519ac8182329fcd3e6c357d44d110955;p=mesa.git nvc0: move sprite coord replace state into cso It's not dependent on any other state anymore now. --- diff --git a/src/gallium/drivers/nvc0/nvc0_state.c b/src/gallium/drivers/nvc0/nvc0_state.c index f230292316f..bbcac3938f5 100644 --- a/src/gallium/drivers/nvc0/nvc0_state.c +++ b/src/gallium/drivers/nvc0/nvc0_state.c @@ -166,6 +166,7 @@ nvc0_rasterizer_state_create(struct pipe_context *pipe, const struct pipe_rasterizer_state *cso) { struct nvc0_rasterizer_stateobj *so; + uint32_t reg; so = CALLOC_STRUCT(nvc0_rasterizer_stateobj); if (!so) @@ -202,6 +203,13 @@ nvc0_rasterizer_state_create(struct pipe_context *pipe, SB_BEGIN_3D(so, POINT_SIZE, 1); SB_DATA (so, fui(cso->point_size)); } + + reg = (cso->sprite_coord_mode == PIPE_SPRITE_COORD_UPPER_LEFT) ? + NVC0_3D_POINT_COORD_REPLACE_COORD_ORIGIN_UPPER_LEFT : + NVC0_3D_POINT_COORD_REPLACE_COORD_ORIGIN_LOWER_LEFT; + + SB_BEGIN_3D(so, POINT_COORD_REPLACE, 1); + SB_DATA (so, ((cso->sprite_coord_enable & 0xff) << 3) | reg); SB_IMMED_3D(so, POINT_SPRITE_ENABLE, cso->point_quad_rasterization); SB_IMMED_3D(so, POINT_SMOOTH_ENABLE, cso->point_smooth); diff --git a/src/gallium/drivers/nvc0/nvc0_state_validate.c b/src/gallium/drivers/nvc0/nvc0_state_validate.c index 6fd880829e4..c37a070bc68 100644 --- a/src/gallium/drivers/nvc0/nvc0_state_validate.c +++ b/src/gallium/drivers/nvc0/nvc0_state_validate.c @@ -293,32 +293,6 @@ nvc0_validate_rasterizer(struct nvc0_context *nvc0) OUT_RINGp(chan, nvc0->rast->state, nvc0->rast->size); } -static void -nvc0_validate_sprite_coords(struct nvc0_context *nvc0) -{ - struct nouveau_channel *chan = nvc0->screen->base.channel; - uint32_t reg; - - if (nvc0->rast->pipe.sprite_coord_mode == PIPE_SPRITE_COORD_UPPER_LEFT) - reg = NVC0_3D_POINT_COORD_REPLACE_COORD_ORIGIN_UPPER_LEFT; - else - reg = NVC0_3D_POINT_COORD_REPLACE_COORD_ORIGIN_LOWER_LEFT; - - if (nvc0->rast->pipe.point_quad_rasterization) { - uint32_t en = nvc0->rast->pipe.sprite_coord_enable; - - while (en) { - int i = ffs(en) - 1; - en &= ~(1 << i); - if (i >= 0 && i < 8) - reg |= 8 << i; - } - } - - BEGIN_RING(chan, RING_3D(POINT_COORD_REPLACE), 1); - OUT_RING (chan, reg); -} - static void nvc0_constbufs_validate(struct nvc0_context *nvc0) { @@ -432,7 +406,6 @@ static struct state_validate { { nvc0_tevlprog_validate, NVC0_NEW_TEVLPROG }, { nvc0_gmtyprog_validate, NVC0_NEW_GMTYPROG }, { nvc0_fragprog_validate, NVC0_NEW_FRAGPROG }, - { nvc0_validate_sprite_coords, NVC0_NEW_RASTERIZER | NVC0_NEW_FRAGPROG }, { nvc0_constbufs_validate, NVC0_NEW_CONSTBUF }, { nvc0_validate_textures, NVC0_NEW_TEXTURES }, { nvc0_validate_samplers, NVC0_NEW_SAMPLERS },