0

D3D11 Debug Layer shows Name="unnamed" even if DebugName property of the D3D11 object is set with a name ("test" for example).

  1. Context is D3D11 with C# using Vortice.
  2. Debug Layer seems to be working well. It is active using DirectX Control Panel or d3dconfig command line and debug messages are from ID3D11InfoQueue.GetMessages(messageIndex).
  3. DebugName property is set using SetPrivateData and VS Debug shows the value of this property is set ("test" for example).

I must be missing something but I can not figure it out.

Is the Name="unnamed" field in the InfoQueue description the same as DebugName property in D3D11 objects?

MarcioAB
  • 601
  • 1
  • 5
  • 11
  • Yes, it should work. With what parameters do you exactly call SetPrivateData? Also in my case, I don't see these message in Visual Studio Output Window, I see them w/o debugging and running a tool aside that display OutputDebugString traces (not sure why). – Simon Mourier Nov 16 '22 at 22:33
  • @SimonMourier: the code to set SetPrivateData is this: var y = Encoding.ASCII.GetBytes("test"); unsafe { fixed (byte* pointerToFirst = y) { RTV11.SetPrivateData(CommonGuid.DebugObjectName, y.Length, pointerToFirst); }} – MarcioAB Nov 16 '22 at 23:17
  • @SimonMourier Same here: Don't see the messages in the Output Window, so I created a function using Debug.WriteLine(d3dInfoQueue.GetMessage(n0).Description) being n0 the messageIndex in d3dInfoQueue. – MarcioAB Nov 16 '22 at 23:23
  • There are two guids: https://www.magnumdb.com/search?q=WKPDID_D3DDebugObjectName* make sure you're using the proper ansi vs unicode one – Simon Mourier Nov 17 '22 at 07:27
  • Comparing Debug Layer D3D12 with D3D11 I think I found the problem. D3D11 InfoQueue debug messages are created automatically by the runtime's internal mechanism or per user request using report generators (live objects, validate context). The messages created automatically does NOT use the Name field and output Name="unnamed" in the Description property even if the object was named. The messages created by live objects (Detail flag) use Name field and output the object name correctly. – MarcioAB Nov 17 '22 at 21:26
  • In D3D12, this "error" was corrected and despite the messages created automatically still does not use the Name field, the Description property does not output anything related to Name. The messages created by live objects (Detail flag) use Name field and output the object name correctly. So, I assume no one was able to change that Name="unnamed" in D3D11. – MarcioAB Nov 17 '22 at 21:27

1 Answers1

0

Comparing Debug Layer D3D12 with D3D11 I think I found the problem.

D3D11 issue a debug message during object creation informing the object name. As object name is set after the object is created, the name that appear in this message is "unnamed".

D3D12 fixed that and there is no more information about object name during object creation.

MarcioAB
  • 601
  • 1
  • 5
  • 11
  • 1
    Hi, glad to know you've found the solution to resolve this issue! Please consider accepting it and changing its status to Answered. See [can I answer my own question..](https://stackoverflow.com/help/self-answer), Just a reminder :) It will also help others to solve the similar issue. – Jingmiao Xu-MSFT Nov 25 '22 at 01:21