Answered by:
GetCPUDescriptorHandleForHeapStart - Rigged?

Question
-
I just spent about three and a half very intensive and frustrating hours trying to track down a crash in a group of function calls between (and including) GetCPUDescriptorHandleForHeapStart and CreateRenderTargetView in DX12. I am not using Visual Studio; I'm using "manual" assembly language as I always do (clearly making me public enemy #1 to the entire development community on Earth). I did track down the problem and I have to say that it is quite disturbing that it exists at all. I'm wondering if anybody else has encountered it - something I seriously doubt because few if any others would take the time to track the problem down.
The problem occurs in the call to GetCPUDescriptorHandleForHeapStart, although depending on seemingly random conditions, it may not actually manifest a crash until the subsequent call to CreateRenderTargetView.
Completely undocumented, the RDX register is required to point *somewhere* in the app's data segment on the call to GetCPUDescriptorHandleForHeapStart. That method is clearly documented as having no parameters, with [THIS] of course being implicit in RCX as is always the case with COM. The assignment of a valid pointer into RDX immediately before the call is not part of any C++ code whatsoever, at any level. It's simply generated by the compiler, making it APPEAR to be a manually rigged piece of f***ery to shut down any languages outside VS attempting to use DirectX 12.
If you're using DirectX 12 outside of Visual Studio, you might want to make a note of this at the very least, for future reference. Now I'm proceeding in a state of terror wondering when the next time is going to be that I will encounter such an issue. I've learned to begin debugging by setting any unused registers of RDX, R8, and R9 to unique and consistent values so that if illegal writes or reads are occurring in the future, they will be immediately identifiable.
I cannot possibly see how something like this could be inadvertent. But an explanation could always exist despite appearances so I will leave that door open.
Those who can, do. Those who can't, teach.
Saturday, June 13, 2020 7:12 AM
Answers
-
The retirement notice sticky here;
https://social.msdn.microsoft.com/Forums/windowsapps/en-US/c9f499f0-52b3-41ba-8022-f4fbb94dbb34/the-building-windows-store-games-with-directx-forum-is-retiring?forum=wingameswithdirectx
is directing users to post in Developing Universal Windows apps forum
https://docs.microsoft.com/en-us/answers/topics/uwp.html
Regards, Dave Patrick ....
Microsoft Certified Professional
Microsoft MVP [Windows Server] Datacenter Management
Disclaimer: This posting is provided "AS IS" with no warranties or guarantees, and confers no rights.- Proposed as answer by Guido Franzke Monday, June 15, 2020 8:25 AM
- Marked as answer by Guido Franzke Monday, June 22, 2020 6:49 AM
Saturday, June 13, 2020 12:39 PM
All replies
-
The retirement notice sticky here;
https://social.msdn.microsoft.com/Forums/windowsapps/en-US/c9f499f0-52b3-41ba-8022-f4fbb94dbb34/the-building-windows-store-games-with-directx-forum-is-retiring?forum=wingameswithdirectx
is directing users to post in Developing Universal Windows apps forum
https://docs.microsoft.com/en-us/answers/topics/uwp.html
Regards, Dave Patrick ....
Microsoft Certified Professional
Microsoft MVP [Windows Server] Datacenter Management
Disclaimer: This posting is provided "AS IS" with no warranties or guarantees, and confers no rights.- Proposed as answer by Guido Franzke Monday, June 15, 2020 8:25 AM
- Marked as answer by Guido Franzke Monday, June 22, 2020 6:49 AM
Saturday, June 13, 2020 12:39 PM -
I have retired this message. You are directed to post in the Ubuntu MAC forum.
Those who can, do. Those who can't, teach.
Monday, June 15, 2020 4:20 PM -
Sounds good then.
Regards, Dave Patrick ....
Microsoft Certified Professional
Microsoft MVP [Windows Server] Datacenter Management
Disclaimer: This posting is provided "AS IS" with no warranties or guarantees, and confers no rights.Monday, June 15, 2020 4:30 PM