mirror of
https://github.com/MobileGL-Dev/MobileGL
synced 2026-09-10 13:18:31 +09:00
[Fix] (GLImpl/Program, MG_Backend/DirectGLES): guard against not linked program object
This commit is contained in:
@@ -223,7 +223,7 @@ namespace MobileGL::MG_Backend::DirectGLES {
|
||||
namespace PrgramImpl {
|
||||
void SyncCurrentProgram() {
|
||||
auto currentProgram = MG_State::pGLContext->GetCurrentProgram();
|
||||
if (!currentProgram) {
|
||||
if (!currentProgram || !currentProgram->GetLinkStatus()) {
|
||||
MG_External::GLES::glUseProgram(0);
|
||||
return;
|
||||
}
|
||||
@@ -311,7 +311,7 @@ namespace MobileGL::MG_Backend::DirectGLES {
|
||||
MG_External::GLES::glActiveTexture(GL_TEXTURE0 + originalActiveUnit);
|
||||
|
||||
const auto& currentProgram = MG_State::pGLContext->GetCurrentProgram();
|
||||
if (currentProgram) {
|
||||
if (currentProgram && currentProgram->GetLinkStatus()) {
|
||||
const auto& backendProgramIt = PrgramImpl::g_backendProgramObjects.find(currentProgram);
|
||||
if (backendProgramIt != PrgramImpl::g_backendProgramObjects.end()) {
|
||||
backendProgramIt->second->Use();
|
||||
|
||||
Reference in New Issue
Block a user