copy_propagation_transform_object_load() currently retrieves true, which
indicates that there was progress, even if the input dereference remains
the same.
This can happen repeatedly if an uninitialized object is copied onto
itself, as in the tests added in this patch. This results on the
compilation getting stuck on an endless loop.
This patch checks if the deref didn't change, to retrieve false in that
case.
--
v5: vkd3d-shader/hlsl: Validate that referenced objects are uniform.
tests: Test uninitialized object references.
vkd3d-shader/hlsl: Avoid infinite loop in copy propagation.
https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/59
LOCALE_SGROUPING's string and the `Grouping` field in NUMBERFMTW are confusingly different. The former, which is what is fixed here, treats a '0' as a repeat of the previous grouping. But a 0 at the end of the `Grouping` field prevents it from repeating (it repeats by default otherwise) so it's the opposite. Note that without a '0' in the LOCALE_SGROUPING string, it shouldn't even repeat in the first place.
This fixes the typical "3;0" default grouping, for example.
See: https://learn.microsoft.com/en-us/windows/win32/intl/locale-sgrouping
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/1937
copy_propagation_transform_object_load() currently retrieves true, which
indicates that there was progress, even if the input dereference remains
the same.
This can happen repeatedly if an uninitialized object is copied onto
itself, as in the tests added in this patch. This results on the
compilation getting stuck on an endless loop.
This patch checks if the deref didn't change, to retrieve false in that
case.
--
v4: vkd3d-shader/hlsl: Validate that referenced objects are uniform.
tests: Test uninitialized object references.
vkd3d-shader/hlsl: Avoid infinite loop in copy propagation.
https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/59
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