]> git.tdb.fi Git - libs/gl.git/commitdiff
Avoid accessing a null object if there's only a sampler for some unit
authorMikko Rasa <tdb@tdb.fi>
Sun, 28 Mar 2021 21:26:01 +0000 (00:26 +0300)
committerMikko Rasa <tdb@tdb.fi>
Sun, 28 Mar 2021 21:26:01 +0000 (00:26 +0300)
source/render/texturing.cpp

index ab5d39b4c42e2b38d51c9ba1dfea5258e851a23a..be24d5d72b3a6e4fe2075e30af6f5772113b23a3 100644 (file)
@@ -136,7 +136,10 @@ void Texturing::bind_attachment(const Attachment &attch) const
                attch.sampler->bind_to(attch.unit);
        else
                Sampler::unbind_from(attch.unit);
-       attch.texture->bind_to(attch.unit);
+       if(attch.texture)
+               attch.texture->bind_to(attch.unit);
+       else
+               Texture::unbind_from(attch.unit);
 }
 
 void Texturing::unbind()