Add checking for compute in main queue
This commit is contained in:
parent
c96881208a
commit
211c901335
@ -25,6 +25,7 @@ bool g_supports_partially_bound = false;
|
|||||||
uint32_t g_max_sampler_supported = 0;
|
uint32_t g_max_sampler_supported = 0;
|
||||||
bool g_supports_multi_draw_indirect = false;
|
bool g_supports_multi_draw_indirect = false;
|
||||||
bool g_supports_base_vertex_rendering = true;
|
bool g_supports_base_vertex_rendering = true;
|
||||||
|
bool g_supports_compute_in_main_queue = false;
|
||||||
} // GEVulkanFeatures
|
} // GEVulkanFeatures
|
||||||
|
|
||||||
// ============================================================================
|
// ============================================================================
|
||||||
@ -78,6 +79,23 @@ void GEVulkanFeatures::init(GEVulkanDriver* vk)
|
|||||||
g_supports_descriptor_indexing = true;
|
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<VkQueueFamilyProperties> 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 = {};
|
VkPhysicalDeviceFeatures2 supported_features = {};
|
||||||
supported_features.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2;
|
supported_features.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2;
|
||||||
VkPhysicalDeviceDescriptorIndexingFeatures descriptor_indexing_features = {};
|
VkPhysicalDeviceDescriptorIndexingFeatures descriptor_indexing_features = {};
|
||||||
@ -161,6 +179,9 @@ void GEVulkanFeatures::printStats()
|
|||||||
os::Printer::log(
|
os::Printer::log(
|
||||||
"Vulkan supports base vertex rendering",
|
"Vulkan supports base vertex rendering",
|
||||||
g_supports_base_vertex_rendering ? "true" : "false");
|
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(
|
os::Printer::log(
|
||||||
"Vulkan descriptor indexes can be dynamically non-uniform",
|
"Vulkan descriptor indexes can be dynamically non-uniform",
|
||||||
g_supports_non_uniform_indexing ? "true" : "false");
|
g_supports_non_uniform_indexing ? "true" : "false");
|
||||||
@ -226,12 +247,18 @@ bool GEVulkanFeatures::supportsBindMeshTexturesAtOnce()
|
|||||||
bool GEVulkanFeatures::supportsMultiDrawIndirect()
|
bool GEVulkanFeatures::supportsMultiDrawIndirect()
|
||||||
{
|
{
|
||||||
return g_supports_multi_draw_indirect;
|
return g_supports_multi_draw_indirect;
|
||||||
} // supportsBindMeshTexturesAtOnce
|
} // supportsMultiDrawIndirect
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
bool GEVulkanFeatures::supportsBaseVertexRendering()
|
bool GEVulkanFeatures::supportsBaseVertexRendering()
|
||||||
{
|
{
|
||||||
return g_supports_base_vertex_rendering;
|
return g_supports_base_vertex_rendering;
|
||||||
} // supportsBindMeshTexturesAtOnce
|
} // supportsBaseVertexRendering
|
||||||
|
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
bool GEVulkanFeatures::supportsComputeInMainQueue()
|
||||||
|
{
|
||||||
|
return g_supports_compute_in_main_queue;
|
||||||
|
} // supportsComputeInMainQueue
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -32,6 +32,8 @@ bool supportsBindMeshTexturesAtOnce();
|
|||||||
bool supportsMultiDrawIndirect();
|
bool supportsMultiDrawIndirect();
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
bool supportsBaseVertexRendering();
|
bool supportsBaseVertexRendering();
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
bool supportsComputeInMainQueue();
|
||||||
}; // GEVulkanFeatures
|
}; // GEVulkanFeatures
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user