There's a setter, but no getter. The doc doesn't give any information other than that this name will be used in debug diagnostics and tools.
Asked
Active
Viewed 891 times
1 Answers
4
This works:
wchar_t name[128] = {};
UINT size = sizeof(name);
object->GetPrivateData(WKPDID_D3DDebugObjectNameW, &size, name);
In DX11 the SetName
API didn't exist, but SetPrivateData(WKPDID_D3DDebugObjectName, ...)
was used for the same purpose. And GetPrivateData
could be used to retrieve the string.
DX12 actually uses the same system, just with a different GUID because the name is in unicode (note the W
at the end of WKPDID_D3DDebugObjectNameW
), and SetName
is just a shortcut for it.

Jerem
- 1,725
- 14
- 24