Skip to content

Commit

Permalink
[gl] disabling the raster method setup for GLES
Browse files Browse the repository at this point in the history
  • Loading branch information
kvark committed Jun 18, 2016
1 parent 28c974a commit ca9224e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/backend/gl/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -480,7 +480,7 @@ impl Device {
state::bind_draw_color_buffers(&self.share.context, mask);
},
Command::SetRasterizer(rast) => {
state::bind_rasterizer(&self.share.context, &rast);
state::bind_rasterizer(&self.share.context, &rast, self.info.version.is_embedded);
},
Command::SetViewport(rect) => {
state::bind_viewport(&self.share.context, rect);
Expand Down
8 changes: 5 additions & 3 deletions src/backend/gl/src/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ pub fn bind_raster_method(gl: &gl::Gl, method: s::RasterMethod, offset: Option<s
}
}

pub fn bind_rasterizer(gl: &gl::Gl, r: &s::Rasterizer) {
pub fn bind_rasterizer(gl: &gl::Gl, r: &s::Rasterizer, is_embedded: bool) {
unsafe {
gl.FrontFace(match r.front_face {
FrontFace::Clockwise => gl::CW,
Expand All @@ -63,8 +63,10 @@ pub fn bind_rasterizer(gl: &gl::Gl, r: &s::Rasterizer) {
gl.CullFace(gl::BACK);
}}
}

bind_raster_method(gl, r.method, r.offset);

if !is_embedded {
bind_raster_method(gl, r.method, r.offset);
}
match r.samples {
Some(_) => unsafe { gl.Enable(gl::MULTISAMPLE) },
None => unsafe { gl.Disable(gl::MULTISAMPLE) },
Expand Down

0 comments on commit ca9224e

Please sign in to comment.