diff --git a/lib/graphics_engine/src/ge_vulkan_features.cpp b/lib/graphics_engine/src/ge_vulkan_features.cpp index 5566dc4b7..2895d70d4 100644 --- a/lib/graphics_engine/src/ge_vulkan_features.cpp +++ b/lib/graphics_engine/src/ge_vulkan_features.cpp @@ -25,6 +25,7 @@ bool g_supports_partially_bound = false; uint32_t g_max_sampler_supported = 0; bool g_supports_multi_draw_indirect = false; bool g_supports_base_vertex_rendering = true; +bool g_supports_compute_in_main_queue = false; } // GEVulkanFeatures // ============================================================================ @@ -78,6 +79,23 @@ void GEVulkanFeatures::init(GEVulkanDriver* vk) g_supports_descriptor_indexing = true; } + uint32_t queue_family_count = 0; + vkGetPhysicalDeviceQueueFamilyProperties(vk->getPhysicalDevice(), + &queue_family_count, NULL); + if (queue_family_count != 0) + { + std::vector queue_families(queue_family_count); + vkGetPhysicalDeviceQueueFamilyProperties(vk->getPhysicalDevice(), + &queue_family_count, &queue_families[0]); + uint32_t main_family = vk->getGraphicsFamily(); + if (main_family < queue_families.size()) + { + g_supports_compute_in_main_queue = + (queue_families[main_family].queueFlags & VK_QUEUE_COMPUTE_BIT) + != 0; + } + } + VkPhysicalDeviceFeatures2 supported_features = {}; supported_features.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2; VkPhysicalDeviceDescriptorIndexingFeatures descriptor_indexing_features = {}; @@ -161,6 +179,9 @@ void GEVulkanFeatures::printStats() os::Printer::log( "Vulkan supports base vertex rendering", g_supports_base_vertex_rendering ? "true" : "false"); + os::Printer::log( + "Vulkan supports compute in main queue", + g_supports_compute_in_main_queue ? "true" : "false"); os::Printer::log( "Vulkan descriptor indexes can be dynamically non-uniform", g_supports_non_uniform_indexing ? "true" : "false"); @@ -226,12 +247,18 @@ bool GEVulkanFeatures::supportsBindMeshTexturesAtOnce() bool GEVulkanFeatures::supportsMultiDrawIndirect() { return g_supports_multi_draw_indirect; -} // supportsBindMeshTexturesAtOnce +} // supportsMultiDrawIndirect // ---------------------------------------------------------------------------- bool GEVulkanFeatures::supportsBaseVertexRendering() { return g_supports_base_vertex_rendering; -} // supportsBindMeshTexturesAtOnce +} // supportsBaseVertexRendering + +// ---------------------------------------------------------------------------- +bool GEVulkanFeatures::supportsComputeInMainQueue() +{ + return g_supports_compute_in_main_queue; +} // supportsComputeInMainQueue } diff --git a/lib/graphics_engine/src/ge_vulkan_features.hpp b/lib/graphics_engine/src/ge_vulkan_features.hpp index 1b3706452..de948e3d4 100644 --- a/lib/graphics_engine/src/ge_vulkan_features.hpp +++ b/lib/graphics_engine/src/ge_vulkan_features.hpp @@ -32,6 +32,8 @@ bool supportsBindMeshTexturesAtOnce(); bool supportsMultiDrawIndirect(); // ---------------------------------------------------------------------------- bool supportsBaseVertexRendering(); +// ---------------------------------------------------------------------------- +bool supportsComputeInMainQueue(); }; // GEVulkanFeatures }