tests/hlsl: Add a sampler min/max reduction filtering test.

The Metal runner could in principle support this feature using
MTLSamplerDescriptor.reductionMode, but that requires macOS 26.0/Tahoe,
which is newer than my current setup.
This commit is contained in:
Henri Verbeet
2025-11-21 17:32:23 +01:00
parent 1007ba40b5
commit dc7cdec9a5
Notes: Henri Verbeet 2025-11-26 17:14:34 +01:00
Approved-by: Henri Verbeet (@hverbeet)
Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/1846
8 changed files with 156 additions and 14 deletions

View File

@@ -0,0 +1,63 @@
[require]
filter-minmax
[rtv 0]
format r32g32b32a32-float
size (2d, 64, 64)
[srv 0]
size (2d, 4, 4)
.00 .00 .00 1.0 .25 .00 .00 1.0 .50 .00 .00 1.0 .75 .00 .00 1.0
.00 .25 .00 1.0 .25 .25 .00 1.0 .50 .25 .00 1.0 .75 .25 .00 1.0
.00 .50 .00 1.0 .25 .50 .00 1.0 .50 .50 .00 1.0 .75 .50 .00 1.0
.00 .75 .00 1.0 .25 .75 .00 1.0 .50 .75 .00 1.0 .75 .75 .00 1.0
[vertex shader]
void main(float4 p : POSITION, out float2 t : TEXCOORD, out float4 position : SV_Position)
{
t.x = (p.x + 1.0) / 2.0;
t.y = (-p.y + 1.0) / 2.0;
position = p;
}
[pixel shader]
Texture2D t;
sampler s;
float4 main(float2 p : TEXCOORD) : SV_Target
{
return t.Sample(s, floor(p * 8.0) / 8.0);
}
[sampler 0]
filter linear linear point
[test]
draw quad
probe (36, 20) f32(.375, .125, 0, 1)
probe (20, 36) f32(.125, .375, 0, 1)
probe (36, 36) f32(.375, .375, 0, 1)
probe (52, 36) f32(.625, .375, 0, 1)
probe (36, 52) f32(.375, .625, 0, 1)
[sampler 0]
filter minimum linear linear point
[test]
draw quad
todo(d3d12) probe (36, 20) f32(.25, .00, 0, 1)
todo(d3d12) probe (20, 36) f32(.00, .25, 0, 1)
todo(d3d12) probe (36, 36) f32(.25, .25, 0, 1)
todo(d3d12) probe (52, 36) f32(.50, .25, 0, 1)
todo(d3d12) probe (36, 52) f32(.25, .50, 0, 1)
[sampler 0]
filter maximum linear linear point
[test]
draw quad
todo(d3d12) probe (36, 20) f32(.50, .25, 0, 1)
todo(d3d12) probe (20, 36) f32(.25, .50, 0, 1)
todo(d3d12) probe (36, 36) f32(.50, .50, 0, 1)
todo(d3d12) probe (52, 36) f32(.75, .50, 0, 1)
todo(d3d12) probe (36, 52) f32(.50, .75, 0, 1)