diff options
author | Keith Whitwell <[email protected]> | 2009-03-13 16:04:52 +0000 |
---|---|---|
committer | Keith Whitwell <[email protected]> | 2009-03-13 16:42:57 +0000 |
commit | 683e7091a953204c9aee1410ac44be3b69bae9fc (patch) | |
tree | 53e22c5452e1cfed4ecb6fb2c0dd68f372ec7667 /src/gallium/auxiliary/util | |
parent | fa0f48504a32642d688d4b81f62eea54c693b23f (diff) |
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.
Diffstat (limited to 'src/gallium/auxiliary/util')
-rw-r--r-- | src/gallium/auxiliary/util/u_blit.c | 24 | ||||
-rw-r--r-- | src/gallium/auxiliary/util/u_gen_mipmap.c | 23 |
2 files changed, 10 insertions, 37 deletions
diff --git a/src/gallium/auxiliary/util/u_blit.c b/src/gallium/auxiliary/util/u_blit.c index 98bb6a2ce70..deb68c43a6c 100644 --- a/src/gallium/auxiliary/util/u_blit.c +++ b/src/gallium/auxiliary/util/u_blit.c @@ -102,8 +102,7 @@ util_create_blit(struct pipe_context *pipe, struct cso_context *cso) memset(&ctx->rasterizer, 0, sizeof(ctx->rasterizer)); ctx->rasterizer.front_winding = PIPE_WINDING_CW; ctx->rasterizer.cull_mode = PIPE_WINDING_NONE; - ctx->rasterizer.bypass_clipping = 1; - /*ctx->rasterizer.bypass_vs = 1;*/ + ctx->rasterizer.bypass_vs_clip_and_viewport = 1; ctx->rasterizer.gl_rasterization_rules = 1; /* samplers */ @@ -116,17 +115,10 @@ util_create_blit(struct pipe_context *pipe, struct cso_context *cso) ctx->sampler.mag_img_filter = 0; /* set later */ ctx->sampler.normalized_coords = 1; - /* viewport (identity, we setup vertices in wincoords) */ - ctx->viewport.scale[0] = 1.0; - ctx->viewport.scale[1] = 1.0; - ctx->viewport.scale[2] = 1.0; - ctx->viewport.scale[3] = 1.0; - ctx->viewport.translate[0] = 0.0; - ctx->viewport.translate[1] = 0.0; - ctx->viewport.translate[2] = 0.0; - ctx->viewport.translate[3] = 0.0; - - /* vertex shader */ + + /* vertex shader - still required to provide the linkage between + * fragment shader input semantics and vertex_element/buffers. + */ { const uint semantic_names[] = { TGSI_SEMANTIC_POSITION, TGSI_SEMANTIC_GENERIC }; @@ -374,13 +366,11 @@ util_blit_pixels(struct blit_state *ctx, cso_save_framebuffer(ctx->cso); cso_save_fragment_shader(ctx->cso); cso_save_vertex_shader(ctx->cso); - cso_save_viewport(ctx->cso); /* set misc state we care about */ cso_set_blend(ctx->cso, &ctx->blend); cso_set_depth_stencil_alpha(ctx->cso, &ctx->depthstencil); cso_set_rasterizer(ctx->cso, &ctx->rasterizer); - cso_set_viewport(ctx->cso, &ctx->viewport); /* sampler */ ctx->sampler.min_img_filter = filter; @@ -422,7 +412,6 @@ util_blit_pixels(struct blit_state *ctx, cso_restore_framebuffer(ctx->cso); cso_restore_fragment_shader(ctx->cso); cso_restore_vertex_shader(ctx->cso); - cso_restore_viewport(ctx->cso); pipe_texture_reference(&tex, NULL); } @@ -485,13 +474,11 @@ util_blit_pixels_tex(struct blit_state *ctx, cso_save_framebuffer(ctx->cso); cso_save_fragment_shader(ctx->cso); cso_save_vertex_shader(ctx->cso); - cso_save_viewport(ctx->cso); /* set misc state we care about */ cso_set_blend(ctx->cso, &ctx->blend); cso_set_depth_stencil_alpha(ctx->cso, &ctx->depthstencil); cso_set_rasterizer(ctx->cso, &ctx->rasterizer); - cso_set_viewport(ctx->cso, &ctx->viewport); /* sampler */ ctx->sampler.min_img_filter = filter; @@ -536,5 +523,4 @@ util_blit_pixels_tex(struct blit_state *ctx, cso_restore_framebuffer(ctx->cso); cso_restore_fragment_shader(ctx->cso); cso_restore_vertex_shader(ctx->cso); - cso_restore_viewport(ctx->cso); } diff --git a/src/gallium/auxiliary/util/u_gen_mipmap.c b/src/gallium/auxiliary/util/u_gen_mipmap.c index 847b4a6075e..df4a8668630 100644 --- a/src/gallium/auxiliary/util/u_gen_mipmap.c +++ b/src/gallium/auxiliary/util/u_gen_mipmap.c @@ -62,7 +62,6 @@ struct gen_mipmap_state struct pipe_depth_stencil_alpha_state depthstencil; struct pipe_rasterizer_state rasterizer; struct pipe_sampler_state sampler; - struct pipe_viewport_state viewport; void *vs; void *fs; @@ -1292,8 +1291,7 @@ util_create_gen_mipmap(struct pipe_context *pipe, memset(&ctx->rasterizer, 0, sizeof(ctx->rasterizer)); ctx->rasterizer.front_winding = PIPE_WINDING_CW; ctx->rasterizer.cull_mode = PIPE_WINDING_NONE; - ctx->rasterizer.bypass_clipping = 1; - /*ctx->rasterizer.bypass_vs = 1;*/ + ctx->rasterizer.bypass_vs_clip_and_viewport = 1; ctx->rasterizer.gl_rasterization_rules = 1; /* sampler state */ @@ -1304,17 +1302,9 @@ util_create_gen_mipmap(struct pipe_context *pipe, ctx->sampler.min_mip_filter = PIPE_TEX_MIPFILTER_NEAREST; ctx->sampler.normalized_coords = 1; - /* viewport state (identity, verts are in wincoords) */ - ctx->viewport.scale[0] = 1.0; - ctx->viewport.scale[1] = 1.0; - ctx->viewport.scale[2] = 1.0; - ctx->viewport.scale[3] = 1.0; - ctx->viewport.translate[0] = 0.0; - ctx->viewport.translate[1] = 0.0; - ctx->viewport.translate[2] = 0.0; - ctx->viewport.translate[3] = 0.0; - - /* vertex shader */ + /* vertex shader - still needed to specify mapping from fragment + * shader input semantics to vertex elements + */ { const uint semantic_names[] = { TGSI_SEMANTIC_POSITION, TGSI_SEMANTIC_GENERIC }; @@ -1465,13 +1455,11 @@ util_gen_mipmap(struct gen_mipmap_state *ctx, cso_save_framebuffer(ctx->cso); cso_save_fragment_shader(ctx->cso); cso_save_vertex_shader(ctx->cso); - cso_save_viewport(ctx->cso); /* bind our state */ cso_set_blend(ctx->cso, &ctx->blend); cso_set_depth_stencil_alpha(ctx->cso, &ctx->depthstencil); cso_set_rasterizer(ctx->cso, &ctx->rasterizer); - cso_set_viewport(ctx->cso, &ctx->viewport); cso_set_fragment_shader_handle(ctx->cso, ctx->fs); cso_set_vertex_shader_handle(ctx->cso, ctx->vs); @@ -1517,7 +1505,7 @@ util_gen_mipmap(struct gen_mipmap_state *ctx, cso_set_sampler_textures(ctx->cso, 1, &pt); - /* quad coords in window coords (bypassing clipping, viewport mapping) */ + /* quad coords in window coords (bypassing vs, clip and viewport) */ offset = set_vertex_data(ctx, (float) pt->width[dstLevel], (float) pt->height[dstLevel]); @@ -1544,5 +1532,4 @@ util_gen_mipmap(struct gen_mipmap_state *ctx, cso_restore_framebuffer(ctx->cso); cso_restore_fragment_shader(ctx->cso); cso_restore_vertex_shader(ctx->cso); - cso_restore_viewport(ctx->cso); } |