Skip to content

Commit

Permalink
Merge pull request glium#1548 from TimBednarzyk/master
Browse files Browse the repository at this point in the history
Allow OpenGL ES 3.0+ to use Sampler Objects
  • Loading branch information
tomaka authored Nov 28, 2016
2 parents 748d32d + 67fdd5a commit 387da94
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/sampler_object.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ impl SamplerObject {
pub fn new(ctxt: &mut CommandContext, behavior: &SamplerBehavior) -> SamplerObject {
// making sure that the backend supports samplers
assert!(ctxt.version >= &Version(Api::Gl, 3, 2) ||
ctxt.version >= &Version(Api::GlEs, 3, 0) ||
ctxt.extensions.gl_arb_sampler_objects);

let sampler = unsafe {
Expand Down Expand Up @@ -58,7 +59,7 @@ impl SamplerObject {
}
}

///
///
#[inline]
pub fn destroy(mut self, ctxt: &mut CommandContext) {
self.destroyed = true;
Expand Down
1 change: 1 addition & 0 deletions src/uniforms/bind.rs
Original file line number Diff line number Diff line change
Expand Up @@ -647,6 +647,7 @@ fn bind_texture_uniform<P, T>(mut ctxt: &mut context::CommandContext,

if ctxt.state.texture_units[texture_unit as usize].sampler != sampler {
assert!(ctxt.version >= &Version(Api::Gl, 3, 3) ||
ctxt.version >= &Version(Api::GlEs, 3, 0) ||
ctxt.extensions.gl_arb_sampler_objects);

unsafe { ctxt.gl.BindSampler(texture_unit as gl::types::GLenum, sampler); }
Expand Down

0 comments on commit 387da94

Please sign in to comment.