Vulkan: Fix cube map attachment clears and readpixels.

These were both missing the correct layer offset. Cache the layer
inside the RenderTargetVk for easy access.

Bug: angleproject:2470
Change-Id: I690dbf0702d7ec52f44ba0a9429b6ef0e51baf6b
Reviewed-on: https://chromium-review.googlesource.com/1225910
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Yuly Novikov <ynovikov@chromium.org>
diff --git a/src/libANGLE/renderer/vulkan/RenderTargetVk.cpp b/src/libANGLE/renderer/vulkan/RenderTargetVk.cpp
index 9a4a0f3..18dd86d 100644
--- a/src/libANGLE/renderer/vulkan/RenderTargetVk.cpp
+++ b/src/libANGLE/renderer/vulkan/RenderTargetVk.cpp
@@ -17,8 +17,9 @@
 {
 RenderTargetVk::RenderTargetVk(vk::ImageHelper *image,
                                vk::ImageView *imageView,
-                               vk::CommandGraphResource *resource)
-    : mImage(image), mImageView(imageView), mResource(resource)
+                               vk::CommandGraphResource *resource,
+                               size_t layerIndex)
+    : mImage(image), mImageView(imageView), mResource(resource), mLayerIndex(layerIndex)
 {
 }
 
@@ -27,7 +28,10 @@
 }
 
 RenderTargetVk::RenderTargetVk(RenderTargetVk &&other)
-    : mImage(other.mImage), mImageView(other.mImageView), mResource(other.mResource)
+    : mImage(other.mImage),
+      mImageView(other.mImageView),
+      mResource(other.mResource),
+      mLayerIndex(other.mLayerIndex)
 {
 }