Fix broken layerCount for some types of textures (#8151)

Currently mLayerCount for RenderTarget is always updated to the number
of depth for attachments, which incurs unintended behaviors for some
types of textures. i.e., 2d array, cubemap array, and 3d textures.

Fix this by updating mLayerCount only for multiview use case.

BUGS=[369165616]
This commit is contained in:
Sungun Park
2024-09-24 10:24:32 -07:00
committed by GitHub
parent fe15a3047e
commit 9d57ced452
9 changed files with 63 additions and 25 deletions

View File

@@ -224,6 +224,8 @@ int main(int argc, char** argv) {
app.stereoRenderTarget = RenderTarget::Builder()
.texture(RenderTarget::AttachmentPoint::COLOR, app.stereoColorTexture)
.texture(RenderTarget::AttachmentPoint::DEPTH, app.stereoDepthTexture)
.multiview(RenderTarget::AttachmentPoint::COLOR, eyeCount, 0)
.multiview(RenderTarget::AttachmentPoint::DEPTH, eyeCount, 0)
.build(*engine);
app.stereoView->setRenderTarget(app.stereoRenderTarget);
app.stereoView->setViewport({0, 0, vp.width, vp.height});