]> git.tdb.fi Git - libs/gl.git/commitdiff
Fix sampler binding bug
authorMikko Rasa <tdb@tdb.fi>
Sun, 7 Feb 2021 16:20:13 +0000 (18:20 +0200)
committerMikko Rasa <tdb@tdb.fi>
Sun, 7 Feb 2021 16:20:13 +0000 (18:20 +0200)
source/texture.cpp

index e6691b41616b6fc5ca0f297a96655d4a396c9d35..f6594ab14c7e5143434ac0823c862427c70f2c9d 100644 (file)
@@ -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);
        }
 }