added compute_family value in VKDeviceAttribute

This commit is contained in:
HuYingzhuo(hugo/hyzboy) 2022-08-18 19:00:33 +08:00
parent 0a9d2af2d2
commit 8a66578813
2 changed files with 7 additions and 0 deletions

View File

@ -23,6 +23,7 @@ struct GPUDeviceAttribute
uint32_t graphics_family =ERROR_FAMILY_INDEX;
uint32_t present_family =ERROR_FAMILY_INDEX;
uint32_t compute_family =ERROR_FAMILY_INDEX;
VkQueue graphics_queue =VK_NULL_HANDLE;
VkQueue present_queue =VK_NULL_HANDLE;

View File

@ -158,6 +158,12 @@ void GPUDeviceAttribute::GetQueueFamily()
VkBool32 *sp = supports_present.GetData();
for (uint32_t i = 0; i < family_count; i++)
{
if(fp->queueFlags & VK_QUEUE_COMPUTE_BIT)
{
if(compute_family==ERROR_FAMILY_INDEX)
compute_family=i;
}
if (fp->queueFlags & VK_QUEUE_GRAPHICS_BIT)
{
if (graphics_family == ERROR_FAMILY_INDEX)