-
Notifications
You must be signed in to change notification settings - Fork 290
Use texture layers for render target allocations, remove render phases. #478
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
Conversation
r? @pcwalton |
@pcwalton btw I tested this on mac mini hardware, since I know we've had troubles with driver stalls around texture / fbo allocs before. It seemed to be working nicely on my mac mini (and also on linux + osmesa). |
vec2 st1 = vec2(src.screen_origin_task_origin.zw + src.size.xy) / 2048.0; | ||
vUv = mix(st0, st1, aPosition.xy); | ||
vec2 texture_size = vec2(textureSize(sCache, 0)); | ||
vec2 st0 = vec2(src.screen_origin_task_origin.zw) / texture_size; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: Do you need the vec2()
cast here and below?
vUv0 = mix(st0, st1, aPosition.xy); | ||
vec2 texture_size = vec2(textureSize(sCache, 0)); | ||
vec2 st0 = vec2(src0.screen_origin_task_origin.zw) / texture_size; | ||
vec2 st1 = vec2(src0.screen_origin_task_origin.zw + src0.size_target_index.xy) / texture_size; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same comment about vec2()
as above
r=me with a couple of nits |
☔ The latest upstream changes (presumably #445) made this pull request unmergeable. Please resolve the merge conflicts. |
fef4193
to
3751007
Compare
Instead of splitting the scene into multiple phases, use texture layers to allocate slices as needed for each pass of the render frame. These are pooled and only allocated when the frame render target configuration changes. Previously, the code asserted if it was unable to fit the render tasks into a single render target for a single tile. Now, this (pathological) case is handled correctly. This makes the upcoming dynamic primitive cache support a lot simpler to add. It also means that we don't use a ping-pong allocation style, which typically performs badly on mobile / tiled rendering architectures.
3751007
to
8928181
Compare
@bors-servo: r+ |
📌 Commit 8928181 has been approved by |
Use texture layers for render target allocations, remove render phases. Instead of splitting the scene into multiple phases, use texture layers to allocate slices as needed for each pass of the render frame. These are pooled and only allocated when the frame render target configuration changes. Previously, the code asserted if it was unable to fit the render tasks into a single render target for a single tile. Now, this (pathological) case is handled correctly. This makes the upcoming dynamic primitive cache support a lot simpler to add. It also means that we don't use a ping-pong allocation style, which typically performs badly on mobile / tiled rendering architectures. <!-- 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/478) <!-- Reviewable:end -->
☀️ Test successful - status-travis |
let (internal_format, gl_format) = gl_texture_formats_for_image_format(texture.format); | ||
let type_ = gl_type_for_texture_format(texture.format); | ||
|
||
gl::tex_image_3d(texture_id.target, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is concerning. I don't see the previous implementation actually reallocating the texture, like this one. Neither does the method name imply that the texture is going to be changed (create_fbo_for_texture_if_necessary
).
Instead of splitting the scene into multiple phases, use texture
layers to allocate slices as needed for each pass of the render
frame. These are pooled and only allocated when the frame render
target configuration changes.
Previously, the code asserted if it was unable to fit the render
tasks into a single render target for a single tile. Now, this
(pathological) case is handled correctly.
This makes the upcoming dynamic primitive cache support a lot
simpler to add. It also means that we don't use a ping-pong
allocation style, which typically performs badly on mobile / tiled
rendering architectures.
This change is