ImageIndex: Consolidate layer/cube face.

In terms of the Texture or Image resource, a cube face
refers to a layer of a 2D texture. This layer has a special
meaning for cube textures, but it is represented as a layer
with a layer index. Cube array textures are no different,
they just use a different indexing scheme for the array
layers.

This also cleans up the ImageIndex helper to have a class
structure with private data, and cleans up a few cases to
use generic Make functions and iterators where they were
setting properties of the index directly.

This will make it easier to have ImageIndexes address
entire levels of a Cube map in the future, and makes the
layer count logic in Vulkan cleaner.

Bug: angleproject:2318
Change-Id: Iea9842e233f974a9896282ca224cb001f7882bd1
Reviewed-on: https://chromium-review.googlesource.com/987525
Reviewed-by: Luc Ferron <lucferron@chromium.org>
Reviewed-by: Yuly Novikov <ynovikov@chromium.org>
Commit-Queue: Jamie Madill <jmadill@chromium.org>
diff --git a/src/libANGLE/renderer/vulkan/TextureVk.cpp b/src/libANGLE/renderer/vulkan/TextureVk.cpp
index 6cda5d5..00735f7 100644
--- a/src/libANGLE/renderer/vulkan/TextureVk.cpp
+++ b/src/libANGLE/renderer/vulkan/TextureVk.cpp
@@ -190,7 +190,7 @@
     VkDevice device      = contextVk->getDevice();
 
     // TODO(jmadill): support multi-level textures.
-    ASSERT(index.mipIndex == 0);
+    ASSERT(index.getLevelIndex() == 0);
 
     // Convert internalFormat to sized internal format.
     const gl::InternalFormat &formatInfo = gl::GetInternalFormatInfo(internalFormat, type);
@@ -212,7 +212,7 @@
     }
 
     // TODO(jmadill): Cube map textures. http://anglebug.com/2318
-    if (index.target != gl::TextureTarget::_2D)
+    if (index.getTarget() != gl::TextureTarget::_2D)
     {
         UNIMPLEMENTED();
         return gl::InternalError();
@@ -375,10 +375,10 @@
                                                FramebufferAttachmentRenderTarget **rtOut)
 {
     // TODO(jmadill): Handle cube textures. http://anglebug.com/2318
-    ASSERT(imageIndex.type == gl::TextureType::_2D);
+    ASSERT(imageIndex.getType() == gl::TextureType::_2D);
 
     // Non-zero mip level attachments are an ES 3.0 feature.
-    ASSERT(imageIndex.mipIndex == 0 && imageIndex.layerIndex == gl::ImageIndex::ENTIRE_LEVEL);
+    ASSERT(imageIndex.getLevelIndex() == 0 && !imageIndex.hasLayer());
 
     ContextVk *contextVk = vk::GetImpl(context);
     RendererVk *renderer = contextVk->getRenderer();