summaryrefslogtreecommitdiff
path: root/Source/Core/VideoBackends/D3DCommon/Common.cpp
diff options
context:
space:
mode:
authorSilent <zdanio95@gmail.com>2019-11-10 16:05:23 +0100
committerSilent <zdanio95@gmail.com>2019-11-10 16:07:32 +0100
commita68789a70c181a3ce424c6b9504678c7bf3624f6 (patch)
treef4e195d71d8994227cf2efe916d9fad074288774 /Source/Core/VideoBackends/D3DCommon/Common.cpp
parent8445644e0561469f9216b388ffcc6a8839215095 (diff)
D3DCommon: Remove unused GetDebugObjectName and tidy up SetDebugObjectName
Diffstat (limited to 'Source/Core/VideoBackends/D3DCommon/Common.cpp')
-rw-r--r--Source/Core/VideoBackends/D3DCommon/Common.cpp41
1 files changed, 5 insertions, 36 deletions
diff --git a/Source/Core/VideoBackends/D3DCommon/Common.cpp b/Source/Core/VideoBackends/D3DCommon/Common.cpp
index 1046cc8cb0..b84fc4a4df 100644
--- a/Source/Core/VideoBackends/D3DCommon/Common.cpp
+++ b/Source/Core/VideoBackends/D3DCommon/Common.cpp
@@ -268,53 +268,22 @@ AbstractTextureFormat GetAbstractFormatForDXGIFormat(DXGI_FORMAT format)
}
}
-void SetDebugObjectName(IUnknown* resource, const char* format, ...)
+void SetDebugObjectName(IUnknown* resource, std::string_view name)
{
if (!g_ActiveConfig.bEnableValidationLayer)
return;
- std::va_list ap;
- va_start(ap, format);
- std::string name = StringFromFormatV(format, ap);
- va_end(ap);
-
Microsoft::WRL::ComPtr<ID3D11DeviceChild> child11;
Microsoft::WRL::ComPtr<ID3D12DeviceChild> child12;
- if (SUCCEEDED(resource->QueryInterface(IID_PPV_ARGS(&child11))))
+ if (SUCCEEDED(resource->QueryInterface(IID_PPV_ARGS(child11.GetAddressOf()))))
{
child11->SetPrivateData(WKPDID_D3DDebugObjectName, static_cast<UINT>(name.length()),
- name.c_str());
+ name.data());
}
- else if (SUCCEEDED(resource->QueryInterface(IID_PPV_ARGS(&child12))))
+ else if (SUCCEEDED(resource->QueryInterface(IID_PPV_ARGS(child12.GetAddressOf()))))
{
child12->SetPrivateData(WKPDID_D3DDebugObjectName, static_cast<UINT>(name.length()),
- name.c_str());
+ name.data());
}
}
-
-std::string GetDebugObjectName(IUnknown* resource)
-{
- if (!g_ActiveConfig.bEnableValidationLayer)
- return {};
-
- std::string name;
- UINT size = 0;
-
- Microsoft::WRL::ComPtr<ID3D11DeviceChild> child11;
- Microsoft::WRL::ComPtr<ID3D12DeviceChild> child12;
- if (SUCCEEDED(resource->QueryInterface(IID_PPV_ARGS(&child11))))
- {
- child11->GetPrivateData(WKPDID_D3DDebugObjectName, &size, nullptr);
- name.resize(size);
- child11->GetPrivateData(WKPDID_D3DDebugObjectName, &size, name.data());
- }
- else if (SUCCEEDED(resource->QueryInterface(IID_PPV_ARGS(&child12))))
- {
- child12->GetPrivateData(WKPDID_D3DDebugObjectName, &size, nullptr);
- name.resize(size);
- child12->GetPrivateData(WKPDID_D3DDebugObjectName, &size, name.data());
- }
-
- return name;
-}
} // namespace D3DCommon