[d3d11] Don't check for apitrace on non-Windows platforms

This commit is contained in:
Joshua Ashton 2022-08-21 18:28:01 +00:00 committed by Philip Rebohle
parent a5db9d22f1
commit baa88d8cf1
1 changed files with 9 additions and 1 deletions

View File

@ -4,6 +4,14 @@
namespace dxvk {
static bool IsAPITracingDXGI() {
#ifdef _WIN32
return !!::GetModuleHandle("dxgitrace.dll");
#else
return false;
#endif
}
D3D11Options::D3D11Options(const Config& config, const Rc<DxvkDevice>& device) {
this->dcSingleUseMode = config.getOption<bool>("d3d11.dcSingleUseMode", true);
this->enableRtOutputNanFixup = config.getOption<bool>("d3d11.enableRtOutputNanFixup", false);
@ -39,7 +47,7 @@ namespace dxvk {
auto cachedDynamicResources = config.getOption<std::string>("d3d11.cachedDynamicResources", std::string());
if (::GetModuleHandle("dxgitrace.dll")) {
if (IsAPITracingDXGI()) {
// apitrace reads back all mapped resources on the CPU, so
// allocating everything in cached memory is necessary to
// achieve acceptable performance