[Mesa-dev] [PATCH] intel: Fix copying of separate stencil data in glCopyTexSubImage().

Eric Anholt eric at anholt.net
Mon Jun 3 14:22:35 PDT 2013


Jordan Justen <jljusten at gmail.com> writes:

> On Thu, May 30, 2013 at 3:47 PM, Eric Anholt <eric at anholt.net> wrote:
>> We were copying the source stencil data onto the destination depth data.
>>
>> Fixes piglit copyteximage other than 1D_ARRAY.
>> ---
>>  src/mesa/drivers/dri/i965/brw_blorp_blit.cpp | 10 ++++++++--
>>  1 file changed, 8 insertions(+), 2 deletions(-)
>>
>> diff --git a/src/mesa/drivers/dri/i965/brw_blorp_blit.cpp b/src/mesa/drivers/dri/i965/brw_blorp_blit.cpp
>> index c3ef054..67c40a7 100644
>> --- a/src/mesa/drivers/dri/i965/brw_blorp_blit.cpp
>> +++ b/src/mesa/drivers/dri/i965/brw_blorp_blit.cpp
>> @@ -375,10 +375,16 @@ brw_blorp_copytexsubimage(struct intel_context *intel,
>>     if (_mesa_get_format_bits(dst_image->TexFormat, GL_STENCIL_BITS) > 0 &&
>>         src_rb != NULL) {
>>        src_irb = intel_renderbuffer(src_rb);
>> -      if (src_irb->mt != src_mt)
>
> Was this previous 'if' a mistake? I see the brw_blorp_blit_miptrees
> call was not indented previously, and it was separated by a line.

Good catch!  It wasn't a mistake -- if one was to copy a real packed
depth/stencil to packed depth/stencil, you wouldn't want to copy it
twice.  Bad indentation on my part in the previous code made me lose
track of what was going on.

>> +      src_mt = src_irb->mt;
>> +
>> +      if (src_mt->stencil_mt)
>> +         src_mt = src_mt->stencil_mt;
>
> else
>      src_mt = src_irb->mt;
> ?

The previous pattern is common, so I'll leave it.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20130603/9ec0ec37/attachment.pgp>


More information about the mesa-dev mailing list