Skip to content
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

Try to improve Reflex command queue lookups #184

Merged
merged 3 commits into from
Jun 15, 2024

Conversation

Saancreed
Copy link
Collaborator

@Saancreed Saancreed commented Jun 12, 2024

This lets us avoid having to QueryInterface on every call to NvAPI_D3D12_SetAsyncFrameMarker. The consequence of doing it like this is that now there might be multiple entries in m_lowLatencyDeviceMap pointing to the same ID3DLowLatencyDevice so in order to still correctly have a single frame ID generator per ID3DLowLatencyDevice, their map is now keyed on low latency devices which we have to retrieve on every call anyway.

We could further reduce the lookups if we either returned intermediate ID3DLowLatencyDevice from SupportsLowLatency and then acted on it in the following call or if we just got rid of explicit SupportsLowLatency and had methods like SetFrameMarker returned more detailed error codes (or just NvAPI_Status directly). But that's an idea for another day.

@Saancreed Saancreed force-pushed the reflex-command-queue-lookup branch from 5a4a010 to 64ea672 Compare June 14, 2024 21:39
@Saancreed
Copy link
Collaborator Author

Changed it a bit, now there are separate methods with overloads for IUnknown which is presumed to be some kind of ID3D1[12]Device and ID3D12CommandQueue where appropriate instead of a single one that blindly tries to handle both, which should limit the amount of weird DXVK and vkd3d-proton logs about unsupported QueryInterface calls.

@Saancreed Saancreed marked this pull request as ready for review June 14, 2024 21:49
@Saancreed Saancreed requested a review from jp7677 June 14, 2024 21:49
Copy link
Owner

@jp7677 jp7677 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Small suggestion for the tests, otherwise LGTM! Thanks for diving into this.

And check ref counts at the end of D3D12 Reflex tests.
@Saancreed Saancreed force-pushed the reflex-command-queue-lookup branch from 64ea672 to d82b0ca Compare June 15, 2024 09:52
@jp7677 jp7677 merged commit 2b9806d into master Jun 15, 2024
2 checks passed
@Saancreed Saancreed deleted the reflex-command-queue-lookup branch June 15, 2024 10:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants