mirror of
https://github.com/MobileGL-Dev/MobileGL
synced 2026-09-12 14:18:31 +09:00
[Fix] (MG_State/GLState, MG_Backend): track layered framebuffer textures
This commit is contained in:
@@ -12,8 +12,10 @@
|
||||
namespace MobileGL::MG_State::GLState {
|
||||
// FramebufferAttachmentObject
|
||||
FramebufferAttachmentObject::FramebufferAttachmentObject(
|
||||
const SharedPtr<MG_State::GLState::ITextureObject>& texture, TextureUploadTarget textureUploadTarget, Int level)
|
||||
: m_texture(texture), m_textureUploadTarget(textureUploadTarget), m_textureLevel(level) {}
|
||||
const SharedPtr<MG_State::GLState::ITextureObject>& texture, TextureUploadTarget textureUploadTarget, Int level,
|
||||
Int layer, Bool layered)
|
||||
: m_texture(texture), m_textureUploadTarget(textureUploadTarget), m_textureLevel(level),
|
||||
m_textureLayer(layer), m_layered(layered) {}
|
||||
FramebufferAttachmentObject::FramebufferAttachmentObject(const SharedPtr<RenderbufferObject>& renderbuffer)
|
||||
: m_renderbuffer(renderbuffer) {}
|
||||
FramebufferAttachmentObject::FramebufferAttachmentObject(Bool IsValid)
|
||||
@@ -45,6 +47,14 @@ namespace MobileGL::MG_State::GLState {
|
||||
return m_textureLevel;
|
||||
}
|
||||
|
||||
Int FramebufferAttachmentObject::GetTextureLayer() const {
|
||||
return m_textureLayer;
|
||||
}
|
||||
|
||||
Bool FramebufferAttachmentObject::IsLayered() const {
|
||||
return m_layered;
|
||||
}
|
||||
|
||||
TextureUploadTarget FramebufferAttachmentObject::GetTextureUploadTarget() const {
|
||||
return m_textureUploadTarget;
|
||||
}
|
||||
@@ -98,8 +108,9 @@ namespace MobileGL::MG_State::GLState {
|
||||
}
|
||||
|
||||
void FramebufferObject::AttachTexture(FramebufferAttachmentType type, const SharedPtr<ITextureObject>& texture,
|
||||
TextureUploadTarget textureUploadTarget, int level) {
|
||||
m_attachmentObjects[static_cast<SizeT>(type)] = FramebufferAttachmentObject(texture, textureUploadTarget, level);
|
||||
TextureUploadTarget textureUploadTarget, int level, int layer, Bool layered) {
|
||||
m_attachmentObjects[static_cast<SizeT>(type)] =
|
||||
FramebufferAttachmentObject(texture, textureUploadTarget, level, layer, layered);
|
||||
BumpAttachmentVersion(type);
|
||||
}
|
||||
|
||||
|
||||
@@ -74,7 +74,7 @@ namespace MobileGL {
|
||||
public:
|
||||
explicit FramebufferAttachmentObject(const SharedPtr<MG_State::GLState::ITextureObject>& texture,
|
||||
TextureUploadTarget textureUploadTarget,
|
||||
Int level = 0);
|
||||
Int level = 0, Int layer = 0, Bool layered = false);
|
||||
explicit FramebufferAttachmentObject(const SharedPtr<RenderbufferObject>& renderbuffer);
|
||||
explicit FramebufferAttachmentObject(Bool IsValid = true);
|
||||
|
||||
@@ -84,6 +84,8 @@ namespace MobileGL {
|
||||
const SharedPtr<MG_State::GLState::ITextureObject>& GetTexture() const;
|
||||
const SharedPtr<RenderbufferObject>& GetRenderbuffer() const;
|
||||
Int GetTextureLevel() const;
|
||||
Int GetTextureLayer() const;
|
||||
Bool IsLayered() const;
|
||||
TextureUploadTarget GetTextureUploadTarget() const;
|
||||
Bool IsComplete() const;
|
||||
IntVec3 GetSize() const;
|
||||
@@ -94,6 +96,8 @@ namespace MobileGL {
|
||||
SharedPtr<RenderbufferObject> m_renderbuffer = nullptr;
|
||||
TextureUploadTarget m_textureUploadTarget = TextureUploadTarget::Unknown;
|
||||
Int m_textureLevel = 0;
|
||||
Int m_textureLayer = 0;
|
||||
Bool m_layered = false;
|
||||
Bool m_isValid = true;
|
||||
};
|
||||
|
||||
@@ -112,7 +116,8 @@ namespace MobileGL {
|
||||
FramebufferObject(Uint externalIndex);
|
||||
|
||||
void AttachTexture(FramebufferAttachmentType type, const SharedPtr<ITextureObject>& texture,
|
||||
TextureUploadTarget textureUploadTarget = TextureUploadTarget::Unknown, int level = 0);
|
||||
TextureUploadTarget textureUploadTarget = TextureUploadTarget::Unknown, int level = 0,
|
||||
int layer = 0, Bool layered = false);
|
||||
void AttachRenderbuffer(FramebufferAttachmentType type, const SharedPtr<RenderbufferObject>& renderbuffer);
|
||||
void Detach(FramebufferAttachmentType type);
|
||||
const FramebufferAttachmentObject& GetAttachment(FramebufferAttachmentType type) const;
|
||||
|
||||
@@ -45,7 +45,7 @@ namespace MobileGL {
|
||||
{TextureUploadTarget::Texture1DArray});
|
||||
|
||||
STUB_TEXTURE_OBJECT_CLASS_DEFINITION(TextureObject2DArray, TextureTarget::Texture2DArray,
|
||||
{TextureUploadTarget::Texture2D});
|
||||
{TextureUploadTarget::Texture2DArray});
|
||||
|
||||
STUB_TEXTURE_OBJECT_CLASS_DEFINITION(TextureObjectCubeMapArray, TextureTarget::TextureCubeMapArray,
|
||||
{TextureUploadTarget::CubeMapArray});
|
||||
|
||||
Reference in New Issue
Block a user