Re: [Mesa-dev] [PATCH] trace: Correct transfer box size calculation.

2017-07-24 Thread Cherniak, Bruce
> On Jul 24, 2017, at 10:22 AM, Roland Scheidegger wrote: > > Am 24.07.2017 um 15:26 schrieb Jose Fonseca: >> In particular: >> >> 1) For buffers the box expresses bytes, not pixels. > This shouldn't be an issue, since buffers are required to have a 1-byte > format (usually

Re: [Mesa-dev] [PATCH] trace: Correct transfer box size calculation.

2017-07-24 Thread Jose Fonseca
> This shouldn't be an issue, since buffers are required to have a 1-byte format Ah OK. I was no longer sure. In that case, I can leave the single code path and put an assert as you suggested. Jose From: Roland Scheidegger Sent: Monday, July 24, 2017 16:22

Re: [Mesa-dev] [PATCH] trace: Correct transfer box size calculation.

2017-07-24 Thread Roland Scheidegger
Am 24.07.2017 um 15:26 schrieb Jose Fonseca: > In particular: > > 1) For buffers the box expresses bytes, not pixels. This shouldn't be an issue, since buffers are required to have a 1-byte format (usually R8_UINT, but R8_UNORM works too). (llvmpipe_transfer_map, for instance, will still do all

[Mesa-dev] [PATCH] trace: Correct transfer box size calculation.

2017-07-24 Thread Jose Fonseca
In particular: 1) For buffers the box expresses bytes, not pixels. 2) For textures we must not approximate the calculation with `stride * height`, or `slice_stride * depth`, as that can easily lead to buffer overflows, particularly for partial transfers. But this code path is not