mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-04 00:50:40 +00:00
Set the d3d12path for d3d12 tests before caching the d3d12 capabilities
This commit is contained in:
@@ -286,6 +286,32 @@ void D3D12GraphicsTest::Prepare(int argc, char **argv)
|
||||
{
|
||||
GraphicsTest::Prepare(argc, argv);
|
||||
|
||||
for(int i = 0; i < argc; i++)
|
||||
{
|
||||
if(!strcmp(argv[i], "--gpuva") || !strcmp(argv[i], "--debug-gpu"))
|
||||
{
|
||||
gpuva = true;
|
||||
}
|
||||
if(i + 1 < argc &&
|
||||
(!strcmp(argv[i], "--d3d12") || !strcmp(argv[i], "--sdk") || !strcmp(argv[i], "--d3d12core")))
|
||||
{
|
||||
d3d12path = argv[i + 1];
|
||||
}
|
||||
}
|
||||
|
||||
if(d3d12path.empty())
|
||||
{
|
||||
d3d12path = GetExecutableName();
|
||||
d3d12path.erase(d3d12path.find_last_of("/\\"));
|
||||
d3d12path += "/D3D12/d3d12core.dll";
|
||||
|
||||
FILE *f = fopen(d3d12path.c_str(), "r");
|
||||
if(!f)
|
||||
d3d12path.clear();
|
||||
else
|
||||
fclose(f);
|
||||
}
|
||||
|
||||
static bool prepared = false;
|
||||
|
||||
if(!prepared)
|
||||
@@ -434,32 +460,6 @@ void D3D12GraphicsTest::Prepare(int argc, char **argv)
|
||||
opts7 = caps.opts7;
|
||||
opts19 = caps.opts19;
|
||||
|
||||
for(int i = 0; i < argc; i++)
|
||||
{
|
||||
if(!strcmp(argv[i], "--gpuva") || !strcmp(argv[i], "--debug-gpu"))
|
||||
{
|
||||
gpuva = true;
|
||||
}
|
||||
if(i + 1 < argc &&
|
||||
(!strcmp(argv[i], "--d3d12") || !strcmp(argv[i], "--sdk") || !strcmp(argv[i], "--d3d12core")))
|
||||
{
|
||||
d3d12path = argv[i + 1];
|
||||
}
|
||||
}
|
||||
|
||||
if(d3d12path.empty())
|
||||
{
|
||||
d3d12path = GetExecutableName();
|
||||
d3d12path.erase(d3d12path.find_last_of("/\\"));
|
||||
d3d12path += "/D3D12/d3d12core.dll";
|
||||
|
||||
FILE *f = fopen(d3d12path.c_str(), "r");
|
||||
if(!f)
|
||||
d3d12path.clear();
|
||||
else
|
||||
fclose(f);
|
||||
}
|
||||
|
||||
m_Factory = factory;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user