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

Only apply nvidia hack with nvidia drivers #67

Merged
merged 3 commits into from May 27, 2014

Conversation

@bjwbell
Copy link
Contributor

bjwbell commented May 27, 2014

Check the GLX vendor string for nvidia before applying nvidia driver hack.
See commit 04aeadbfbe.

@mrobinson

Check the GLX vendor string for nvidia before applying nvidia driver hack.
}
}
}else if number_of_configs != 0 {

This comment has been minimized.

Copy link
@pcwalton

pcwalton May 27, 2014

Contributor

nit: put a space after the }

if (*visual_info).depth == 32 {
return (visual_info, Some(config))
let glXGetClientString: extern "C" fn(*Display, c_int) -> *c_char =
cast::transmute(glXGetProcAddress(cast::transmute(&"glXGetClientString\x00"[0])));

This comment has been minimized.

Copy link
@pcwalton

pcwalton May 27, 2014

Contributor

Use the std::c_str functionality instead.

let glXGetClientString: extern "C" fn(*Display, c_int) -> *c_char =
cast::transmute(glXGetProcAddress(cast::transmute(&"glXGetClientString\x00"[0])));
assert!(glXGetClientString as *c_void != ptr::null());
let glx_client_vendor = glXGetClientString(display, 1);

This comment has been minimized.

Copy link
@bjwbell

bjwbell May 27, 2014

Author Contributor

Will replace 1 -> GLX_VENDOR after merge of PR Add GLX_VENDOR define

@mrobinson
Copy link
Member

mrobinson commented May 27, 2014

This seems to be the solution used in Gecko as well: https://bugzilla.mozilla.org/show_bug.cgi?id=896287

bjwbell added 2 commits May 27, 2014
Replace 1 with GLX_VENDOR for glXGetClientString call.
@bjwbell
Copy link
Contributor Author

bjwbell commented May 27, 2014

Shoot they match on glx server vendor string. I'm matching on the client.

Can you test? (maybe try it with X11 ssh forwarding too??)

I don't have any Nvidia systems.

@mrobinson
Copy link
Member

mrobinson commented May 27, 2014

I get this error:

src/support/layers/rust-layers/platform/linux/surface.rs:25:21: 25:31 error: unresolved import: there is no GLX_VENDOR in opengles::glx

When I just use 1 instead of GLX_VENDOR the patch works great.

@bjwbell
Copy link
Contributor Author

bjwbell commented May 27, 2014

Great. To fix the error update to the newest version of rust-opengles (servo/rust-opengles#83)

@pcwalton

This comment has been minimized.

Copy link

pcwalton commented on 6de7f80 May 27, 2014

r+

pcwalton added a commit that referenced this pull request May 27, 2014
Only apply nvidia hack with nvidia drivers
@pcwalton pcwalton merged commit b3ba5e7 into servo:master May 27, 2014
@bjwbell bjwbell deleted the bjwbell:nvidia-driver-hack branch Jul 13, 2014
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

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