D3D11: Handle Clear* commands for layered framebuffers
According to the ANGLE_multiview spec, Clear* commands only affect
the range of attached layers to the multi-view layered framebuffer.
The patch extends ImageIndex so that the range of attached layers is
tracked and a render target view can be created with that range of
texture array slices attached.
The special case of scissored clears for depth and stencil attachments
is handled by instancing the same number of quads as there are views and
selecting the layer within a geometry shader.
BUG=angleproject:2062
TEST=angle_end2end_tests
Change-Id: Ibea248b980513f83d918652030a72c62c7ecd88b
Reviewed-on: https://chromium-review.googlesource.com/632256
Commit-Queue: Martin Radev <mradev@nvidia.com>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
diff --git a/src/libANGLE/Context.cpp b/src/libANGLE/Context.cpp
index 331e40f..021cacd 100644
--- a/src/libANGLE/Context.cpp
+++ b/src/libANGLE/Context.cpp
@@ -3072,7 +3072,7 @@
{
Texture *textureObj = getTexture(texture);
- ImageIndex index = ImageIndex::Make2DArray(level, baseViewIndex);
+ ImageIndex index = ImageIndex::Make2DArrayRange(level, baseViewIndex, numViews);
framebuffer->setAttachmentMultiviewLayered(this, GL_TEXTURE, attachment, index, textureObj,
numViews, baseViewIndex);
}