Keep the environment map's pipeline when a new map is assigned - #359
Merged
Conversation
`assign` released the resources of the previous map by calling `destroy`,
which also destroys the compute pipeline that builds the importance sampling
weights - the very pipeline it goes on to bind a few lines later. Assigning
any environment map took down the driver on the first dispatch:
vkCmdBindPipeline(): pipeline Invalid VkPipeline Object [env-prepare]
The two jobs are now separate. `release_weights` lets go of the weight texture
and its mip views, which is all that assigning a new map has to undo, and
`destroy` keeps meaning teardown by doing that and then dropping the pipeline.
Nothing caught this because nothing assigned a real map. `EnvironmentMap::new`
starts out holding `dummy.white_view`, and `env_map_gpu_test` assigned that
same view, so the early return fired and the body never ran - including the
weight chain the test then handed to the sampler, which was empty. The test
now builds a small equirectangular map with a bright spot in it, assigns that,
and asserts the chain is there before sampling it.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MaDekFuFvymYai37WQ7SDr
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.
assignreleased the resources of the previous map by callingdestroy, which also destroys the compute pipeline that builds the importance sampling weights - the very pipeline it goes on to bind a few lines later. Assigning any environment map took down the driver on the first dispatch:The two jobs are now separate.
release_weightslets go of the weight texture and its mip views, which is all that assigning a new map has to undo, anddestroykeeps meaning teardown by doing that and then dropping the pipeline.Nothing caught this because nothing assigned a real map.
EnvironmentMap::newstarts out holdingdummy.white_view, andenv_map_gpu_testassigned that same view, so the early return fired and the body never ran - including the weight chain the test then handed to the sampler, which was empty. The test now builds a small equirectangular map with a bright spot in it, assigns that, and asserts the chain is there before sampling it.Claude-Session: https://claude.ai/code/session_01MaDekFuFvymYai37WQ7SDr