mirror of
https://github.com/MobileGL-Dev/MobileGL
synced 2026-09-07 19:58:32 +09:00
[Fix] (MG_Backend/DirectGLES): Remove the use of glVertexAttribFormat.
This commit is contained in:
@@ -216,7 +216,7 @@ namespace MobileGL::MG_Backend::DirectGLES {
|
||||
MG_External::GLES::glBindVertexArray(m_backendVAOId);
|
||||
}
|
||||
|
||||
void BackendVertexArrayObject::SyncAttributeBuffer(Uint index,
|
||||
void BackendVertexArrayObject::BindAttributeBuffer(Uint index,
|
||||
const MG_State::GLState::VertexAttribute& attrib) {
|
||||
const auto& bufferObject = attrib.Buffer;
|
||||
if (!bufferObject) {
|
||||
@@ -268,35 +268,20 @@ namespace MobileGL::MG_Backend::DirectGLES {
|
||||
m_syncedAttributeVersions[attribIndex].BufferVersion;
|
||||
if (!needsSyncFormat && !needsSyncBuffer) continue;
|
||||
|
||||
if (needsSyncBuffer) {
|
||||
SyncAttributeBuffer(attribIndex, attrib);
|
||||
BindAttributeBuffer(attribIndex, attrib);
|
||||
|
||||
if (!attrib.IsInteger) {
|
||||
MG_External::GLES::glVertexAttribPointer(
|
||||
attribIndex, attrib.Size, MG_Util::ConvertDataTypeToGLEnum(attrib.Type),
|
||||
attrib.Normalized ? GL_TRUE : GL_FALSE, attrib.Stride, (const void*)attrib.Offset);
|
||||
} else {
|
||||
MG_External::GLES::glVertexAttribIPointer(attribIndex, attrib.Size,
|
||||
MG_Util::ConvertDataTypeToGLEnum(attrib.Type),
|
||||
attrib.Stride, (const void*)attrib.Offset);
|
||||
}
|
||||
|
||||
if (needsSyncFormat) {
|
||||
MG_External::GLES::glVertexAttribDivisor(attribIndex, attrib.Divisor);
|
||||
}
|
||||
continue; // No need to set format again
|
||||
if (!attrib.IsInteger) {
|
||||
MG_External::GLES::glVertexAttribPointer(
|
||||
attribIndex, attrib.Size, MG_Util::ConvertDataTypeToGLEnum(attrib.Type),
|
||||
attrib.Normalized ? GL_TRUE : GL_FALSE, attrib.Stride, (const void*)attrib.Offset);
|
||||
} else {
|
||||
MG_External::GLES::glVertexAttribIPointer(attribIndex, attrib.Size,
|
||||
MG_Util::ConvertDataTypeToGLEnum(attrib.Type),
|
||||
attrib.Stride, (const void*)attrib.Offset);
|
||||
}
|
||||
|
||||
if (needsSyncFormat) {
|
||||
MG_External::GLES::glVertexAttribDivisor(attribIndex, attrib.Divisor);
|
||||
if (!attrib.IsInteger) {
|
||||
MG_External::GLES::glVertexAttribFormat(attribIndex, attrib.Size,
|
||||
MG_Util::ConvertDataTypeToGLEnum(attrib.Type),
|
||||
attrib.Normalized ? GL_TRUE : GL_FALSE, attrib.Offset);
|
||||
} else {
|
||||
MG_External::GLES::glVertexAttribIFormat(
|
||||
attribIndex, attrib.Size, MG_Util::ConvertDataTypeToGLEnum(attrib.Type), attrib.Offset);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -49,7 +49,7 @@ namespace MobileGL::MG_Backend::DirectGLES {
|
||||
void Bind();
|
||||
|
||||
private:
|
||||
void SyncAttributeBuffer(Uint index, const MG_State::GLState::VertexAttribute& attrib);
|
||||
void BindAttributeBuffer(Uint index, const MG_State::GLState::VertexAttribute& attrib);
|
||||
|
||||
Uint m_backendVAOId = 0;
|
||||
Bool m_isInitialized = false;
|
||||
@@ -132,8 +132,9 @@ namespace MobileGL::MG_Backend::DirectGLES {
|
||||
bool SyncAttachmentObject(GLenum glFBOTarget,
|
||||
const MG_State::GLState::FramebufferAttachmentObject& attachmentObject,
|
||||
GLenum glBackendAttachment);
|
||||
// FramebufferAttachmentType GetCompactedAttachmentTypeAtDrawBufferIndex(Int index);
|
||||
// FramebufferAttachmentType GetCompactedAttachmentTypeAtDrawBufferIndex(Int index);
|
||||
GLenum GetBackendAttachmentType(FramebufferAttachmentType frontendAtt) const;
|
||||
|
||||
private:
|
||||
Uint m_backendFBOId = 0;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user