updated VKDeviceCreater.cpp
This commit is contained in:
parent
222ff2961f
commit
71fd42cfc8
2
CMCore
2
CMCore
@ -1 +1 @@
|
|||||||
Subproject commit 4d58256a3d5caec9258d0059996dbed5627ff02a
|
Subproject commit fbb3154e5b8ca0e3d0480ad121a704359f527966
|
@ -25,13 +25,15 @@ struct GPUDeviceAttribute
|
|||||||
uint32_t graphics_family =ERROR_FAMILY_INDEX;
|
uint32_t graphics_family =ERROR_FAMILY_INDEX;
|
||||||
uint32_t present_family =ERROR_FAMILY_INDEX;
|
uint32_t present_family =ERROR_FAMILY_INDEX;
|
||||||
uint32_t compute_family =ERROR_FAMILY_INDEX;
|
uint32_t compute_family =ERROR_FAMILY_INDEX;
|
||||||
|
uint32_t video_decode_family =ERROR_FAMILY_INDEX;
|
||||||
|
|
||||||
|
#ifdef VK_ENABLE_BETA_EXTENSIONS
|
||||||
|
uint32_t video_encode_family =ERROR_FAMILY_INDEX;
|
||||||
|
#endif//VK_ENABLE_BETA_EXTENSIONS
|
||||||
|
|
||||||
VkQueue graphics_queue =VK_NULL_HANDLE;
|
VkQueue graphics_queue =VK_NULL_HANDLE;
|
||||||
VkQueue present_queue =VK_NULL_HANDLE;
|
VkQueue present_queue =VK_NULL_HANDLE;
|
||||||
|
|
||||||
List<VkQueueFamilyProperties> family_properties;
|
|
||||||
List<VkBool32> supports_present;
|
|
||||||
|
|
||||||
VkSurfaceFormatKHR surface_format;
|
VkSurfaceFormatKHR surface_format;
|
||||||
List<VkPresentModeKHR> present_modes;
|
List<VkPresentModeKHR> present_modes;
|
||||||
|
|
||||||
|
@ -101,14 +101,21 @@ void GPUDeviceAttribute::GetQueueFamily()
|
|||||||
{
|
{
|
||||||
VkPhysicalDevice pdevice = *physical_device;
|
VkPhysicalDevice pdevice = *physical_device;
|
||||||
|
|
||||||
|
AutoDeleteArray<VkQueueFamilyProperties> family_properties;
|
||||||
|
AutoDeleteArray<VkBool32> supports_present;
|
||||||
|
|
||||||
uint32_t family_count;
|
uint32_t family_count;
|
||||||
|
|
||||||
vkGetPhysicalDeviceQueueFamilyProperties(pdevice, &family_count, nullptr);
|
vkGetPhysicalDeviceQueueFamilyProperties(pdevice, &family_count, nullptr);
|
||||||
family_properties.SetCount(family_count);
|
|
||||||
vkGetPhysicalDeviceQueueFamilyProperties(pdevice, &family_count, family_properties.GetData());
|
family_properties.alloc(family_count);
|
||||||
|
supports_present.alloc(family_count);
|
||||||
|
|
||||||
|
vkGetPhysicalDeviceQueueFamilyProperties(pdevice, &family_count, family_properties);
|
||||||
|
|
||||||
{
|
{
|
||||||
supports_present.SetCount(family_count);
|
VkBool32 *sp = supports_present;
|
||||||
VkBool32 *sp = supports_present.GetData();
|
|
||||||
for (uint32_t i = 0; i < family_count; i++)
|
for (uint32_t i = 0; i < family_count; i++)
|
||||||
{
|
{
|
||||||
vkGetPhysicalDeviceSurfaceSupportKHR(pdevice, i, surface, sp);
|
vkGetPhysicalDeviceSurfaceSupportKHR(pdevice, i, surface, sp);
|
||||||
@ -117,10 +124,25 @@ void GPUDeviceAttribute::GetQueueFamily()
|
|||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
VkQueueFamilyProperties *fp = family_properties.GetData();
|
VkQueueFamilyProperties *fp = family_properties;
|
||||||
VkBool32 *sp = supports_present.GetData();
|
VkBool32 *sp = supports_present;
|
||||||
|
|
||||||
for (uint32_t i = 0; i < family_count; i++)
|
for (uint32_t i = 0; i < family_count; i++)
|
||||||
{
|
{
|
||||||
|
if(fp->queueFlags & VK_QUEUE_VIDEO_DECODE_BIT_KHR)
|
||||||
|
{
|
||||||
|
if (video_decode_family == ERROR_FAMILY_INDEX)
|
||||||
|
video_decode_family = i;
|
||||||
|
}
|
||||||
|
|
||||||
|
#ifdef VK_ENABLE_BETA_EXTENSIONS
|
||||||
|
if(fp->queueFlags & VK_QUEUE_VIDEO_ENCODE_BIT_KHR)
|
||||||
|
{
|
||||||
|
if (video_encode_family == ERROR_FAMILY_INDEX)
|
||||||
|
video_encode_family = i;
|
||||||
|
}
|
||||||
|
#endif//VK_ENABLE_BETA_EXTENSIONS
|
||||||
|
|
||||||
if(fp->queueFlags & VK_QUEUE_COMPUTE_BIT)
|
if(fp->queueFlags & VK_QUEUE_COMPUTE_BIT)
|
||||||
{
|
{
|
||||||
if(compute_family==ERROR_FAMILY_INDEX)
|
if(compute_family==ERROR_FAMILY_INDEX)
|
||||||
@ -136,7 +158,6 @@ void GPUDeviceAttribute::GetQueueFamily()
|
|||||||
{
|
{
|
||||||
graphics_family = i;
|
graphics_family = i;
|
||||||
present_family = i;
|
present_family = i;
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -147,7 +168,8 @@ void GPUDeviceAttribute::GetQueueFamily()
|
|||||||
|
|
||||||
if (present_family == ERROR_FAMILY_INDEX)
|
if (present_family == ERROR_FAMILY_INDEX)
|
||||||
{
|
{
|
||||||
VkBool32 *sp = supports_present.GetData();
|
VkBool32 *sp = supports_present;
|
||||||
|
|
||||||
for (uint32_t i = 0; i < family_count; i++)
|
for (uint32_t i = 0; i < family_count; i++)
|
||||||
{
|
{
|
||||||
if (*sp)
|
if (*sp)
|
||||||
|
@ -68,6 +68,8 @@ namespace
|
|||||||
VK_KHR_DYNAMIC_RENDERING_EXTENSION_NAME,
|
VK_KHR_DYNAMIC_RENDERING_EXTENSION_NAME,
|
||||||
|
|
||||||
// VK_EXT_SAMPLER_FILTER_MINMAX_EXTENSION_NAME,
|
// VK_EXT_SAMPLER_FILTER_MINMAX_EXTENSION_NAME,
|
||||||
|
|
||||||
|
VK_KHR_SPIRV_1_4_EXTENSION_NAME,
|
||||||
};
|
};
|
||||||
|
|
||||||
for(const char *ext_name:require_ext_list)
|
for(const char *ext_name:require_ext_list)
|
||||||
@ -100,6 +102,10 @@ namespace
|
|||||||
if(require.wide_lines) FEATURE_COPY(wideLines)
|
if(require.wide_lines) FEATURE_COPY(wideLines)
|
||||||
if(require.large_points) FEATURE_COPY(largePoints)
|
if(require.large_points) FEATURE_COPY(largePoints)
|
||||||
|
|
||||||
|
if(require.texture_compression.bc)FEATURE_COPY(textureCompressionBC);
|
||||||
|
if(require.texture_compression.etc2)FEATURE_COPY(textureCompressionETC2);
|
||||||
|
if(require.texture_compression.astc_ldr)FEATURE_COPY(textureCompressionASTC_LDR);
|
||||||
|
|
||||||
#undef FEATURE_COPY
|
#undef FEATURE_COPY
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user