Start adding support for some base extensions which others build on.

Many of the other extensions in Vulkan rely on these some just want to
get these landed so we can start building on top of them.

Bug: skia:
Change-Id: Icef82c169cd50ff51b97fe065923531ef2940319
Reviewed-on: https://skia-review.googlesource.com/145362
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
diff --git a/src/gpu/vk/GrVkGpu.cpp b/src/gpu/vk/GrVkGpu.cpp
index efdca90..3231394 100644
--- a/src/gpu/vk/GrVkGpu.cpp
+++ b/src/gpu/vk/GrVkGpu.cpp
@@ -66,14 +66,30 @@
         return nullptr;
     }
 
+    PFN_vkGetPhysicalDeviceProperties localGetPhysicalDeviceProperties =
+            reinterpret_cast<PFN_vkGetPhysicalDeviceProperties>(
+                    backendContext.fGetProc("vkGetPhysicalDeviceProperties",
+                                            backendContext.fInstance,
+                                            VK_NULL_HANDLE));
+
+    if (!localGetPhysicalDeviceProperties) {
+        return nullptr;
+    }
+    VkPhysicalDeviceProperties physDeviceProperties;
+    localGetPhysicalDeviceProperties(backendContext.fPhysicalDevice, &physDeviceProperties);
+    uint32_t physDevVersion = physDeviceProperties.apiVersion;
+
     sk_sp<const GrVkInterface> interface;
 
     if (backendContext.fVkExtensions) {
         interface.reset(new GrVkInterface(backendContext.fGetProc,
                                           backendContext.fInstance,
                                           backendContext.fDevice,
+                                          backendContext.fInstanceVersion,
+                                          physDevVersion,
                                           backendContext.fVkExtensions));
-        if (!interface->validate(backendContext.fVkExtensions)) {
+        if (!interface->validate(backendContext.fInstanceVersion, physDevVersion,
+                                 backendContext.fVkExtensions)) {
             return nullptr;
         }
     } else {
@@ -83,8 +99,10 @@
         interface.reset(new GrVkInterface(backendContext.fGetProc,
                                           backendContext.fInstance,
                                           backendContext.fDevice,
+                                          backendContext.fInstanceVersion,
+                                          physDevVersion,
                                           &extensions));
-        if (!interface->validate(&extensions)) {
+        if (!interface->validate(backendContext.fInstanceVersion, physDevVersion, &extensions)) {
             return nullptr;
         }
     }
@@ -118,8 +136,10 @@
                                                                : backendContext.fMinAPIVersion;
 
     if (backendContext.fFeatures & kIgnoreAllFlags_GrVkFeatureFlag) {
+        SkASSERT(backendContext.fVkExtensions);
         fVkCaps.reset(new GrVkCaps(options, this->vkInterface(), backendContext.fPhysicalDevice,
-                                   backendContext.fDeviceFeatures, instanceVersion));
+                                   backendContext.fDeviceFeatures, instanceVersion,
+                                   *backendContext.fVkExtensions));
     } else {
         VkPhysicalDeviceFeatures features;
         if (backendContext.fFeatures & kGeometryShader_GrVkFeatureFlag) {
@@ -132,7 +152,7 @@
             features.sampleRateShading = true;
         }
         fVkCaps.reset(new GrVkCaps(options, this->vkInterface(), backendContext.fPhysicalDevice,
-                                   features, instanceVersion));
+                                   features, instanceVersion, GrVkExtensions()));
     }
     fCaps.reset(SkRef(fVkCaps.get()));