[Mesa-dev] [PATCH 1/3] nvc0: fix blit triangle size to fully cover FB's > 8192x8192

Ilia Mirkin imirkin at alum.mit.edu
Sun Mar 13 15:03:21 UTC 2016


On Sun, Mar 13, 2016 at 7:43 AM, Samuel Pitoiset
<samuel.pitoiset at gmail.com> wrote:
> What about nv50? Is there the same issue?

Yes, but nv50's max fb size is 8192x8192, and there the blit
triangle's size is 16384x16384, so it all works out. (Also nv50 has
some funny business wrt MS textures that ends up being a bit different
on nvc0)

> Don't you need to update nvc0_clear_buffer() accordingly?

I don't think so, but perhaps I'm missing something? clear_buffer
doesn't draw any triangles... the point of this blit is to draw a
triangle that rasterizes over the full fb. By making the w/h of the
tri 2x the fb size, we ensure that the full fb is covered... here's
some ASCII art that might help:

+-----+-----/
|     |   /
|     | /
+-----/
|   /
| /
/

note that the width of a char is 2x the height, which is why it looks
a bit funny. The square in the middle is the fb, and the larger
triangle is defined by the position coordinates that we're providing.


>
>
> On 03/13/2016 04:07 AM, Ilia Mirkin wrote:
>>
>> The idea is that a single triangle will cover the whole area being
>> drawn, allowing the blit shader to do its work. However the max fb size
>> is 16384x16384, which means that the triangle we draw needs to be twice
>> that in order to cover the whole area fully. Increase the size of the
>> triangle to 32768x32768.
>>
>> This fixes a number of dEQP tests that were failing because a blit was
>> involved which would miss some of the resulting texture.
>>
>> Signed-off-by: Ilia Mirkin <imirkin at alum.mit.edu>
>> Cc: "11.1 11.2" <mesa-stable at lists.freedesktop.org>
>> ---
>>   src/gallium/drivers/nouveau/nvc0/nvc0_surface.c | 8 ++++----
>>   1 file changed, 4 insertions(+), 4 deletions(-)
>>
>> diff --git a/src/gallium/drivers/nouveau/nvc0/nvc0_surface.c
>> b/src/gallium/drivers/nouveau/nvc0/nvc0_surface.c
>> index ccfc9e2..f2ad4bf 100644
>> --- a/src/gallium/drivers/nouveau/nvc0/nvc0_surface.c
>> +++ b/src/gallium/drivers/nouveau/nvc0/nvc0_surface.c
>> @@ -1215,8 +1215,8 @@ nvc0_blit_3d(struct nvc0_context *nvc0, const struct
>> pipe_blit_info *info)
>>      x0 = (float)info->src.box.x - x_range * (float)info->dst.box.x;
>>      y0 = (float)info->src.box.y - y_range * (float)info->dst.box.y;
>>
>> -   x1 = x0 + 16384.0f * x_range;
>> -   y1 = y0 + 16384.0f * y_range;
>> +   x1 = x0 + 32768.0f * x_range;
>> +   y1 = y0 + 32768.0f * y_range;
>>
>>      x0 *= (float)(1 << nv50_miptree(src)->ms_x);
>>      x1 *= (float)(1 << nv50_miptree(src)->ms_x);
>> @@ -1327,14 +1327,14 @@ nvc0_blit_3d(struct nvc0_context *nvc0, const
>> struct pipe_blit_info *info)
>>         *(vbuf++) = fui(y0);
>>         *(vbuf++) = fui(z);
>>
>> -      *(vbuf++) = fui(16384 << nv50_miptree(dst)->ms_x);
>> +      *(vbuf++) = fui(32768 << nv50_miptree(dst)->ms_x);
>>         *(vbuf++) = fui(0.0f);
>>         *(vbuf++) = fui(x1);
>>         *(vbuf++) = fui(y0);
>>         *(vbuf++) = fui(z);
>>
>>         *(vbuf++) = fui(0.0f);
>> -      *(vbuf++) = fui(16384 << nv50_miptree(dst)->ms_y);
>> +      *(vbuf++) = fui(32768 << nv50_miptree(dst)->ms_y);
>>         *(vbuf++) = fui(x0);
>>         *(vbuf++) = fui(y1);
>>         *(vbuf++) = fui(z);
>>
>


More information about the mesa-dev mailing list