aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/auxiliary/util/u_blit.c
diff options
context:
space:
mode:
authorJosé Fonseca <[email protected]>2008-04-21 22:26:33 +0900
committerJosé Fonseca <[email protected]>2008-04-21 22:26:33 +0900
commit13d8b1b211a803f44ffe325e7eed887cce4abaca (patch)
tree82dc6f36b4d827ae3c0f7aa8ddef5304f4529633 /src/gallium/auxiliary/util/u_blit.c
parent08717d94619802f7816420be155c0c92fa727109 (diff)
gallium: Set all state via cso_context in blit/gen_mipmap utils.
cso_restore_* functions are implemented on top of cso_set_*, therefore they require full knowledge of the current pipe state to work correctly. Directly calling pipe's set_*_state functions will lead to undefined state. Also save and restore shaders.
Diffstat (limited to 'src/gallium/auxiliary/util/u_blit.c')
-rw-r--r--src/gallium/auxiliary/util/u_blit.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/gallium/auxiliary/util/u_blit.c b/src/gallium/auxiliary/util/u_blit.c
index eec5e600c91..be5e83e8346 100644
--- a/src/gallium/auxiliary/util/u_blit.c
+++ b/src/gallium/auxiliary/util/u_blit.c
@@ -300,6 +300,8 @@ util_blit_pixels(struct blit_state *ctx,
cso_save_samplers(ctx->cso);
cso_save_sampler_textures(ctx->cso);
cso_save_framebuffer(ctx->cso);
+ cso_save_fragment_shader(ctx->cso);
+ cso_save_vertex_shader(ctx->cso);
/* set misc state we care about */
cso_set_blend(ctx->cso, &ctx->blend);
@@ -313,11 +315,11 @@ util_blit_pixels(struct blit_state *ctx,
cso_single_sampler_done(ctx->cso);
/* texture */
- pipe->set_sampler_textures(pipe, 1, &tex);
+ cso_set_sampler_textures(ctx->cso, 1, &tex);
/* shaders */
- pipe->bind_fs_state(pipe, ctx->fs);
- pipe->bind_vs_state(pipe, ctx->vs);
+ cso_set_fragment_shader(ctx->cso, ctx->fs);
+ cso_set_vertex_shader(ctx->cso, ctx->vs);
/* drawing dest */
memset(&fb, 0, sizeof(fb));
@@ -344,6 +346,8 @@ util_blit_pixels(struct blit_state *ctx,
cso_restore_samplers(ctx->cso);
cso_restore_sampler_textures(ctx->cso);
cso_restore_framebuffer(ctx->cso);
+ cso_restore_fragment_shader(ctx->cso);
+ cso_restore_vertex_shader(ctx->cso);
/* free the texture */
pipe_surface_reference(&texSurf, NULL);