summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2012-09-08 15:30:24 +0200
committerMarek Olšák <[email protected]>2012-09-22 01:19:23 +0200
commit27e056ff15ff365e0e00209738ff97ca64f02f2a (patch)
tree5519a401be8acaa29a4a68c5e82767dba8dbc5da /src
parente81717e9e7c46eed05f9a29adaaf4c86306a8920 (diff)
gallium/u_blitter: fix stencil-only blits
NOTE: This is a candidate for the stable branches. (cherry picked from commit 61706915a3b5644faf7a5e67f47c9c593620bf8c)
Diffstat (limited to 'src')
-rw-r--r--src/gallium/auxiliary/util/u_blitter.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/gallium/auxiliary/util/u_blitter.c b/src/gallium/auxiliary/util/u_blitter.c
index 44295c136a6..35b8edba75c 100644
--- a/src/gallium/auxiliary/util/u_blitter.c
+++ b/src/gallium/auxiliary/util/u_blitter.c
@@ -1213,6 +1213,21 @@ void util_blitter_copy_texture_view(struct blitter_context *blitter,
pipe->bind_fragment_sampler_states(pipe, 2, samplers);
pipe_sampler_view_reference(&views[1], NULL);
+ } else if (blit_stencil) {
+ /* Set a stencil-only sampler view for it not to sample depth instead. */
+ struct pipe_sampler_view templ;
+ struct pipe_sampler_view *view;
+
+ templ = *src;
+ templ.format = util_format_stencil_only(templ.format);
+ assert(templ.format != PIPE_FORMAT_NONE);
+
+ view = pipe->create_sampler_view(pipe, src->texture, &templ);
+
+ pipe->set_fragment_sampler_views(pipe, 1, &view);
+ pipe->bind_fragment_sampler_states(pipe, 1, &ctx->sampler_state);
+
+ pipe_sampler_view_reference(&view, NULL);
} else {
pipe->set_fragment_sampler_views(pipe, 1, &src);
pipe->bind_fragment_sampler_states(pipe, 1, &ctx->sampler_state);