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 primitive shaders referencing the render target caches. #1585

Merged
merged 1 commit into from Aug 17, 2017

Conversation

@glennw
Copy link
Member

glennw commented Aug 17, 2017

This switches ps_cache_image over to use SourceTexture::CacheRGBA8.

The idea here is to enable primitives added during batch creation
to select a render cache target as a source texture. This is possible
now since the texture cache uses array textures, and therefore shares
the same sampler target as the render target cache.

The goal is to begin unifying some of the shaders - for example,
the ps_cache_image shader can be replaced by the normal ps_image
shader, which will reduce the number of shaders and shader switches.


This change is Reviewable

This switches ps_cache_image over to use SourceTexture::CacheRGBA8.

The idea here is to enable primitives added during batch creation
to select a render cache target as a source texture. This is possible
now since the texture cache uses array textures, and therefore shares
the same sampler target as the render target cache.

The goal is to begin unifying some of the shaders - for example,
the ps_cache_image shader can be replaced by the normal ps_image
shader, which will reduce the number of shaders and shader switches.
@glennw
Copy link
Member Author

glennw commented Aug 17, 2017

r? @kvark

Most of the changes here are moving a few pre-existing fields from the Renderer struct to the new SourceTextureResolver struct.

It's still a bit untidy how we reference the cache texture in places, but I consider this an incremental improvement.

@kvark
kvark approved these changes Aug 17, 2017
Copy link
Member

kvark left a comment

👍

cache_texture_id_map: Vec<TextureId>,
texture_cache_upload_pbo: PBOId,
// Manages and resolves source textures IDs to real texture IDs.
texture_resolver: SourceTextureResolver,

This comment has been minimized.

@kvark

kvark Aug 17, 2017

Member

nice abstraction!

@kvark
Copy link
Member

kvark commented Aug 17, 2017

@bors-servo
Copy link
Contributor

bors-servo commented Aug 17, 2017

📌 Commit 9bd7492 has been approved by kvark

@bors-servo
Copy link
Contributor

bors-servo commented Aug 17, 2017

Testing commit 9bd7492 with merge 8a8c966...

bors-servo added a commit that referenced this pull request Aug 17, 2017
Add support for primitive shaders referencing the render target caches.

This switches ps_cache_image over to use SourceTexture::CacheRGBA8.

The idea here is to enable primitives added during batch creation
to select a render cache target as a source texture. This is possible
now since the texture cache uses array textures, and therefore shares
the same sampler target as the render target cache.

The goal is to begin unifying some of the shaders - for example,
the ps_cache_image shader can be replaced by the normal ps_image
shader, which will reduce the number of shaders and shader switches.

<!-- 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/1585)
<!-- Reviewable:end -->
@bors-servo
Copy link
Contributor

bors-servo commented Aug 17, 2017

☀️ Test successful - status-travis
Approved by: kvark
Pushing 8a8c966 to master...

@bors-servo bors-servo merged commit 9bd7492 into servo:master Aug 17, 2017
2 of 3 checks passed
2 of 3 checks passed
continuous-integration/appveyor/pr AppVeyor build failed
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
homu Test successful
Details
@glennw glennw deleted the glennw:texture-resolver branch Aug 17, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

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