From: Mikko Rasa Date: Sun, 7 Feb 2021 16:20:13 +0000 (+0200) Subject: Fix sampler binding bug X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=1fe271c3f60ec619bacf789ebdcd35be480950ba;p=libs%2Fgl.git Fix sampler binding bug --- diff --git a/source/texture.cpp b/source/texture.cpp index e6691b41..f6594ab1 100644 --- a/source/texture.cpp +++ b/source/texture.cpp @@ -226,6 +226,7 @@ void Texture::bind_to(unsigned i) const } TexUnit &unit = TexUnit::get_unit(i); + const Texture *cur = unit.get_texture(); if(unit.set_texture(this)) { if(manager) @@ -239,7 +240,7 @@ void Texture::bind_to(unsigned i) const glBindTexture(target, id); } - if(!unit.get_sampler()) + if(!unit.get_sampler() || unit.get_sampler()==&cur->default_sampler) default_sampler.bind_to(i); } }