tests/hlsl: Add sample bias tests for cube textures.

This commit is contained in:
Shaun Ren
2025-08-14 19:29:46 -04:00
committed by Henri Verbeet
parent d037b45718
commit b9545f7422
Notes: Henri Verbeet 2025-09-03 13:09:54 +02:00
Approved-by: Elizabeth Figura (@zfigura)
Approved-by: Henri Verbeet (@hverbeet)
Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/1698

View File

@@ -70,3 +70,77 @@ probe (0,0) rgba(4.0, 0.0, 10.0, 0.0)
uniform 0 float4 8.5 0.0 0.0 0.0
draw quad
probe (0,0) rgba(0.0, 0.0, 10.0, 0.0)
[require]
% Reset requirements
[srv 0]
size (cube, 2)
levels 2
1.0 0.0 1.0 0.0 1.0 0.0 1.0 0.0 1.0 0.0 1.0 0.0 1.0 0.0 1.0 0.0
1.0 0.0 1.0 0.0 1.0 0.0 1.0 0.0 1.0 0.0 1.0 0.0 1.0 0.0 1.0 0.0
1.0 0.0 1.0 0.0 1.0 0.0 1.0 0.0 1.0 0.0 1.0 0.0 1.0 0.0 1.0 0.0
1.0 0.0 1.0 0.0 1.0 0.0 1.0 0.0 1.0 0.0 1.0 0.0 1.0 0.0 1.0 0.0
1.0 0.0 1.0 0.0 1.0 0.0 1.0 0.0 1.0 0.0 1.0 0.0 1.0 0.0 1.0 0.0
1.0 0.0 1.0 0.0 1.0 0.0 1.0 0.0 1.0 0.0 1.0 0.0 1.0 0.0 1.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.0
0.0 0.0 1.0 0.0
0.0 0.0 1.0 0.0
0.0 0.0 1.0 0.0
[pixel shader]
sampler s;
TextureCube t;
uniform float bias;
float4 main(float2 coord : texcoord) : sv_target
{
/* Choice of initial mipmap level is hardware-dependent, and in practice
* varies too much to be reasonably covered by ULPS. Quantize instead. */
return floor(t.SampleBias(s, float3(coord, 1), bias) * 5) * 2;
}
[test]
uniform 0 float 7.9
draw quad
probe (0, 0) f32(10.0, 0.0, 10.0, 0.0)
uniform 0 float 8.4
draw quad
probe (0, 0) f32(4.0, 0.0, 10.0, 0.0)
uniform 0 float 8.9
draw quad
probe (0, 0) f32(0.0, 0.0, 10.0, 0.0)
[require]
shader model >= 3.0
options: backcompat
[pixel shader fail(sm>=5.1) todo(sm<5.1)]
sampler s;
float bias;
float4 main(float2 coord : texcoord) : sv_target
{
/* Choice of initial mipmap level is hardware-dependent, and in practice
* varies too much to be reasonably covered by ULPS. Quantize instead. */
return floor(texCUBEbias(s, float4(coord, 1, bias)) * 5) * 2;
}
[test]
uniform 0 float 7.9
todo draw quad
probe (0, 0) f32(10.0, 0.0, 10.0, 0.0)
uniform 0 float 8.4
todo draw quad
probe (0, 0) f32(4.0, 0.0, 10.0, 0.0)
uniform 0 float 8.9
todo draw quad
probe (0, 0) f32(0.0, 0.0, 10.0, 0.0)