Commit e259e7e3 by Jamie Madill

Pass layer count to robust 2D array texure init.

The Vulkan back-end needs the layer count to correctly initialize the whole range of the mip level. Otherwise we were only clearing a single layer of the 2D array. This only popped up when the code started to be lazier about robust resource init. Bug: angleproject:4517 Change-Id: Id5007c877d413dc80d54d9800a5898e130593451 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2134412Reviewed-by: 's avatarCody Northrop <cnorthrop@google.com>
parent 390ef299
......@@ -318,8 +318,11 @@ angle::Result FramebufferAttachmentObject::initializeContents(const Context *con
// initializing entire mip levels for 2D array textures.
if (imageIndex.getType() == TextureType::_2DArray && imageIndex.hasLayer())
{
ImageIndex fullMipIndex =
ImageIndex::Make2DArray(imageIndex.getLevelIndex(), ImageIndex::kEntireLevel);
// Compute the layer count so we get a correct 2D array index.
const gl::Extents &size = getAttachmentSize(imageIndex);
ImageIndex fullMipIndex = ImageIndex::Make2DArrayRange(
imageIndex.getLevelIndex(), ImageIndex::kEntireLevel, size.depth);
return getAttachmentImpl()->initializeContents(context, fullMipIndex);
}
else if (imageIndex.getType() == TextureType::_2DMultisampleArray && imageIndex.hasLayer())
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment