From 683e7091a953204c9aee1410ac44be3b69bae9fc Mon Sep 17 00:00:00 2001 From: Keith Whitwell Date: Fri, 13 Mar 2009 16:04:52 +0000 Subject: gallium: consolidate bypass_vs and bypass_clipping flags The draw module provides a similar interface to the driver which is retained as various bits of hardware may be able to take on incremental parts of the vertex pipeline. However, there's no need to advertise all this complexity to the state tracker. There are basically two modes now - normal and passthrough/screen-coords. --- src/gallium/auxiliary/draw/draw_context.c | 4 ++-- src/gallium/auxiliary/draw/draw_pt.c | 2 +- src/gallium/auxiliary/draw/draw_pt.h | 2 +- .../auxiliary/draw/draw_pt_fetch_shade_emit.c | 3 ++- .../auxiliary/draw/draw_pt_fetch_shade_pipeline.c | 21 +++++++++++---------- src/gallium/auxiliary/draw/draw_pt_post_vs.c | 4 ++-- 6 files changed, 19 insertions(+), 17 deletions(-) (limited to 'src/gallium/auxiliary/draw') diff --git a/src/gallium/auxiliary/draw/draw_context.c b/src/gallium/auxiliary/draw/draw_context.c index 581532c1c9f..a4f1fcddc1a 100644 --- a/src/gallium/auxiliary/draw/draw_context.c +++ b/src/gallium/auxiliary/draw/draw_context.c @@ -127,7 +127,7 @@ void draw_set_rasterizer_state( struct draw_context *draw, draw->rasterizer = raster; draw->bypass_clipping = - ((draw->rasterizer && draw->rasterizer->bypass_clipping) || + ((draw->rasterizer && draw->rasterizer->bypass_vs_clip_and_viewport) || draw->driver.bypass_clipping); } @@ -139,7 +139,7 @@ void draw_set_driver_clipping( struct draw_context *draw, draw->driver.bypass_clipping = bypass_clipping; draw->bypass_clipping = - ((draw->rasterizer && draw->rasterizer->bypass_clipping) || + ((draw->rasterizer && draw->rasterizer->bypass_vs_clip_and_viewport) || draw->driver.bypass_clipping); } diff --git a/src/gallium/auxiliary/draw/draw_pt.c b/src/gallium/auxiliary/draw/draw_pt.c index 4e5ffa09305..9ea0cbe5990 100644 --- a/src/gallium/auxiliary/draw/draw_pt.c +++ b/src/gallium/auxiliary/draw/draw_pt.c @@ -87,7 +87,7 @@ draw_pt_arrays(struct draw_context *draw, opt |= PT_CLIPTEST; } - if (!draw->rasterizer->bypass_vs) { + if (!draw->rasterizer->bypass_vs_clip_and_viewport) { opt |= PT_SHADE; } } diff --git a/src/gallium/auxiliary/draw/draw_pt.h b/src/gallium/auxiliary/draw/draw_pt.h index aecaeee5b9e..6f3e1e0289b 100644 --- a/src/gallium/auxiliary/draw/draw_pt.h +++ b/src/gallium/auxiliary/draw/draw_pt.h @@ -215,7 +215,7 @@ boolean draw_pt_post_vs_run( struct pt_post_vs *pvs, void draw_pt_post_vs_prepare( struct pt_post_vs *pvs, boolean bypass_clipping, - boolean identity_viewport, + boolean bypass_viewport, boolean opengl ); struct pt_post_vs *draw_pt_post_vs_create( struct draw_context *draw ); diff --git a/src/gallium/auxiliary/draw/draw_pt_fetch_shade_emit.c b/src/gallium/auxiliary/draw/draw_pt_fetch_shade_emit.c index cd9cd4b53fd..44147aed9be 100644 --- a/src/gallium/auxiliary/draw/draw_pt_fetch_shade_emit.c +++ b/src/gallium/auxiliary/draw/draw_pt_fetch_shade_emit.c @@ -101,7 +101,8 @@ static void fse_prepare( struct draw_pt_middle_end *middle, fse->key.nr_elements = MAX2(fse->key.nr_outputs, /* outputs - translate to hw format */ fse->key.nr_inputs); /* inputs - fetch from api format */ - fse->key.viewport = !draw->identity_viewport; + fse->key.viewport = (!draw->rasterizer->bypass_vs_clip_and_viewport && + !draw->identity_viewport); fse->key.clip = !draw->bypass_clipping; fse->key.const_vbuffers = 0; diff --git a/src/gallium/auxiliary/draw/draw_pt_fetch_shade_pipeline.c b/src/gallium/auxiliary/draw/draw_pt_fetch_shade_pipeline.c index 38f9b604d37..11ac90fc563 100644 --- a/src/gallium/auxiliary/draw/draw_pt_fetch_shade_pipeline.c +++ b/src/gallium/auxiliary/draw/draw_pt_fetch_shade_pipeline.c @@ -84,7 +84,8 @@ static void fetch_pipeline_prepare( struct draw_pt_middle_end *middle, */ draw_pt_post_vs_prepare( fpme->post_vs, (boolean)draw->bypass_clipping, - (boolean)draw->identity_viewport, + (boolean)(draw->identity_viewport || + draw->rasterizer->bypass_vs_clip_and_viewport), (boolean)draw->rasterizer->gl_rasterization_rules ); @@ -140,9 +141,9 @@ static void fetch_pipeline_run( struct draw_pt_middle_end *middle, (char *)pipeline_verts ); /* Run the shader, note that this overwrites the data[] parts of - * the pipeline verts. If there is no shader, ie a bypass shader, - * then the inputs == outputs, and are already in the correct - * place. + * the pipeline verts. If there is no shader, eg if + * bypass_vs_clip_and_viewport, then the inputs == outputs, and are + * already in the correct place. */ if (opt & PT_SHADE) { @@ -216,9 +217,9 @@ static void fetch_pipeline_linear_run( struct draw_pt_middle_end *middle, (char *)pipeline_verts ); /* Run the shader, note that this overwrites the data[] parts of - * the pipeline verts. If there is no shader, ie a bypass shader, - * then the inputs == outputs, and are already in the correct - * place. + * the pipeline verts. If there is no shader, ie if + * bypass_vs_clip_and_viewport, then the inputs == outputs, and are + * already in the correct place. */ if (opt & PT_SHADE) { @@ -286,9 +287,9 @@ static boolean fetch_pipeline_linear_run_elts( struct draw_pt_middle_end *middle (char *)pipeline_verts ); /* Run the shader, note that this overwrites the data[] parts of - * the pipeline verts. If there is no shader, ie a bypass shader, - * then the inputs == outputs, and are already in the correct - * place. + * the pipeline verts. If there is no shader, ie if + * bypass_vs_clip_and_viewport, then the inputs == outputs, and are + * already in the correct place. */ if (opt & PT_SHADE) { diff --git a/src/gallium/auxiliary/draw/draw_pt_post_vs.c b/src/gallium/auxiliary/draw/draw_pt_post_vs.c index 96dc706b998..00d7197b132 100644 --- a/src/gallium/auxiliary/draw/draw_pt_post_vs.c +++ b/src/gallium/auxiliary/draw/draw_pt_post_vs.c @@ -200,11 +200,11 @@ boolean draw_pt_post_vs_run( struct pt_post_vs *pvs, void draw_pt_post_vs_prepare( struct pt_post_vs *pvs, boolean bypass_clipping, - boolean identity_viewport, + boolean bypass_viewport, boolean opengl ) { if (bypass_clipping) { - if (identity_viewport) + if (bypass_viewport) pvs->run = post_vs_none; else pvs->run = post_vs_viewport; -- cgit v1.2.3