Skip to content

fix(image): an image or outline store past the device's largest texture draws from a mip that fits instead of failing validation - #1611

Merged
Hona merged 1 commit into
devfrom
fix/588-texture-limit
Nov 23, 2026
Merged

Hona merged 1 commit into
devfrom
fix/588-texture-limit

Conversation

@Hona

@Hona Hona commented Nov 23, 2026

Copy link
Copy Markdown
Member

Refs #588

Part 2 of #588: nothing Rune uploads asks the GPU for a texture larger than its max_texture_dimension_2d. WebGL2, downlevel and older mobile adapters report 2048 or 4096.

What was wrong

  • ImageAtlas::place_at (rune-image/src/pixels.rs) placed images up to the fixed 8192 px MAX_SIDE.
  • Renderer::upload_images (render/upload.rs) then made each page's texture at the page's size. With one large photo, a headless host panicked and a window showed an uncaptured validation error with no image.
  • upload_outlines (render/outlines.rs) grew the glyph outline texture to OutlineStore's 4096 rows, whatever the device takes.

What changed

  • pixels::limit_side: each Renderer records its device's limit when it is made (the smallest in the process). place_at takes the largest decoded mip that fits. A streamed Pixels::set frame past the limit draws nothing.
  • upload_images makes no texture for a page past the limit (one placed before the renderer said its limit), so it draws nothing instead of failing validation.
  • OutlineStore::limit_rows holds the store to the device's rows, set from attach_text and each upload. Records past it start again at the next frame, as a full store already does.
  • Layer targets were already held to max_texture_dim in prepare_layers.

Tests

render/texture_limit_tests.rs runs on a device requested with max_texture_dimension_2d = 2048, under a validation scope. Both tests fail on dev.

  • an_image_larger_than_the_device_s_largest_texture_draws_from_a_mip_that_fits: a 4096×4096 image draws its colour on the first frame.
  • the_outline_store_never_outgrows_the_device_s_largest_texture: a 3000-row store.

…re draws from a mip that fits instead of failing validation
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