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
Assertion and panic alert improvements #10209
Conversation
e9fb81c
to
37bab59
Compare
971cbdd
to
3fddbcc
Compare
|
I've added another commit, which uses the caller's file and line number for panic alerts instead of the line number of the log call in Example |
3fddbcc
to
38c0afe
Compare
444512f
to
f061de8
Compare
9fb54ee
to
f62bcb8
Compare
f62bcb8
to
3174ea3
Compare
e741a81
to
0a8d825
Compare
0a8d825
to
0839173
Compare
16c2302
to
158616c
Compare
290f6da
to
a068548
Compare
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.
Wanted to make sure this didn't get lost. Untested but looks like a huge improvement!
Most of these became unneeded when fmt was introduced.
They're no longer used.
Since it was unused, nonexistent values were used in a few places. I've replaced them.
Specifically, this meant that __func__ in macros (namely ASSERT) would always be evaluate to "operator ()".
This will assist with finding the source of a panic alert based on logs; before, Common\MsgHandler.cpp:113 (or similar) was always used.
HRWrap now allows HRESULT to be formatted, giving useful information beyond "it failed" or a hex code that isn't obvious to most users. This commit does not add any uses of it, though.
Note that D3DCommon can't use DX11HRWrap or DX12HRWrap since it's shared between them.
|
FifoCI detected that this change impacts graphical rendering. Here are the behavior differences detected by the system:
automated-fifoci-reporter |
ASSERT_MSG; now, all relevant information is shown with that too.ASSERT_MSGnow uses fmt. I've updated all uses of this (and in some cases added additional details to the message).CHECKmacro in the D3D backends has been removed and replaced withASSERT_MSG.HRWrapstruct that can be used to formatHRESULTin messages; afmt::formatterexists for it. This uses_com_resultbased on this. This gives MUCH more useful information (compared to both just a hex value, and to no information at all (which was the norm for most uses)) and it should be fairly user-friendly.I put this inThis is now located inD3DCommon.h, but maybe this should be somewhere else so that it could be used in other code.Common/HRWrap.h, and used by a few places outside of D3D. D3D11 and D3D12 both have their own variants that callGetDeviceRemovedReasonwhen needed.PanicAlerthave been removed; they're no longer used by anything.ASSERT_MSG's first parameter now indicating the log type is now actually used.PanicAlertFmtTnow actually works. Yes, this was broken. The values were extracted for translation beforehand, but they were never actually translated at runtime. You can test this by modifyingdsp_rom.binso that it has an invalid hash, and then setting the language to French; the message will still be in English despite a translation for it existing. This will hopefully make it easier for people to understand these messages (though it may make things a bit harder for support).Before
would result in these dialogs:
and this being logged:
After
would result in these dialogs:
and this being logged: