radeonsi: use faster integer division for instance divisors
authorMarek Olšák <marek.olsak@amd.com>
Sun, 23 Sep 2018 02:02:32 +0000 (22:02 -0400)
committerMarek Olšák <marek.olsak@amd.com>
Tue, 16 Oct 2018 21:23:25 +0000 (17:23 -0400)
commit0b40fbc8796b8e204e7af45b3d39b67d20fb3da7
treee53e6f95f9a4b86339d14c1ce2ea07b355d94d00
parentbfc795670ec82af5767cf360806e32322664604e
radeonsi: use faster integer division for instance divisors

We know the divisors when we upload them, so instead we can precompute
and upload division factors derived from each divisor.

This fast division consists of add, mul_hi, and two shifts,
and we have to load 4 dwords intead of 1.

This probably won't affect any apps.
src/gallium/drivers/radeonsi/si_shader.c
src/gallium/drivers/radeonsi/si_state.c
src/gallium/drivers/radeonsi/si_state.h