Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for large images. #620

Closed
glennw opened this issue Dec 8, 2016 · 6 comments
Closed

Add support for large images. #620

glennw opened this issue Dec 8, 2016 · 6 comments

Comments

@glennw
Copy link
Member

@glennw glennw commented Dec 8, 2016

This will need some kind of API support to handle very large images, as well as supporting scrolling / partial images.

@jrmuizel jrmuizel mentioned this issue Dec 9, 2016
20 of 24 tasks complete
@kvark
Copy link
Member

@kvark kvark commented Dec 14, 2016

We could split a large image into equally sized tiles and store them in a texture array (as proposed by @glennw ), similarly to #645 .
Both proposals would require the shaders to become aware of 2D texture array sources.

@nical
Copy link
Collaborator

@nical nical commented Dec 15, 2016

Ideally we would lazily upload visible parts of the large image to textures. Currently gecko does not do this (we just split up the big image into tiles and upload them all) and we end up allocating silly amounts of GPU memory for something that tends to only be partially shown.

If using texture arrays is too complicated we could just split all images into small tiles and use the texture cache as usual generating a bit more geometry. With small enough tiles this could become an optimization for images that are partially off the viewport without being too big to fit into a texture.
For reference, FastUIDraw uses a sparse virtual texture for this type of things.

@nical
Copy link
Collaborator

@nical nical commented Feb 13, 2017

I am looking into this. I'll first work on getting the logic in place to split large images into smaller ones and and make sure these sub primitives are requested and uploaded lazily. But it will still use the texture cache like regular images. Whether and how to use texture arrays for this is something that can be solved separately.

@nical
Copy link
Collaborator

@nical nical commented Feb 14, 2017

The first issue I am running into is that it is pretty hard to support repeating images once their tiled. One way to work around this is to have two fallbacks for large images: one that down-scales on the CPU before inserting in the texture cache, and one that does the actual tiling. we'd only use the tiling for non-repeating image display items.

Another way to look at it is to simply not support repeating large images, which is probably reasonable*.

In any case it is not entirely clear to me whether we should hide the tiling inside of WR, or if it should be explicitly requested in the API when creating the image. I started working with the former in mind but I now am leaning towards doing the latter instead.

*edit: We talked about it during the gfx meeting today and it turns out we need to support repeating very large images, and preferably without downsampling.

@glennw
Copy link
Member Author

@glennw glennw commented Mar 21, 2017

@nical I think this can be closed?

@nical
Copy link
Collaborator

@nical nical commented Mar 21, 2017

Yes, this is fixed now.

@KiChjang KiChjang closed this Mar 22, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants
You can’t perform that action at this time.