Vulkan: Enable robust buffer access.

This is not a complete implementation because it does not have the
ability to disable the physical device feature. It does pass the
current set of robust access tests. But there could be a performance
regression on platforms that have a slower impelmentation. We would
want the ability to support cases with bufer robustness on or off.

Bug: angleproject:3062
Change-Id: I7d6eb889debcbd32f6ed809b526677123f872726
Reviewed-on: https://chromium-review.googlesource.com/c/1403967
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Commit-Queue: Jamie Madill <jmadill@chromium.org>
diff --git a/src/libANGLE/renderer/vulkan/VertexArrayVk.cpp b/src/libANGLE/renderer/vulkan/VertexArrayVk.cpp
index 378321c..af63f40 100644
--- a/src/libANGLE/renderer/vulkan/VertexArrayVk.cpp
+++ b/src/libANGLE/renderer/vulkan/VertexArrayVk.cpp
@@ -450,11 +450,23 @@
             }
             else
             {
-                mCurrentArrayBuffers[attribIndex] = &bufferVk->getBuffer();
-                mCurrentArrayBufferHandles[attribIndex] =
-                    bufferVk->getBuffer().getBuffer().getHandle();
-                mCurrentArrayBufferOffsets[attribIndex] = binding.getOffset();
-                mCurrentArrayBufferStrides[attribIndex] = binding.getStride();
+                if (bufferVk->getSize() == 0)
+                {
+                    mCurrentArrayBuffers[attribIndex] = nullptr;
+                    mCurrentArrayBufferHandles[attribIndex] =
+                        mTheNullBuffer.getBuffer().getHandle();
+                    mCurrentArrayBufferOffsets[attribIndex] = 0;
+                    mCurrentArrayBufferStrides[attribIndex] = 0;
+                }
+                else
+                {
+                    mCurrentArrayBuffers[attribIndex] = &bufferVk->getBuffer();
+                    mCurrentArrayBufferHandles[attribIndex] =
+                        bufferVk->getBuffer().getBuffer().getHandle();
+                    mCurrentArrayBufferOffsets[attribIndex] = binding.getOffset();
+                    mCurrentArrayBufferStrides[attribIndex] = binding.getStride();
+                }
+
                 ensureConversionReleased(renderer, attribIndex);
             }
         }