summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichal Krol <michal@vmware.com>2010-02-24 15:48:30 +0100
committerMichal Krol <michal@vmware.com>2010-02-24 15:48:30 +0100
commit5b3f8369c693e75d1dbc7587e4e0d77934c0cd77 (patch)
treed26418f259fd283d6ade13d46b2c9eef1a89dca2
parent8039ee09b8c78a70c1c50207cce9a7bb4cffc675 (diff)
util: Reset clip state when doing blitting.
-rw-r--r--src/gallium/auxiliary/util/u_blit.c8
-rw-r--r--src/gallium/auxiliary/util/u_gen_mipmap.c4
2 files changed, 11 insertions, 1 deletions
diff --git a/src/gallium/auxiliary/util/u_blit.c b/src/gallium/auxiliary/util/u_blit.c
index 90a3230a0f..95567d00fe 100644
--- a/src/gallium/auxiliary/util/u_blit.c
+++ b/src/gallium/auxiliary/util/u_blit.c
@@ -62,6 +62,7 @@ struct blit_state
struct pipe_rasterizer_state rasterizer;
struct pipe_sampler_state sampler;
struct pipe_viewport_state viewport;
+ struct pipe_clip_state clip;
void *vs;
void *fs[TGSI_WRITEMASK_XYZW + 1];
@@ -264,7 +265,6 @@ regions_overlap(int srcX0, int srcY0,
* \param writemask controls which channels in the dest surface are sourced
* from the src surface. Disabled channels are sourced
* from (0,0,0,1).
- * XXX what about clipping???
* XXX need some control over blitting Z and/or stencil.
*/
void
@@ -409,11 +409,13 @@ util_blit_pixels_writemask(struct blit_state *ctx,
cso_save_framebuffer(ctx->cso);
cso_save_fragment_shader(ctx->cso);
cso_save_vertex_shader(ctx->cso);
+ cso_save_clip(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_clip(ctx->cso, &ctx->clip);
/* sampler */
ctx->sampler.min_img_filter = filter;
@@ -475,6 +477,7 @@ util_blit_pixels_writemask(struct blit_state *ctx,
cso_restore_framebuffer(ctx->cso);
cso_restore_fragment_shader(ctx->cso);
cso_restore_vertex_shader(ctx->cso);
+ cso_restore_clip(ctx->cso);
pipe_texture_reference(&tex, NULL);
}
@@ -558,11 +561,13 @@ 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_clip(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_clip(ctx->cso, &ctx->clip);
/* sampler */
ctx->sampler.min_img_filter = filter;
@@ -607,4 +612,5 @@ 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_clip(ctx->cso);
}
diff --git a/src/gallium/auxiliary/util/u_gen_mipmap.c b/src/gallium/auxiliary/util/u_gen_mipmap.c
index 4f9ff1d961..f423882ca2 100644
--- a/src/gallium/auxiliary/util/u_gen_mipmap.c
+++ b/src/gallium/auxiliary/util/u_gen_mipmap.c
@@ -61,6 +61,7 @@ struct gen_mipmap_state
struct pipe_depth_stencil_alpha_state depthstencil;
struct pipe_rasterizer_state rasterizer;
struct pipe_sampler_state sampler;
+ struct pipe_clip_state clip;
void *vs;
void *fs2d, *fsCube;
@@ -1499,11 +1500,13 @@ util_gen_mipmap(struct gen_mipmap_state *ctx,
cso_save_fragment_shader(ctx->cso);
cso_save_vertex_shader(ctx->cso);
cso_save_viewport(ctx->cso);
+ cso_save_clip(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_clip(ctx->cso, &ctx->clip);
cso_set_fragment_shader_handle(ctx->cso, fs);
cso_set_vertex_shader_handle(ctx->cso, ctx->vs);
@@ -1589,4 +1592,5 @@ util_gen_mipmap(struct gen_mipmap_state *ctx,
cso_restore_fragment_shader(ctx->cso);
cso_restore_vertex_shader(ctx->cso);
cso_restore_viewport(ctx->cso);
+ cso_restore_clip(ctx->cso);
}