mirror of
https://github.com/MobileGL-Dev/MobileGL
synced 2026-09-11 21:58:31 +09:00
use unordered_dense to mitigate __next_prime overflow error
This commit is contained in:
@@ -280,8 +280,8 @@ namespace MG_RHI::GLES {
|
||||
SyncAllBuffersToGLES(bufferState);
|
||||
|
||||
// VAO
|
||||
GLuint mgVAO = vaState->currentVao_;
|
||||
VertexArrayObject* vao = &vaState->vaos_[vaState->currentVao_];
|
||||
GLuint mgVAOId = vaState->currentVao_;
|
||||
VertexArrayObject* vao = &vaState->vaos_[mgVAOId];
|
||||
for (auto& [mgVAOId, mgVAO] : vaState->vaos_) {
|
||||
MG_Util::Debug::LogD("Uploading VAO: %d", mgVAOId);
|
||||
if (!mgVAO.generated) continue;
|
||||
@@ -290,6 +290,7 @@ namespace MG_RHI::GLES {
|
||||
GLuint glVAO;
|
||||
if (vaoMap_.find(mgVAOId) == vaoMap_.end()) {
|
||||
MGL_TRY(::GLES::glGenVertexArrays(1, &glVAO);)
|
||||
MG_Util::Debug::LogD("Saving VAO: %d -> %d", mgVAOId, glVAO);
|
||||
vaoMap_[mgVAOId] = glVAO;
|
||||
} else {
|
||||
glVAO = vaoMap_[mgVAOId];
|
||||
@@ -301,7 +302,7 @@ namespace MG_RHI::GLES {
|
||||
}
|
||||
|
||||
for (auto& [index, attrib] : mgVAO.attribs) {
|
||||
MG_Util::Debug::LogD("attrib #%s, type = %s, size = %d, stride = %d, pointer = %p",
|
||||
MG_Util::Debug::LogD("attrib #%d, type = %s, size = %d, stride = %d, pointer = %p",
|
||||
index, MG_Util::Debug::GLEnumToString(attrib.type), attrib.size, attrib.stride, attrib.pointer);
|
||||
if (attrib.buffer != 0 && bufferMap_.count(attrib.buffer)) {
|
||||
MGL_TRY(::GLES::glBindBuffer(GL_ARRAY_BUFFER, bufferMap_[attrib.buffer]);)
|
||||
@@ -329,11 +330,11 @@ namespace MG_RHI::GLES {
|
||||
MGL_TRY(::GLES::glBindVertexArray(0);)
|
||||
//}
|
||||
}
|
||||
GLuint currentMgVAO = vaState->currentVao_;
|
||||
if (vaoMap_.count(currentMgVAO)) {
|
||||
MGL_TRY(::GLES::glBindVertexArray(vaoMap_[currentMgVAO]);)
|
||||
// GLuint currentMgVAO = vaState->currentVao_;
|
||||
if (vaoMap_.find(mgVAOId) != vaoMap_.end()) {
|
||||
MGL_TRY(::GLES::glBindVertexArray(vaoMap_[mgVAOId]);)
|
||||
|
||||
VertexArrayObject& currentVAO = vaState->vaos_[currentMgVAO];
|
||||
VertexArrayObject& currentVAO = vaState->vaos_[mgVAOId];
|
||||
for (auto& [index, attrib] : currentVAO.attribs) {
|
||||
if (attrib.enabled) {
|
||||
MGL_TRY(::GLES::glEnableVertexAttribArray(index);)
|
||||
@@ -623,8 +624,6 @@ namespace MG_RHI::GLES {
|
||||
|
||||
lastBoundFBO = currentFBO;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user