diff --git a/Tutorials/02-InitDXR/02-InitDXR.cpp b/Tutorials/02-InitDXR/02-InitDXR.cpp index c8efc23..faa0991 100644 --- a/Tutorials/02-InitDXR/02-InitDXR.cpp +++ b/Tutorials/02-InitDXR/02-InitDXR.cpp @@ -202,7 +202,7 @@ void Tutorial02::endFrame(uint32_t rtvIndex) uint32_t bufferIndex = mpSwapChain->GetCurrentBackBufferIndex(); // Make sure we have the new back-buffer is ready - if (mFenceValue > kDefaultSwapChainBuffers) + if (mFenceValue >= kDefaultSwapChainBuffers) { mpFence->SetEventOnCompletion(mFenceValue - kDefaultSwapChainBuffers + 1, mFenceEvent); WaitForSingleObject(mFenceEvent, INFINITE); diff --git a/Tutorials/03-AccelerationStructure/03-AccelerationStructure.cpp b/Tutorials/03-AccelerationStructure/03-AccelerationStructure.cpp index 4a06907..8ad4096 100644 --- a/Tutorials/03-AccelerationStructure/03-AccelerationStructure.cpp +++ b/Tutorials/03-AccelerationStructure/03-AccelerationStructure.cpp @@ -203,7 +203,7 @@ void Tutorial03::endFrame(uint32_t rtvIndex) uint32_t bufferIndex = mpSwapChain->GetCurrentBackBufferIndex(); // Make sure we have the new back-buffer is ready - if (mFenceValue > kDefaultSwapChainBuffers) + if (mFenceValue >= kDefaultSwapChainBuffers) { mpFence->SetEventOnCompletion(mFenceValue - kDefaultSwapChainBuffers + 1, mFenceEvent); WaitForSingleObject(mFenceEvent, INFINITE); diff --git a/Tutorials/04-RtPipelineState/04-RtPipelineState.cpp b/Tutorials/04-RtPipelineState/04-RtPipelineState.cpp index d7281af..4356dc8 100644 --- a/Tutorials/04-RtPipelineState/04-RtPipelineState.cpp +++ b/Tutorials/04-RtPipelineState/04-RtPipelineState.cpp @@ -211,7 +211,7 @@ void Tutorial04::endFrame(uint32_t rtvIndex) uint32_t bufferIndex = mpSwapChain->GetCurrentBackBufferIndex(); // Make sure we have the new back-buffer is ready - if (mFenceValue > kDefaultSwapChainBuffers) + if (mFenceValue >= kDefaultSwapChainBuffers) { mpFence->SetEventOnCompletion(mFenceValue - kDefaultSwapChainBuffers + 1, mFenceEvent); WaitForSingleObject(mFenceEvent, INFINITE); diff --git a/Tutorials/05-ShaderTable/05-ShaderTable.cpp b/Tutorials/05-ShaderTable/05-ShaderTable.cpp index 595dbff..a8cbc30 100644 --- a/Tutorials/05-ShaderTable/05-ShaderTable.cpp +++ b/Tutorials/05-ShaderTable/05-ShaderTable.cpp @@ -210,7 +210,7 @@ void Tutorial05::endFrame(uint32_t rtvIndex) uint32_t bufferIndex = mpSwapChain->GetCurrentBackBufferIndex(); // Make sure we have the new back-buffer is ready - if (mFenceValue > kDefaultSwapChainBuffers) + if (mFenceValue >= kDefaultSwapChainBuffers) { mpFence->SetEventOnCompletion(mFenceValue - kDefaultSwapChainBuffers + 1, mFenceEvent); WaitForSingleObject(mFenceEvent, INFINITE); diff --git a/Tutorials/06-Raytrace/06-Raytrace.cpp b/Tutorials/06-Raytrace/06-Raytrace.cpp index 6770257..6954f9d 100644 --- a/Tutorials/06-Raytrace/06-Raytrace.cpp +++ b/Tutorials/06-Raytrace/06-Raytrace.cpp @@ -214,7 +214,7 @@ void Tutorial06::endFrame(uint32_t rtvIndex) uint32_t bufferIndex = mpSwapChain->GetCurrentBackBufferIndex(); // Make sure we have the new back-buffer is ready - if (mFenceValue > kDefaultSwapChainBuffers) + if (mFenceValue >= kDefaultSwapChainBuffers) { mpFence->SetEventOnCompletion(mFenceValue - kDefaultSwapChainBuffers + 1, mFenceEvent); WaitForSingleObject(mFenceEvent, INFINITE); diff --git a/Tutorials/07-BasicShaders/07-BasicShaders.cpp b/Tutorials/07-BasicShaders/07-BasicShaders.cpp index 2236fed..81bb76c 100644 --- a/Tutorials/07-BasicShaders/07-BasicShaders.cpp +++ b/Tutorials/07-BasicShaders/07-BasicShaders.cpp @@ -214,7 +214,7 @@ void Tutorial07::endFrame(uint32_t rtvIndex) uint32_t bufferIndex = mpSwapChain->GetCurrentBackBufferIndex(); // Make sure we have the new back-buffer is ready - if (mFenceValue > kDefaultSwapChainBuffers) + if (mFenceValue >= kDefaultSwapChainBuffers) { mpFence->SetEventOnCompletion(mFenceValue - kDefaultSwapChainBuffers + 1, mFenceEvent); WaitForSingleObject(mFenceEvent, INFINITE); diff --git a/Tutorials/08-Instancing/08-Instancing.cpp b/Tutorials/08-Instancing/08-Instancing.cpp index 013ff21..af9e106 100644 --- a/Tutorials/08-Instancing/08-Instancing.cpp +++ b/Tutorials/08-Instancing/08-Instancing.cpp @@ -214,7 +214,7 @@ void Tutorial08::endFrame(uint32_t rtvIndex) uint32_t bufferIndex = mpSwapChain->GetCurrentBackBufferIndex(); // Make sure we have the new back-buffer is ready - if (mFenceValue > kDefaultSwapChainBuffers) + if (mFenceValue >= kDefaultSwapChainBuffers) { mpFence->SetEventOnCompletion(mFenceValue - kDefaultSwapChainBuffers + 1, mFenceEvent); WaitForSingleObject(mFenceEvent, INFINITE); diff --git a/Tutorials/09-ConstantBuffer/09-ConstantBuffer.cpp b/Tutorials/09-ConstantBuffer/09-ConstantBuffer.cpp index 980a6d7..3f0dea1 100644 --- a/Tutorials/09-ConstantBuffer/09-ConstantBuffer.cpp +++ b/Tutorials/09-ConstantBuffer/09-ConstantBuffer.cpp @@ -214,7 +214,7 @@ void Tutorial09::endFrame(uint32_t rtvIndex) uint32_t bufferIndex = mpSwapChain->GetCurrentBackBufferIndex(); // Make sure we have the new back-buffer is ready - if (mFenceValue > kDefaultSwapChainBuffers) + if (mFenceValue >= kDefaultSwapChainBuffers) { mpFence->SetEventOnCompletion(mFenceValue - kDefaultSwapChainBuffers + 1, mFenceEvent); WaitForSingleObject(mFenceEvent, INFINITE); diff --git a/Tutorials/10-PerInstanceConstantBuffer/10-PerInstanceConstantBuffer.cpp b/Tutorials/10-PerInstanceConstantBuffer/10-PerInstanceConstantBuffer.cpp index 3cf3ecb..89c380c 100644 --- a/Tutorials/10-PerInstanceConstantBuffer/10-PerInstanceConstantBuffer.cpp +++ b/Tutorials/10-PerInstanceConstantBuffer/10-PerInstanceConstantBuffer.cpp @@ -214,7 +214,7 @@ void Tutorial10::endFrame(uint32_t rtvIndex) uint32_t bufferIndex = mpSwapChain->GetCurrentBackBufferIndex(); // Make sure we have the new back-buffer is ready - if (mFenceValue > kDefaultSwapChainBuffers) + if (mFenceValue >= kDefaultSwapChainBuffers) { mpFence->SetEventOnCompletion(mFenceValue - kDefaultSwapChainBuffers + 1, mFenceEvent); WaitForSingleObject(mFenceEvent, INFINITE); diff --git a/Tutorials/11-SecondGeometry/11-SecondGeometry.cpp b/Tutorials/11-SecondGeometry/11-SecondGeometry.cpp index 21afd0e..fdec4ea 100644 --- a/Tutorials/11-SecondGeometry/11-SecondGeometry.cpp +++ b/Tutorials/11-SecondGeometry/11-SecondGeometry.cpp @@ -214,7 +214,7 @@ void Tutorial11::endFrame(uint32_t rtvIndex) uint32_t bufferIndex = mpSwapChain->GetCurrentBackBufferIndex(); // Make sure we have the new back-buffer is ready - if (mFenceValue > kDefaultSwapChainBuffers) + if (mFenceValue >= kDefaultSwapChainBuffers) { mpFence->SetEventOnCompletion(mFenceValue - kDefaultSwapChainBuffers + 1, mFenceEvent); WaitForSingleObject(mFenceEvent, INFINITE); diff --git a/Tutorials/12-PerGeometryHitShader/12-PerGeometryHitShader.cpp b/Tutorials/12-PerGeometryHitShader/12-PerGeometryHitShader.cpp index 9759245..67a242a 100644 --- a/Tutorials/12-PerGeometryHitShader/12-PerGeometryHitShader.cpp +++ b/Tutorials/12-PerGeometryHitShader/12-PerGeometryHitShader.cpp @@ -214,7 +214,7 @@ void Tutorial12::endFrame(uint32_t rtvIndex) uint32_t bufferIndex = mpSwapChain->GetCurrentBackBufferIndex(); // Make sure we have the new back-buffer is ready - if (mFenceValue > kDefaultSwapChainBuffers) + if (mFenceValue >= kDefaultSwapChainBuffers) { mpFence->SetEventOnCompletion(mFenceValue - kDefaultSwapChainBuffers + 1, mFenceEvent); WaitForSingleObject(mFenceEvent, INFINITE); diff --git a/Tutorials/13-SecondRayType/13-SecondRayType.cpp b/Tutorials/13-SecondRayType/13-SecondRayType.cpp index 5e7bb32..182185b 100644 --- a/Tutorials/13-SecondRayType/13-SecondRayType.cpp +++ b/Tutorials/13-SecondRayType/13-SecondRayType.cpp @@ -214,7 +214,7 @@ void Tutorial13::endFrame(uint32_t rtvIndex) uint32_t bufferIndex = mpSwapChain->GetCurrentBackBufferIndex(); // Make sure we have the new back-buffer is ready - if (mFenceValue > kDefaultSwapChainBuffers) + if (mFenceValue >= kDefaultSwapChainBuffers) { mpFence->SetEventOnCompletion(mFenceValue - kDefaultSwapChainBuffers + 1, mFenceEvent); WaitForSingleObject(mFenceEvent, INFINITE);