> > > In practice I see a number of difficulties:
> > >
> > > * Shaders are not just code; they also embed interface information (input and output signatures, uniforms, buffers, object bindings, ...) and other random metadata (for example for the hull shaders). Should this be representable in the common IR?
> >
> > We need *some* way to represent that information so it doesn't get lost, at least. I think we don't want side channels, to be clear: I think that there should be a point where all of the information relevant to a shader is represented in v_s_i format, including metadata.
> >
> > And contrary to the instructions themselves, I think we want this information to be in a relatively simple and well-designed form. In a sense, it doesn't need to be "complex" like the instructions since we're not doing optimization passes over it \[if that makes sense\]. I think Conor has basically been pushing v_s_i in this direction in order to accommodate sm6 (at least wrt semantics), and given the tribulations I've had to endure to get sm1 to work, I think that's the right approach.
>
> Yes, although I don't think that necessarily means storing these as "instructions". The approach I'm personally leaning towards at this point is to rebrand "struct vkd3d_shader_instruction_array" as "struct vkd3d_shader_program" (or something along those lines), and then add the input/output/patch constant signatures and the shader version structure to that structure. I think a similar approach should work for e.g. RDEF as well.
Yes, agreed wholeheartedly there.
--
https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/174#note_31662
> This is causing several GStreamer-Video-CRITICAL messages to be printed while running the tests:
Indeed. Looking into these might be a good idea, but on the other hand, if there's no actual regression in behaviour then I don't think we care.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/2546#note_31661
See https://bugs.winehq.org/show_bug.cgi?id=54832
I'm starting to see this particular FIXME in quite a few games (Escape Goat 2, Murder Miners, and Little Racers STREET to name a few), and since I'm not sure how to fix this I figured I could at least provide a test for someone that knows more SM4 than me :P
--
v3: tests: Add a test for arrays with an expression as the index.
https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/189
Otherwise, in the added test, we get:
```
vkd3d-compiler: vkd3d-shader/hlsl.c:452: hlsl_init_deref_from_index_chain: Assertion `chain' failed.
```
because on the path that triggers the following error:
```
E5002: Wrong type for argument 1 of 'tex3D': expected 'sampler' or 'sampler3D', but got 'sampler2D'.
```
a NULL params.resource is passed to hlsl_new_resource_load() and
then to hlsl_init_deref_from_index_chain().
--
v2: vkd3d-shader/hlsl: Always specify resource on intrinsic_tex().
https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/183
This is required by https://bugs.winehq.org/show_bug.cgi?id=54660 .
--
v10: vkd3d-shader/hlsl: Consider duplicated input semantic types equivalent in SM1.
vkd3d-shader/hlsl: Handle possibly different types in input semantic var load.
vkd3d-shader/hlsl: Error out when a semantic is used with incompatible types.
vkd3d-shader/hlsl: Error out when an output semantic is used more than once.
vkd3d-shader/hlsl: Support semantics for array types.
https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/148