<div dir="ltr">Reviewed-by: Marek Olšák <<a href="mailto:maraeo@gmail.com">maraeo@gmail.com</a>><br><br>Marek<br></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Apr 5, 2013 at 7:27 PM, Brian Paul <span dir="ltr"><<a href="mailto:brianp@vmware.com" target="_blank">brianp@vmware.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Don't check if there's sampler support for stencil if we're not<br>
going to actually blit/copy stencil values. Fixes the case where<br>
we mistakenly said we can't support a blit of depth values from<br>
S8Z24 to X8Z24.<br>
<br>
Also, rename the is_stencil variable to dst_has_stencil to improve<br>
readability.<br>
<br>
NOTE: This is a candidate for the stable branches.<br>
---<br>
src/gallium/auxiliary/util/u_blitter.c | 28 +++++++++++++++-------------<br>
1 files changed, 15 insertions(+), 13 deletions(-)<br>
<br>
diff --git a/src/gallium/auxiliary/util/u_blitter.c b/src/gallium/auxiliary/util/u_blitter.c<br>
index 70fec91..2a4a13e 100644<br>
--- a/src/gallium/auxiliary/util/u_blitter.c<br>
+++ b/src/gallium/auxiliary/util/u_blitter.c<br>
@@ -1135,18 +1135,17 @@ static boolean is_blit_generic_supported(struct blitter_context *blitter,<br>
<br>
if (dst) {<br>
unsigned bind;<br>
- boolean is_stencil;<br>
const struct util_format_description *desc =<br>
util_format_description(dst_format);<br>
-<br>
- is_stencil = util_format_has_stencil(desc);<br>
+ boolean dst_has_stencil = util_format_has_stencil(desc);<br>
<br>
/* Stencil export must be supported for stencil copy. */<br>
- if ((mask & PIPE_MASK_S) && is_stencil && !ctx->has_stencil_export) {<br>
+ if ((mask & PIPE_MASK_S) && dst_has_stencil &&<br>
+ !ctx->has_stencil_export) {<br>
return FALSE;<br>
}<br>
<br>
- if (is_stencil || util_format_has_depth(desc))<br>
+ if (dst_has_stencil || util_format_has_depth(desc))<br>
bind = PIPE_BIND_DEPTH_STENCIL;<br>
else<br>
bind = PIPE_BIND_RENDER_TARGET;<br>
@@ -1168,15 +1167,18 @@ static boolean is_blit_generic_supported(struct blitter_context *blitter,<br>
}<br>
<br>
/* Check stencil sampler support for stencil copy. */<br>
- if (util_format_has_stencil(util_format_description(src_format))) {<br>
- enum pipe_format stencil_format =<br>
+ if (mask & PIPE_MASK_S) {<br>
+ if (util_format_has_stencil(util_format_description(src_format))) {<br>
+ enum pipe_format stencil_format =<br>
util_format_stencil_only(src_format);<br>
- assert(stencil_format != PIPE_FORMAT_NONE);<br>
+ assert(stencil_format != PIPE_FORMAT_NONE);<br>
<br>
- if (stencil_format != src_format &&<br>
- !screen->is_format_supported(screen, stencil_format, src->target,<br>
- src->nr_samples, PIPE_BIND_SAMPLER_VIEW)) {<br>
- return FALSE;<br>
+ if (stencil_format != src_format &&<br>
+ !screen->is_format_supported(screen, stencil_format,<br>
+ src->target, src->nr_samples,<br>
+ PIPE_BIND_SAMPLER_VIEW)) {<br>
+ return FALSE;<br>
+ }<br>
}<br>
}<br>
}<br>
<span class="HOEnZb"><font color="#888888">--<br>
1.7.3.4<br>
<br>
_______________________________________________<br>
mesa-dev mailing list<br>
<a href="mailto:mesa-dev@lists.freedesktop.org">mesa-dev@lists.freedesktop.org</a><br>
<a href="http://lists.freedesktop.org/mailman/listinfo/mesa-dev" target="_blank">http://lists.freedesktop.org/mailman/listinfo/mesa-dev</a><br>
</font></span></blockquote></div><br></div>