[Mesa-dev] [PATCH] i965: use mt->offset in intel_miptree_map_movntdqa().

Chad Versace chad at kiwitree.net
Tue Aug 2 23:48:52 UTC 2016


On 08/02/2016 04:35 PM, Chad Versace wrote:
> On 08/02/2016 04:17 PM, Haixia Shi wrote:
>> We need to include mt->offset in the calculation of src pointer
>> because its
>> value may be non-zero, for example in a cubemap texture.
>>
>> Signed-off-by: Haixia Shi <hshi at chromium.org>
>> Cc: Jason Ekstrand <jason.ekstrand at intel.com>
>> Cc: kenneth.w.graunke at intel.com
>> Cc: Chad Versace <chad at kiwitree.net>
>>
>> Change-Id: I461ad5b204626d5a1c45611fc6b63735dcf29f63
>> ---
>>  src/mesa/drivers/dri/i965/intel_mipmap_tree.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
>> b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
>> index a988221..a3d921f 100644
>> --- a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
>> +++ b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
>> @@ -2459,7 +2459,7 @@ intel_miptree_map_movntdqa(struct brw_context *brw,
>>     image_x += map->x;
>>     image_y += map->y;
>>
>> -   void *src = intel_miptree_map_raw(brw, mt);
>> +   void *src = intel_miptree_map_raw(brw, mt) + mt->offset;
>>     if (!src)
>>        return;
>>     src += image_y * mt->pitch;
>
> Reviewed-by: Chad Versace <chad at kiwitree.net>
>
> I'll wait for others to voice any opposition before committing.

Oops. I retract my r-b. There's actually a small bug in the patch. The
test for !src needs to occur before adding the mt->offset. Otherwise,
the test may pass with a false positive.

Fix the bug, and I'll add my r-b back.



More information about the mesa-dev mailing list