-
-
Notifications
You must be signed in to change notification settings - Fork 21.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
D3D12: Use the right state for resources in certain heap types #93707
Conversation
I am still getting a crash with this PR, but the crash happens later. It seems it crashes when trying to read back data from a texture. I was able to reproduce this just by opening a project in the editor. I'll do more testing to see if I can find more info for you edit: Crashing when opening https://github.com/RPicster/godot4-demo-desert-light in the editor and the MRP from #93249 (but with a slightly different backtrace
|
It doesn't do it for me either with and without Agility SDK. Is it dependent on the driver? I recall having trouble with this elsewhere on other systems but couldn't find any details on the specification about why COMMON is banned from being used in upload (and state promotion is supposed to take care of it AFAIK). I'm just confused as to why the validation says nothing to me in this case. Either way I'm not against the change in the PR, just trying to understand the reason behind the problem further. |
181e9e1
to
207f523
Compare
I found this at https://learn.microsoft.com/en-us/windows/win32/api/d3d12/ne-d3d12-d3d12_heap_type:
And also this, I've just found the debug layer complains about in my case as well:
I've updated the PR so we meet this latter requirement as well. I no longer get errors about that. @clayjohn, can you confirm this fixes the issue for you, too? |
Seems like a good enough reason to change it then, apologies for the change to common then. I can't help but wonder why the debug layer accepts it on some systems and not in others though. I'll ask if the validation was added at some point. |
No need to apologize! We do changes to our best judgement. I'm curious about the validation difference, too. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me.
I have tested with the original MRP and with Desert Light and neither are crashing now!
Thanks! |
I can confirm this PR seems to be fixing the crash we were experiencing in #93670 on our NVIDIA 1070 Windows 10 computer. When we get back home, I'll test on our AMD Radeon Windows 10 computer and see if it is fixed there as well! Thanks everyone and great work! :) |
Can confirm the PR fixes both AMD and NVIDIA issues on Windows 10 :) |
When enhanced resource barriers are not available, and thus the legacy barriers are used, buffers in an upload heap need to have the
D3D12_RESOURCE_STATE_GENERIC_READ
status (otherwise, the creation fails and also the debug layer complains about it).2024-07-01: Also using
D3D12_RESOURCE_STATE_COPY_DEST
for readback heaps.Fixes #93670.