tests/hlsl: Add tests for cube textures.

This commit is contained in:
Elizabeth Figura
2025-06-25 18:23:45 -05:00
committed by Henri Verbeet
parent e312207124
commit f2238deea9
Notes: Henri Verbeet 2025-06-26 17:50:53 +02:00
Approved-by: Henri Verbeet (@hverbeet)
Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/1606

View File

@@ -75,17 +75,48 @@ float4 main() : sv_target
draw quad draw quad
probe (0, 0) f32(0.25, 0.5, 0.25, 0) probe (0, 0) f32(0.25, 0.5, 0.25, 0)
[require] [srv 0]
options: backcompat size (cube, 2)
0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0
0.0 0.0 0.1 0.0 0.0 0.0 0.1 0.0 0.0 0.0 0.1 0.0 1.0 0.0 0.1 0.0
0.0 0.0 0.2 0.0 0.0 0.0 0.2 0.0 0.0 0.0 0.2 0.0 1.0 0.0 0.2 0.0
0.0 0.0 0.3 0.0 0.0 0.0 0.3 0.0 0.0 0.0 0.3 0.0 1.0 0.0 0.3 0.0
0.0 0.0 0.4 0.0 0.0 0.0 0.4 0.0 0.0 0.0 0.4 0.0 1.0 0.0 0.4 0.0
0.0 0.0 0.5 0.0 0.0 0.0 0.5 0.0 0.0 0.0 0.5 0.0 1.0 0.0 0.5 0.0
[pixel shader fail(sm>=5.1) todo(sm>=5.1)] [pixel shader]
samplerCUBE s; sampler s;
TextureCube t;
float3 coords;
float4 main() : sv_target float4 main() : sv_target
{ {
return texCUBE(s, float3(0.0, 0.0, 0.0)); return t.Sample(s, coords);
} }
[test]
uniform 0 float4 1 0 0 0
draw quad
probe (0, 0) f32(0.25, 0.0, 0.0, 0)
uniform 0 float4 -1 0 0 0
draw quad
probe (0, 0) f32(0.25, 0.0, 0.1, 0)
uniform 0 float4 0 1 0 0
draw quad
probe (0, 0) f32(0.25, 0.0, 0.2, 0)
uniform 0 float4 0 -1 0 0
draw quad
probe (0, 0) f32(0.25, 0.0, 0.3, 0)
uniform 0 float4 0 0 1 0
draw quad
probe (0, 0) f32(0.25, 0.0, 0.4, 0)
uniform 0 float4 0 0 -1 0
draw quad
probe (0, 0) f32(0.25, 0.0, 0.5, 0)
[require]
options: backcompat
[pixel shader fail(sm>=5.1) todo(sm>=5.1)] [pixel shader fail(sm>=5.1) todo(sm>=5.1)]
sampler1D s; sampler1D s;
@@ -209,6 +240,44 @@ float4 main() : sv_target
draw quad draw quad
probe (0, 0) f32(0.25, 0.5, 0.25, 0) probe (0, 0) f32(0.25, 0.5, 0.25, 0)
[srv 0]
size (cube, 2)
0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0
0.0 0.0 0.1 0.0 0.0 0.0 0.1 0.0 0.0 0.0 0.1 0.0 1.0 0.0 0.1 0.0
0.0 0.0 0.2 0.0 0.0 0.0 0.2 0.0 0.0 0.0 0.2 0.0 1.0 0.0 0.2 0.0
0.0 0.0 0.3 0.0 0.0 0.0 0.3 0.0 0.0 0.0 0.3 0.0 1.0 0.0 0.3 0.0
0.0 0.0 0.4 0.0 0.0 0.0 0.4 0.0 0.0 0.0 0.4 0.0 1.0 0.0 0.4 0.0
0.0 0.0 0.5 0.0 0.0 0.0 0.5 0.0 0.0 0.0 0.5 0.0 1.0 0.0 0.5 0.0
[pixel shader fail(sm>=5.1) todo(sm>=5.1)]
samplerCUBE s;
float3 coords;
float4 main() : sv_target
{
return texCUBE(s, coords);
}
[test]
uniform 0 float4 1 0 0 0
draw quad
probe (0, 0) f32(0.25, 0.0, 0.0, 0)
uniform 0 float4 -1 0 0 0
draw quad
probe (0, 0) f32(0.25, 0.0, 0.1, 0)
uniform 0 float4 0 1 0 0
draw quad
probe (0, 0) f32(0.25, 0.0, 0.2, 0)
uniform 0 float4 0 -1 0 0
draw quad
probe (0, 0) f32(0.25, 0.0, 0.3, 0)
uniform 0 float4 0 0 1 0
draw quad
probe (0, 0) f32(0.25, 0.0, 0.4, 0)
uniform 0 float4 0 0 -1 0
draw quad
probe (0, 0) f32(0.25, 0.0, 0.5, 0)
[require] [require]
shader model >= 4.0 shader model >= 4.0