[Mesa-dev] [PATCH 14/14] radeonsi: increase the maximum UBO size to 2 GB

Marek Olšák maraeo at gmail.com
Thu Aug 9 16:12:46 UTC 2018


piglit testing the max uniform block size:

Before:

FRAG
PROPERTY FS_COLOR0_WRITES_ALL_CBUFS 1
DCL OUT[0], COLOR
DCL CONST[0][0]
DCL CONST[1][0..4095]
DCL TEMP[0], LOCAL
IMM[0] UINT32 {0, 16, 0, 0}
  0: UMUL TEMP[0].x, CONST[0][0].xxxx, IMM[0].yyyy
  1: LOAD OUT[0], CONSTBUF[1], TEMP[0].xxxx
  2: END


After:

FRAG
PROPERTY FS_COLOR0_WRITES_ALL_CBUFS 1
DCL OUT[0], COLOR
DCL CONST[0][0]
DCL CONST[1][0..65527]
DCL TEMP[0], LOCAL
IMM[0] UINT32 {0, 16, 0, 0}
  0: UMUL TEMP[0].x, CONST[0][0].xxxx, IMM[0].yyyy
  1: LOAD OUT[0], CONSTBUF[1], TEMP[0].xxxx
  2: END

CONST[1] is fairly small, but the UBO has 2GB, and CONST[0][0]
contains 134217719, so the final offset is 2147483504.

Marek

On Thu, Aug 9, 2018 at 11:57 AM, Marek Olšák <maraeo at gmail.com> wrote:
> On Thu, Aug 9, 2018 at 1:35 AM, Roland Scheidegger <sroland at vmware.com> wrote:
>> I'm not quite convinced you can really use huge ubos safely? At least
>> direct addressing in tgsi can't work (you've only got a 16bit register
>> index, and it's signed too).
>
> UBOs use the LOAD instruction if PIPE_CAP_LOAD_CONSTBUF is supported.
>
> Marek


More information about the mesa-dev mailing list