Skip to content

[FIX] Refresh texture state when toggling mipmaps#8455

Merged
willeastcott merged 4 commits intomainfrom
fix-texture-mipmaps-refresh
Feb 12, 2026
Merged

[FIX] Refresh texture state when toggling mipmaps#8455
willeastcott merged 4 commits intomainfrom
fix-texture-mipmaps-refresh

Conversation

@willeastcott
Copy link
Contributor

@willeastcott willeastcott commented Feb 12, 2026

Fixes playcanvas/editor#1187

Summary

  • update Texture#mipmaps to recalculate mip level count when toggled at runtime
  • mark minification filter parameters dirty when mipmaps changes so sampler state updates immediately
  • preserve existing mip upload scheduling when enabling mipmaps and keep current WebGPU/integer-format guards
  • addresses the viewport update behavior reported in Changing the Mipmaps checkbox does not update the game scene images editor#1187

Test plan

  • linked Editor to this Engine branch and confirmed toggling texture Mipmaps updates viewport visuals immediately
  • confirmed no filtering-mode change or scene reload is needed after toggling mipmaps
  • confirmed PR scope is only src/platform/graphics/texture.js
  • no new automated test file included in this PR (by request)

Update Texture#mipmaps to recalculate mip levels and mark min filter parameters dirty when toggled, so runtime mipmap changes apply immediately without requiring unrelated texture edits.

Co-authored-by: Cursor <cursoragent@cursor.com>
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Updates PlayCanvas Engine texture runtime behavior so toggling Texture#mipmaps recalculates mip level count and forces sampler minification state to refresh immediately, addressing Editor viewport update issues when mipmaps are toggled at runtime.

Changes:

  • Recalculate Texture._numLevels when mipmaps is toggled at runtime (_updateNumLevel()).
  • Mark minification filter state dirty when mipmaps changes to refresh sampler state immediately.
  • Preserve existing mipmap upload scheduling when enabling mipmaps, with existing WebGPU / integer-format guards.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Base mip upload scheduling on effective mipmap state after _updateNumLevel, and recreate array texture storage when mip level count changes to keep immutable GPU allocation in sync.

Co-authored-by: Cursor <cursoragent@cursor.com>
@willeastcott willeastcott merged commit b3cff83 into main Feb 12, 2026
8 checks passed
@willeastcott willeastcott deleted the fix-texture-mipmaps-refresh branch February 12, 2026 16:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: graphics Graphics related issue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Changing the Mipmaps checkbox does not update the game scene images

2 participants