Skip to content

Commit

Permalink
Fix SaveImage which was not using a parameter and add a comment
Browse files Browse the repository at this point in the history
  • Loading branch information
jorgeag-google committed Jul 18, 2024
1 parent bc6fd24 commit c4ad8f1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions assets/benchmarks/shaders/FoveationBenchmarkFragSizeEXT.frag
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions src/ppx/application.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down

0 comments on commit c4ad8f1

Please sign in to comment.