Vulkan: Incomplete textures support

2D multisample is out of scope since its ES 3 only.

Bug: angleproject:2499
Change-Id: Id5f81d713a2882ba2a91b7d3f281d71a3e9289f4
Reviewed-on: https://chromium-review.googlesource.com/1046786
Commit-Queue: Luc Ferron <lucferron@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
diff --git a/src/libANGLE/renderer/vulkan/ProgramVk.cpp b/src/libANGLE/renderer/vulkan/ProgramVk.cpp
index 714ffd4..2c7d52e 100644
--- a/src/libANGLE/renderer/vulkan/ProgramVk.cpp
+++ b/src/libANGLE/renderer/vulkan/ProgramVk.cpp
@@ -825,13 +825,14 @@
     return mUsedDescriptorSetRange;
 }
 
-vk::Error ProgramVk::updateTexturesDescriptorSet(ContextVk *contextVk)
+gl::Error ProgramVk::updateTexturesDescriptorSet(const gl::Context *context)
 {
     if (mState.getSamplerBindings().empty() || !mDirtyTextures)
     {
-        return vk::NoError();
+        return gl::NoError();
     }
 
+    ContextVk *contextVk = GetImplAs<ContextVk>(context);
     ANGLE_TRY(allocateDescriptorSet(contextVk, vk::TextureIndex));
 
     ASSERT(mUsedDescriptorSetRange.contains(1));
@@ -852,11 +853,15 @@
         // TODO(jmadill): Sampler arrays
         ASSERT(samplerBinding.boundTextureUnits.size() == 1);
 
-        GLuint textureUnit         = samplerBinding.boundTextureUnits[0];
-        const gl::Texture *texture = completeTextures[textureUnit];
+        GLuint textureUnit   = samplerBinding.boundTextureUnits[0];
+        gl::Texture *texture = completeTextures[textureUnit];
 
-        // TODO(jmadill): Incomplete textures handling.
-        ASSERT(texture);
+        if (texture == nullptr)
+        {
+            // If we have an incomplete texture, fetch it from our renderer.
+            ANGLE_TRY(
+                contextVk->getIncompleteTexture(context, samplerBinding.textureType, &texture));
+        }
 
         TextureVk *textureVk   = vk::GetImpl(texture);
         const vk::ImageHelper &image = textureVk->getImage();
@@ -889,7 +894,7 @@
     vkUpdateDescriptorSets(device, imageCount, writeDescriptorInfo.data(), 0, nullptr);
 
     mDirtyTextures = false;
-    return vk::NoError();
+    return gl::NoError();
 }
 
 void ProgramVk::invalidateTextures()