[Mesa-dev] [PATCH 5/8] i965: Simplify intel_miptree_updownsample.

Eric Anholt eric at anholt.net
Tue Feb 18 09:41:10 PST 2014


Kenneth Graunke <kenneth at whitecape.org> writes:

> On 02/14/2014 03:00 PM, Eric Anholt wrote:
>> Pretty silly to pass in values dereferenced out of one of the arguments.
>> ---
>>  src/mesa/drivers/dri/i965/intel_mipmap_tree.c | 35 +++++++++------------------
>>  1 file changed, 11 insertions(+), 24 deletions(-)
>> 
>> diff --git a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
>> index 08b8475..86a3887 100644
>> --- a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
>> +++ b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
>> @@ -1619,32 +1619,25 @@ intel_offset_S8(uint32_t stride, uint32_t x, uint32_t y, bool swizzled)
>>  static void
>>  intel_miptree_updownsample(struct brw_context *brw,
>>                             struct intel_mipmap_tree *src,
>> -                           struct intel_mipmap_tree *dst,
>> -                           unsigned width,
>> -                           unsigned height)
>> +                           struct intel_mipmap_tree *dst)
>>  {
>> -   int src_x0 = 0;
>> -   int src_y0 = 0;
>> -   int dst_x0 = 0;
>> -   int dst_y0 = 0;
>> -
>
> It would be great to add a comment here stating that the use of src's
> logical dimensions in both cases is intentional.  Otherwise, it looks
> like a cut and paste bug to the casual observer.

I just switched to using the dst mt for destination size.  No sense
being weird-looking just because the callers happen to always have src
== dst size.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 818 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20140218/8bc0ef88/attachment-0001.pgp>


More information about the mesa-dev mailing list