1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2024-12-05 01:24:14 +01:00

[dxgi] Change CreateSwapChain to take a surface factory

This commit is contained in:
Philip Rebohle 2022-10-28 17:22:27 +02:00
parent 03dca539cb
commit 76e6b2764b
4 changed files with 9 additions and 8 deletions

View File

@ -2997,7 +2997,7 @@ namespace dxvk {
HRESULT STDMETHODCALLTYPE DXGIVkSwapChainFactory::CreateSwapChain(
HWND hWnd,
IDXGIVkSurfaceFactory* pSurfaceFactory,
const DXGI_SWAP_CHAIN_DESC1* pDesc,
IDXGIVkSwapChain** ppSwapChain) {
InitReturnPtr(ppSwapChain);
@ -3005,10 +3005,8 @@ namespace dxvk {
try {
auto vki = m_device->GetDXVKDevice()->adapter()->vki();
Com<IDXGIVkSurfaceFactory> surfaceFactory = new DxgiSurfaceFactory(vki->getLoaderProc(), hWnd);
Com<D3D11SwapChain> presenter = new D3D11SwapChain(
m_container, m_device, surfaceFactory.ptr(), pDesc);
m_container, m_device, pSurfaceFactory, pDesc);
*ppSwapChain = presenter.ref();
return S_OK;

View File

@ -710,7 +710,7 @@ namespace dxvk {
void** ppvObject);
HRESULT STDMETHODCALLTYPE CreateSwapChain(
HWND hWnd,
IDXGIVkSurfaceFactory* pSurfaceFactory,
const DXGI_SWAP_CHAIN_DESC1* pDesc,
IDXGIVkSwapChain** ppSwapChain);

View File

@ -1,4 +1,5 @@
#include "dxgi_factory.h"
#include "dxgi_surface.h"
#include "dxgi_swapchain.h"
#include "dxgi_swapchain_dispatcher.h"
@ -153,9 +154,11 @@ namespace dxvk {
Com<IWineDXGISwapChainFactory> wineFactory;
if (SUCCEEDED(pDevice->QueryInterface(IID_PPV_ARGS(&dxvkFactory)))) {
Com<IDXGIVkSwapChain> presenter;
Com<IDXGIVkSurfaceFactory> surfaceFactory = new DxgiSurfaceFactory(
m_instance->vki()->getLoaderProc(), hWnd);
HRESULT hr = dxvkFactory->CreateSwapChain(hWnd, &desc, &presenter);
Com<IDXGIVkSwapChain> presenter;
HRESULT hr = dxvkFactory->CreateSwapChain(surfaceFactory.ptr(), &desc, &presenter);
if (FAILED(hr)) {
Logger::err(str::format("DXGI: CreateSwapChainForHwnd: Failed to create swap chain, hr ", hr));

View File

@ -121,7 +121,7 @@ IDXGIVkSwapChain : public IUnknown {
MIDL_INTERFACE("e7d6c3ca-23a0-4e08-9f2f-ea5231df6633")
IDXGIVkSwapChainFactory : public IUnknown {
virtual HRESULT STDMETHODCALLTYPE CreateSwapChain(
HWND hWnd,
IDXGIVkSurfaceFactory* pSurfaceFactory,
const DXGI_SWAP_CHAIN_DESC1* pDesc,
IDXGIVkSwapChain** ppSwapChain) = 0;
};