diff options
author | bruvzg <7645683+bruvzg@users.noreply.github.com> | 2024-05-03 11:48:46 +0300 |
---|---|---|
committer | bruvzg <7645683+bruvzg@users.noreply.github.com> | 2024-05-23 15:23:18 +0300 |
commit | 628c81d2d9a2cf05541a8d95dd99f6349aca851d (patch) | |
tree | f0063c0a9125e9a6a9562e572429e38efbbb2372 /drivers/vulkan | |
parent | b947c53ddc08d4314b2ce70ca1bc2adb37b83c37 (diff) | |
download | redot-engine-628c81d2d9a2cf05541a8d95dd99f6349aca851d.tar.gz |
[DisplayServer] Add method to check if window transparency is supported and enabled.
Diffstat (limited to 'drivers/vulkan')
-rw-r--r-- | drivers/vulkan/rendering_device_driver_vulkan.cpp | 8 | ||||
-rw-r--r-- | drivers/vulkan/rendering_device_driver_vulkan.h | 3 |
2 files changed, 11 insertions, 0 deletions
diff --git a/drivers/vulkan/rendering_device_driver_vulkan.cpp b/drivers/vulkan/rendering_device_driver_vulkan.cpp index 896fc6ff91..b03a8418ed 100644 --- a/drivers/vulkan/rendering_device_driver_vulkan.cpp +++ b/drivers/vulkan/rendering_device_driver_vulkan.cpp @@ -2646,6 +2646,7 @@ Error RenderingDeviceDriverVulkan::swap_chain_resize(CommandQueueID p_cmd_queue, break; } } + has_comp_alpha[(uint64_t)p_cmd_queue.id] = (composite_alpha != VK_COMPOSITE_ALPHA_OPAQUE_BIT_KHR); } VkSwapchainCreateInfoKHR swap_create_info = {}; @@ -4945,6 +4946,13 @@ const RDD::Capabilities &RenderingDeviceDriverVulkan::get_capabilities() const { return device_capabilities; } +bool RenderingDeviceDriverVulkan::is_composite_alpha_supported(CommandQueueID p_queue) const { + if (has_comp_alpha.has((uint64_t)p_queue.id)) { + return has_comp_alpha[(uint64_t)p_queue.id]; + } + return false; +} + /******************/ RenderingDeviceDriverVulkan::RenderingDeviceDriverVulkan(RenderingContextDriverVulkan *p_context_driver) { diff --git a/drivers/vulkan/rendering_device_driver_vulkan.h b/drivers/vulkan/rendering_device_driver_vulkan.h index e70019962a..b9e7563069 100644 --- a/drivers/vulkan/rendering_device_driver_vulkan.h +++ b/drivers/vulkan/rendering_device_driver_vulkan.h @@ -494,6 +494,7 @@ private: static int caching_instance_count; PipelineCache pipelines_cache; String pipeline_cache_id; + HashMap<uint64_t, bool> has_comp_alpha; public: virtual void pipeline_free(PipelineID p_pipeline) override final; @@ -627,6 +628,8 @@ public: virtual String get_pipeline_cache_uuid() const override final; virtual const Capabilities &get_capabilities() const override final; + virtual bool is_composite_alpha_supported(CommandQueueID p_queue) const override final; + private: /*********************/ /**** BOOKKEEPING ****/ |