diff --git a/MobileGL/MG_Impl/GLImpl/Sampler/GL_Sampler.cpp b/MobileGL/MG_Impl/GLImpl/Sampler/GL_Sampler.cpp index ad4eb704..beca9c5f 100644 --- a/MobileGL/MG_Impl/GLImpl/Sampler/GL_Sampler.cpp +++ b/MobileGL/MG_Impl/GLImpl/Sampler/GL_Sampler.cpp @@ -10,6 +10,9 @@ namespace MobileGL { if (!SamplerImpl::ValidateSamplerName(sampler)) return; auto samplerObj = MG_State::pGLContext->GetSamplerObject(sampler); + if (!samplerObj) { + samplerObj = MG_State::pGLContext->CreateSamplerObject(sampler); // for compatibility + } if (!SamplerImpl::ValidateSamplerObject(sampler)) return; using namespace MG_Util; @@ -55,6 +58,9 @@ namespace MobileGL { if (!SamplerImpl::ValidateSamplerName(sampler)) return; auto samplerObj = MG_State::pGLContext->GetSamplerObject(sampler); + if (!samplerObj) { + samplerObj = MG_State::pGLContext->CreateSamplerObject(sampler); // for compatibility + } if (!SamplerImpl::ValidateSamplerObject(sampler)) return; using namespace MG_Util;