mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2024-11-21 16:46:41 -08:00
1c73513425
At the current moment this is a little odd because for SM1 [test] directives are skipped, and the [shader] directives are not executed by the shader_runner_vulkan.c:compile_shader() but by the general shader_runner.c:compile_shader(). So in principle it is a little weird that we go through the vulkan runner. But fret not, because in the future we plan to make the parser agnostic to the language of the tests, so we will get rid of the general shader_runner.c:compile_shader() function and instead call a runner->compile_shader() function, defined for each runner. Granted, most of these may call a generic implementation that uses native compiler in Windows, and vkd3d-shader on Linux, but it would be more conceptually correct.
157 lines
2.4 KiB
Plaintext
157 lines
2.4 KiB
Plaintext
[require]
|
|
shader model >= 4.0
|
|
shader model < 6.0
|
|
options: backcompat
|
|
|
|
|
|
[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
|
|
|
|
[texture 0]
|
|
size (1, 1)
|
|
0.0 0.0 0.0 1.0
|
|
|
|
[texture 1]
|
|
size (1, 1)
|
|
1.0 1.0 1.0 1.0
|
|
|
|
[texture 2]
|
|
size (1, 1)
|
|
2.0 2.0 2.0 1.0
|
|
|
|
[texture 3]
|
|
size (1, 1)
|
|
3.0 3.0 3.0 1.0
|
|
|
|
[texture 4]
|
|
size (1, 1)
|
|
4.0 4.0 4.0 1.0
|
|
|
|
[pixel shader]
|
|
sampler sam;
|
|
|
|
float4 main() : sv_target
|
|
{
|
|
return tex2D(sam, float2(0, 0));
|
|
}
|
|
|
|
[test]
|
|
draw quad
|
|
probe all rgba (0, 0, 0, 1)
|
|
|
|
|
|
% Textures for new separated samplers are allocated before regular textures.
|
|
[pixel shader]
|
|
Texture2D tex;
|
|
sampler sam;
|
|
|
|
float4 main() : sv_target
|
|
{
|
|
return 10 * tex.Sample(sam, float2(0, 0)) + tex2D(sam, float2(0, 0));
|
|
}
|
|
|
|
[test]
|
|
draw quad
|
|
probe all rgba (10, 10, 10, 11)
|
|
|
|
|
|
[pixel shader todo(sm<4)]
|
|
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]
|
|
draw quad
|
|
probe all rgba (21, 21, 21, 11)
|
|
|
|
|
|
[pixel shader]
|
|
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]
|
|
draw quad
|
|
probe all rgba (12, 12, 12, 111)
|
|
|
|
|
|
[pixel shader]
|
|
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]
|
|
draw quad
|
|
probe all rgba (104, 104, 104, 111)
|
|
|
|
|
|
% 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.
|
|
[pixel shader fail(sm>=4)]
|
|
sampler sam[2];
|
|
|
|
float4 main() : sv_target
|
|
{
|
|
return tex2D(sam[0], float2(0, 0)) + tex3D(sam[1], float3(0, 0, 0));
|
|
}
|
|
|
|
|
|
[pixel shader]
|
|
sampler sam[2];
|
|
|
|
float4 main() : sv_target
|
|
{
|
|
return 10 * tex2D(sam[0], float2(0, 0)) + tex1D(sam[1], 0);
|
|
}
|
|
|
|
[test]
|
|
draw quad
|
|
probe all rgba (1, 1, 1, 11)
|
|
|
|
|
|
[require]
|
|
shader model >= 5.0
|
|
shader model < 6.0
|
|
options: backcompat
|
|
|
|
|
|
[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)
|