From e263bb945e9fbfc901683c4d45a53ae3d611fb56 Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Mon, 10 Oct 2016 22:06:40 -0700 Subject: [PATCH 1/2] Vulkan: Correct initial swapchain compositeAlpha. We'll just need to deal with the fact that we have to output 1.0 so that blending doesn't matter, I think. --- Common/Vulkan/VulkanContext.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Common/Vulkan/VulkanContext.cpp b/Common/Vulkan/VulkanContext.cpp index 9118297bb8..bbbafa8897 100644 --- a/Common/Vulkan/VulkanContext.cpp +++ b/Common/Vulkan/VulkanContext.cpp @@ -1030,7 +1030,13 @@ void VulkanContext::InitSwapchain(VkCommandBuffer cmd) { swap_chain_info.imageSharingMode = VK_SHARING_MODE_EXCLUSIVE; swap_chain_info.queueFamilyIndexCount = 0; swap_chain_info.pQueueFamilyIndices = NULL; - swap_chain_info.compositeAlpha = VK_COMPOSITE_ALPHA_OPAQUE_BIT_KHR; + // OPAQUE is not supported everywhere. + if (surfCapabilities.supportedCompositeAlpha & VK_COMPOSITE_ALPHA_OPAQUE_BIT_KHR) { + swap_chain_info.compositeAlpha = VK_COMPOSITE_ALPHA_OPAQUE_BIT_KHR; + } else { + // This should be supported anywhere, and is the only thing supported on the SHIELD TV, for example. + swap_chain_info.compositeAlpha = VK_COMPOSITE_ALPHA_INHERIT_BIT_KHR; + } res = vkCreateSwapchainKHR(device_, &swap_chain_info, NULL, &swap_chain_); assert(res == VK_SUCCESS); From 1d9222b3e4aeeb818522ea7b4c9879176a39579c Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Mon, 10 Oct 2016 22:08:44 -0700 Subject: [PATCH 2/2] Vulkan: Add comment for Android validation layers. Note: these also require minor tweaks to Local.mk to include, currently, but we're probably moving to gradle. --- Common/Vulkan/VulkanContext.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Common/Vulkan/VulkanContext.cpp b/Common/Vulkan/VulkanContext.cpp index bbbafa8897..d07cc7f6b1 100644 --- a/Common/Vulkan/VulkanContext.cpp +++ b/Common/Vulkan/VulkanContext.cpp @@ -37,6 +37,16 @@ static const char *validationLayers[] = { "VK_LAYER_LUNARG_object_tracker", "VK_LAYER_LUNARG_param_checker", */ + /* + // For layers included in the Android NDK. + "VK_LAYER_GOOGLE_threading", + "VK_LAYER_LUNARG_parameter_validation", + "VK_LAYER_LUNARG_core_validation", + "VK_LAYER_LUNARG_image", + "VK_LAYER_LUNARG_object_tracker", + "VK_LAYER_LUNARG_swapchain", + "VK_LAYER_GOOGLE_unique_objects", + */ }; static VkBool32 CheckLayers(const std::vector &layer_props, const std::vector &layer_names);