intel/compiler: Properly consider UBO loads that cross 32B boundaries.
authorKenneth Graunke <kenneth@whitecape.org>
Fri, 8 Jun 2018 21:24:16 +0000 (14:24 -0700)
committerKenneth Graunke <kenneth@whitecape.org>
Wed, 13 Jun 2018 09:07:58 +0000 (02:07 -0700)
commitb8fa847c2ed9c7c743f31e57560a09fae3992f46
treec360bd6dd8c6a19cdb9bf23e7691cb90729a572f
parent3c288da5eec81ee58b85927df18d9194ead8f5c2
intel/compiler: Properly consider UBO loads that cross 32B boundaries.

The UBO push analysis pass incorrectly assumed that all values would fit
within a 32B chunk, and only recorded a bit for the 32B chunk containing
the starting offset.

For example, if a UBO contained the following, tightly packed:

   vec4 a;  // [0, 16)
   float b; // [16, 20)
   vec4 c;  // [20, 36)

then, c would start at offset 20 / 32 = 0 and end at 36 / 32 = 1,
which means that we ought to record two 32B chunks in the bitfield.

Similarly, dvec4s would suffer from the same problem.

Reviewed-by: Rafael Antognolli <rafael.antognolli@intel.com>
src/intel/compiler/brw_nir_analyze_ubo_ranges.c