Skip to content

Make the intermediate render targets select the correct size dynamically. #705

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

Merged
merged 1 commit into from
Jan 12, 2017

Conversation

glennw
Copy link
Member

@glennw glennw commented Jan 11, 2017

The render targets need to be >= framebuffer size, to ensure they
can allocate worst case render tasks.


This change is Reviewable

@glennw
Copy link
Member Author

glennw commented Jan 11, 2017

r? @kvark

Copy link
Member

@kvark kvark left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, I think we just need to make one change to it.

fn new(pass_index: isize, is_framebuffer: bool) -> RenderPass {
fn new(pass_index: isize,
is_framebuffer: bool,
size: DeviceUintSize) -> RenderPass {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's store the size inside a RenderPass in order to avoid asking for it in allocate_target?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed - had to change the code structure slightly to make this work, but it's much cleaner now.

// TODO(gw): Remove this hack once the tiling code is sorted out!!
let max_dimension = cmp::max(screen_rect.size.width, screen_rect.size.height);
let aligned_max_dimension = (max_dimension + SCREEN_TILE_SIZE - 1) & !(SCREEN_TILE_SIZE-1);
let cache_size = DeviceUintSize::new(aligned_max_dimension as u32,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if this code wasn't temporary, I'd ask for each of width/height to be rounded up separately

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was originally separate - it actually needs to be square to avoid the rounding glitch in OSMesa :|

@@ -3,7 +3,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#![cfg_attr(feature = "nightly", feature(nonzero))]
#![cfg_attr(feature = "serde_derive", feature(proc_macro, rustc_attrs, structural_match))]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this no longer needed for serde? I assume there is a compile warning at the moment then.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct

@glennw
Copy link
Member Author

glennw commented Jan 11, 2017

@kvark Thanks for the review - updated to address comments. I'll squash once you're happy with the changes.

@kvark
Copy link
Member

kvark commented Jan 11, 2017

@glennw thanks!

dynamically.

The render targets need to be >= framebuffer size, to ensure they
can allocate worst case render tasks.
@glennw
Copy link
Member Author

glennw commented Jan 11, 2017

@bors-servo r=kvark

@bors-servo
Copy link
Contributor

📌 Commit e5a3562 has been approved by kvark

@bors-servo
Copy link
Contributor

⌛ Testing commit e5a3562 with merge ad25b20...

bors-servo pushed a commit that referenced this pull request Jan 11, 2017
Make the intermediate render targets select the correct size dynamically.

The render targets need to be >= framebuffer size, to ensure they
can allocate worst case render tasks.

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

☀️ Test successful - status-travis

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants