vkd3d-shader/hlsl: Forbid recursive calls.

This commit is contained in:
Zebediah Figura
2021-09-11 11:20:32 -05:00
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
4 changed files with 96 additions and 0 deletions

View File

@@ -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;
}

View File

@@ -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;