util,gallium: put count in pipe_resource & pipe_sampler_view on its own cache line for faster atomics
This adds 60 bytes to both structures. It makes atomic operations faster by eliminating "False Sharing" (see wikipedia). The changes are trivial.
Most resource updates are better.
Test | Before | After | Delta | |
---|---|---|---|---|
DrawArrays ( 1 VBO, 0 UBO, 0 ) w/ no state change | 43673 | 45067 | 3.19% | |
DrawElements ( 1 VBO, 0 UBO, 0 ) w/ no state change | 42878 | 43817 | 2.19% | |
DrawElements (16 VBO, 8 UBO, 16 Tex) w/ no state change | 43009 | 43802 | 1.84% | |
DrawElements ( 1 VBO, 1 UBO, 1 Tex) w/ buffer replacement change | 1064 | 947 | -11.00% | posix_memalign adds overhead for resource_create, optimize manually |
DrawElements ( 1 VBO, 8 UBO, 8 Tex) w/ 1 vertex attrib change | 4669 | 4800 | 2.81% | |
DrawElements (16 VBO, 8 UBO, 8 Tex) w/ 16 vertex attribs change | 1525 | 1546 | 1.38% | |
DrawElements ( 1 VBO, 0 UBO, 0 ) w/ shader program change | 714 | 714 | 0.00% | |
DrawElements ( 8 VBO, 8 UBO, 8 Tex) w/ shader program change | 486 | 485 | -0.21% | |
DrawElements ( 8 VBO, 8 UBO, 1 Tex) w/ 1/1 texture change | 2536 | 2560 | 0.95% | |
DrawElements ( 8 VBO, 8 UBO, 8 Tex) w/ 1/8 texture change | 1378 | 1443 | 4.72% | |
DrawElements ( 8 VBO, 8 UBO, 8 Tex) w/ 8/8 textures change | 1107 | 1229 | 11.02% | |
DrawElements ( 8 VBO, 8 UBO, 1 TBO) w/ 1/1 TBO change | 2574 | 2572 | -0.08% | |
DrawElements ( 8 VBO, 8 UBO, 8 TBO) w/ 1/8 TBO change | 1430 | 1485 | 3.85% | |
DrawElements ( 8 VBO, 8 UBO, 8 TBO) w/ 8/8 TBOs change | 1219 | 1334 | 9.43% | |
DrawElements ( 8 VBO, 8 UBO, 1 Img) w/ 1/1 image change | 2360 | 2374 | 0.59% | |
DrawElements ( 8 VBO, 8 UBO, 8 Img) w/ 1/8 image change | 1233 | 1312 | 6.41% | |
DrawElements ( 8 VBO, 8 UBO, 8 Img) w/ 8/8 images change | 1145 | 1215 | 6.11% | |
DrawElements ( 8 VBO, 8 UBO, 1 ImB) w/ 1/1 image buffer change | 2544 | 2503 | -1.61% | |
DrawElements ( 8 VBO, 8 UBO, 8 ImB) w/ 1/8 image buffer change | 1364 | 1601 | 17.38% | |
DrawElements ( 8 VBO, 8 UBO, 8 ImB) w/ 8/8 image buffers change | 1324 | 1421 | 7.33% | |
DrawElements ( 8 VBO, 1 UBO, 8 Tex) w/ 1/1 UBO change | 2357 | 2471 | 4.84% | |
DrawElements ( 8 VBO, 8 UBO, 8 Tex) w/ 1/8 UBO change | 1251 | 1295 | 3.52% | |
DrawElements ( 8 VBO, 8 UBO, 8 Tex) w/ 8/8 UBOs change | 1245 | 1300 | 4.42% | |
DrawElements ( 8 VBO, 8 UBO, 8 Tex) w/ few uniforms / 1 change | 1594 | 1579 | -0.94% | |
DrawElements ( 8 VBO, 8 UBO, 8 Tex) w/ many uniforms / 1 change | 334 | 334 | 0.00% | |
DrawElements ( 8 VBO, 8 UBO, 8 Tex) w/ scissor change | 7617 | 7650 | 0.43% | |
DrawElements ( 8 VBO, 8 UBO, 8 Tex) w/ viewport change | 2213 | 2205 | -0.36% | |
DrawElements ( 8 VBO, 8 UBO, 8 Tex) w/ primitive restart enable change | 8204 | 8191 | -0.16% | |
DrawElements ( 8 VBO, 8 UBO, 8 Tex) w/ blend enable change | 4687 | 4700 | 0.28% | |
DrawElements ( 8 VBO, 8 UBO, 8 Tex) w/ depth enable change | 6099 | 6087 | -0.20% | |
DrawElements ( 8 VBO, 8 UBO, 8 Tex) w/ depth clamp enable change | 6228 | 6477 | 4.00% | |
DrawElements ( 8 VBO, 8 UBO, 8 Tex) w/ stencil enable change | 5903 | 5993 | 1.52% | |
DrawElements ( 8 VBO, 8 UBO, 8 Tex) w/ scissor enable change | 6433 | 6516 | 1.29% | |
DrawElements ( 8 VBO, 8 UBO, 8 Tex) w/ MSAA enable change | 6890 | 7198 | 4.47% | |
DrawElements ( 8 VBO, 8 UBO, 8 Tex) w/ sample mask enable change | 17547 | 17694 | 0.84% | |
DrawElements ( 8 VBO, 8 UBO, 8 Tex) w/ alpha-to-coverage enable change | 15728 | 15275 | -2.88% | |
DrawElements ( 8 VBO, 8 UBO, 8 Tex) w/ sample shading enable change | 8830 | 8598 | -2.63% | |
DrawElements ( 8 VBO, 8 UBO, 8 Tex) w/ cull face enable change | 7020 | 6994 | -0.37% | |
DrawElements ( 8 VBO, 8 UBO, 8 Tex) w/ clip distance enable change | 4797 | 4875 | 1.63% |