2022-12-01 11:50:17 -08:00
|
|
|
[require]
|
|
|
|
shader model >= 4.0
|
2023-09-14 02:29:24 -07:00
|
|
|
shader model < 6.0
|
2023-10-16 03:45:32 -07:00
|
|
|
options: backcompat
|
2022-12-01 11:50:17 -08:00
|
|
|
|
|
|
|
|
|
|
|
[sampler 0]
|
|
|
|
filter linear linear linear
|
|
|
|
address clamp clamp clamp
|
|
|
|
|
|
|
|
[sampler 1]
|
|
|
|
filter linear linear linear
|
|
|
|
address clamp clamp clamp
|
|
|
|
|
|
|
|
[sampler 2]
|
|
|
|
filter linear linear linear
|
|
|
|
address clamp clamp clamp
|
|
|
|
|
2024-01-24 11:11:17 -08:00
|
|
|
[srv 0]
|
|
|
|
size (2d, 1, 1)
|
2022-12-01 11:50:17 -08:00
|
|
|
0.0 0.0 0.0 1.0
|
|
|
|
|
2024-01-24 11:11:17 -08:00
|
|
|
[srv 1]
|
|
|
|
size (2d, 1, 1)
|
2022-12-01 11:50:17 -08:00
|
|
|
1.0 1.0 1.0 1.0
|
|
|
|
|
2024-01-24 11:11:17 -08:00
|
|
|
[srv 2]
|
|
|
|
size (2d, 1, 1)
|
2022-12-01 11:50:17 -08:00
|
|
|
2.0 2.0 2.0 1.0
|
|
|
|
|
2024-01-24 11:11:17 -08:00
|
|
|
[srv 3]
|
|
|
|
size (2d, 1, 1)
|
2022-12-01 11:50:17 -08:00
|
|
|
3.0 3.0 3.0 1.0
|
|
|
|
|
2024-01-24 11:11:17 -08:00
|
|
|
[srv 4]
|
|
|
|
size (2d, 1, 1)
|
2022-12-01 11:50:17 -08:00
|
|
|
4.0 4.0 4.0 1.0
|
|
|
|
|
2023-05-29 18:59:17 -07:00
|
|
|
[pixel shader]
|
2022-12-01 11:50:17 -08:00
|
|
|
sampler sam;
|
|
|
|
|
|
|
|
float4 main() : sv_target
|
|
|
|
{
|
|
|
|
return tex2D(sam, float2(0, 0));
|
|
|
|
}
|
|
|
|
|
|
|
|
[test]
|
2024-03-19 04:36:23 -07:00
|
|
|
todo(glsl) draw quad
|
2023-05-29 18:59:17 -07:00
|
|
|
probe all rgba (0, 0, 0, 1)
|
2022-12-01 11:50:17 -08:00
|
|
|
|
|
|
|
|
|
|
|
% Textures for new separated samplers are allocated before regular textures.
|
2023-05-29 18:59:17 -07:00
|
|
|
[pixel shader]
|
2022-12-01 11:50:17 -08:00
|
|
|
Texture2D tex;
|
|
|
|
sampler sam;
|
|
|
|
|
|
|
|
float4 main() : sv_target
|
|
|
|
{
|
|
|
|
return 10 * tex.Sample(sam, float2(0, 0)) + tex2D(sam, float2(0, 0));
|
|
|
|
}
|
|
|
|
|
|
|
|
[test]
|
2024-03-19 04:36:23 -07:00
|
|
|
todo(glsl) draw quad
|
2023-08-04 12:02:39 -07:00
|
|
|
probe all rgba (10, 10, 10, 11)
|
2022-12-01 11:50:17 -08:00
|
|
|
|
|
|
|
|
2023-11-15 12:41:33 -08:00
|
|
|
[pixel shader todo(sm<4)]
|
2022-12-01 11:50:17 -08:00
|
|
|
Texture2D tex;
|
|
|
|
sampler sam[2];
|
|
|
|
|
|
|
|
float4 main() : sv_target
|
|
|
|
{
|
|
|
|
return 10 * tex.Sample(sam[0], float2(0, 0)) + tex2D(sam[1], float2(0, 0));
|
|
|
|
}
|
|
|
|
|
|
|
|
[test]
|
2024-03-19 04:36:23 -07:00
|
|
|
todo(glsl) draw quad
|
2023-08-04 12:02:39 -07:00
|
|
|
probe all rgba (21, 21, 21, 11)
|
2022-12-01 11:50:17 -08:00
|
|
|
|
|
|
|
|
2023-05-29 18:59:17 -07:00
|
|
|
[pixel shader]
|
2022-12-01 11:50:17 -08:00
|
|
|
sampler sam0;
|
|
|
|
sampler sam1;
|
|
|
|
sampler sam2;
|
|
|
|
|
|
|
|
float4 main() : sv_target
|
|
|
|
{
|
|
|
|
return 100 * tex2D(sam1, float2(0, 0)) + 10 * tex2D(sam0, float2(0, 0))
|
|
|
|
+ tex2D(sam2, float2(0, 0));
|
|
|
|
}
|
|
|
|
|
|
|
|
[test]
|
2024-03-19 04:36:23 -07:00
|
|
|
todo(glsl) draw quad
|
2023-05-29 18:59:17 -07:00
|
|
|
probe all rgba (12, 12, 12, 111)
|
2022-12-01 11:50:17 -08:00
|
|
|
|
|
|
|
|
2023-05-29 18:59:17 -07:00
|
|
|
[pixel shader]
|
2022-12-01 11:50:17 -08:00
|
|
|
Texture2D tex[2][2];
|
|
|
|
sampler sam;
|
|
|
|
|
|
|
|
float4 main() : sv_target
|
|
|
|
{
|
|
|
|
return 100 * tex[0][0].Load(int3(0, 0, 0)) + 10 * tex2D(sam, float2(0, 0))
|
|
|
|
+ tex[1][1].Sample(sam, float2(0, 0));
|
|
|
|
}
|
|
|
|
|
|
|
|
[test]
|
2024-03-19 04:36:23 -07:00
|
|
|
todo(glsl) draw quad
|
2023-08-04 12:02:39 -07:00
|
|
|
probe all rgba (104, 104, 104, 111)
|
2022-12-01 11:50:17 -08:00
|
|
|
|
|
|
|
|
|
|
|
% Sampler arrays with components that have different usage dimensions are only forbidden in SM4 upwards.
|
|
|
|
% However, tex2D and tex1D are considered the same dimension for these purposes.
|
2023-11-15 12:41:33 -08:00
|
|
|
[pixel shader fail(sm>=4)]
|
2022-12-01 11:50:17 -08:00
|
|
|
sampler sam[2];
|
|
|
|
|
|
|
|
float4 main() : sv_target
|
|
|
|
{
|
|
|
|
return tex2D(sam[0], float2(0, 0)) + tex3D(sam[1], float3(0, 0, 0));
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2023-09-11 03:23:04 -07:00
|
|
|
[pixel shader]
|
2022-12-01 11:50:17 -08:00
|
|
|
sampler sam[2];
|
|
|
|
|
|
|
|
float4 main() : sv_target
|
|
|
|
{
|
|
|
|
return 10 * tex2D(sam[0], float2(0, 0)) + tex1D(sam[1], 0);
|
|
|
|
}
|
|
|
|
|
|
|
|
[test]
|
2024-03-19 04:36:23 -07:00
|
|
|
todo(glsl) draw quad
|
2023-09-11 03:23:04 -07:00
|
|
|
probe all rgba (1, 1, 1, 11)
|
2022-12-01 11:50:17 -08:00
|
|
|
|
|
|
|
|
|
|
|
[require]
|
|
|
|
shader model >= 5.0
|
2023-09-14 02:29:24 -07:00
|
|
|
shader model < 6.0
|
2023-10-16 03:45:32 -07:00
|
|
|
options: backcompat
|
2022-12-01 11:50:17 -08:00
|
|
|
|
|
|
|
|
|
|
|
[pixel shader todo]
|
|
|
|
struct
|
|
|
|
{
|
|
|
|
Texture2D tex;
|
|
|
|
sampler sam;
|
|
|
|
} foo;
|
|
|
|
|
|
|
|
float4 main() : sv_target
|
|
|
|
{
|
|
|
|
return 10 * foo.tex.Sample(foo.sam, float2(0, 0)) + tex2D(foo.sam, float2(0, 0));
|
|
|
|
}
|
|
|
|
|
|
|
|
[test]
|
|
|
|
todo draw quad
|
|
|
|
todo probe all rgba (10, 10, 10, 11)
|