surface: Temporary workaround for surface features 90/65690/1
authorTaekyun Kim <tkq.kim@samsung.com>
Mon, 11 Apr 2016 10:24:54 +0000 (19:24 +0900)
committerTaekyun Kim <tkq.kim@samsung.com>
Tue, 12 Apr 2016 05:56:03 +0000 (14:56 +0900)
In order to run demo applications, there should be at least one available
supported surface format and present mode.

Change-Id: If99769a67492aeaf91d1fdfedb0da84fadb53705

src/wsi/surface.c

index 9f03c85..4fee652 100644 (file)
@@ -183,6 +183,8 @@ vk_GetPhysicalDeviceSurfaceSupportKHR(VkPhysicalDevice       pdev,
                                                                          VkBool32                      *supported)
 {
        /* TODO: */
+
+       *supported = VK_TRUE;
        return VK_SUCCESS;
 }
 
@@ -202,6 +204,16 @@ vk_GetPhysicalDeviceSurfaceFormatsKHR(VkPhysicalDevice              pdev,
                                                                          VkSurfaceFormatKHR    *formats)
 {
        /* TODO: */
+
+       if (formats == NULL) {
+               *format_count = 1;
+       } else {
+               if (*format_count != 0) {
+                       formats[0].format = VK_FORMAT_B8G8R8A8_UINT;
+                       formats[0].colorSpace = VK_COLORSPACE_SRGB_NONLINEAR_KHR;
+               }
+       }
+
        return VK_SUCCESS;
 }
 
@@ -212,5 +224,13 @@ vk_GetPhysicalDeviceSurfacePresentModesKHR(VkPhysicalDevice         pdev,
                                                                                   VkPresentModeKHR     *modes)
 {
        /* TODO: */
+
+       if (modes == NULL) {
+               *mode_count = 1;
+       } else {
+               if (*mode_count != 0)
+                       modes[0] = VK_PRESENT_MODE_FIFO_KHR;
+       }
+
        return VK_SUCCESS;
 }