mirror of
https://github.com/MobileGL-Dev/MobileGL
synced 2026-11-16 22:43:24 +09:00
[Fix] (MG_Backend/DirectGLES): Actually compile shader and use.
* TODO: remove junk code.
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
#include "DirectGLES.h"
|
||||
#include "MG_Util/ShaderTranspiler/Types.h"
|
||||
#include "Utils.h"
|
||||
#include "Managers.h"
|
||||
#include <MG_State/GLState/Core.h>
|
||||
@@ -289,6 +290,18 @@ namespace MobileGL::MG_Backend::DirectGLES {
|
||||
const auto& backendProgramIt = PrgramImpl::g_backendProgramObjects.find(currentProgram);
|
||||
if (backendProgramIt != PrgramImpl::g_backendProgramObjects.end()) {
|
||||
backendProgramIt->second->Use();
|
||||
// UBO
|
||||
MG_External::GLES::glBindBuffer(GL_UNIFORM_BUFFER, backendProgramIt->second->GetBackendGlobalUBOId());
|
||||
MG_External::GLES::glBufferSubData(GL_UNIFORM_BUFFER, 0, currentProgram->GetUBOSize(),
|
||||
currentProgram->MapUBO());
|
||||
MG_External::GLES::glBindBuffer(GL_UNIFORM_BUFFER, 0);
|
||||
|
||||
Uint bindingPoint;
|
||||
MG_External::GLES::glGetUniformBlockIndex(backendProgramIt->second->GetBackendProgramId(),
|
||||
MG_Util::ShaderTranspiler::GLOBAL_UBO_NAME);
|
||||
|
||||
MG_External::GLES::glBindBufferBase(GL_UNIFORM_BUFFER, bindingPoint,
|
||||
backendProgramIt->second->GetBackendGlobalUBOId());
|
||||
} else {
|
||||
MG_External::GLES::glUseProgram(0);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user