mirror of
https://github.com/MobileGL-Dev/MobileGL
synced 2026-09-08 04:08:32 +09:00
Merge branch 'Feat/Backend-Direct-GLES' of https://github.com/MobileGL-Dev/MobileGL into Feat/Backend-Direct-GLES
This commit is contained in:
@@ -23,6 +23,7 @@ namespace MobileGL::MG_Backend::DirectGLES {
|
||||
}
|
||||
|
||||
for (const auto& attrib : currentVAOObject->GetAllAttributes()) {
|
||||
if (!attrib.Enabled) return;
|
||||
const auto& bufferObject = attrib.Buffer;
|
||||
if (bufferObject) {
|
||||
buffersToSync.push_back(bufferObject);
|
||||
|
||||
@@ -162,6 +162,14 @@ namespace MobileGL::MG_Backend::DirectGLES {
|
||||
|
||||
for (const auto& attribIndex : stateVAOObject->GetDirtyAttributeIndices()) {
|
||||
const auto& attrib = stateVAOObject->GetAttribute(attribIndex);
|
||||
if (attrib.Enabled) {
|
||||
MGLOG_D("Binding attribute index %u for VAO ID: %u", attribIndex, m_backendVAOId);
|
||||
MG_External::GLES::glEnableVertexAttribArray(attribIndex);
|
||||
} else {
|
||||
MGLOG_D("Disabling attribute index %u for VAO ID: %u", attribIndex, m_backendVAOId);
|
||||
MG_External::GLES::glDisableVertexAttribArray(attribIndex);
|
||||
continue;
|
||||
}
|
||||
|
||||
const auto& bufferObject = attrib.Buffer;
|
||||
if (!bufferObject) {
|
||||
@@ -177,7 +185,6 @@ namespace MobileGL::MG_Backend::DirectGLES {
|
||||
const auto& backendBufferObject = backendBufferIt->second;
|
||||
|
||||
backendBufferObject->Bind(GL_ARRAY_BUFFER);
|
||||
MG_External::GLES::glEnableVertexAttribArray(attribIndex);
|
||||
if (!attrib.IsInteger) {
|
||||
MG_External::GLES::glVertexAttribPointer(
|
||||
attribIndex, attrib.Size, MG_Util::ConvertDataTypeToGLEnum(attrib.Type),
|
||||
|
||||
@@ -99,8 +99,6 @@ namespace MobileGL {
|
||||
for (GLsizei y = 0; y < height; y++) {
|
||||
const SizeT destRowOffset = (yoffset + y) * destRowSize + xoffset * bytesPerPixel;
|
||||
const SizeT srcRowOffset = y * srcRowSize;
|
||||
MGLOG_D("memcpy params: dst: %p, src: %p, size: %zu", destData + destRowOffset, srcData + srcRowOffset,
|
||||
srcRowSize);
|
||||
Memcpy(destData + destRowOffset, srcData + srcRowOffset, srcRowSize);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user