mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2025-09-12 18:50:22 -07:00
vkd3d-shader/hlsl: Forbid recursive calls.
This commit is contained in:
committed by
Alexandre Julliard
parent
503be4243c
commit
9c817e5e6d
Notes:
Alexandre Julliard
2023-01-19 22:45:50 +01:00
Approved-by: Giovanni Mascellani (@giomasce) Approved-by: Francisco Casas (@fcasas) Approved-by: Henri Verbeet (@hverbeet) Approved-by: Alexandre Julliard (@julliard) Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/63
@@ -162,3 +162,41 @@ float4 main() : sv_target
|
||||
[test]
|
||||
draw quad
|
||||
todo probe all rgba (0.6, 0.1, 0.5, 0)
|
||||
|
||||
% Recursion is forbidden.
|
||||
|
||||
[pixel shader notimpl]
|
||||
|
||||
void bar();
|
||||
|
||||
void foo()
|
||||
{
|
||||
bar();
|
||||
}
|
||||
|
||||
void bar()
|
||||
{
|
||||
foo();
|
||||
}
|
||||
|
||||
float4 main() : sv_target
|
||||
{
|
||||
foo();
|
||||
return 0;
|
||||
}
|
||||
|
||||
[pixel shader notimpl todo]
|
||||
|
||||
% Even trivially finite recursion is forbidden.
|
||||
|
||||
void func(bool x)
|
||||
{
|
||||
if (x)
|
||||
func(false);
|
||||
}
|
||||
|
||||
float4 main() : sv_target
|
||||
{
|
||||
func(true);
|
||||
return 0;
|
||||
}
|
||||
|
@@ -893,6 +893,16 @@ void run_shader_tests(struct shader_runner *runner, int argc, char **argv, const
|
||||
state = STATE_SHADER_PIXEL_TODO;
|
||||
expect_hr = E_FAIL;
|
||||
}
|
||||
else if (!strcmp(line, "[pixel shader notimpl]\n"))
|
||||
{
|
||||
state = STATE_SHADER_PIXEL;
|
||||
expect_hr = E_NOTIMPL;
|
||||
}
|
||||
else if (!strcmp(line, "[pixel shader notimpl todo]\n"))
|
||||
{
|
||||
state = STATE_SHADER_PIXEL_TODO;
|
||||
expect_hr = E_NOTIMPL;
|
||||
}
|
||||
else if (sscanf(line, "[sampler %u]\n", &index))
|
||||
{
|
||||
state = STATE_SAMPLER;
|
||||
|
Reference in New Issue
Block a user