[Fix] (MG_State/FramebufferState): FramebufferAttachment::IsEmpty should be const.

This commit is contained in:
BZLZHH
2025-11-15 21:57:43 +08:00
parent 49b66c30c1
commit 845f699e3f
2 changed files with 13 additions and 14 deletions
@@ -21,7 +21,7 @@ namespace MobileGL {
return false; return false;
} }
Bool FramebufferAttachment::IsEmpty() { Bool FramebufferAttachment::IsEmpty() const {
return m_texture == nullptr && m_renderbuffer == nullptr; return m_texture == nullptr && m_renderbuffer == nullptr;
} }
@@ -63,8 +63,7 @@ namespace MobileGL {
} }
// FramebufferObject // FramebufferObject
FramebufferObject::FramebufferObject(Uint externalIndex) : FramebufferObject::FramebufferObject(Uint externalIndex) : m_externalIndex(externalIndex) {
m_externalIndex(externalIndex) {
m_attachments.fill(FramebufferAttachment(false)); m_attachments.fill(FramebufferAttachment(false));
m_drawBuffers.fill(FramebufferAttachmentType::None); m_drawBuffers.fill(FramebufferAttachmentType::None);
m_drawBuffers[0] = FramebufferAttachmentType::Color0; m_drawBuffers[0] = FramebufferAttachmentType::Color0;
@@ -130,21 +129,21 @@ namespace MobileGL {
} }
void FramebufferObject::SetDrawBuffer(Uint index, FramebufferAttachmentType buffer) { void FramebufferObject::SetDrawBuffer(Uint index, FramebufferAttachmentType buffer) {
if (m_drawBuffers[index] == buffer) if (m_drawBuffers[index] == buffer) return;
return;
m_drawBuffersDirty = true; m_drawBuffersDirty = true;
m_drawBuffers[index] = buffer; m_drawBuffers[index] = buffer;
} }
// void FramebufferObject::SetDrawBuffers(const Vector<FramebufferAttachmentType>& buffers) { // void FramebufferObject::SetDrawBuffers(const Vector<FramebufferAttachmentType>& buffers) {
// m_drawBuffers = buffers; // m_drawBuffers = buffers;
// m_drawBuffersDirty = true; // m_drawBuffersDirty = true;
// } // }
// void SetDrawBuffer(Uint index, FramebufferAttachmentType buffer) { // void SetDrawBuffer(Uint index, FramebufferAttachmentType buffer) {
// //
// } // }
const Array<FramebufferAttachmentType, FramebufferObject::MAX_DRAW_BUFFERS>& FramebufferObject::GetDrawBuffers() const { const Array<FramebufferAttachmentType, FramebufferObject::MAX_DRAW_BUFFERS>& FramebufferObject::
GetDrawBuffers() const {
return m_drawBuffers; return m_drawBuffers;
} }
@@ -72,7 +72,7 @@ namespace MobileGL {
Bool IsTexture() const; Bool IsTexture() const;
Bool IsRenderbuffer() const; Bool IsRenderbuffer() const;
Bool IsEmpty(); Bool IsEmpty() const;
SharedPtr<MG_State::GLState::ITextureObject> GetTexture() const; SharedPtr<MG_State::GLState::ITextureObject> GetTexture() const;
SharedPtr<RenderbufferObjectStub> GetRenderbuffer() const; SharedPtr<RenderbufferObjectStub> GetRenderbuffer() const;
Int GetTextureLevel() const; Int GetTextureLevel() const;