vkd3d/tests/hlsl/uav-rwstructuredbuffer.shader_test
Conor McCarthy 57280673e5 tests/shader-runner: Test shaders with dxcompiler.
The location of dxcompiler should be set during configuration with
'DXCOMPILER_LIBS=-L/path/to/dxcompiler', and then at runtime with
LD_LIBRARY_PATH, WINEPATH or PATH as applicable.

A new 'fail(sm<6)' decoration is needed on many shader declarations
because dxcompiler succeeds on many shaders which fail with fxc. The
opposite case is less common and is flagged with 'fail(sm>=6)'. A few
tests cause dxcompiler to crash or hang, so these are avoided using
[require], which now skips tests until reset instead of exiting. Also,
'todo(sm<6)' and 'todo(sm>=6)' are used to separate checking of results.
2023-10-11 22:21:14 +02:00

58 lines
793 B
Plaintext

[require]
shader model >= 5.0
[pixel shader todo]
struct s
{
float3 a;
};
struct s2
{
float4x4 f1, f2, f3;
};
RWStructuredBuffer<float4> u : register(u2);
RWStructuredBuffer<float> u1;
RWStructuredBuffer<float2x2> u2;
RWStructuredBuffer<struct s> u3;
RWStructuredBuffer<float4x4> u4;
RWStructuredBuffer<struct s2> u5;
float4 main() : sv_target1
{
u[0] = float4(11.1, 12.2, 13.3, 14.4);
return 0;
}
% Array type
[pixel shader]
typedef float arr[2];
RWStructuredBuffer<arr> u;
float4 main() : sv_target1
{
return 0;
}
% Object types
[pixel shader fail(sm<6)]
RWStructuredBuffer<Texture2D> u;
float4 main() : sv_target1
{
return 0;
}
[pixel shader fail]
struct s
{
Texture2D t;
};
RWStructuredBuffer<struct s> u;
float4 main() : sv_target1
{
return 0;
}