Skip to content

Keep the environment map's pipeline when a new map is assigned - #359

Merged
kvark merged 1 commit into
mainfrom
fix/env-map-pipeline
Jul 26, 2026
Merged

Keep the environment map's pipeline when a new map is assigned#359
kvark merged 1 commit into
mainfrom
fix/env-map-pipeline

Conversation

@kvark

@kvark kvark commented Jul 26, 2026

Copy link
Copy Markdown
Owner

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.

Claude-Session: https://claude.ai/code/session_01MaDekFuFvymYai37WQ7SDr

`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
@kvark
kvark enabled auto-merge (rebase) July 26, 2026 16:31
@kvark
kvark merged commit 422d596 into main Jul 26, 2026
12 checks passed
@kvark
kvark deleted the fix/env-map-pipeline branch July 26, 2026 16:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant