jp7677 / dxvk-nvapi

Alternative NVAPI implementation on top of DXVK.
MIT License
353 stars 32 forks source link

Try to improve Reflex command queue lookups #184

Closed Saancreed closed 2 weeks ago

Saancreed commented 3 weeks ago

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 commented 3 weeks ago

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.