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

Standalone texture allocation id's are freed in render_backend but not in renderer #676

Closed
eqrion opened this issue Jan 4, 2017 · 2 comments
Closed
Labels

Comments

@eqrion
Copy link
Contributor

@eqrion eqrion commented Jan 4, 2017

The CacheTextureId for standalone texture allocations is returned to the free list in the render_backend when it is freed [1], but no message is sent to sync this change to renderer. When that id is reused. this assert [2] is triggered.

I was able to trigger this by using ImageRendering::Pixelated which causes TextureFilter::Point which causes standalone texture allocations.

Either not returning the id to the free list or adding a new TextureUpdateOp to free from the cache_texture_id_map worked for me. I'm not sure if there are any side effects we'd need to be concerned about with freeing from cache_texture_id_map, but I think that'd be the way to go.

[1] https://github.com/servo/webrender/blob/master/webrender/src/texture_cache.rs#L880
[2] https://github.com/servo/webrender/blob/master/webrender/src/renderer.rs#L867

@kvark kvark added the type: bug label Jan 4, 2017
bors-servo added a commit that referenced this issue Jan 5, 2017
Free CacheTextureId's in Renderer but persist their TextureId.

Currently the TextureCache will free CacheTextureId's for standalone texture allocations. This isn't synced to Renderer::cache_texture_id_map, which will then hit an assert when the CacheTextureId is reused. (#676)

When we get a TextureUpdateOp::Create and detect that they're reusing a CacheTextureId, we should just reuse the existing TextureId. The cache_texture_id_map can then drop Option and be Vec<TextureId>.

For the TextureId's that haven't been reused yet, we should send a TextureUpdateOp::Free that notifies Renderer to free the texture memory of the TextureId. This wouldn't gl::delete_textures the TextureId, but just deinit the TextureId until it is reused.

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/webrender/682)
<!-- Reviewable:end -->
@glennw
Copy link
Member

@glennw glennw commented Jan 19, 2017

@rlhunt This is fixed now, right?

@kvark
Copy link
Member

@kvark kvark commented Jan 20, 2017

Yeah, closing.

@kvark kvark closed this Jan 20, 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
3 participants
You can’t perform that action at this time.