Skip to content
This repository was archived by the owner on Jul 10, 2023. It is now read-only.

Glutin update - #43

Closed
paulrouget wants to merge 416 commits into
servo:masterfrom
paulrouget:glutin-update
Closed

paulrouget wants to merge 416 commits into
servo:masterfrom
paulrouget:glutin-update

Conversation

@paulrouget

Copy link
Copy Markdown

Review on Reviewable

tomaka and others added 30 commits April 29, 2015 11:05
Extract headless context from api/win32 to platform/windows
…lformats

Add a fallback on win32 if enumerate_arb_pixel_formats returns vec![]
Add pixelformat for cocoa and remove individual color components
Adding SWP_NOMOVE flag to prevent the window from moving to 0,0 when setting inner size on Windows 8
Fix the GLES code in examples/support/mod.rs
Fix further compilation of cocoa
@tomaka

tomaka commented Aug 10, 2015

Copy link
Copy Markdown

Does it work for you before the glutin update?

OS/X only supports shader versions 100 or 140+. If you want version 100 you need to add precision qualifiers to all the variables, like mediump. If you want version 140 then the attribute and varying keywords no longer exist.

If you omit the #version declaration I think it implicitely means version 110. The shaders seem to be in GLSL 1.1, so that would be coherent. But version 110 is not supported by OS/X.

So I don't see how rust-layers even works on OS/X in its current state except if it's relying on non-standard behavior.

@tomaka

tomaka commented Aug 10, 2015

Copy link
Copy Markdown

Oh, wait, duh.

I said that OS/X didn't support version 110, but that's only true if you use a recent version of OpenGL.

There's also the possibility to create a legacy context (opengl 3.1 or less) at initialization, in which case it is supported.

This is what servo is doing:

That's the answer to your problem, just use with_gl(GlRequest::Specific(Api::OpenGl, (3, 0))) at initialization.

@metajack

Copy link
Copy Markdown

@mrobinson @glennw What should we be doing here? Should we upgrade the context or keep using the legacy one?

@paulrouget

Copy link
Copy Markdown
Author

@mrobinson @glennw What should we be doing here? Should we upgrade the context or keep using the legacy one?

For the record, using NSOpenGLProfileVersionLegacy works.

If that's ok, we can use the legacy context and once the update has landed, we upgrade?

@metajack

Copy link
Copy Markdown

I think it's fine to keep doing what we were doing and upgrade later if that is the correct thing long term.

@paulrouget

Copy link
Copy Markdown
Author

Note: we hit a Rust bug in the match code that selects the right OpenGL profile. Not using ranges appears to solve the issue.

@paulrouget

Copy link
Copy Markdown
Author

See rust-windowing#567 for profile selection fix.

@paulrouget

Copy link
Copy Markdown
Author

@glennw / @tomaka can you please tell me if both of these patches are needed, and where they should go (servo/glutin or tomaka/glutin):

And does one require the other?

7ee0318 is a bit tricky because I don't know what to do in wakeup_event_loop where things changed quite a bit (display.display and x11.display).

@metajack

Copy link
Copy Markdown

I believe Glenn took out Weak support so rust-windowing@5124bda is no longer needed for current Servo.

glennw@7ee0318 is needed though. But seems like this could go upstream. @tomaka ?

@tomaka

tomaka commented Aug 10, 2015

Copy link
Copy Markdown

Sure. As long as it's not unstable I'm ok with it.

@paulrouget

Copy link
Copy Markdown
Author

@paulrouget

Copy link
Copy Markdown
Author

All required PRs have now been merged upstreams.
Can someone review this?

@paulrouget

Copy link
Copy Markdown
Author

Once merged, I'll update servo's Cargo.lock in servo/servo#7096

@paulrouget

Copy link
Copy Markdown
Author

Review status: 0 of 83 files reviewed at latest revision, 1 unresolved discussion, all commit checks successful.


src/api/x11/window.rs, line 122 [r1] (raw file):
Addressed. Change made it upstream.


Comments from the review on Reviewable.io

@glennw

glennw commented Aug 13, 2015

Copy link
Copy Markdown
Member

@paulrouget This is quite difficult to review as is. Perhaps we could rename the existing servo branch to servo_ and create a new servo branch from glutin/master then just apply our local patches on top? (We've done this in the past a few times). It would be a lot easier to see the differences and give us a cleaner history.

@paulrouget paulrouget mentioned this pull request Aug 14, 2015
@paulrouget

Copy link
Copy Markdown
Author

This PR is against the master branch, not the servo branch. Creating a new PR: #44

@paulrouget paulrouget closed this Aug 14, 2015
bors-servo pushed a commit that referenced this pull request Aug 22, 2015
Glutin update

Previous PR (#43) was against the master branch, not the servo branch.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/glutin/44)
<!-- Reviewable:end -->
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.