[PATCH vkd3d 2/2] vkd3d: Write a resource null descriptor to all applicable sets when one set is written.

Conor McCarthy cmccarthy at codeweavers.com
Mon Mar 21 19:44:17 CDT 2022


March 22, 2022 3:14 AM, "Henri Verbeet" <hverbeet at gmail.com> wrote:

> Perhaps I'm just a bit "out of it", but it's not clear to me what "the
> wrong null descriptor type" means above. I gather from the contents of
> the patch that if we're writing a NULL descriptor at a particular
> index we should also clear other descriptor types at that same index;
> is that right? That would make sense, but I'd also imagine that would
> be the case if we're writing a non-NULL descriptor. A test
> demonstrating the issue would also be helpful, of course...

A root signature descriptor range may declare, say, an SRV, and a shader may bind to it as such, but there's no constraint on what actually gets written there, so the client may write a UAV. This works if the descriptor is null, but with Vulkan-backed heaps, the UAV will be in a different set, and the shader accessing the SRV set will find an uninitialised descriptor.

This problem can also be eliminated by mutable descriptors, which all go in one set. The reduction in resource usage alone makes them worthwhile, so I intend to make a patch, but they are only available on RADV.


> So at the risk that I'm just not understanding the issue very well,
> why does this need EXT_robustness2, and why is it limited to the case
> where a NULL descriptor is written?

It's much simpler with EXT_robustness2. Otherwise we'd need to create a set of null views. I assume the dimension won't matter much, e.g. if a null 3D SRV is written, a null 2D UAV will work in the UAV set. We could do that, but since the issue will only exist where descriptor indexing is available but EXT_robustness2 is not, I think it will show up rarely.



More information about the wine-devel mailing list