From 571e96b202fc22220a0af2d6e10beecc36e97abd Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Mon, 29 Mar 2021 00:26:01 +0300 Subject: [PATCH] Avoid accessing a null object if there's only a sampler for some unit --- source/render/texturing.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/source/render/texturing.cpp b/source/render/texturing.cpp index ab5d39b4..be24d5d7 100644 --- a/source/render/texturing.cpp +++ b/source/render/texturing.cpp @@ -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() -- 2.45.2