Open
Conversation
Adds SaveVulkanImageAsPNG to the shared vk_renderer, mirroring SaveMetalTextureAsPNG. Wires --screenshot / --auto-exit into the main loop of every Vulkan project: frameIndex tracking, auto-exit guard updated to respect screenshotFrame, and screenshot block inserted between WaitForGpu and SwapchainPresent. Also adds bitmap.h/bitmap.cpp to each project's CMakeLists (and the stb include path to early raytracing projects that were missing it). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
SaveVulkanImageAsPNG()tovk_renderer.h/cpp, mirroring the existingSaveMetalTextureAsPNG. It creates a CPU-readable staging buffer, transitions the swapchain image toTRANSFER_SRC, copies viavkCmdCopyImageToBuffer, transitions back toPRESENT, swaps BGRA→RGBA channels, forces alpha to 255, and saves withBitmapRGBA8u::Save()--screenshot <path> [frame]and the updated--auto-exitguard into every Vulkan project's main loop (43 projects across geometry, pbr, texture, raytracing, and io categories)bitmap.h/bitmap.cppto each project's CMakeLists, and thestbinclude path to the early raytracing projects (000–006) that were missing itTest plan
./101_color_cube_vulkan --screenshot /tmp/out.png 0— captures frame 0, exits immediately, produces a valid 1280×720 RGBA PNG./030_raytracing_path_trace_vulkan --screenshot /tmp/out.png 100— runs to frame 100, captures, exits./031_raytracing_path_trace_pbr_vulkan --screenshot /tmp/out.png 100— same--auto-exitwithout a frame target still exits after N seconds as before🤖 Generated with Claude Code