nvrhi icon indicating copy to clipboard operation
nvrhi copied to clipboard

Thread safety documentation

Open f6cd opened this issue 1 year ago • 1 comments

I was looking at implementing multi-threading in my engine for uploading textures. I used the CommandList::writeTexture method. Unfortunately this causes a crash, as although it's a member of the command list (which should be able to be recorded in parallel?), behind the scenes it interfaces with the (Vulkan) device to allocate memory.

Some documentation on which methods are thread safe, and an overview of how to safely use them in the Programming Guide would be very helpful I think? Thanks

f6cd avatar Mar 16 '23 18:03 f6cd

Thanks for bringing this up. The intention is that all CommandList methods should be thread-safe, but apparently some things are broken in that sense. To my knowledge, we haven't done extensive multi-threaded testing of NVRHI to find those bugs, and that's something that should be done, and bugs should be fixed.

apanteleev avatar Mar 20 '23 16:03 apanteleev