[PATCH] wined3d: Allow wined3d_stream_info_from_declaration() to include inputs with no buffer set.

Jan Sikorski jsikorski at codeweavers.com
Wed Apr 14 10:45:59 CDT 2021


> On 14 Apr 2021, at 14:00, Henri Verbeet <hverbeet at gmail.com> wrote:
> 
> On Wed, 14 Apr 2021 at 13:37, Jan Sikorski <jsikorski at 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/vkCmdDraw.html#VUID-vkCmdDraw-None-04007 https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkCmdDraw.html#VUID-vkCmdDraw-None-02721
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


More information about the wine-devel mailing list