nv50: make use of scissor enable/disable method

This commit is contained in:
Ben Skeggs
2010-03-04 11:13:51 +10:00
parent 885d2eceb1
commit 2b8c0cf169
4 changed files with 8 additions and 25 deletions
-1
View File
@@ -126,7 +126,6 @@ struct nv50_state {
struct nouveau_stateobj *hw[64];
uint64_t hw_dirty;
unsigned scissor_enabled;
unsigned miptree_nr[PIPE_SHADER_TYPES];
struct nouveau_stateobj *vtxbuf;
struct nouveau_stateobj *vtxattr;
-4
View File
@@ -485,10 +485,6 @@ nv50_screen_create(struct pipe_winsys *ws, struct nouveau_device *dev)
so_method(so, screen->tesla, NV50TCL_LINKED_TSC, 1);
so_data (so, 1);
/* activate first scissor rectangle */
so_method(so, screen->tesla, NV50TCL_SCISSOR_ENABLE(0), 1);
so_data (so, 1);
so_method(so, screen->tesla, NV50TCL_EDGEFLAG_ENABLE, 1);
so_data (so, 1); /* default edgeflag to TRUE */
+4 -1
View File
@@ -302,7 +302,7 @@ static void *
nv50_rasterizer_state_create(struct pipe_context *pipe,
const struct pipe_rasterizer_state *cso)
{
struct nouveau_stateobj *so = so_new(15, 21, 0);
struct nouveau_stateobj *so = so_new(16, 22, 0);
struct nouveau_grobj *tesla = nv50_context(pipe)->screen->tesla;
struct nv50_rasterizer_stateobj *rso =
CALLOC_STRUCT(nv50_rasterizer_stateobj);
@@ -314,6 +314,9 @@ nv50_rasterizer_state_create(struct pipe_context *pipe,
* - point_sprite / sprite_coord_mode
*/
so_method(so, tesla, NV50TCL_SCISSOR_ENABLE(0), 1);
so_data (so, cso->scissor);
so_method(so, tesla, NV50TCL_SHADE_MODEL, 1);
so_data (so, cso->flatshade ? NV50TCL_SHADE_MODEL_FLAT :
NV50TCL_SHADE_MODEL_SMOOTH);
+4 -19
View File
@@ -167,9 +167,6 @@ validate_fb(struct nv50_context *nv50)
so_data (so, w << 16);
so_data (so, h << 16);
/* we set scissors to framebuffer size when they're 'turned off' */
nv50->dirty |= NV50_NEW_SCISSOR;
so_ref(NULL, &nv50->state.hw[12]);
return so;
}
@@ -264,26 +261,14 @@ validate_stipple(struct nv50_context *nv50)
static struct nouveau_stateobj *
validate_scissor(struct nv50_context *nv50)
{
struct pipe_rasterizer_state *rast = &nv50->rasterizer->pipe;
struct pipe_scissor_state *s = &nv50->scissor;
struct nouveau_grobj *tesla = nv50->screen->tesla;
struct pipe_scissor_state *s = &nv50->scissor;
struct nouveau_stateobj *so;
if (nv50->state.hw[12] &&
(rast->scissor == 0 && nv50->state.scissor_enabled == 0))
return NULL;
nv50->state.scissor_enabled = rast->scissor;
so = so_new(1, 2, 0);
so_method(so, tesla, NV50TCL_SCISSOR_HORIZ(0), 2);
if (nv50->state.scissor_enabled) {
so_data(so, (s->maxx << 16) | s->minx);
so_data(so, (s->maxy << 16) | s->miny);
} else {
so_data(so, (nv50->framebuffer.width << 16));
so_data(so, (nv50->framebuffer.height << 16));
}
so_data (so, (s->maxx << 16) | s->minx);
so_data (so, (s->maxy << 16) | s->miny);
return so;
}
@@ -374,7 +359,7 @@ struct state_validate {
{ validate_blend_colour , NV50_NEW_BLEND_COLOUR },
{ validate_stencil_ref , NV50_NEW_STENCIL_REF },
{ validate_stipple , NV50_NEW_STIPPLE },
{ validate_scissor , NV50_NEW_SCISSOR | NV50_NEW_RASTERIZER },
{ validate_scissor , NV50_NEW_SCISSOR },
{ validate_viewport , NV50_NEW_VIEWPORT },
{ validate_sampler , NV50_NEW_SAMPLER },
{ nv50_tex_validate , NV50_NEW_TEXTURE | NV50_NEW_SAMPLER },