Files
vkd3d/tests/hlsl/descriptors.shader_test
Giovanni Mascellani 2903831f79 tests/hlsl: Test using an SRV in combination with a CBV larger than the declared uniforms.
This appears to be valid on native (no validation message is
raised) but is not properly handled by vkd3d.
2025-11-12 15:19:33 +01:00

126 lines
1.6 KiB
Plaintext

[require]
shader model >= 4.0
[srv 0]
format r32-float
size (2d, 1, 1)
1.0
% Test a shader that uses an SRV in combination with a CBV longer than the
% declared uniforms.
[pixel shader]
Texture2D<float> t : register(t0);
uniform float4 x;
uniform float4 y;
float4 main() : SV_Target
{
return t.Load(uint3(0, 0, 0)) + x;
}
[test]
uniform 0 float4 1.0 2.0 3.0 4.0
todo(d3d12 & !windows & !mvk) draw quad
probe (0, 0) f32(2.0, 3.0, 4.0, 5.0)
[require]
shader model >= 5.0
descriptors
[srv 0]
format r32-float
size (2d, 1, 1)
1.0
[srv 1]
format r32-float
size (2d, 1, 1)
2.0
[srv 2]
format r32-float
size (2d, 1, 1)
3.0
[pixel shader]
Texture2D<float> t : register(t1);
float4 main() : SV_Target
{
return t.Load(uint3(0, 0, 0));
}
[test]
draw quad
probe (0, 0) f32(2.0, 2.0, 2.0, 2.0)
[descriptors]
t[1:1], space 0, srv 2
[test]
draw quad
probe (0, 0) f32(3.0, 3.0, 3.0, 3.0)
[descriptors]
t[1:2], space 0, srv 0
[test]
draw quad
probe (0, 0) f32(1.0, 1.0, 1.0, 1.0)
[require]
shader model >= 5.0
descriptors
format r32-float uav-load
[uav 1]
format r32-float
size (2d, 1, 1)
1.0
[uav 2]
format r32-float
size (2d, 1, 1)
2.0
[uav 3]
format r32-float
size (2d, 1, 1)
3.0
[pixel shader]
RWTexture2D<float> u : register(u2);
float4 main() : SV_Target
{
return u[uint2(0, 0)];
}
[descriptors]
[test]
todo(msl) draw quad
probe (0, 0) f32(2.0, 2.0, 2.0, 2.0)
[descriptors]
u[2:2], space 0, uav 3
[test]
todo(msl) draw quad
probe (0, 0) f32(3.0, 3.0, 3.0, 3.0)
[descriptors]
u[2:3], space 0, uav 1
[test]
todo(msl) draw quad
probe (0, 0) f32(1.0, 1.0, 1.0, 1.0)