Change deafult composite alpha for Android

Android typically only supports the INHERIT bit. Easiest way to accomodate this
is to #ifdef ANDROID to use the INHERIT bit.
This commit is contained in:
Charles Giessen 2022-10-10 09:41:22 -06:00 committed by Charles Giessen
parent 01de71738c
commit 706ffb6355

View File

@ -359,11 +359,12 @@ class InstanceBuilder {
// Prefer a vulkan instance API version. If the desired version isn't available, it will use the // Prefer a vulkan instance API version. If the desired version isn't available, it will use the
// highest version available. Should be constructed with VK_MAKE_VERSION or VK_MAKE_API_VERSION. // highest version available. Should be constructed with VK_MAKE_VERSION or VK_MAKE_API_VERSION.
[[deprecated("Use require_api_version + set_minimum_instance_version instead.")]] [[deprecated("Use require_api_version + set_minimum_instance_version instead.")]] InstanceBuilder&
InstanceBuilder& desire_api_version(uint32_t preferred_vulkan_version); desire_api_version(uint32_t preferred_vulkan_version);
// Prefer a vulkan instance API version. If the desired version isn't available, it will use the highest version available. // Prefer a vulkan instance API version. If the desired version isn't available, it will use the highest version available.
[[deprecated("Use require_api_version + set_minimum_instance_version instead.")]] [[deprecated("Use require_api_version + set_minimum_instance_version instead.")]] InstanceBuilder&
InstanceBuilder& desire_api_version(uint32_t major, uint32_t minor, uint32_t patch = 0); desire_api_version(uint32_t major, uint32_t minor, uint32_t patch = 0);
// Adds a layer to be enabled. Will fail to create an instance if the layer isn't available. // Adds a layer to be enabled. Will fail to create an instance if the layer isn't available.
InstanceBuilder& enable_layer(const char* layer_name); InstanceBuilder& enable_layer(const char* layer_name);
@ -581,8 +582,9 @@ class PhysicalDeviceSelector {
PhysicalDeviceSelector& add_desired_extensions(std::vector<const char*> extensions); PhysicalDeviceSelector& add_desired_extensions(std::vector<const char*> extensions);
// Prefer a physical device that supports a (major, minor) version of vulkan. // Prefer a physical device that supports a (major, minor) version of vulkan.
[[deprecated("Use set_minimum_version + InstanceBuilder::require_api_version.")]] [[deprecated("Use set_minimum_version + InstanceBuilder::require_api_version.")]] PhysicalDeviceSelector&
PhysicalDeviceSelector& set_desired_version(uint32_t major, uint32_t minor); set_desired_version(uint32_t major, uint32_t minor);
// Require a physical device that supports a (major, minor) version of vulkan. // Require a physical device that supports a (major, minor) version of vulkan.
PhysicalDeviceSelector& set_minimum_version(uint32_t major, uint32_t minor); PhysicalDeviceSelector& set_minimum_version(uint32_t major, uint32_t minor);
@ -924,7 +926,11 @@ class SwapchainBuilder {
uint32_t graphics_queue_index = 0; uint32_t graphics_queue_index = 0;
uint32_t present_queue_index = 0; uint32_t present_queue_index = 0;
VkSurfaceTransformFlagBitsKHR pre_transform = static_cast<VkSurfaceTransformFlagBitsKHR>(0); VkSurfaceTransformFlagBitsKHR pre_transform = static_cast<VkSurfaceTransformFlagBitsKHR>(0);
#if defined(__ANDROID__)
VkCompositeAlphaFlagBitsKHR composite_alpha = VK_COMPOSITE_ALPHA_INHERIT_BIT_KHR;
#else
VkCompositeAlphaFlagBitsKHR composite_alpha = VK_COMPOSITE_ALPHA_OPAQUE_BIT_KHR; VkCompositeAlphaFlagBitsKHR composite_alpha = VK_COMPOSITE_ALPHA_OPAQUE_BIT_KHR;
#endif
std::vector<VkPresentModeKHR> desired_present_modes; std::vector<VkPresentModeKHR> desired_present_modes;
bool clipped = true; bool clipped = true;
VkSwapchainKHR old_swapchain = VK_NULL_HANDLE; VkSwapchainKHR old_swapchain = VK_NULL_HANDLE;