-
Notifications
You must be signed in to change notification settings - Fork 810
LongVectors tests: Fix device leak and improve logging #7951
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
base: main
Are you sure you want to change the base?
Conversation
Previously, if a device is removed then the code that recreates it wouldn't release the old device pointer, resulting in the device leaking. This actually prevents removed device recovery entirely, since all references to a removed device need to be released before a new one can be created. This change fixes that. Also: * improve logging in situations where requirements aren't met (eg trying to create a SM 6.9 device on a system that doesn't support SM 6.9) * improve logging when recreating a device so we can tell the difference between "device was removed" and "there wasn't a device set" * add a warning log if createDevice is called with something that looks like it already has a value set Fixes microsoft#7949
| bool SkipUnsupported) { | ||
|
|
||
| if (*D3DDevice) | ||
| hlsl_test::LogWarningFmt(L"createDevice called with non-null *D3DDevice - " |
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.
Could this be a failure instead of a warning? It seems bad to allow this with just a warning.
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.
I'm maybe being overly cautious here, and partly this is because of the distance between this code and it running in its final location, I wanted to find out places where this might be happening without taking everything down with it - hence the warning.
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.
If it caused failures in current runs, I think we'd want to know and fix those anyway. Is now just a particularly bad time to potentially disrupt the tests? Maybe we can follow up with a change to turn this into a failure instead of doing it here.
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.
Agreed, yes, and agreed :)
tex3d
left a comment
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, but it feels like we should fail if we would overwrite a device pointer (creating a leak) rather than just issue a warning.
Previously, if a device is removed then the code that recreates it wouldn't release the old device pointer, resulting in the device leaking. This actually prevents removed device recovery entirely, since all references to a removed device need to be released before a new one can be created. This change fixes that.
Also:
Fixes #7949