Make vkGetPhysicalDeviceSurfaceCapabilitiesKHR provide a return code

Rather than assume success, allow WSI surface implementations to return
a VkResult for getSurfaceCapabilities.

Also, made VkSurfaceKHR::getSurfaceCapabilities pure virtual, and moved
its implementation to a protected static helper named
setCommonSurfaceCapabilities.

Bug: chromium:1174372
Change-Id: I75f5f5a30f786f0675d830e4e2a684a4cbcb149c
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/53048
Kokoro-Result: kokoro <noreply+kokoro@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Tested-by: Antonio Maiorano <amaiorano@google.com>
Commit-Queue: Antonio Maiorano <amaiorano@google.com>
diff --git a/src/WSI/XlibSurfaceKHR.hpp b/src/WSI/XlibSurfaceKHR.hpp
index f9ee870..4d26173 100644
--- a/src/WSI/XlibSurfaceKHR.hpp
+++ b/src/WSI/XlibSurfaceKHR.hpp
@@ -34,7 +34,7 @@
 
 	static size_t ComputeRequiredAllocationSize(const VkXlibSurfaceCreateInfoKHR *pCreateInfo);
 
-	void getSurfaceCapabilities(VkSurfaceCapabilitiesKHR *pSurfaceCapabilities) const override;
+	VkResult getSurfaceCapabilities(VkSurfaceCapabilitiesKHR *pSurfaceCapabilities) const override;
 
 	virtual void attachImage(PresentImage *image) override;
 	virtual void detachImage(PresentImage *image) override;