Storing the Vulkan view handle in the descriptor should still work with this if it's useful for descriptor updates (in fact it can even be done without increasing the descriptor size since the VkDescriptorBufferInfo struct in the union pushes the whole thing to 32 bytes anyway), but the previous implementation stored a lot of data in the descriptor that wasn't really needed at all most of the time. ClearUAV and friends are rare and heavy enough that, dereferencing the view pointer really isn't a performance concern at all.
Am 12.11.19 um 05:19 schrieb Conor McCarthy:
On Tue, Nov 12, 2019 at 2:40 AM Philip Rebohle <philip.rebohle@tu-dortmund.de mailto:philip.rebohle@tu-dortmund.de> wrote:
Moving this out of d3d12_desc also helps make copying and traversing descriptor arrays more CPU cache-friendly.
Making descriptors smaller would help, but the most likely cause of a cache miss is accessing two objects located far apart in memory. Reading data from a descriptor and then other data via a view pointer creates this situation. I made a new version of the cache coherence patch which eliminates use of vkd3d_view for CBV, SRV and UAV descriptors and only stores a refcount on the heap, but haven't sent it because it conflicts with a pending patch. It only gains 0.5% fps, so if new implementations need an expanded view struct instead then that takes precedence. CPU caching is worth taking into account though.
Conor