mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2025-12-15 08:03:30 -08:00
tests/shader_runner: Introduce a new tag system.
Mostly to be able to associate a version number to each tag and get rid of all the foo<1.2.3 tags. The new system also has fixed tag slots, rather than dealing with strings, so we don't have to manually adjust the size of the `tags' array. With the new system each tag can be present or not, and if it is present it can have an associated version number (of the form major.minor.patch). If the version is not available, it is set to 0.0.0. Each tag can be queried for existence and for comparison with the version number.
This commit is contained in:
committed by
Henri Verbeet
parent
41515b7047
commit
cd64aa69c8
Notes:
Henri Verbeet
2025-10-06 19:48:45 +02:00
Approved-by: Henri Verbeet (@hverbeet) Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/1768
@@ -491,7 +491,12 @@ static inline bool is_mesa_device(ID3D12Device *device)
|
||||
return false;
|
||||
}
|
||||
|
||||
static inline bool is_mesa_device_lt(ID3D12Device *device, uint32_t major, uint32_t minor, uint32_t patch)
|
||||
static inline bool get_mesa_device_version(ID3D12Device *device, uint32_t *major, uint32_t *minor, uint32_t *patch)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
static inline bool get_llvm_device_version(ID3D12Device *device, uint32_t *major, uint32_t *minor, uint32_t *patch)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -501,12 +506,6 @@ static inline bool is_llvmpipe_device(ID3D12Device *device)
|
||||
return false;
|
||||
}
|
||||
|
||||
static inline bool is_llvmpipe_device_gte(ID3D12Device *device,
|
||||
uint32_t major, uint32_t minor, uint32_t patch)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
static inline bool is_nvidia_device(ID3D12Device *device)
|
||||
{
|
||||
return false;
|
||||
@@ -538,12 +537,12 @@ static inline bool is_mvk_paravirtualized_device(ID3D12Device *device)
|
||||
return false;
|
||||
}
|
||||
|
||||
static inline bool is_mvk_device_lt(ID3D12Device *device, uint32_t major, uint32_t minor, uint32_t patch)
|
||||
static inline bool get_mvk_device_version(ID3D12Device *device, uint32_t *major, uint32_t *minor, uint32_t *patch)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
static inline bool is_mesa_device_with_llvm_ge(ID3D12Device *device, uint32_t major, uint32_t minor, uint32_t patch)
|
||||
static inline bool is_mvk_device_lt(ID3D12Device *device, uint32_t major, uint32_t minor, uint32_t patch)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -796,18 +795,24 @@ static inline bool is_mesa_device(ID3D12Device *device)
|
||||
return is_mesa_vulkan_driver(&properties);
|
||||
}
|
||||
|
||||
static inline bool is_mesa_device_lt(ID3D12Device *device, uint32_t major, uint32_t minor, uint32_t patch)
|
||||
static inline bool get_mesa_device_version(ID3D12Device *device, uint32_t *major, uint32_t *minor, uint32_t *patch)
|
||||
{
|
||||
VkPhysicalDeviceDriverPropertiesKHR driver_properties;
|
||||
uint32_t driver_major, driver_minor, driver_patch;
|
||||
VkPhysicalDeviceDriverPropertiesKHR properties;
|
||||
VkPhysicalDeviceProperties device_properties;
|
||||
|
||||
get_driver_properties(device, &device_properties, &driver_properties);
|
||||
get_driver_properties(device, &device_properties, &properties);
|
||||
|
||||
if (!get_mesa_driver_version(&device_properties, &driver_properties, &driver_major, &driver_minor, &driver_patch))
|
||||
return false;
|
||||
return get_mesa_driver_version(&device_properties, &properties, major, minor, patch);
|
||||
}
|
||||
|
||||
return compare_versions(driver_major, driver_minor, driver_patch, major, minor, patch) < 0;
|
||||
static inline bool get_llvm_device_version(ID3D12Device *device, uint32_t *major, uint32_t *minor, uint32_t *patch)
|
||||
{
|
||||
VkPhysicalDeviceDriverPropertiesKHR properties;
|
||||
VkPhysicalDeviceProperties device_properties;
|
||||
|
||||
get_driver_properties(device, &device_properties, &properties);
|
||||
|
||||
return get_llvm_driver_version(&device_properties, major, minor, patch);
|
||||
}
|
||||
|
||||
static inline bool is_llvmpipe_device(ID3D12Device *device)
|
||||
@@ -818,17 +823,6 @@ static inline bool is_llvmpipe_device(ID3D12Device *device)
|
||||
return properties.driverID == VK_DRIVER_ID_MESA_LLVMPIPE;
|
||||
}
|
||||
|
||||
static inline bool is_llvmpipe_device_gte(ID3D12Device *device,
|
||||
uint32_t major, uint32_t minor, uint32_t patch)
|
||||
{
|
||||
VkPhysicalDeviceDriverPropertiesKHR driver_properties;
|
||||
VkPhysicalDeviceProperties device_properties;
|
||||
|
||||
get_driver_properties(device, &device_properties, &driver_properties);
|
||||
return driver_properties.driverID == VK_DRIVER_ID_MESA_LLVMPIPE
|
||||
&& is_vulkan_driver_version_ge(&device_properties, &driver_properties, major, minor, patch);
|
||||
}
|
||||
|
||||
static inline bool is_nvidia_device(ID3D12Device *device)
|
||||
{
|
||||
VkPhysicalDeviceDriverPropertiesKHR properties;
|
||||
@@ -886,33 +880,24 @@ static inline bool is_mvk_paravirtualized_device(ID3D12Device *device)
|
||||
&& strcmp(device_properties.deviceName, "Apple Paravirtual device") == 0;
|
||||
}
|
||||
|
||||
static inline bool is_mvk_device_lt(ID3D12Device *device, uint32_t major, uint32_t minor, uint32_t patch)
|
||||
static inline bool get_mvk_device_version(ID3D12Device *device, uint32_t *major, uint32_t *minor, uint32_t *patch)
|
||||
{
|
||||
VkPhysicalDeviceDriverPropertiesKHR driver_properties;
|
||||
uint32_t driver_major, driver_minor, driver_patch;
|
||||
VkPhysicalDeviceDriverPropertiesKHR properties;
|
||||
VkPhysicalDeviceProperties device_properties;
|
||||
|
||||
get_driver_properties(device, &device_properties, &driver_properties);
|
||||
get_driver_properties(device, &device_properties, &properties);
|
||||
|
||||
if (!get_mvk_driver_version(&device_properties, &driver_properties, &driver_major, &driver_minor, &driver_patch))
|
||||
return false;
|
||||
|
||||
return compare_versions(driver_major, driver_minor, driver_patch, major, minor, patch) < 0;
|
||||
return get_mvk_driver_version(&device_properties, &properties, major, minor, patch);
|
||||
}
|
||||
|
||||
static inline bool is_mesa_device_with_llvm_ge(ID3D12Device *device, uint32_t major, uint32_t minor, uint32_t patch)
|
||||
static inline bool is_mvk_device_lt(ID3D12Device *device, uint32_t major, uint32_t minor, uint32_t patch)
|
||||
{
|
||||
VkPhysicalDeviceDriverPropertiesKHR driver_properties;
|
||||
VkPhysicalDeviceProperties device_properties;
|
||||
uint32_t llvm_major, llvm_minor, llvm_patch;
|
||||
uint32_t device_major, device_minor, device_patch;
|
||||
|
||||
get_driver_properties(device, &device_properties, &driver_properties);
|
||||
|
||||
if (!get_llvm_driver_version(&device_properties, &llvm_major, &llvm_minor, &llvm_patch))
|
||||
if (!get_mvk_device_version(device, &device_major, &device_minor, &device_patch))
|
||||
return false;
|
||||
|
||||
return is_mesa_vulkan_driver(&driver_properties)
|
||||
&& compare_versions(llvm_major, llvm_minor, llvm_patch, major, minor, patch) >= 0;
|
||||
return compare_versions(device_major, device_minor, device_patch, major, minor, patch) < 0;
|
||||
}
|
||||
|
||||
#ifdef __APPLE__
|
||||
|
||||
Reference in New Issue
Block a user