mirror of
https://github.com/MobileGL-Dev/MobileGL
synced 2026-09-12 06:08:30 +09:00
[Fix] (DirectVulkan): handle renderbuffer attachments in color blit clears
BlitFramebuffer's color path asserted that the read framebuffer's source attachment is a texture; a renderbuffer source (packed_depth_stencil.blit color checks) aborted the process. Materialize pending clears through the renderbuffer path for both source and destination, as ReadPixels already does.
This commit is contained in:
@@ -6246,11 +6246,18 @@ void main() {
|
|||||||
if (!readIsDefaultFbo) {
|
if (!readIsDefaultFbo) {
|
||||||
const auto& sourceAttachment = readFbo->GetAttachment(readFbo->GetReadBuffer());
|
const auto& sourceAttachment = readFbo->GetAttachment(readFbo->GetReadBuffer());
|
||||||
auto sourceTexture = sourceAttachment.GetTexture();
|
auto sourceTexture = sourceAttachment.GetTexture();
|
||||||
MOBILEGL_ASSERT(sourceTexture != nullptr, "BlitFramebuffer: source texture attachment is null");
|
if (sourceTexture != nullptr) {
|
||||||
const Bool clearReady = MaterializePendingClearForTexture(frame.commandBuffer, *sourceTexture);
|
const Bool clearReady = MaterializePendingClearForTexture(frame.commandBuffer, *sourceTexture);
|
||||||
MOBILEGL_ASSERT(clearReady,
|
MOBILEGL_ASSERT(clearReady,
|
||||||
"BlitFramebuffer: failed to materialize pending clear for source textureId=%d",
|
"BlitFramebuffer: failed to materialize pending clear for source textureId=%d",
|
||||||
sourceTexture->GetExternalIndex());
|
sourceTexture->GetExternalIndex());
|
||||||
|
} else if (sourceAttachment.IsRenderbuffer()) {
|
||||||
|
const Bool clearReady =
|
||||||
|
MaterializePendingClearForRenderbuffer(frame.commandBuffer, sourceAttachment.GetRenderbuffer());
|
||||||
|
MOBILEGL_ASSERT(clearReady,
|
||||||
|
"BlitFramebuffer: failed to materialize pending clear for source renderbuffer %u",
|
||||||
|
sourceAttachment.GetRenderbuffer()->GetExternalIndex());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!drawIsDefaultFbo) {
|
if (!drawIsDefaultFbo) {
|
||||||
@@ -6263,6 +6270,12 @@ void main() {
|
|||||||
MOBILEGL_ASSERT(dstClearReady,
|
MOBILEGL_ASSERT(dstClearReady,
|
||||||
"BlitFramebuffer: failed to materialize pending clear for destination textureId=%d",
|
"BlitFramebuffer: failed to materialize pending clear for destination textureId=%d",
|
||||||
destTexture->GetExternalIndex());
|
destTexture->GetExternalIndex());
|
||||||
|
} else if (destAttachment.IsRenderbuffer()) {
|
||||||
|
const Bool dstClearReady =
|
||||||
|
MaterializePendingClearForRenderbuffer(frame.commandBuffer, destAttachment.GetRenderbuffer());
|
||||||
|
MOBILEGL_ASSERT(dstClearReady,
|
||||||
|
"BlitFramebuffer: failed to materialize pending clear for destination renderbuffer %u",
|
||||||
|
destAttachment.GetRenderbuffer()->GetExternalIndex());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user