aboutsummaryrefslogtreecommitdiff
path: root/demo/d3d12/appD3D12Ctx.cpp
diff options
context:
space:
mode:
authorMiles Macklin <[email protected]>2017-07-05 12:59:25 +1200
committerMiles Macklin <[email protected]>2017-07-05 12:59:25 +1200
commit7f669cec7c812a366eedaf0cdfe09d6a5bad84af (patch)
tree5744216f9f88788c88f07a69ad11a43d232c95f9 /demo/d3d12/appD3D12Ctx.cpp
parent1.2.0.beta.1 (diff)
downloadflex-7f669cec7c812a366eedaf0cdfe09d6a5bad84af.tar.xz
flex-7f669cec7c812a366eedaf0cdfe09d6a5bad84af.zip
Flex 1.2 (beta 2)
Diffstat (limited to 'demo/d3d12/appD3D12Ctx.cpp')
-rw-r--r--demo/d3d12/appD3D12Ctx.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/demo/d3d12/appD3D12Ctx.cpp b/demo/d3d12/appD3D12Ctx.cpp
index 944453a..82aa56a 100644
--- a/demo/d3d12/appD3D12Ctx.cpp
+++ b/demo/d3d12/appD3D12Ctx.cpp
@@ -310,7 +310,7 @@ void AppGraphCtxInitRenderTargetD3D12(AppGraphCtx* contextIn, SDL_Window* window
hr = pFactory->CreateSwapChain(context->m_commandQueue, &desc, (IDXGISwapChain**)&context->m_swapChain);
- if(hr != S_OK)
+ if (hr != S_OK)
{
COMRelease(context->m_swapChain);
context->m_fullscreen = false;
@@ -378,7 +378,7 @@ void AppGraphCtxInitRenderTargetD3D12(AppGraphCtx* contextIn, SDL_Window* window
D3D12_RESOURCE_DESC desc = backBuffer->GetDesc();
DXGI_FORMAT resourceFormat;
-
+
if (desc.Format == DXGI_FORMAT_R32_FLOAT || desc.Format == DXGI_FORMAT_D32_FLOAT)
{
resourceFormat = DXGI_FORMAT_R32_TYPELESS;
@@ -449,7 +449,7 @@ void AppGraphCtxInitRenderTargetD3D12(AppGraphCtx* contextIn, SDL_Window* window
D3D12_RESOURCE_STATE_DEPTH_WRITE,
&clearValue,
IID_PPV_ARGS(&context->m_depthStencil)
- ))
+ ))
{
return;
}
@@ -457,7 +457,7 @@ void AppGraphCtxInitRenderTargetD3D12(AppGraphCtx* contextIn, SDL_Window* window
// create the depth stencil view
D3D12_DEPTH_STENCIL_VIEW_DESC viewDesc = {};
viewDesc.Format = context->m_dsv_format; // DXGI_FORMAT_D32_FLOAT;
- viewDesc.ViewDimension = (context->m_numMsaaSamples>1) ? D3D12_DSV_DIMENSION_TEXTURE2DMS : D3D12_DSV_DIMENSION_TEXTURE2D;
+ viewDesc.ViewDimension = (context->m_numMsaaSamples > 1) ? D3D12_DSV_DIMENSION_TEXTURE2DMS : D3D12_DSV_DIMENSION_TEXTURE2D;
viewDesc.Flags = D3D12_DSV_FLAG_NONE;
viewDesc.Texture2D.MipSlice = 0;
@@ -621,8 +621,10 @@ void AppGraphCtxFramePresentD3D12(AppGraphCtx* contextIn, bool fullsync)
auto context = cast_to_AppGraphCtxD3D12(contextIn);
// check if now is good time to present
+#if 0 // disable frame latency waitable object check because it will cause vsync to fail
bool shouldPresent = context->m_fullscreen ? true : WaitForSingleObjectEx(context->m_swapChainWaitableObject, 0, TRUE) != WAIT_TIMEOUT;
if (shouldPresent)
+#endif
{
context->m_swapChain->Present(fullsync, 0);
context->m_renderTargetID++;