mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-12-18 00:22:11 +00:00
- pick the first device that supports our required features
This commit is contained in:
parent
aa1ff58353
commit
389469c604
2 changed files with 13 additions and 1 deletions
|
@ -272,6 +272,16 @@ void VulkanDevice::createSurface()
|
|||
}
|
||||
}
|
||||
|
||||
bool VulkanDevice::checkFeatures(const VkPhysicalDeviceFeatures &f)
|
||||
{
|
||||
return
|
||||
f.samplerAnisotropy == VK_TRUE &&
|
||||
f.shaderClipDistance == VK_TRUE &&
|
||||
f.fragmentStoresAndAtomics == VK_TRUE &&
|
||||
f.depthClamp == VK_TRUE &&
|
||||
f.shaderClipDistance == VK_TRUE;
|
||||
}
|
||||
|
||||
void VulkanDevice::selectPhysicalDevice()
|
||||
{
|
||||
VkResult result;
|
||||
|
@ -293,7 +303,7 @@ void VulkanDevice::selectPhysicalDevice()
|
|||
vkGetPhysicalDeviceProperties(device, &deviceProperties);
|
||||
vkGetPhysicalDeviceFeatures(device, &deviceFeatures);
|
||||
|
||||
bool isUsableDevice = deviceProperties.deviceType == VK_PHYSICAL_DEVICE_TYPE_DISCRETE_GPU && deviceFeatures.geometryShader && deviceFeatures.samplerAnisotropy;
|
||||
bool isUsableDevice = /*deviceProperties.deviceType == VK_PHYSICAL_DEVICE_TYPE_DISCRETE_GPU &&*/ checkFeatures(deviceFeatures);
|
||||
if (!isUsableDevice)
|
||||
continue;
|
||||
|
||||
|
|
|
@ -61,6 +61,8 @@ private:
|
|||
void createSemaphores();
|
||||
void releaseResources();
|
||||
|
||||
static bool checkFeatures(const VkPhysicalDeviceFeatures &f);
|
||||
|
||||
VkDebugUtilsMessengerEXT debugMessenger = VK_NULL_HANDLE;
|
||||
static VKAPI_ATTR VkBool32 VKAPI_CALL debugCallback(VkDebugUtilsMessageSeverityFlagBitsEXT messageSeverity, VkDebugUtilsMessageTypeFlagsEXT messageType, const VkDebugUtilsMessengerCallbackDataEXT* pCallbackData, void* pUserData);
|
||||
|
||||
|
|
Loading…
Reference in a new issue