mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2024-09-13 09:16:14 -07:00
tests: Introduce parse_args() helper function.
Signed-off-by: Józef Kucia <jkucia@codeweavers.com> Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
03eba4b0ad
commit
96f9b1b771
@ -21809,26 +21809,7 @@ static void test_primitive_restart(void)
|
||||
|
||||
START_TEST(d3d12)
|
||||
{
|
||||
bool enable_debug_layer = false;
|
||||
ID3D12Debug *debug;
|
||||
unsigned int i;
|
||||
|
||||
for (i = 1; i < argc; ++i)
|
||||
{
|
||||
if (!strcmp(argv[i], "--validate"))
|
||||
enable_debug_layer = true;
|
||||
else if (!strcmp(argv[i], "--warp"))
|
||||
use_warp_device = true;
|
||||
else if (!strcmp(argv[i], "--adapter") && i + 1 < argc)
|
||||
use_adapter_idx = atoi(argv[++i]);
|
||||
}
|
||||
|
||||
if (enable_debug_layer && SUCCEEDED(D3D12GetDebugInterface(&IID_ID3D12Debug, (void **)&debug)))
|
||||
{
|
||||
ID3D12Debug_EnableDebugLayer(debug);
|
||||
ID3D12Debug_Release(debug);
|
||||
}
|
||||
|
||||
parse_args(argc, argv);
|
||||
print_adapter_info();
|
||||
|
||||
run_test(test_create_device);
|
||||
|
@ -316,4 +316,27 @@ static ID3D12Device *create_device(void)
|
||||
return SUCCEEDED(hr) ? device : NULL;
|
||||
}
|
||||
|
||||
static void parse_args(int argc, char **argv)
|
||||
{
|
||||
bool enable_debug_layer = false;
|
||||
ID3D12Debug *debug;
|
||||
unsigned int i;
|
||||
|
||||
for (i = 1; i < argc; ++i)
|
||||
{
|
||||
if (!strcmp(argv[i], "--validate"))
|
||||
enable_debug_layer = true;
|
||||
else if (!strcmp(argv[i], "--warp"))
|
||||
use_warp_device = true;
|
||||
else if (!strcmp(argv[i], "--adapter") && i + 1 < argc)
|
||||
use_adapter_idx = atoi(argv[++i]);
|
||||
}
|
||||
|
||||
if (enable_debug_layer && SUCCEEDED(D3D12GetDebugInterface(&IID_ID3D12Debug, (void **)&debug)))
|
||||
{
|
||||
ID3D12Debug_EnableDebugLayer(debug);
|
||||
ID3D12Debug_Release(debug);
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* __VKD3D_D3D12_CROSSTEST_H */
|
||||
|
@ -152,26 +152,7 @@ static void test_invalid_texture_resource_barriers(void)
|
||||
|
||||
START_TEST(d3d12_invalid_usage)
|
||||
{
|
||||
bool enable_debug_layer = false;
|
||||
ID3D12Debug *debug;
|
||||
unsigned int i;
|
||||
|
||||
for (i = 1; i < argc; ++i)
|
||||
{
|
||||
if (!strcmp(argv[i], "--validate"))
|
||||
enable_debug_layer = true;
|
||||
else if (!strcmp(argv[i], "--warp"))
|
||||
use_warp_device = true;
|
||||
else if (!strcmp(argv[i], "--adapter") && i + 1 < argc)
|
||||
use_adapter_idx = atoi(argv[++i]);
|
||||
}
|
||||
|
||||
if (enable_debug_layer && SUCCEEDED(D3D12GetDebugInterface(&IID_ID3D12Debug, (void **)&debug)))
|
||||
{
|
||||
ID3D12Debug_EnableDebugLayer(debug);
|
||||
ID3D12Debug_Release(debug);
|
||||
}
|
||||
|
||||
parse_args(argc, argv);
|
||||
print_adapter_info();
|
||||
|
||||
run_test(test_invalid_texture_resource_barriers);
|
||||
|
Loading…
Reference in New Issue
Block a user