Skip to content

fix(layers): submit command buffer after texture copy in IconLayer resize#10176

Merged
Pessimistress merged 2 commits intovisgl:masterfrom
officialasishkumar:fix/icon-layer-resize-texture-submit
Apr 6, 2026
Merged

fix(layers): submit command buffer after texture copy in IconLayer resize#10176
Pessimistress merged 2 commits intovisgl:masterfrom
officialasishkumar:fix/icon-layer-resize-texture-submit

Conversation

@officialasishkumar
Copy link
Copy Markdown
Contributor

Closes #9994

Change List

  • Add missing device.submit() call after commandEncoder.finish() in resizeTexture() within icon-manager.ts
  • In luma.gl v9's CommandEncoder/CommandBuffer pattern, finish() only creates the command buffer — actual GPU commands are not executed until device.submit() is called
  • Without this call, the copyTextureToTexture operation is never performed, so existing icon data is lost when the atlas texture needs to grow (e.g. crossing a power-of-2 height boundary like 256px → 512px)
  • Previously loaded icons become permanently invisible because getDiffIcons caches already-seen icon URLs and never reloads the lost data

…size

Add missing device.submit() call after commandEncoder.finish() in the
resizeTexture function. In luma.gl v9's CommandEncoder/CommandBuffer
pattern, finish() only creates the command buffer but does not execute
the GPU commands. Without submit(), the texture copy is never performed,
causing existing icon data to be lost when the atlas texture is resized.

This manifests when icons are added incrementally across render cycles,
crossing a power-of-2 height boundary (e.g. from 256px to 512px).
Previously loaded icons become permanently invisible because getDiffIcons
caches already-seen icon URLs and never reloads the lost icons.

Signed-off-by: Asish Kumar <officialasishkumar@gmail.com>
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 6b1f32cd78

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

height: oldHeight
});
commandEncoder.finish();
device.submit();
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Submit the finished command buffer explicitly

Calling device.submit() with no argument submits the device's default command encoder, not the command buffer returned by this function's local device.createCommandEncoder(). As written, commandEncoder.finish() is discarded, so the copyTextureToTexture recorded here is still never executed and icon atlas data can still be lost on resize. Capture the result of finish() and pass it to device.submit(commandBuffer).

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch. Confirmed by tracing through the luma.gl source:

  • device.submit() with no argument calls _finalizeDefaultCommandEncoderForSubmit(), which finalizes the device's own commandEncoder property -- not the locally created one.
  • The CommandBuffer returned by commandEncoder.finish() was being discarded, so the copyTextureToTexture recorded on the local encoder was never actually submitted.

Fixed in 7b4f82b by capturing the return value of finish() and passing it to device.submit(commandBuffer).

…eTexture

device.submit() with no arguments finalizes and submits the device's
default command encoder, not a locally created one. The texture copy
was recorded on a separate command encoder created via
device.createCommandEncoder(), so the CommandBuffer returned by
finish() must be passed explicitly to device.submit() to ensure
the copyTextureToTexture operation is actually executed.

Signed-off-by: Asish Kumar <officialasishkumar@gmail.com>
@Pessimistress Pessimistress requested a review from ibgreen April 6, 2026 18:16
@coveralls
Copy link
Copy Markdown

Coverage Status

coverage: 80.453% (-0.004%) from 80.457% — officialasishkumar:fix/icon-layer-resize-texture-submit into visgl:master

@Pessimistress Pessimistress merged commit 932ceb2 into visgl:master Apr 6, 2026
5 checks passed
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.

[Bug] IconLayer: resizeTexture never executes texture copy (missing device.submit after commandEncoder.finish)

4 participants