[dxgi] Implement IDXGISwapChain3

- Stub IDXGISwapChain3::ResizeBuffers1
This commit is contained in:
Philip Rebohle 2018-11-12 12:51:43 +01:00
parent 81bb561c75
commit c25483e856
No known key found for this signature in database
GPG Key ID: C8CC613427A31C99
2 changed files with 60 additions and 2 deletions

View File

@ -59,7 +59,8 @@ namespace dxvk {
|| riid == __uuidof(IDXGIDeviceSubObject)
|| riid == __uuidof(IDXGISwapChain)
|| riid == __uuidof(IDXGISwapChain1)
|| riid == __uuidof(IDXGISwapChain2)) {
|| riid == __uuidof(IDXGISwapChain2)
|| riid == __uuidof(IDXGISwapChain3)) {
*ppvObject = ref(this);
return S_OK;
}
@ -83,6 +84,11 @@ namespace dxvk {
HRESULT STDMETHODCALLTYPE DxgiSwapChain::GetBuffer(UINT Buffer, REFIID riid, void** ppSurface) {
return m_presenter->GetImage(Buffer, riid, ppSurface);
}
UINT STDMETHODCALLTYPE DxgiSwapChain::GetCurrentBackBufferIndex() {
return m_presenter->GetImageIndex();
}
HRESULT STDMETHODCALLTYPE DxgiSwapChain::GetContainingOutput(IDXGIOutput** ppOutput) {
@ -302,6 +308,24 @@ namespace dxvk {
}
HRESULT STDMETHODCALLTYPE DxgiSwapChain::ResizeBuffers1(
UINT BufferCount,
UINT Width,
UINT Height,
DXGI_FORMAT Format,
UINT SwapChainFlags,
const UINT* pCreationNodeMask,
IUnknown* const* ppPresentQueue) {
static bool s_errorShown = false;
if (!std::exchange(s_errorShown, true))
Logger::warn("DxgiSwapChain::ResizeBuffers1: Stub");
return ResizeBuffers(BufferCount,
Width, Height, Format, SwapChainFlags);
}
HRESULT STDMETHODCALLTYPE DxgiSwapChain::ResizeTarget(const DXGI_MODE_DESC* pNewTargetParameters) {
std::lock_guard<std::mutex> lock(m_lockWindow);
@ -448,6 +472,22 @@ namespace dxvk {
}
HRESULT STDMETHODCALLTYPE DxgiSwapChain::CheckColorSpaceSupport(
DXGI_COLOR_SPACE_TYPE ColorSpace,
UINT* pColorSpaceSupport) {
Logger::err("DxgiSwapChain::CheckColorSpaceSupport: Not implemented");
*pColorSpaceSupport = 0;
return E_NOTIMPL;
}
HRESULT DxgiSwapChain::SetColorSpace1(DXGI_COLOR_SPACE_TYPE ColorSpace) {
Logger::err("DxgiSwapChain::SetColorSpace1: Not implemented");
return E_NOTIMPL;
}
HRESULT DxgiSwapChain::SetGammaControl(const DXGI_GAMMA_CONTROL* pGammaControl) {
return m_presenter->SetGammaControl(DXGI_VK_GAMMA_CP_COUNT, pGammaControl->GammaCurve);
}

View File

@ -19,7 +19,7 @@ namespace dxvk {
class DxgiFactory;
class DxgiOutput;
class DxgiSwapChain : public DxgiObject<IDXGISwapChain2> {
class DxgiSwapChain : public DxgiObject<IDXGISwapChain3> {
public:
@ -49,6 +49,8 @@ namespace dxvk {
REFIID riid,
void** ppSurface) final;
UINT STDMETHODCALLTYPE GetCurrentBackBufferIndex() final;
HRESULT STDMETHODCALLTYPE GetContainingOutput(
IDXGIOutput** ppOutput) final;
@ -105,6 +107,15 @@ namespace dxvk {
DXGI_FORMAT NewFormat,
UINT SwapChainFlags) final;
HRESULT STDMETHODCALLTYPE ResizeBuffers1(
UINT BufferCount,
UINT Width,
UINT Height,
DXGI_FORMAT Format,
UINT SwapChainFlags,
const UINT* pCreationNodeMask,
IUnknown* const* ppPresentQueue) final;
HRESULT STDMETHODCALLTYPE ResizeTarget(
const DXGI_MODE_DESC* pNewTargetParameters) final;
@ -139,6 +150,13 @@ namespace dxvk {
HRESULT STDMETHODCALLTYPE SetSourceSize(
UINT Width,
UINT Height) final;
HRESULT STDMETHODCALLTYPE CheckColorSpaceSupport(
DXGI_COLOR_SPACE_TYPE ColorSpace,
UINT* pColorSpaceSupport) final;
HRESULT STDMETHODCALLTYPE SetColorSpace1(
DXGI_COLOR_SPACE_TYPE ColorSpace) final;
HRESULT SetGammaControl(
const DXGI_GAMMA_CONTROL* pGammaControl);