2022-04-06 14:05:37 -07:00
|
|
|
[require]
|
|
|
|
shader model >= 4.0
|
|
|
|
|
2024-01-24 11:11:17 -08:00
|
|
|
[srv 0]
|
|
|
|
size (2d, 2, 2)
|
2021-10-03 17:19:08 -07:00
|
|
|
0.1 0.2 0.3 0.4 0.5 0.7 0.6 0.8
|
|
|
|
0.6 0.5 0.2 0.1 0.8 0.0 0.7 1.0
|
|
|
|
|
|
|
|
[pixel shader]
|
|
|
|
Texture2D t;
|
|
|
|
|
|
|
|
float4 main(float4 pos : sv_position) : sv_target
|
|
|
|
{
|
|
|
|
return t.Load(int3(pos.xy, 0));
|
|
|
|
}
|
|
|
|
|
|
|
|
[test]
|
2024-10-21 07:23:27 -07:00
|
|
|
todo(msl) draw quad
|
2022-04-17 23:33:58 -07:00
|
|
|
probe (0, 0) rgba (0.1, 0.2, 0.3, 0.4)
|
|
|
|
probe (1, 0) rgba (0.5, 0.7, 0.6, 0.8)
|
|
|
|
probe (0, 1) rgba (0.6, 0.5, 0.2, 0.1)
|
|
|
|
probe (1, 1) rgba (0.8, 0.0, 0.7, 1.0)
|
2021-08-12 16:26:53 -07:00
|
|
|
|
|
|
|
[pixel shader]
|
|
|
|
Texture2D t;
|
|
|
|
|
|
|
|
float4 main(float4 pos : sv_position) : sv_target
|
|
|
|
{
|
|
|
|
return t[pos.yx];
|
|
|
|
}
|
|
|
|
|
|
|
|
[test]
|
2024-10-21 07:23:27 -07:00
|
|
|
todo(msl) draw quad
|
2021-08-12 16:26:53 -07:00
|
|
|
probe (0, 0) rgba (0.1, 0.2, 0.3, 0.4)
|
|
|
|
probe (1, 0) rgba (0.6, 0.5, 0.2, 0.1)
|
|
|
|
probe (0, 1) rgba (0.5, 0.7, 0.6, 0.8)
|
|
|
|
probe (1, 1) rgba (0.8, 0.0, 0.7, 1.0)
|
2023-04-27 01:15:36 -07:00
|
|
|
|
|
|
|
[pixel shader]
|
2023-06-28 02:28:49 -07:00
|
|
|
static const int size = 2;
|
|
|
|
Texture2DMS<float4, size - 1> t;
|
2024-08-03 15:13:56 -07:00
|
|
|
Texture2DMS<float4> t2;
|
2023-04-27 01:15:36 -07:00
|
|
|
|
|
|
|
float4 main(float4 pos : sv_position) : sv_target
|
|
|
|
{
|
|
|
|
return t.Load(pos.yx, 0);
|
|
|
|
}
|
|
|
|
|
|
|
|
[test]
|
2024-10-09 04:34:21 -07:00
|
|
|
todo(msl) draw quad
|
2023-04-27 01:15:36 -07:00
|
|
|
probe (0, 0) rgba (0.1, 0.2, 0.3, 0.4)
|
|
|
|
probe (1, 0) rgba (0.6, 0.5, 0.2, 0.1)
|
|
|
|
probe (0, 1) rgba (0.5, 0.7, 0.6, 0.8)
|
|
|
|
probe (1, 1) rgba (0.8, 0.0, 0.7, 1.0)
|
2023-12-13 03:14:39 -08:00
|
|
|
|
|
|
|
% The sample count only matters for the external definition in SM4-5;
|
|
|
|
% internally it doesn't, you can even avoid it
|
|
|
|
|
|
|
|
[require]
|
|
|
|
shader model >= 4.0
|
|
|
|
shader model < 6.0
|
|
|
|
|
|
|
|
[pixel shader]
|
|
|
|
static const int size = 2;
|
|
|
|
Texture2DMS<float4, size - 1> t;
|
|
|
|
|
|
|
|
float4 main(float4 pos : sv_position) : sv_target
|
|
|
|
{
|
|
|
|
Texture2DMS<float4, 4> s = t;
|
|
|
|
return s.Load(pos.yx, 0);
|
|
|
|
}
|
|
|
|
|
|
|
|
[test]
|
2024-10-09 04:34:21 -07:00
|
|
|
todo(msl) draw quad
|
2023-12-13 03:14:39 -08:00
|
|
|
probe (0, 0) rgba (0.1, 0.2, 0.3, 0.4)
|
|
|
|
probe (1, 0) rgba (0.6, 0.5, 0.2, 0.1)
|
|
|
|
probe (0, 1) rgba (0.5, 0.7, 0.6, 0.8)
|
|
|
|
probe (1, 1) rgba (0.8, 0.0, 0.7, 1.0)
|
|
|
|
|
2024-08-03 15:13:56 -07:00
|
|
|
[pixel shader]
|
2023-12-13 03:14:39 -08:00
|
|
|
static const int size = 2;
|
|
|
|
Texture2DMS<float4, size - 1> t;
|
|
|
|
|
|
|
|
float4 main(float4 pos : sv_position) : sv_target
|
|
|
|
{
|
|
|
|
Texture2DMS<float4> s = t;
|
|
|
|
return s.Load(pos.yx, 0);
|
|
|
|
}
|
|
|
|
|
|
|
|
[test]
|
2024-10-09 04:34:21 -07:00
|
|
|
todo(msl) draw quad
|
2023-12-13 03:14:39 -08:00
|
|
|
probe (0, 0) rgba (0.1, 0.2, 0.3, 0.4)
|
|
|
|
probe (1, 0) rgba (0.6, 0.5, 0.2, 0.1)
|
|
|
|
probe (0, 1) rgba (0.5, 0.7, 0.6, 0.8)
|
|
|
|
probe (1, 1) rgba (0.8, 0.0, 0.7, 1.0)
|
|
|
|
|
|
|
|
% SM6 is stricter instead
|
|
|
|
|
|
|
|
[require]
|
|
|
|
shader model >= 6.0
|
|
|
|
|
|
|
|
[pixel shader fail]
|
|
|
|
static const int size = 2;
|
|
|
|
Texture2DMS<float4, size - 1> t;
|
|
|
|
|
|
|
|
float4 main(float4 pos : sv_position) : sv_target
|
|
|
|
{
|
|
|
|
Texture2DMS<float4, 4> s = t;
|
|
|
|
return s.Load(pos.yx, 0);
|
|
|
|
}
|
|
|
|
|
|
|
|
[pixel shader fail]
|
|
|
|
static const int size = 2;
|
|
|
|
Texture2DMS<float4, size - 1> t;
|
|
|
|
|
|
|
|
float4 main(float4 pos : sv_position) : sv_target
|
|
|
|
{
|
|
|
|
Texture2DMS<float4> s = t;
|
|
|
|
return s.Load(pos.yx, 0);
|
|
|
|
}
|
2024-03-26 14:11:22 -07:00
|
|
|
|
|
|
|
% SM4.0 cannot dynamically index multisampled textures, it relies on loop unrolling.
|
|
|
|
|
|
|
|
[require]
|
|
|
|
shader model >= 4.0
|
|
|
|
shader model < 4.1
|
|
|
|
|
2024-04-11 07:11:14 -07:00
|
|
|
[pixel shader]
|
2024-03-26 14:11:22 -07:00
|
|
|
Texture2DMS<float4, 1> t;
|
|
|
|
|
|
|
|
float4 main(float4 pos : sv_position) : sv_target
|
|
|
|
{
|
|
|
|
int i;
|
|
|
|
float4 o;
|
|
|
|
for (i = 0; i < 1; i++)
|
|
|
|
{
|
|
|
|
o = t.Load(pos.xy, i);
|
|
|
|
}
|
|
|
|
return o;
|
|
|
|
}
|
|
|
|
|
|
|
|
[test]
|
2024-10-09 04:34:21 -07:00
|
|
|
todo(msl) draw quad
|
2024-03-26 14:11:22 -07:00
|
|
|
probe (0, 0) rgba (0.1, 0.2, 0.3, 0.4)
|
|
|
|
probe (1, 0) rgba (0.5, 0.7, 0.6, 0.8)
|
|
|
|
probe (0, 1) rgba (0.6, 0.5, 0.2, 0.1)
|
|
|
|
probe (1, 1) rgba (0.8, 0.0, 0.7, 1.0)
|
2024-10-20 15:21:00 -07:00
|
|
|
|
|
|
|
% Test an actual multisample load
|
|
|
|
|
|
|
|
[require]
|
|
|
|
shader model >= 4.1
|
|
|
|
|
|
|
|
[rtv 0]
|
|
|
|
format r32g32b32a32-float
|
|
|
|
size (2dms, 4, 64, 64)
|
|
|
|
|
|
|
|
[srv 0]
|
|
|
|
format r32g32b32a32-float
|
|
|
|
size (2dms, 4, 64, 64)
|
|
|
|
|
|
|
|
[pixel shader]
|
|
|
|
float4 main(uint id : sv_sampleindex) : sv_target
|
|
|
|
{
|
|
|
|
return float4(1u << id, 0.25f, 0.5f, 1.0f);
|
|
|
|
}
|
|
|
|
|
|
|
|
[test]
|
|
|
|
clear rtv 0 0.0 0.0 0.0 0.0
|
2024-10-25 05:42:58 -07:00
|
|
|
todo(sm>=6 | msl) draw quad
|
2024-10-20 15:21:00 -07:00
|
|
|
probe (32, 32) rgba(3.75, 0.25, 0.5, 1.0)
|
2024-10-21 07:23:27 -07:00
|
|
|
todo(msl) copy rtv 0 srv 0
|
2024-10-20 15:21:00 -07:00
|
|
|
|
|
|
|
[rtv 0]
|
|
|
|
format r32g32b32a32-float
|
|
|
|
size (2d, 64, 64)
|
|
|
|
|
|
|
|
[pixel shader]
|
|
|
|
Texture2DMS<float4> t;
|
|
|
|
uint sample;
|
|
|
|
|
|
|
|
float4 main(float4 position : sv_position) : sv_target
|
|
|
|
{
|
|
|
|
float2 p = position.xy / 64.0f;
|
|
|
|
return t.Load(p, sample);
|
|
|
|
}
|
|
|
|
|
|
|
|
[test]
|
|
|
|
uniform 0 uint 0
|
2024-10-09 04:34:21 -07:00
|
|
|
todo(msl) draw quad
|
2024-10-20 15:21:00 -07:00
|
|
|
todo(sm>=6) probe (32, 32) rgba(1.0, 0.25, 0.5, 1.0)
|
|
|
|
uniform 0 uint 1
|
2024-10-09 04:34:21 -07:00
|
|
|
todo(msl) draw quad
|
2024-10-20 15:21:00 -07:00
|
|
|
todo(sm>=6) probe (32, 32) rgba(2.0, 0.25, 0.5, 1.0)
|
|
|
|
uniform 0 uint 2
|
2024-10-09 04:34:21 -07:00
|
|
|
todo(msl) draw quad
|
2024-10-20 15:21:00 -07:00
|
|
|
todo(sm>=6) probe (32, 32) rgba(4.0, 0.25, 0.5, 1.0)
|
|
|
|
uniform 0 uint 3
|
2024-10-09 04:34:21 -07:00
|
|
|
todo(msl) draw quad
|
2024-10-20 15:21:00 -07:00
|
|
|
todo(sm>=6) probe (32, 32) rgba(8.0, 0.25, 0.5, 1.0)
|