summaryrefslogtreecommitdiff
path: root/src/gallium/auxiliary/util/u_gen_mipmap.c
diff options
context:
space:
mode:
authorJosé Fonseca <jrfonseca@tungstengraphics.com>2008-04-21 22:26:33 +0900
committerJosé Fonseca <jrfonseca@tungstengraphics.com>2008-04-21 22:26:33 +0900
commit13d8b1b211a803f44ffe325e7eed887cce4abaca (patch)
tree82dc6f36b4d827ae3c0f7aa8ddef5304f4529633 /src/gallium/auxiliary/util/u_gen_mipmap.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_gen_mipmap.c')
-rw-r--r--src/gallium/auxiliary/util/u_gen_mipmap.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/gallium/auxiliary/util/u_gen_mipmap.c b/src/gallium/auxiliary/util/u_gen_mipmap.c
index 2fd214d22e..f0c4063b28 100644
--- a/src/gallium/auxiliary/util/u_gen_mipmap.c
+++ b/src/gallium/auxiliary/util/u_gen_mipmap.c
@@ -880,16 +880,18 @@ util_gen_mipmap(struct gen_mipmap_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);
/* 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);
- pipe->bind_vs_state(pipe, ctx->vs);
- pipe->bind_fs_state(pipe, ctx->fs);
+ cso_set_fragment_shader(ctx->cso, ctx->fs);
+ cso_set_vertex_shader(ctx->cso, ctx->vs);
#if 0
- pipe->set_viewport_state(pipe, &ctx->viewport);
+ cso_set_viewport(ctx->cso, &ctx->viewport);
#endif
/* init framebuffer state */
@@ -930,7 +932,7 @@ util_gen_mipmap(struct gen_mipmap_state *ctx,
simple_viewport(pipe, pt->width[dstLevel], pt->height[dstLevel]);
#endif
- pipe->set_sampler_textures(pipe, 1, &pt);
+ cso_set_sampler_textures(ctx->cso, 1, &pt);
/* quad coords in window coords (bypassing clipping, viewport mapping) */
set_vertex_data(ctx,
@@ -954,4 +956,6 @@ util_gen_mipmap(struct gen_mipmap_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);
}