mirror of
https://github.com/MobileGL-Dev/MobileGL
synced 2026-09-12 06:08:30 +09:00
[Fix] (MG_Backend/DirectGLES): Bind sampler object in backend.
This commit is contained in:
@@ -353,6 +353,7 @@ namespace MobileGL::MG_Backend::DirectGLES {
|
|||||||
const auto& textureObject = bindingSlot.GetBoundObject();
|
const auto& textureObject = bindingSlot.GetBoundObject();
|
||||||
if (!textureObject) continue;
|
if (!textureObject) continue;
|
||||||
|
|
||||||
|
// Bind texture object
|
||||||
auto target = textureObject->GetTarget();
|
auto target = textureObject->GetTarget();
|
||||||
if (target == TextureTarget::TextureBuffer || target == TextureTarget::Texture1D ||
|
if (target == TextureTarget::TextureBuffer || target == TextureTarget::Texture1D ||
|
||||||
target == TextureTarget::TextureRectangle || target == TextureTarget::Texture2DMultisampleArray ||
|
target == TextureTarget::TextureRectangle || target == TextureTarget::Texture2DMultisampleArray ||
|
||||||
@@ -368,6 +369,17 @@ namespace MobileGL::MG_Backend::DirectGLES {
|
|||||||
GLenum targetGL = MG_Util::ConvertTextureTargetToGLEnum(target);
|
GLenum targetGL = MG_Util::ConvertTextureTargetToGLEnum(target);
|
||||||
backendTextureIt->second->Bind(targetGL);
|
backendTextureIt->second->Bind(targetGL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Bind sampler object
|
||||||
|
const auto& samplerObject = textureUnit.GetSamplerObject();
|
||||||
|
if (samplerObject) {
|
||||||
|
const auto& backendSamplerIt = SamplerImpl::g_backendSamplerObjects.find(samplerObject);
|
||||||
|
if (backendSamplerIt != SamplerImpl::g_backendSamplerObjects.end()) {
|
||||||
|
backendSamplerIt->second->Bind(unit);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
MG_External::GLES::glBindSampler(unit, 0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const auto& currentProgram = MG_State::pGLContext->GetCurrentProgram();
|
const auto& currentProgram = MG_State::pGLContext->GetCurrentProgram();
|
||||||
|
|||||||
Reference in New Issue
Block a user