2023-05-03 16:25:24 -07:00
|
|
|
[require]
|
|
|
|
shader model >= 5.0
|
|
|
|
|
2023-05-10 01:01:05 -07:00
|
|
|
% UAVs are implicitly allocated starting from the highest render target slot.
|
|
|
|
% They cannot overlap render target slots, and also cannot be allocated any
|
|
|
|
% lower than the highest render target.
|
|
|
|
% This ceases to be true with shader model 5.1.
|
|
|
|
|
2024-01-24 11:11:17 -08:00
|
|
|
[rtv 1]
|
2023-05-10 01:01:05 -07:00
|
|
|
format r32g32b32a32 float
|
2024-01-24 11:11:17 -08:00
|
|
|
size (2d, 640, 480)
|
2023-05-10 01:01:05 -07:00
|
|
|
|
2023-05-03 16:25:24 -07:00
|
|
|
[pixel shader]
|
|
|
|
struct s
|
|
|
|
{
|
|
|
|
float3 a;
|
|
|
|
};
|
|
|
|
|
|
|
|
RWBuffer<float4> u : register(u2);
|
|
|
|
RWBuffer<float> u1;
|
|
|
|
RWBuffer<float2x2> u2;
|
|
|
|
RWBuffer<struct s> u3;
|
|
|
|
|
|
|
|
float4 main() : sv_target1
|
|
|
|
{
|
|
|
|
u[0] = float4(11.1, 12.2, 13.3, 14.4);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2023-10-12 10:32:02 -07:00
|
|
|
[pixel shader]
|
2023-10-13 14:35:12 -07:00
|
|
|
struct s
|
|
|
|
{
|
|
|
|
float3 a;
|
|
|
|
};
|
|
|
|
|
|
|
|
RasterizerOrderedBuffer<float4> u : register(u2);
|
|
|
|
RasterizerOrderedBuffer<float> u1;
|
|
|
|
RasterizerOrderedBuffer<float2x2> u2;
|
|
|
|
RasterizerOrderedBuffer<struct s> u3;
|
|
|
|
|
|
|
|
float4 main() : sv_target1
|
|
|
|
{
|
|
|
|
u[0] = float4(11.1, 12.2, 13.3, 14.4);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2023-05-03 16:25:24 -07:00
|
|
|
% Type size is too wide
|
|
|
|
[pixel shader fail]
|
|
|
|
struct s
|
|
|
|
{
|
|
|
|
float3 a;
|
|
|
|
float2 b;
|
|
|
|
};
|
|
|
|
RWBuffer<struct s> u;
|
|
|
|
|
|
|
|
float4 main() : sv_target1
|
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2023-09-14 02:29:24 -07:00
|
|
|
[pixel shader fail(sm<6) todo]
|
2023-05-03 16:25:24 -07:00
|
|
|
RWBuffer<double3> u;
|
|
|
|
|
|
|
|
float4 main() : sv_target1
|
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
[pixel shader]
|
|
|
|
RWBuffer<double2> u;
|
|
|
|
|
|
|
|
float4 main() : sv_target1
|
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2023-10-13 14:35:12 -07:00
|
|
|
[pixel shader fail]
|
|
|
|
struct s
|
|
|
|
{
|
|
|
|
float3 a;
|
|
|
|
float2 b;
|
|
|
|
};
|
|
|
|
RasterizerOrderedBuffer<struct s> u;
|
|
|
|
|
|
|
|
float4 main() : sv_target1
|
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2023-10-12 10:32:02 -07:00
|
|
|
[pixel shader fail(sm<6) todo]
|
2023-10-13 14:35:12 -07:00
|
|
|
RasterizerOrderedBuffer<double3> u;
|
|
|
|
|
|
|
|
float4 main() : sv_target1
|
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2023-10-12 10:32:02 -07:00
|
|
|
[pixel shader]
|
2023-10-13 14:35:12 -07:00
|
|
|
RasterizerOrderedBuffer<double2> u;
|
|
|
|
|
|
|
|
float4 main() : sv_target1
|
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2023-05-03 16:25:24 -07:00
|
|
|
% Array type
|
2023-09-14 02:29:24 -07:00
|
|
|
[pixel shader fail(sm<6)]
|
2023-05-03 16:25:24 -07:00
|
|
|
typedef float arr[2];
|
|
|
|
RWBuffer<arr> u;
|
|
|
|
|
|
|
|
float4 main() : sv_target1
|
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
% Object types
|
2023-09-14 02:29:24 -07:00
|
|
|
[pixel shader fail(sm<6)]
|
2023-05-03 16:25:24 -07:00
|
|
|
RWBuffer<Texture2D> u;
|
|
|
|
|
|
|
|
float4 main() : sv_target1
|
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
[pixel shader fail]
|
|
|
|
struct s
|
|
|
|
{
|
|
|
|
Texture2D t;
|
|
|
|
};
|
|
|
|
RWBuffer<struct s> u;
|
|
|
|
|
|
|
|
float4 main() : sv_target1
|
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
2023-05-10 01:01:05 -07:00
|
|
|
|
2023-10-13 14:35:12 -07:00
|
|
|
[pixel shader fail(sm<6)]
|
|
|
|
typedef float arr[2];
|
|
|
|
RasterizerOrderedBuffer<arr> u;
|
|
|
|
|
|
|
|
float4 main() : sv_target1
|
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
% Object types
|
|
|
|
[pixel shader fail(sm<6)]
|
|
|
|
RasterizerOrderedBuffer<Texture2D> u;
|
|
|
|
|
|
|
|
float4 main() : sv_target1
|
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
[pixel shader fail]
|
|
|
|
struct s
|
|
|
|
{
|
|
|
|
Texture2D t;
|
|
|
|
};
|
|
|
|
RasterizerOrderedBuffer<struct s> u;
|
|
|
|
|
|
|
|
float4 main() : sv_target1
|
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2024-01-24 11:11:17 -08:00
|
|
|
[uav 2]
|
|
|
|
size (buffer, 1)
|
2023-05-10 01:01:05 -07:00
|
|
|
0.1 0.2 0.3 0.4
|
|
|
|
|
|
|
|
[pixel shader]
|
|
|
|
RWBuffer<float4> u : register(u2);
|
|
|
|
|
|
|
|
float4 main() : sv_target1
|
|
|
|
{
|
|
|
|
u[0] = float4(11.1, 12.2, 13.3, 14.4);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
[test]
|
2023-09-14 02:29:24 -07:00
|
|
|
todo(sm>=6) draw quad
|
2024-01-24 11:35:39 -08:00
|
|
|
probe uav 2 (0) rgba (11.1, 12.2, 13.3, 14.4)
|