From 4f1fd598101bee952ac6b7253fdb59d2d6068b55 Mon Sep 17 00:00:00 2001 From: Max Godefroy Date: Sun, 7 May 2023 16:43:00 +0200 Subject: [PATCH 1/2] Fix Hello Triangle Breathing example not working properly --- examples/hello_triangle.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/examples/hello_triangle.cpp b/examples/hello_triangle.cpp index b68ba82..415523a 100644 --- a/examples/hello_triangle.cpp +++ b/examples/hello_triangle.cpp @@ -216,12 +216,13 @@ class HelloTriangle : public RpsAfxD3D12Renderer const RpsRuntimeResource* argResources[2] = {backBufferResources}; uint32_t argDataCount = 1; + float time; if (c_bBreathing) { argDataCount = 2; - float time = float(RpsAfxCpuTimer::SecondsSinceEpoch().count()); - argData[1] = &time; + time = float(RpsAfxCpuTimer::SecondsSinceEpoch().count()); + argData[1] = &time; } // RpsAfx always waits for presentation before rendering to a swapchain image again, From 54ba3b6d317d7a44d0b157fee1a657831cde6684 Mon Sep 17 00:00:00 2001 From: Max Godefroy Date: Sun, 7 May 2023 16:44:15 +0200 Subject: [PATCH 2/2] Revert spacing style --- examples/hello_triangle.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/hello_triangle.cpp b/examples/hello_triangle.cpp index 415523a..282144a 100644 --- a/examples/hello_triangle.cpp +++ b/examples/hello_triangle.cpp @@ -221,8 +221,8 @@ class HelloTriangle : public RpsAfxD3D12Renderer if (c_bBreathing) { argDataCount = 2; - time = float(RpsAfxCpuTimer::SecondsSinceEpoch().count()); - argData[1] = &time; + time = float(RpsAfxCpuTimer::SecondsSinceEpoch().count()); + argData[1] = &time; } // RpsAfx always waits for presentation before rendering to a swapchain image again,