This patch makes index expressions on resources hlsl_ir_index nodes
instead of hlsl_ir_resource_load nodes, because it is not known if they
will be used later as the lhs of an hlsl_ir_resource_store.
For now, the only benefit is consistency.
--
v2: vkd3d-shader/hlsl: Don't keep the implicit mipmap level on hlsl_ir_index.
https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/182
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
From what I can tell, the recent work on SampleBias/SampleLevel did all of the work for us, we just need to take the same framework and include the case for the `sample_l` instruction.
Tested with some shaders from the native Linux version of Little Racers STREET.
--
v5: vkd3d-shader/tpf: For sample_l/sample_b, set lod swizzle to SCALAR.
https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/188