Repository navigation
Skip unchanged meshes when building G-buffer command buffers - #223
Open
BenjaFriend wants to merge 1 commit into
Open
BenjaFriend wants to merge 1 commit into
BenjaFriend wants to merge 1 commit into
Conversation
Fixes #135. The offscreen subpass used to walk every mesh each frame to write its UBO and record its draw call again. - Transform has a dirty flag. The setters set it, and CalculateWorldMatrix clears it. A mesh UBO is written only when its transform is dirty, or when the mesh is new or replaced. - The camera projection and view moved out of the per-mesh UBO into one shared camera UBO (binding 5 in mrt.vert). A camera move no longer dirties every mesh. - The offscreen command buffers are recorded again only when the draw list changes: a MeshRenderer or Transform is added, removed, or replaced, or the swapchain is resized. - The editor calls registry.replace() after a model or material change, so the renderer records again and writes the new textures to the descriptor set. Before, a material change did not update the textures. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01E5zLKAKV1AEmphy4e2YToX
This branch has not been deployed
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.
Fixes #135.
What changed
SetPos,SetRotation, andSetScaleset it.CalculateWorldMatrixclears it. A transform loaded from a level stays dirty. The editor callsMarkDirty()after it writes fields directly.mrt.vert,.spvrebuilt). A camera move no longer dirties every mesh.MeshRenderer/Transformconstruct, destroy, or replace, or a swapchain resize.registry.replace(), so the renderer writes the new textures to the descriptor set. Before, a material change did not update the textures.Testing
ctest: 101/101 pass, including newFlingTests/Engine/TransformTests.cpp. Comment-style check passes.VK_LAYER_KHRONOS_validation: Level_1 and the Sandbox lighting test with about 750 entities, rotating and moving objects, and a sphere spawned at runtime. 0 validation messages, and rendering is correct.Follow-ups (not in this PR)
EnableValidationLayers=trueconfig fails to create the instance on this machine ("layers requested but not available"). I tested withVK_INSTANCE_LAYERSinstead.🤖 Generated with Claude Code
https://claude.ai/code/session_01E5zLKAKV1AEmphy4e2YToX