Files
vkd3d/tests/hlsl/sample-minmax.shader_test
Henri Verbeet dc7cdec9a5 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.
2025-11-26 16:06:24 +01:00

64 lines
1.5 KiB
Plaintext

[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)