On Wed, Feb 9, 2022 at 7:43 PM Henri Verbeet hverbeet@gmail.com wrote:
On Wed, 9 Feb 2022 at 16:50, Matteo Bruni mbruni@codeweavers.com wrote:
@@ -1802,7 +1802,7 @@ static HRESULT shader_get_registers_used(struct wined3d_shader *shader, DWORD co if (input_signature->elements[i].register_idx >= ARRAY_SIZE(shader->u.vs.attributes)) { WARN("Invalid input signature register index %u.\n", input_signature->elements[i].register_idx);
return WINED3DERR_INVALIDCALL;
continue; }
I don't know what specifically happens with the application mentioned in the commit message, but note that the WARN above can be somewhat misleading. vs_4_1 and vs_5_0 support 32 input registers, but wined3d's MAX_ATTRIBS (used to size the "attributes" array above) is defined as 16.
Oh, right. Not sure what we want to do here e.g. just raise MAX_ATTRIBS or check against a per-shader profile limit. At any rate I will look into that.
The shader referred by the commit message is a bit weird in that it has in its input signature:
05ec:trace:d3d_shader:shader_parse_signature Stream: 0, semantic: "SV_InstanceID", semantic idx: 0, sysval_semantic 0x8, type 1, register idx: 16, use_mask 0, input_mask 0x1.
but then there is no corresponding dcl_input_sv for it. I thought that was because of the 16 inputs limit but, as you point out, that's not it (and indeed it's a vs_5_0 shader). Maybe that's what happens when the HLSL shader declares an input variable that's never used, potentially because of #ifdefs and such.