mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2025-01-28 13:05:02 -08:00
tests/hlsl: Add lhs cast tests.
This commit is contained in:
parent
c7b209124b
commit
51db232368
Notes:
Henri Verbeet
2025-01-22 15:04:09 +01:00
Approved-by: Elizabeth Figura (@zfigura) Approved-by: Henri Verbeet (@hverbeet) Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/1350
@ -168,6 +168,7 @@ vkd3d_shader_tests = \
|
||||
tests/hlsl/ldexp.shader_test \
|
||||
tests/hlsl/length.shader_test \
|
||||
tests/hlsl/lerp.shader_test \
|
||||
tests/hlsl/lhs-cast.shader_test \
|
||||
tests/hlsl/lit.shader_test \
|
||||
tests/hlsl/load-level.shader_test \
|
||||
tests/hlsl/log.shader_test \
|
||||
|
111
tests/hlsl/lhs-cast.shader_test
Normal file
111
tests/hlsl/lhs-cast.shader_test
Normal file
@ -0,0 +1,111 @@
|
||||
% lhs casts to the same type don't have effect.
|
||||
[pixel shader]
|
||||
float4 main() : sv_target
|
||||
{
|
||||
float4 p = 0;
|
||||
|
||||
(float4) p = float4(1, 2, 3, 4);
|
||||
return p;
|
||||
}
|
||||
|
||||
[test]
|
||||
draw quad
|
||||
probe (0, 0) rgba(1, 2, 3, 4)
|
||||
|
||||
|
||||
% Casts with base type changes are only valid on SM1.
|
||||
[pixel shader fail(sm>=4) todo]
|
||||
float4 main() : sv_target
|
||||
{
|
||||
float4 p = 0;
|
||||
|
||||
(int4) p = float4(-1.5, -2.3, 4.7, 0.4);
|
||||
return p;
|
||||
}
|
||||
|
||||
[test]
|
||||
todo draw quad
|
||||
probe (0, 0) rgba(-1, -2, 4, 0)
|
||||
|
||||
|
||||
% Casts don't actually perform base type changes, only the outtermost one, which
|
||||
% I suspect is because the implicit cast on the assignment and not the cast itself.
|
||||
[pixel shader fail(sm>=4) todo(sm>=4)]
|
||||
float4 main() : sv_target
|
||||
{
|
||||
float4 f = 0;
|
||||
|
||||
(float2x2)(int4)(half4) f = float4(1.3, -2.4, 3.3, 4.7);
|
||||
return f;
|
||||
}
|
||||
|
||||
[test]
|
||||
todo(sm>=4) draw quad
|
||||
todo probe (0, 0) rgba(1.3, -2.4, 3.3, 4.7)
|
||||
|
||||
|
||||
[pixel shader fail(sm>=4) todo]
|
||||
float4 main() : sv_target
|
||||
{
|
||||
float4 f = 0;
|
||||
|
||||
(int4)(float4)(half4) f = float4(1.3, -2.4, 3.3, 4.7);
|
||||
return f;
|
||||
}
|
||||
|
||||
[test]
|
||||
todo draw quad
|
||||
probe (0, 0) rgba(1, -2, 3, 4)
|
||||
|
||||
|
||||
[pixel shader fail]
|
||||
float4 main() : sv_target
|
||||
{
|
||||
float p[5] = {-1, -2, -3, -4, -5};
|
||||
float arr[5] = {1.5, 2.5, 3.5, 4.5, 5.5};
|
||||
|
||||
(int[5]) p = arr;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
[pixel shader fail(sm>=6)]
|
||||
float4 main() : sv_target
|
||||
{
|
||||
float4 f = 0;
|
||||
|
||||
(float2x2) f = float3x2(1, 2, 3, 4, 5, 6);
|
||||
return f;
|
||||
}
|
||||
|
||||
[test]
|
||||
draw quad
|
||||
todo probe (0, 0) rgba(1, 2, 3, 4)
|
||||
|
||||
|
||||
[pixel shader fail(sm>=4) todo]
|
||||
float4 main() : sv_target
|
||||
{
|
||||
float4 f = 0;
|
||||
|
||||
((int4) f).xy = float2(1.4, 3.8);
|
||||
return f;
|
||||
}
|
||||
|
||||
[test]
|
||||
todo draw quad
|
||||
probe (0, 0) rgba(1, 3, 0, 0);
|
||||
|
||||
|
||||
[pixel shader fail(sm>=4) todo]
|
||||
float4 main() : sv_target
|
||||
{
|
||||
float4 f = 0;
|
||||
|
||||
((float3)((int4) f).xyz).xy = float2(1.4, 2.8);
|
||||
return f;
|
||||
}
|
||||
|
||||
[test]
|
||||
todo draw quad
|
||||
probe (0, 0) rgba(1.4, 2.8, 0, 0);
|
Loading…
x
Reference in New Issue
Block a user