Use atomicExchange over atomicCompSwap

Significant perf win (approx 2x in the path coarse rasterizer)
This commit is contained in:
Raph Levien 2020-06-05 08:24:26 -07:00
parent e5dd9ae01e
commit f9f5961428
2 changed files with 1 additions and 6 deletions

View file

@ -146,12 +146,7 @@ void main() {
if (x < xx1) {
uint tile_offset = alloc_start + ix * TileSeg_size;
uint tile_el = (sh_base[el_ix] + uint(y * sh_stride[el_ix] + x) * Tile_size) >> 2;
uint old;
uint actual;
do {
old = tile[tile_el];
actual = atomicCompSwap(tile[tile_el], old, tile_offset);
} while (actual != old);
uint old = atomicExchange(tile[tile_el], tile_offset);
TileSeg tile_seg;
tile_seg.start = sh_p0[el_ix];
tile_seg.end = sh_p1[el_ix];

Binary file not shown.