vkd3d-shader/hlsl: Factor out add_binary_expr() and use it for assignment operators.

This fixes a lot of internal compiler errors with assignment operators,
especially bitwise ones. The bitwise-assignment test has the motivating
examples.
This commit is contained in:
Petrichor Park
2024-08-14 13:53:25 -05:00
committed by Henri Verbeet
parent ebc039d128
commit 4467c655f0
Notes: Henri Verbeet 2024-08-19 14:29:40 +02:00
Approved-by: Francisco Casas (@fcasas)
Approved-by: Elizabeth Figura (@zfigura)
Approved-by: Henri Verbeet (@hverbeet)
Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/999
3 changed files with 160 additions and 36 deletions

View File

@@ -129,6 +129,24 @@ float4 main() : SV_TARGET
todo(glsl) draw quad
probe (0, 0) rgba (0.0, 0.0, 163840.0, 480.0)
[pixel shader fail]
% Make sure that bitshifts DON'T work with floats
float4 main() : SV_TARGET
{
uint u = 5;
float f = 15.0;
return float4(u >> f, 0, 0, 0);
}
[pixel shader fail]
float4 main() : SV_TARGET
{
uint u = 5;
float f = 15.0;
return float4(f >> u, 0, 0, 0);
}
[pixel shader]
float4 main() : SV_TARGET
{