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.
This commit is contained in:
Keith Whitwell
2009-03-13 16:04:52 +00:00
parent fa0f48504a
commit 683e7091a9
12 changed files with 43 additions and 75 deletions

View File

@@ -60,20 +60,11 @@ st_init_clear(struct st_context *st)
{
struct pipe_context *pipe = st->pipe;
/* rasterizer state: bypass clipping */
memset(&st->clear.raster, 0, sizeof(st->clear.raster));
st->clear.raster.gl_rasterization_rules = 1;
st->clear.raster.bypass_clipping = 1;
/* viewport state: identity since we're drawing in window coords */
st->clear.viewport.scale[0] = 1.0;
st->clear.viewport.scale[1] = 1.0;
st->clear.viewport.scale[2] = 1.0;
st->clear.viewport.scale[3] = 1.0;
st->clear.viewport.translate[0] = 0.0;
st->clear.viewport.translate[1] = 0.0;
st->clear.viewport.translate[2] = 0.0;
st->clear.viewport.translate[3] = 0.0;
/* rasterizer state: bypass vertex shader, clipping and viewport */
st->clear.raster.bypass_vs_clip_and_viewport = 1;
/* fragment shader state: color pass-through program */
st->clear.fs =
@@ -125,8 +116,9 @@ is_depth_stencil_format(enum pipe_format pipeFormat)
/**
* Draw a screen-aligned quadrilateral.
* Coords are window coords with y=0=bottom. These coords will be transformed
* by the vertex shader and viewport transform (which will flip Y if needed).
* Coords are window coords with y=0=bottom. These will be passed
* through unmodified to the rasterizer as we have set
* rasterizer->bypass_vs_clip_and_viewport.
*/
static void
draw_quad(GLcontext *ctx,
@@ -226,7 +218,6 @@ clear_with_quad(GLcontext *ctx,
cso_save_blend(st->cso_context);
cso_save_depth_stencil_alpha(st->cso_context);
cso_save_rasterizer(st->cso_context);
cso_save_viewport(st->cso_context);
cso_save_fragment_shader(st->cso_context);
cso_save_vertex_shader(st->cso_context);
@@ -278,7 +269,6 @@ clear_with_quad(GLcontext *ctx,
}
cso_set_rasterizer(st->cso_context, &st->clear.raster);
cso_set_viewport(st->cso_context, &st->clear.viewport);
cso_set_fragment_shader_handle(st->cso_context, st->clear.fs);
cso_set_vertex_shader_handle(st->cso_context, st->clear.vs);
@@ -290,7 +280,6 @@ clear_with_quad(GLcontext *ctx,
cso_restore_blend(st->cso_context);
cso_restore_depth_stencil_alpha(st->cso_context);
cso_restore_rasterizer(st->cso_context);
cso_restore_viewport(st->cso_context);
cso_restore_fragment_shader(st->cso_context);
cso_restore_vertex_shader(st->cso_context);
}