[Feat] (MG_State/Program, MG_Impl/Program): skeleton and initial impl of program/shader state machine

This commit is contained in:
2025-08-09 13:08:26 +08:00
parent 4b4b876a25
commit 4ecd4e4a07
9 changed files with 528 additions and 0 deletions
@@ -0,0 +1,27 @@
#include "../../../Includes.h"
namespace MobileGL {
namespace MG_State {
namespace GLState {
Uint ProgramState::CreateProgram() {
Uint programId = 0;
m_indexGenerator.Generate(1, &programId);
EnsureIndexAvail(programId);
m_programObjects[programId] = MakeShared<ProgramObject>();
return programId;
}
SharedPtr<ProgramObject> ProgramState::GetProgramObject(Uint id) {
if (!CheckIndexAvail(id))
return nullptr; // FIXME: add error reporting here
return m_programObjects[id];
}
void ProgramState::DeleteProgram(Uint id) {
if (!CheckIndexAvail(id))
return; // FIXME: add error reporting here
m_programObjects[id].reset();
}
}
}
}