Repository navigation
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
Conversation
…re draws from a mip that fits instead of failing validation
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.
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 pxMAX_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 toOutlineStore's 4096 rows, whatever the device takes.What changed
pixels::limit_side: eachRendererrecords its device's limit when it is made (the smallest in the process).place_attakes the largest decoded mip that fits. A streamedPixels::setframe past the limit draws nothing.upload_imagesmakes 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_rowsholds the store to the device's rows, set fromattach_textand each upload. Records past it start again at the next frame, as a full store already does.max_texture_diminprepare_layers.Tests
render/texture_limit_tests.rsruns on a device requested withmax_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.