mirror of
https://github.com/azahar-emu/azahar.git
synced 2026-06-05 18:23:39 -04:00
libretro: better safety on vkDevice feature checks
This commit is contained in:
parent
8fac24d2a4
commit
27c3e0e5c3
1 changed files with 18 additions and 5 deletions
|
|
@ -115,11 +115,24 @@ bool CreateVulkanDevice(struct retro_vulkan_context* context, VkInstance instanc
|
|||
}
|
||||
}
|
||||
|
||||
// Request features we need (these will be OR'd with frontend requirements)
|
||||
// The Instance class will validate these against actual device capabilities
|
||||
merged_features.geometryShader = VK_TRUE; // Used for certain rendering effects
|
||||
merged_features.logicOp = VK_TRUE; // Used for blending modes
|
||||
merged_features.samplerAnisotropy = VK_TRUE; // Used for texture filtering
|
||||
// Query actual device features so we only request what's supported
|
||||
PFN_vkGetPhysicalDeviceFeatures vkGetPhysicalDeviceFeatures =
|
||||
(PFN_vkGetPhysicalDeviceFeatures)get_instance_proc_addr(instance,
|
||||
"vkGetPhysicalDeviceFeatures");
|
||||
VkPhysicalDeviceFeatures device_features{};
|
||||
vkGetPhysicalDeviceFeatures(gpu, &device_features);
|
||||
|
||||
// Request features we want, gated by actual device support
|
||||
if (device_features.geometryShader)
|
||||
merged_features.geometryShader = VK_TRUE;
|
||||
if (device_features.logicOp)
|
||||
merged_features.logicOp = VK_TRUE;
|
||||
if (device_features.samplerAnisotropy)
|
||||
merged_features.samplerAnisotropy = VK_TRUE;
|
||||
if (device_features.fragmentStoresAndAtomics)
|
||||
merged_features.fragmentStoresAndAtomics = VK_TRUE;
|
||||
if (device_features.shaderClipDistance)
|
||||
merged_features.shaderClipDistance = VK_TRUE;
|
||||
|
||||
// Find queue family with graphics support
|
||||
PFN_vkGetPhysicalDeviceQueueFamilyProperties vkGetPhysicalDeviceQueueFamilyProperties =
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue