Avokadoen / zig_vulkan

Toying with vulkan and zig
45 stars 2 forks source link

Better lock logic for bucket storage #102

Closed Avokadoen closed 2 years ago

Avokadoen commented 2 years ago

Currently bucket storage is bottlenecked by a single mutex locking getBrickBucket

Related issue: #98

Proposal

Split the index: []?Index in BucketStorage so that each worker has their unique index array This would make getting a index lockless.

We then use one mutex for each bucket size so that there is one mutex for 512 buckets, one for 256 buckets ... etc

This would resolve both #102 and #98 and hopefully show some performance gain and without causing excessive GPU memory fragmentation