From c4ad8f17ddb8c79ad9765e17825d69e37223000a Mon Sep 17 00:00:00 2001 From: Jorge Garcia Galicia Date: Thu, 18 Jul 2024 13:42:02 -0700 Subject: [PATCH] Fix SaveImage which was not using a parameter and add a comment --- assets/benchmarks/shaders/FoveationBenchmarkFragSizeEXT.frag | 2 ++ src/ppx/application.cpp | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/assets/benchmarks/shaders/FoveationBenchmarkFragSizeEXT.frag b/assets/benchmarks/shaders/FoveationBenchmarkFragSizeEXT.frag index 9bc43a64d..83e84ebc1 100644 --- a/assets/benchmarks/shaders/FoveationBenchmarkFragSizeEXT.frag +++ b/assets/benchmarks/shaders/FoveationBenchmarkFragSizeEXT.frag @@ -13,6 +13,8 @@ // limitations under the License. #version 450 +// I am using GLSL here because for FMD we need to use the following extension +// that to my knowledge has no equivalent in HLSL #extension GL_EXT_fragment_invocation_density : enable layout(location = 0) out vec4 outColor; diff --git a/src/ppx/application.cpp b/src/ppx/application.cpp index 1a3de7791..d91b7f88e 100644 --- a/src/ppx/application.cpp +++ b/src/ppx/application.cpp @@ -726,13 +726,13 @@ void Application::SaveImage(grfx::ImagePtr image, const std::string& filepath, g grfx::ImageToBufferOutputPitch outPitch; cmdBuf->Begin(); { - cmdBuf->TransitionImageLayout(image, PPX_ALL_SUBRESOURCES, grfx::RESOURCE_STATE_PRESENT, grfx::RESOURCE_STATE_COPY_SRC); + cmdBuf->TransitionImageLayout(image, PPX_ALL_SUBRESOURCES, resourceState, grfx::RESOURCE_STATE_COPY_SRC); grfx::ImageToBufferCopyInfo bufCopyInfo = {}; bufCopyInfo.extent = {width, height, 0}; outPitch = cmdBuf->CopyImageToBuffer(&bufCopyInfo, image, screenshotBuf); - cmdBuf->TransitionImageLayout(image, PPX_ALL_SUBRESOURCES, grfx::RESOURCE_STATE_COPY_SRC, grfx::RESOURCE_STATE_PRESENT); + cmdBuf->TransitionImageLayout(image, PPX_ALL_SUBRESOURCES, grfx::RESOURCE_STATE_COPY_SRC, resourceState); } cmdBuf->End();