vkd3d/tests/hlsl/sample-grad.shader_test
Francisco Casas 00b79cd781 tests: Test SampleGrad() on ps_3_0.
fxc compiles this method even without the backcompat option.

Furthermore, it even does it on ps_2_0 despite the fact that it maps to
a texldd instruction, which is not available on plain ps_2_0, nor ps_2_b,
only on ps_2_a and ps_3_0 according to documentation.

It is worth mentioning that the additional offset parameter is not
supported when lowering.
2025-01-14 17:59:50 +01:00

81 lines
1.6 KiB
Plaintext

[require]
shader model >= 3.0
options: backcompat
[sampler 0]
filter linear linear linear
address clamp clamp clamp
[srv 0]
size (2d, 2, 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
0.0 0.0 1.0 0.0
[pixel shader fail(sm>=5.1) todo(sm>=5.1)]
sampler s;
float4 grad;
float4 main() : sv_target
{
return tex2D(s, float2(0.5, 0.5), grad.xy, grad.zw);
}
[test]
uniform 0 float4 0.0 0.0 0.0 0.0
todo(msl) draw quad
probe (0,0) rgba (1.0, 0.0, 1.0, 0.0)
uniform 0 float4 1.0 1.0 1.0 1.0
todo(msl) draw quad
probe (0,0) rgba (0.0, 0.0, 1.0, 0.0)
uniform 0 float4 2.0 2.0 2.0 2.0
todo(msl) draw quad
probe (0,0) rgba (0.0, 0.0, 1.0, 0.0)
[pixel shader fail(sm>=5.1) todo(sm>=5.1)]
sampler s;
float4 grad;
float4 main() : sv_target
{
return tex2Dgrad(s, float2(0.5, 0.5), grad.xy, grad.zw);
}
[test]
uniform 0 float4 0.0 0.0 0.0 0.0
todo(msl) draw quad
probe (0,0) rgba (1.0, 0.0, 1.0, 0.0)
uniform 0 float4 1.0 1.0 1.0 1.0
todo(msl) draw quad
probe (0,0) rgba (0.0, 0.0, 1.0, 0.0)
uniform 0 float4 2.0 2.0 2.0 2.0
todo(msl) draw quad
probe (0,0) rgba (0.0, 0.0, 1.0, 0.0)
[require]
shader model >= 3.0
[pixel shader todo(sm<4)]
sampler s;
Texture2D t;
uniform float4 grad;
float4 main() : sv_target
{
return t.SampleGrad(s, float2(0.5, 0.5), grad.xy, grad.zw);
}
[test]
uniform 0 float4 0.0 0.0 0.0 0.0
todo(msl | sm<4) draw quad
probe (0, 0) rgba (1.0, 0.0, 1.0, 0.0)
uniform 0 float4 1.0 1.0 1.0 1.0
todo(msl | sm<4) draw quad
probe (0, 0) rgba (0.0, 0.0, 1.0, 0.0)
uniform 0 float4 2.0 2.0 2.0 2.0
todo(msl | sm<4) draw quad
probe (0, 0) rgba (0.0, 0.0, 1.0, 0.0)