-
Notifications
You must be signed in to change notification settings - Fork 98
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Shader resource arrays #29
Comments
Thanks for pointing this out... it's a difficult topic. Descriptor arrays are unique to Vulkan and, as you noted, currently not supported in regular binding sets. It is possible to make a descriptor array using I'm not sure why using a descriptor array in the shader but separate bindings on the host side works, but it does work on both NV and AMD hardware. It's possible to silence the validation layer by using an unsized array in the shader, which is what I've just done to the mipmapgen pass. Looks like nobody has tried to use that pass on Vulkan before, because there were more bugs in the implementation. Another possible fix for this pass specifically would be to use Ideally, of course, descriptor arrays should be supported by NVRHI, but that is not trivial to implement. Issues start with there being not enough unused bits in Alternatively, maybe introduce a |
The unsized array for Vulkan seems to be a good workaround but in long term the DescriptorArray type would be very helpful. Did not find a lot of shaders which use this feature so the priority is not that high in my opinion. |
It seems that currently arrays of resources are not possible. E.g mipmapgen_cs from donut causes an validation error (Vulkan):
Shader expects at least 13 descriptors for binding 0.384 but only 1 provided The Vulkan spec states: layout must be consistent with the layout of the compute shader specified in stage
.While it works on both Vulkan and DX it might be then driver related (RTX 3080).
I am not too familiar with the DX implementation but it could be correct as it groups same resources? For Vulkan this might be hard to support without providing the concept of arrays in layout/bindingset items.
The text was updated successfully, but these errors were encountered: