Skip to content

Isolate GL calls to the device only - #480

Merged
bors-servo merged 3 commits into
servo:masterfrom
kvark:gl_isolation
Oct 27, 2016
Merged

bors-servo merged 3 commits into
servo:masterfrom
kvark:gl_isolation

Conversation

@kvark

@kvark kvark commented Oct 26, 2016 •

Copy link
Copy Markdown
Member

Also used by the WebGL module, but cutting that tie off would be a much bigger task.
This PR makes the code a bit cleaner, also paves the way to #407.


This change is Reviewable

@glennw glennw left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Nice! Just a couple of minor issues / comments. I'll run the tests against this locally later today but it looks good.

Comment thread webrender/src/device.rs Outdated
self.create_fbo_for_texture_if_necessary(temp_texture_id, None);

self.bind_render_target(Some((texture_id, 0)));
self.bind_render_target(Some((texture_id, 0, [1, 1])));

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This adds an extra glViewport call here. It should be fine, I think - but perhaps worth a comment just noting why it's ok to pass [1, 1] here.

Comment thread webrender/src/device.rs Outdated
self.init_texture(texture_id, new_width, new_height, format, filter, mode, None);
self.create_fbo_for_texture_if_necessary(texture_id, None);
self.bind_render_target(Some((temp_texture_id, 0)));
self.bind_render_target(Some((temp_texture_id, 0, [1, 1])));

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Same here

Comment thread webrender/src/renderer.rs Outdated
profiler: Profiler::new(),
enable_profiler: options.enable_profiler,
enable_msaa: options.enable_msaa,
_enable_msaa: options.enable_msaa,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We could possibly just remove the MSAA related code altogether, since it's unused. But it's fine to leave here for now if you like, we could do that as a follow up.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Ok, I removed some of the MSAA logic, but left the RenderOptions (to avoid breaking the API, who knows if we'll need it back soon?) as well as the device's capability field.

@kvark

kvark commented Oct 27, 2016

Copy link
Copy Markdown
Member Author

Should be ready now.

@glennw

glennw commented Oct 27, 2016

Copy link
Copy Markdown
Member

@bors-servo r+

@bors-servo

Copy link
Copy Markdown
Contributor

📌 Commit 262ef0e has been approved by glennw

@bors-servo

Copy link
Copy Markdown
Contributor

⌛ Testing commit 262ef0e with merge e53039a...

bors-servo pushed a commit that referenced this pull request Oct 27, 2016
Isolate GL calls to the device only

Also used by the WebGL module, but cutting that tie off would be a much bigger task.
This PR makes the code a bit cleaner, also paves the way to #407.

<!-- 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/480)
<!-- Reviewable:end -->
@bors-servo

Copy link
Copy Markdown
Contributor

☀️ Test successful - status-travis

@bors-servo
bors-servo merged commit 262ef0e into servo:master Oct 27, 2016
@kvark
kvark deleted the gl_isolation branch October 27, 2016 21:03
@kvark kvark mentioned this pull request Oct 28, 2016
bors-servo pushed a commit that referenced this pull request Oct 30, 2016
Fix GL stencil state

This was a typo from #480
Found out by qApitrace log:
> major api error 14: GL_INVALID_ENUM in glDisable(GL_STENCIL)

Perhaps, we should check for gl errors in the code too. We seem to only do that for WebGL commands at this point.

<!-- 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/500)
<!-- Reviewable:end -->
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.

3 participants