diff options
author | Keith Whitwell <[email protected]> | 2010-05-14 19:20:25 +0100 |
---|---|---|
committer | Keith Whitwell <[email protected]> | 2010-05-14 19:20:25 +0100 |
commit | 9c264642c385557d64b9bc6bbe31d2d15e703aff (patch) | |
tree | be9a5eb3b0369128f05518b4e91984a1e459616d /src/gallium/drivers | |
parent | 0bd1cbcd0d28dbadfb0c3e1f8b048a18b56bc72c (diff) |
gallium: more work on ccw flag removal
The linux-debug target builds...
Diffstat (limited to 'src/gallium/drivers')
-rw-r--r-- | src/gallium/drivers/i965/brw_pipe_rast.c | 12 | ||||
-rw-r--r-- | src/gallium/drivers/i965/brw_sf.c | 4 | ||||
-rw-r--r-- | src/gallium/drivers/i965/brw_sf_state.c | 8 | ||||
-rw-r--r-- | src/gallium/drivers/i965/brw_wm_state.c | 5 | ||||
-rw-r--r-- | src/gallium/drivers/nv50/nv50_state.c | 2 | ||||
-rw-r--r-- | src/gallium/drivers/nvfx/nvfx_state.c | 2 | ||||
-rw-r--r-- | src/gallium/drivers/r300/r300_state.c | 8 | ||||
-rw-r--r-- | src/gallium/drivers/svga/svga_pipe_rasterizer.c | 12 |
8 files changed, 28 insertions, 25 deletions
diff --git a/src/gallium/drivers/i965/brw_pipe_rast.c b/src/gallium/drivers/i965/brw_pipe_rast.c index 79c445e8b01..4c1a6d7dcdf 100644 --- a/src/gallium/drivers/i965/brw_pipe_rast.c +++ b/src/gallium/drivers/i965/brw_pipe_rast.c @@ -50,14 +50,14 @@ calculate_clip_key_rast( const struct brw_context *brw, key->fill_ccw = CLIP_CULL; key->fill_cw = CLIP_CULL; - if (!(templ->cull_mode & PIPE_FACE_FRONT)) { + if (!(templ->cull_face & PIPE_FACE_FRONT)) { if (templ->front_ccw) key->fill_ccw = translate_fill(templ->fill_front); else key->fill_cw = translate_fill(templ->fill_front); } - if (!(templ->cull_mode & PIPE_FACE_BACK)) { + if (!(templ->cull_face & PIPE_FACE_BACK)) { if (templ->front_ccw) key->fill_cw = translate_fill(templ->fill_back); else @@ -138,12 +138,12 @@ static void *brw_create_rasterizer_state( struct pipe_context *pipe, /* Caclculate lookup value for WM IZ table. */ if (templ->line_smooth) { - if (templ->fill_cw == PIPE_POLYGON_MODE_LINE && - templ->fill_ccw == PIPE_POLYGON_MODE_LINE) { + if (templ->fill_front == PIPE_POLYGON_MODE_LINE && + templ->fill_back == PIPE_POLYGON_MODE_LINE) { rast->unfilled_aa_line = AA_ALWAYS; } - else if (templ->fill_cw == PIPE_POLYGON_MODE_LINE || - templ->fill_ccw == PIPE_POLYGON_MODE_LINE) { + else if (templ->fill_front == PIPE_POLYGON_MODE_LINE || + templ->fill_back == PIPE_POLYGON_MODE_LINE) { rast->unfilled_aa_line = AA_SOMETIMES; } else { diff --git a/src/gallium/drivers/i965/brw_sf.c b/src/gallium/drivers/i965/brw_sf.c index 058b1e12e2c..5abf3848ab4 100644 --- a/src/gallium/drivers/i965/brw_sf.c +++ b/src/gallium/drivers/i965/brw_sf.c @@ -166,8 +166,8 @@ static enum pipe_error upload_sf_prog(struct brw_context *brw) case PIPE_PRIM_TRIANGLES: /* PIPE_NEW_RAST */ - if (rast->fill_cw != PIPE_POLYGON_MODE_FILL || - rast->fill_ccw != PIPE_POLYGON_MODE_FILL) + if (rast->fill_front != PIPE_POLYGON_MODE_FILL || + rast->fill_back != PIPE_POLYGON_MODE_FILL) key.primitive = SF_UNFILLED_TRIS; else key.primitive = SF_TRIANGLES; diff --git a/src/gallium/drivers/i965/brw_sf_state.c b/src/gallium/drivers/i965/brw_sf_state.c index fede8bd3009..6c299a86b49 100644 --- a/src/gallium/drivers/i965/brw_sf_state.c +++ b/src/gallium/drivers/i965/brw_sf_state.c @@ -89,8 +89,8 @@ struct brw_sf_unit_key { unsigned line_smooth:1; unsigned point_sprite:1; unsigned point_attenuated:1; - unsigned front_face:2; - unsigned cull_mode:2; + unsigned front_ccw:1; + unsigned cull_face:2; unsigned flatshade_first:1; unsigned gl_rasterization_rules:1; unsigned line_last_pixel_enable:1; @@ -115,8 +115,8 @@ sf_unit_populate_key(struct brw_context *brw, struct brw_sf_unit_key *key) /* PIPE_NEW_RAST */ key->scissor = rast->scissor; - key->front_face = rast->front_winding; - key->cull_mode = rast->cull_mode; + key->front_ccw = rast->front_ccw; + key->cull_face = rast->cull_face; key->line_smooth = rast->line_smooth; key->line_width = rast->line_width; key->flatshade_first = rast->flatshade_first; diff --git a/src/gallium/drivers/i965/brw_wm_state.c b/src/gallium/drivers/i965/brw_wm_state.c index ee970ac75bc..efc2d96be13 100644 --- a/src/gallium/drivers/i965/brw_wm_state.c +++ b/src/gallium/drivers/i965/brw_wm_state.c @@ -128,8 +128,9 @@ wm_unit_populate_key(struct brw_context *brw, struct brw_wm_unit_key *key) key->line_stipple = brw->curr.rast->templ.line_stipple_enable; - key->offset_enable = (brw->curr.rast->templ.offset_cw || - brw->curr.rast->templ.offset_ccw); + key->offset_enable = (brw->curr.rast->templ.offset_point || + brw->curr.rast->templ.offset_line || + brw->curr.rast->templ.offset_tri); key->offset_units = brw->curr.rast->templ.offset_units; key->offset_factor = brw->curr.rast->templ.offset_scale; diff --git a/src/gallium/drivers/nv50/nv50_state.c b/src/gallium/drivers/nv50/nv50_state.c index 2f11ed001bb..b20781fa1fb 100644 --- a/src/gallium/drivers/nv50/nv50_state.c +++ b/src/gallium/drivers/nv50/nv50_state.c @@ -390,7 +390,7 @@ nv50_rasterizer_state_create(struct pipe_context *pipe, so_data(so, cso->poly_smooth ? 1 : 0); so_method(so, tesla, NV50TCL_CULL_FACE_ENABLE, 3); - so_data (so, cso->cull_mode != PIPE_FACE_NONE); + so_data (so, cso->cull_face != PIPE_FACE_NONE); if (cso->front_ccw) { so_data(so, NV50TCL_FRONT_FACE_CCW); } diff --git a/src/gallium/drivers/nvfx/nvfx_state.c b/src/gallium/drivers/nvfx/nvfx_state.c index d7177b0f0bb..17f3f701406 100644 --- a/src/gallium/drivers/nvfx/nvfx_state.c +++ b/src/gallium/drivers/nvfx/nvfx_state.c @@ -218,7 +218,7 @@ nvfx_rasterizer_state_create(struct pipe_context *pipe, sb_method(sb, NV34TCL_POLYGON_MODE_FRONT, 6); sb_data(sb, nvgl_polygon_mode(cso->fill_front)); sb_data(sb, nvgl_polygon_mode(cso->fill_back)); - switch (cso->cull_mode) { + switch (cso->cull_face) { case PIPE_FACE_FRONT: sb_data(sb, NV34TCL_CULL_FACE_FRONT); break; diff --git a/src/gallium/drivers/r300/r300_state.c b/src/gallium/drivers/r300/r300_state.c index 6e72f2ebdc0..006a34119b7 100644 --- a/src/gallium/drivers/r300/r300_state.c +++ b/src/gallium/drivers/r300/r300_state.c @@ -777,10 +777,10 @@ static void* r300_create_rs_state(struct pipe_context* pipe, rs->cull_mode = R300_FRONT_FACE_CW; /* Polygon offset */ - if (state->offset_front) { + if (util_get_offset(state, state->fill_front)) { rs->polygon_offset_enable |= R300_FRONT_ENABLE; } - if (state->offset_back) { + if (util_get_offset(state, state->fill_back)) { rs->polygon_offset_enable |= R300_BACK_ENABLE; } @@ -862,7 +862,9 @@ static void r300_bind_rs_state(struct pipe_context* pipe, void* state) } if (rs) { - r300->polygon_offset_enabled = rs->rs.offset_cw || rs->rs.offset_ccw; + r300->polygon_offset_enabled = (rs->rs.offset_point || + rs->rs.offset_line || + rs->rs.offset_tri); r300->sprite_coord_enable = rs->rs.sprite_coord_enable; r300->two_sided_color = rs->rs.light_twoside; } else { diff --git a/src/gallium/drivers/svga/svga_pipe_rasterizer.c b/src/gallium/drivers/svga/svga_pipe_rasterizer.c index 1661a564e3f..660eb0757a6 100644 --- a/src/gallium/drivers/svga/svga_pipe_rasterizer.c +++ b/src/gallium/drivers/svga/svga_pipe_rasterizer.c @@ -82,7 +82,7 @@ svga_create_rasterizer_state(struct pipe_context *pipe, /* fill_cw, fill_ccw - draw module or index translation */ rast->shademode = svga_translate_flatshade( templ->flatshade ); - rast->cullmode = svga_translate_cullmode( templ->cull_mode, + rast->cullmode = svga_translate_cullmode( templ->cull_face, templ->front_ccw ); rast->scissortestenable = templ->scissor; rast->multisampleantialias = templ->multisample; @@ -118,12 +118,12 @@ svga_create_rasterizer_state(struct pipe_context *pipe, rast->need_pipeline |= SVGA_PIPELINE_FLAG_POINTS; { - boolean offset_cw = templ->offset_cw; - boolean offset_ccw = templ->offset_ccw; - boolean offset = 0; - int fill_cw = templ->fill_cw; - int fill_ccw = templ->fill_ccw; + int fill_front = templ->fill_front; + int fill_back = templ->fill_back; int fill = PIPE_POLYGON_MODE_FILL; + boolean offset_front = util_get_offset(templ, fill_front); + boolean offset_back = util_get_offset(templ, fill_back); + boolean offset = 0; switch (templ->cull_face) { case PIPE_FACE_FRONT_AND_BACK: |