Skip to content

Commit

Permalink
[dxgi] unchain DxgiSwapChain::Present1 and Present
Browse files Browse the repository at this point in the history
dxgi hooking tools might hook both, eg. SpecialKO/SpecialK#167
  • Loading branch information
Kethen authored and doitsujin committed Apr 22, 2024
1 parent 8ba5256 commit 92a43eb
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
13 changes: 10 additions & 3 deletions src/dxgi/dxgi_swapchain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -303,15 +303,22 @@ namespace dxvk {


HRESULT STDMETHODCALLTYPE DxgiSwapChain::Present(UINT SyncInterval, UINT Flags) {
return Present1(SyncInterval, Flags, nullptr);
return PresentBase(SyncInterval, Flags, nullptr);
}



HRESULT STDMETHODCALLTYPE DxgiSwapChain::Present1(
UINT SyncInterval,
UINT PresentFlags,
const DXGI_PRESENT_PARAMETERS* pPresentParameters) {

return PresentBase(SyncInterval, PresentFlags, pPresentParameters);
}

HRESULT STDMETHODCALLTYPE DxgiSwapChain::PresentBase(
UINT SyncInterval,
UINT PresentFlags,
const DXGI_PRESENT_PARAMETERS* pPresentParameters) {

if (SyncInterval > 4)
return DXGI_ERROR_INVALID_CALL;

Expand Down
4 changes: 4 additions & 0 deletions src/dxgi/dxgi_swapchain.h
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,10 @@ namespace dxvk {
DXGI_FORMAT Format,
DXGI_COLOR_SPACE_TYPE ColorSpace);

HRESULT STDMETHODCALLTYPE PresentBase(
UINT SyncInterval,
UINT PresentFlags,
const DXGI_PRESENT_PARAMETERS* pPresentParameters);
};

}

0 comments on commit 92a43eb

Please sign in to comment.