[dxgi] Add option for deferred surface creation

Deferred surface creation is required for Frostpunk due to conflicts
with the D3D9 swap chain created by the game before it presents the
first frame to the DXGI swap chain, but breaks NieR:Automata due to
threading issues.
This commit is contained in:
Philip Rebohle 2018-05-24 12:31:21 +02:00
parent f087016e77
commit d844ddfdfa
No known key found for this signature in database
GPG Key ID: C8CC613427A31C99
2 changed files with 8 additions and 1 deletions

View File

@ -14,6 +14,13 @@ namespace dxvk {
m_device (device),
m_context (device->createContext()) {
// Some games don't work with deferred surface creation,
// so we should default to initializing it immediately.
DxgiOptions dxgiOptions = getDxgiAppOptions(env::getExeName());
if (!dxgiOptions.test(DxgiOption::DeferSurfaceCreation))
m_surface = CreateSurface();
// Reset options for the swap chain itself. We will
// create a swap chain object before presentation.
m_options.preferredSurfaceFormat = { VK_FORMAT_UNDEFINED, VK_COLOR_SPACE_SRGB_NONLINEAR_KHR };

View File

@ -8,7 +8,7 @@
#include "../spirv/spirv_module.h"
#include "dxgi_include.h"
#include "dxgi_options.h"
namespace dxvk {