On 14 Apr 2021, at 14:00, Henri Verbeet hverbeet@gmail.com wrote:
On Wed, 14 Apr 2021 at 13:37, Jan Sikorski jsikorski@codeweavers.com wrote:
Include these inputs in the Vulkan pipeline input descriptor. This prevents MoltenVK from rejecting the pipeline when they are consumed by the shader. We should probably also bind a null resource in that case to comply with Vulkan spec.
I don't think we particularly care about MoltenVK's behaviour, as such. The pertinent questions would probably be whether Direct3D has any defined behaviour across drivers for this (which implies tests), and what the Vulkan spec says.
According to the validation layer, it seems that in d3d it’s ok to not set a buffer, the IA will provide zeros on such inputs. Tests seem to confirm that, except for d3d10 on Vista, which crashes - by the way, what would be the correct way to handle that, if (vista) skip? In Vulkan I get a validation error on the shader module saying “Vertex shader consumes input at location # but not provided”, without a link to the spec. That said this patch only fixes the shader part, there still should be a buffer or NULL_HANDLE bound in the command buffer, relevant links: https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkCmdD... https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkCmdD... The second one seems to imply that we need to actually bind a zeroed buffer in case the shader reads it. I guess I might as well take a shot at the binding issue and then resend with the tests included..
- Janek