mirror of
https://github.com/doitsujin/dxvk.git
synced 2025-03-06 20:58:37 +01:00
[dxgi] Change CreateSwapChain to take a surface factory
This commit is contained in:
parent
03dca539cb
commit
76e6b2764b
4 changed files with 9 additions and 8 deletions
|
@ -2997,7 +2997,7 @@ namespace dxvk {
|
||||||
|
|
||||||
|
|
||||||
HRESULT STDMETHODCALLTYPE DXGIVkSwapChainFactory::CreateSwapChain(
|
HRESULT STDMETHODCALLTYPE DXGIVkSwapChainFactory::CreateSwapChain(
|
||||||
HWND hWnd,
|
IDXGIVkSurfaceFactory* pSurfaceFactory,
|
||||||
const DXGI_SWAP_CHAIN_DESC1* pDesc,
|
const DXGI_SWAP_CHAIN_DESC1* pDesc,
|
||||||
IDXGIVkSwapChain** ppSwapChain) {
|
IDXGIVkSwapChain** ppSwapChain) {
|
||||||
InitReturnPtr(ppSwapChain);
|
InitReturnPtr(ppSwapChain);
|
||||||
|
@ -3005,10 +3005,8 @@ namespace dxvk {
|
||||||
try {
|
try {
|
||||||
auto vki = m_device->GetDXVKDevice()->adapter()->vki();
|
auto vki = m_device->GetDXVKDevice()->adapter()->vki();
|
||||||
|
|
||||||
Com<IDXGIVkSurfaceFactory> surfaceFactory = new DxgiSurfaceFactory(vki->getLoaderProc(), hWnd);
|
|
||||||
|
|
||||||
Com<D3D11SwapChain> presenter = new D3D11SwapChain(
|
Com<D3D11SwapChain> presenter = new D3D11SwapChain(
|
||||||
m_container, m_device, surfaceFactory.ptr(), pDesc);
|
m_container, m_device, pSurfaceFactory, pDesc);
|
||||||
|
|
||||||
*ppSwapChain = presenter.ref();
|
*ppSwapChain = presenter.ref();
|
||||||
return S_OK;
|
return S_OK;
|
||||||
|
|
|
@ -710,7 +710,7 @@ namespace dxvk {
|
||||||
void** ppvObject);
|
void** ppvObject);
|
||||||
|
|
||||||
HRESULT STDMETHODCALLTYPE CreateSwapChain(
|
HRESULT STDMETHODCALLTYPE CreateSwapChain(
|
||||||
HWND hWnd,
|
IDXGIVkSurfaceFactory* pSurfaceFactory,
|
||||||
const DXGI_SWAP_CHAIN_DESC1* pDesc,
|
const DXGI_SWAP_CHAIN_DESC1* pDesc,
|
||||||
IDXGIVkSwapChain** ppSwapChain);
|
IDXGIVkSwapChain** ppSwapChain);
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
#include "dxgi_factory.h"
|
#include "dxgi_factory.h"
|
||||||
|
#include "dxgi_surface.h"
|
||||||
#include "dxgi_swapchain.h"
|
#include "dxgi_swapchain.h"
|
||||||
#include "dxgi_swapchain_dispatcher.h"
|
#include "dxgi_swapchain_dispatcher.h"
|
||||||
|
|
||||||
|
@ -153,9 +154,11 @@ namespace dxvk {
|
||||||
Com<IWineDXGISwapChainFactory> wineFactory;
|
Com<IWineDXGISwapChainFactory> wineFactory;
|
||||||
|
|
||||||
if (SUCCEEDED(pDevice->QueryInterface(IID_PPV_ARGS(&dxvkFactory)))) {
|
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)) {
|
if (FAILED(hr)) {
|
||||||
Logger::err(str::format("DXGI: CreateSwapChainForHwnd: Failed to create swap chain, hr ", hr));
|
Logger::err(str::format("DXGI: CreateSwapChainForHwnd: Failed to create swap chain, hr ", hr));
|
||||||
|
|
|
@ -121,7 +121,7 @@ IDXGIVkSwapChain : public IUnknown {
|
||||||
MIDL_INTERFACE("e7d6c3ca-23a0-4e08-9f2f-ea5231df6633")
|
MIDL_INTERFACE("e7d6c3ca-23a0-4e08-9f2f-ea5231df6633")
|
||||||
IDXGIVkSwapChainFactory : public IUnknown {
|
IDXGIVkSwapChainFactory : public IUnknown {
|
||||||
virtual HRESULT STDMETHODCALLTYPE CreateSwapChain(
|
virtual HRESULT STDMETHODCALLTYPE CreateSwapChain(
|
||||||
HWND hWnd,
|
IDXGIVkSurfaceFactory* pSurfaceFactory,
|
||||||
const DXGI_SWAP_CHAIN_DESC1* pDesc,
|
const DXGI_SWAP_CHAIN_DESC1* pDesc,
|
||||||
IDXGIVkSwapChain** ppSwapChain) = 0;
|
IDXGIVkSwapChain** ppSwapChain) = 0;
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Reference in a new issue