mirror of
https://github.com/servo/servo.git
synced 2025-08-04 21:20:23 +01:00
webgl: Don't unnecessarily enable point sprites on GLES.
This commit is contained in:
parent
3fe83f1d06
commit
9c29e139b9
1 changed files with 14 additions and 3 deletions
|
@ -125,11 +125,22 @@ impl<VR: WebVRRenderHandler + 'static> WebGLThread<VR> {
|
||||||
let glsl_version = Self::get_glsl_version(&data.ctx);
|
let glsl_version = Self::get_glsl_version(&data.ctx);
|
||||||
|
|
||||||
// FIXME(nox): Should probably be done by offscreen_gl_context.
|
// FIXME(nox): Should probably be done by offscreen_gl_context.
|
||||||
if (glsl_version.major, glsl_version.minor) < (3, 1) {
|
|
||||||
data.ctx.gl().enable(gl::POINT_SPRITE);
|
|
||||||
}
|
|
||||||
if !is_gles() {
|
if !is_gles() {
|
||||||
|
// Points sprites are enabled by default in OpenGL 3.2 core
|
||||||
|
// and in GLES. Rather than doing version detection, it does
|
||||||
|
// not hurt to enable them anyways.
|
||||||
|
|
||||||
|
data.ctx.gl().enable(gl::POINT_SPRITE);
|
||||||
|
let err = data.ctx.gl().get_error();
|
||||||
|
if err != 0 {
|
||||||
|
warn!("Error enabling GL point sprites: {}", err);
|
||||||
|
}
|
||||||
|
|
||||||
data.ctx.gl().enable(gl::PROGRAM_POINT_SIZE);
|
data.ctx.gl().enable(gl::PROGRAM_POINT_SIZE);
|
||||||
|
let err = data.ctx.gl().get_error();
|
||||||
|
if err != 0 {
|
||||||
|
warn!("Error enabling GL program point size: {}", err);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
WebGLCreateContextResult {
|
WebGLCreateContextResult {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue