winevulkan: Use blacklist also for instance extensions.

Allows us to treat extensions in a uniform way.

Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Józef Kucia 2019-03-19 15:59:32 +01:00 committed by Alexandre Julliard
parent 3e4189e3ad
commit 0d20471a76
3 changed files with 25 additions and 39 deletions

View File

@ -83,17 +83,20 @@ WINE_VULKAN_THUNKS_H = "vulkan_thunks.h"
EXT_BASE = 1000000000
EXT_BLOCK_SIZE = 1000
# In general instance extensions can't be automatically generated
# and need custom wrappers due to e.g. win32 / X11 specific code.
# List of supported instance extensions.
SUPPORTED_INSTANCE_EXTENSIONS = [
"VK_KHR_device_group_creation",
"VK_KHR_get_physical_device_properties2",
"VK_KHR_surface",
"VK_KHR_win32_surface",
]
BLACKLISTED_EXTENSIONS = [
# Instance extensions
"VK_EXT_debug_utils",
"VK_EXT_swapchain_colorspace",
"VK_EXT_validation_features",
"VK_EXT_validation_flags",
"VK_KHR_display",
"VK_KHR_external_fence_capabilities",
"VK_KHR_external_memory_capabilities",
"VK_KHR_get_surface_capabilities2",
"VK_KHR_surface_protected_capabilities",
"VK_NV_external_memory_capabilities",
# Device extensions
"VK_AMD_display_native_hdr",
"VK_AMD_memory_overallocation_behavior",
# Handling of VK_EXT_debug_report requires some consideration. The win32
@ -2401,6 +2404,11 @@ class VkRegistry(object):
version = tuple(map(int, version.group('major', 'minor')))
return version <= WINE_VK_VERSION
def _is_extension_supported(self, extension):
# We disable some extensions as either we haven't implemented
# support yet or because they are for platforms other than win32.
return extension not in BLACKLISTED_EXTENSIONS
def _mark_command_required(self, command):
""" Helper function to mark a certain command and the datatypes it needs as required."""
def mark_bitmask_dependencies(bitmask, types):
@ -2587,15 +2595,12 @@ class VkRegistry(object):
LOGGER.debug("Skipping experimental extension: {0}".format(ext_name))
continue
# Instance extensions often require a custom implementation, so filter.
ext_type = ext.attrib["type"]
if ext_type == "instance" and not ext_name in SUPPORTED_INSTANCE_EXTENSIONS:
LOGGER.debug("Skipping instance extension: {0}".format(ext_name))
continue
platform = ext.attrib.get("platform")
if platform and platform != "win32":
LOGGER.debug("Skipping extensions {0} for platform {1}".format(ext_name, platform))
continue;
# We disable some extensions as either we haven't implemented
# support yet or because they are for platforms other than win32.
if ext_name in BLACKLISTED_EXTENSIONS:
if not self._is_extension_supported(ext_name):
LOGGER.debug("Skipping blacklisted extension: {0}".format(ext_name))
continue
elif "requires" in ext.attrib:
@ -2626,7 +2631,7 @@ class VkRegistry(object):
continue
required_extension = require.attrib.get("extension")
if required_extension and required_extension in BLACKLISTED_EXTENSIONS:
if required_extension and not self._is_extension_supported(required_extension):
continue
# Pull in any commands we need. We infer types to pull in from the command
@ -2636,7 +2641,7 @@ class VkRegistry(object):
self._mark_command_required(cmd_name)
# Store a list with extensions.
ext_info = {"name" : ext_name, "type" : ext_type}
ext_info = {"name" : ext_name, "type" : ext.attrib["type"]}
extensions.append(ext_info)
# Sort in alphabetical order.

View File

@ -3678,7 +3678,6 @@ static const char * const vk_device_extensions[] =
"VK_NV_corner_sampled_image",
"VK_NV_dedicated_allocation",
"VK_NV_device_diagnostic_checkpoints",
"VK_NV_external_memory",
"VK_NV_fill_rectangle",
"VK_NV_fragment_coverage_to_color",
"VK_NV_fragment_shader_barycentric",

View File

@ -130,8 +130,6 @@
#define VK_KHR_MULTIVIEW_EXTENSION_NAME "VK_KHR_multiview"
#define VK_IMG_FORMAT_PVRTC_SPEC_VERSION 1
#define VK_IMG_FORMAT_PVRTC_EXTENSION_NAME "VK_IMG_format_pvrtc"
#define VK_NV_EXTERNAL_MEMORY_SPEC_VERSION 1
#define VK_NV_EXTERNAL_MEMORY_EXTENSION_NAME "VK_NV_external_memory"
#define VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_SPEC_VERSION 1
#define VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_EXTENSION_NAME "VK_KHR_get_physical_device_properties2"
#define VK_KHR_DEVICE_GROUP_SPEC_VERSION 3
@ -1900,8 +1898,6 @@ typedef enum VkStructureType
VK_STRUCTURE_TYPE_RENDER_PASS_MULTIVIEW_CREATE_INFO = 1000053000,
VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_FEATURES = 1000053001,
VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_PROPERTIES = 1000053002,
VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_IMAGE_CREATE_INFO_NV = 1000056000,
VK_STRUCTURE_TYPE_EXPORT_MEMORY_ALLOCATE_INFO_NV = 1000056001,
VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2 = 1000059000,
VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2 = 1000059001,
VK_STRUCTURE_TYPE_FORMAT_PROPERTIES_2 = 1000059002,
@ -2436,13 +2432,6 @@ typedef struct VkExportMemoryAllocateInfo
VkExternalMemoryHandleTypeFlags handleTypes;
} VkExportMemoryAllocateInfo;
typedef struct VkExportMemoryAllocateInfoNV
{
VkStructureType sType;
const void *pNext;
VkExternalMemoryHandleTypeFlagsNV handleTypes;
} VkExportMemoryAllocateInfoNV;
typedef struct VkExtensionProperties
{
char extensionName[VK_MAX_EXTENSION_NAME_SIZE];
@ -2470,13 +2459,6 @@ typedef struct VkExternalMemoryImageCreateInfo
VkExternalMemoryHandleTypeFlags handleTypes;
} VkExternalMemoryImageCreateInfo;
typedef struct VkExternalMemoryImageCreateInfoNV
{
VkStructureType sType;
const void *pNext;
VkExternalMemoryHandleTypeFlagsNV handleTypes;
} VkExternalMemoryImageCreateInfoNV;
typedef struct VkFilterCubicImageViewImageFormatPropertiesEXT
{
VkStructureType sType;