We are currently not initializing static values to zero by default.
Consider the following shader:
```hlsl
static float4 va;
float4 main() : sv_target
{
return va;
}
```
we get the following output:
```
ps_5_0
dcl_output o0.xyzw
dcl_temps 2
mov r0.xyzw, r1.xyzw
mov o0.xyzw, r0.xyzw
ret
```
where r1.xyzw is not initialized.
This patch solves this by assigning the static variable the value of an
uint 0, and thus, relying on complex broadcasts.
This seems to be the behaviour of the the native compiler, since it retrieves
the following error on a shader that lacks an initializer on a data type with
object components:
```
error X3017: cannot convert from 'uint' to 'struct <unnamed>'
```
--
v6: vkd3d-shader/hlsl: Allow uninitialized static objects.
vkd3d-shader/hlsl: Validate that non-uniform objects are not referenced.
tests: Add additional object references tests.
https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/54
--
v3: vkd3d-shader/hlsl: Get rid of the "intrinsic" field of struct hlsl_ir_function.
vkd3d-shader/hlsl: Forbid returning void expressions from void functions.
vkd3d-shader/hlsl: Generate IR for user-defined function calls.
https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/47
For the console tests, I prefer to run new/modified tests on all VM configurations so I can quickly see which behaviour or return codes are commonly correct. In some cases, this lets me determine in which version some expected behaviour changed.
This all started with the font family registry value MR. I wanted to check the value name on XP, since I thought it was correct but couldn’t be certain. That’s when I discovered the tests weren’t running and decided to see how much effort it would take to fix them.
I know the value of these patches isn’t worth much, but I still find them useful.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/1899#note_20678
> I don't see the maintenance cost or burden as high, nor do I mind monitoring this, if that's a concern.
Seeing the number of patches you had to write (and will have to continue to write on an ongoing basis), I'd say the cost is significant.
What's the upside? What behavior do you need to test on XP, and why?
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/1899#note_20671
I don't see the maintenance cost or burden as high, nor do I mind monitoring this, if that's a concern.
Looking at recent test patches, I can see function addresses used. It's really only adding the macro part, then calling the pointer. Everything else is the same as normal.
I think I'm actually to blame for the issues in the console tests...
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/1899#note_20669