mirror of
https://github.com/MobileGL-Dev/MobileGL
synced 2026-09-11 21:58:31 +09:00
[Fix] (MG_Impl/GLImpl): report incomplete framebuffer attachments [skip ci]
This commit is contained in:
@@ -64,6 +64,15 @@ namespace MobileGL::MG_Impl::GLImpl {
|
|||||||
HasCompleteRenderbufferAttachment(framebufferObject);
|
HasCompleteRenderbufferAttachment(framebufferObject);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Bool HasDefinedAttachment(const MG_State::GLState::FramebufferObject& framebufferObject) {
|
||||||
|
for (const auto& attachment : framebufferObject.GetAllAttachmentObjects()) {
|
||||||
|
if (attachment.IsValid() && !attachment.IsEmpty()) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
void RecordUnsupportedFramebufferTextureAttachmentError(const char* functionName, const char* detail) {
|
void RecordUnsupportedFramebufferTextureAttachmentError(const char* functionName, const char* detail) {
|
||||||
MG_State::pGLContext->RecordError(
|
MG_State::pGLContext->RecordError(
|
||||||
ErrorCode::InvalidOperation,
|
ErrorCode::InvalidOperation,
|
||||||
@@ -1199,7 +1208,9 @@ namespace MobileGL::MG_Impl::GLImpl {
|
|||||||
// additional GL_FRAMEBUFFER_UNSUPPORTED cases, GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE,
|
// additional GL_FRAMEBUFFER_UNSUPPORTED cases, GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE,
|
||||||
// GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS
|
// GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS
|
||||||
if (!framebufferObject->CheckCompleteness()) {
|
if (!framebufferObject->CheckCompleteness()) {
|
||||||
return GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT;
|
return HasDefinedAttachment(*framebufferObject) ?
|
||||||
|
GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT :
|
||||||
|
GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT;
|
||||||
}
|
}
|
||||||
if (IsActiveBackendDirectVulkan() &&
|
if (IsActiveBackendDirectVulkan() &&
|
||||||
IsUnsupportedFramebufferForDirectVulkan(*framebufferObject)) {
|
IsUnsupportedFramebufferForDirectVulkan(*framebufferObject)) {
|
||||||
@@ -1222,7 +1233,9 @@ namespace MobileGL::MG_Impl::GLImpl {
|
|||||||
if (!framebufferObject) return GL_FRAMEBUFFER_UNDEFINED;
|
if (!framebufferObject) return GL_FRAMEBUFFER_UNDEFINED;
|
||||||
|
|
||||||
if (!framebufferObject->CheckCompleteness()) {
|
if (!framebufferObject->CheckCompleteness()) {
|
||||||
return GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT;
|
return HasDefinedAttachment(*framebufferObject) ?
|
||||||
|
GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT :
|
||||||
|
GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT;
|
||||||
}
|
}
|
||||||
if (IsActiveBackendDirectVulkan() &&
|
if (IsActiveBackendDirectVulkan() &&
|
||||||
IsUnsupportedFramebufferForDirectVulkan(*framebufferObject)) {
|
IsUnsupportedFramebufferForDirectVulkan(*framebufferObject)) {
|
||||||
|
|||||||
Reference in New Issue
Block a user