mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2024-11-21 16:46:41 -08:00
tests/hlsl: Add a test for constexpr pointer cast.
This commit is contained in:
parent
05510c118a
commit
2fc32c3d1d
Notes:
Alexandre Julliard
2024-04-30 23:14:34 +02:00
Approved-by: Giovanni Mascellani (@giomasce) Approved-by: Henri Verbeet (@hverbeet) Approved-by: Alexandre Julliard (@julliard) Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/836
@ -163,6 +163,7 @@ vkd3d_shader_tests = \
|
||||
tests/hlsl/object-field-offsets.shader_test \
|
||||
tests/hlsl/object-parameters.shader_test \
|
||||
tests/hlsl/object-references.shader_test \
|
||||
tests/hlsl/pointer-cast.shader_test \
|
||||
tests/hlsl/pow.shader_test \
|
||||
tests/hlsl/precise-modifier.shader_test \
|
||||
tests/hlsl/rasteriser-ordered-views.shader_test \
|
||||
|
23
tests/hlsl/pointer-cast.shader_test
Normal file
23
tests/hlsl/pointer-cast.shader_test
Normal file
@ -0,0 +1,23 @@
|
||||
[require]
|
||||
shader model >= 6.0
|
||||
|
||||
[pixel shader]
|
||||
uint u, v, w;
|
||||
|
||||
static float foo[3] = {0.25, 0.5, 0.75};
|
||||
|
||||
float4 main(float4 pos : SV_Position) : SV_Target
|
||||
{
|
||||
// Compiles to a constexpr uint pointer cast of foo for a store instruction.
|
||||
if (v)
|
||||
foo[1] = asfloat(w);
|
||||
return float4(foo[u], foo[u + 1], 0.0, 1.0);
|
||||
}
|
||||
|
||||
[test]
|
||||
uniform 0 uint4 0 1 0x3e000000 0
|
||||
todo draw quad
|
||||
probe all rgba (0.25, 0.125, 0.0, 1.0)
|
||||
uniform 0 uint4 1 0 0x3e000000 0
|
||||
todo draw quad
|
||||
probe all rgba (0.5, 0.75, 0.0, 1.0)
|
Loading…
Reference in New Issue
Block a user