mirror of
https://github.com/doitsujin/dxvk.git
synced 2025-03-03 07:29:14 +01:00
[dxvk] Add function to check for a specific driver / driver version
This commit is contained in:
parent
6c992c7b02
commit
598280dc3f
@ -329,6 +329,22 @@ namespace dxvk {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool DxvkAdapter::matchesDriver(
|
||||||
|
DxvkGpuVendor vendor,
|
||||||
|
VkDriverIdKHR driver,
|
||||||
|
uint32_t minVer,
|
||||||
|
uint32_t maxVer) const {
|
||||||
|
bool driverMatches = m_deviceInfo.khrDeviceDriverProperties.driverID
|
||||||
|
? driver == m_deviceInfo.khrDeviceDriverProperties.driverID
|
||||||
|
: vendor == DxvkGpuVendor(m_deviceInfo.core.properties.vendorID);
|
||||||
|
|
||||||
|
if (minVer) driverMatches &= m_deviceInfo.core.properties.driverVersion >= minVer;
|
||||||
|
if (maxVer) driverMatches &= m_deviceInfo.core.properties.driverVersion < maxVer;
|
||||||
|
|
||||||
|
return driverMatches;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void DxvkAdapter::logAdapterInfo() const {
|
void DxvkAdapter::logAdapterInfo() const {
|
||||||
VkPhysicalDeviceProperties deviceInfo = this->deviceProperties();
|
VkPhysicalDeviceProperties deviceInfo = this->deviceProperties();
|
||||||
VkPhysicalDeviceMemoryProperties memoryInfo = this->memoryProperties();
|
VkPhysicalDeviceMemoryProperties memoryInfo = this->memoryProperties();
|
||||||
@ -398,6 +414,11 @@ namespace dxvk {
|
|||||||
m_deviceInfo.extVertexAttributeDivisor.pNext = std::exchange(m_deviceInfo.core.pNext, &m_deviceInfo.extVertexAttributeDivisor);
|
m_deviceInfo.extVertexAttributeDivisor.pNext = std::exchange(m_deviceInfo.core.pNext, &m_deviceInfo.extVertexAttributeDivisor);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (m_deviceExtensions.supports(VK_KHR_DRIVER_PROPERTIES_EXTENSION_NAME)) {
|
||||||
|
m_deviceInfo.khrDeviceDriverProperties.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DRIVER_PROPERTIES_KHR;
|
||||||
|
m_deviceInfo.khrDeviceDriverProperties.pNext = std::exchange(m_deviceInfo.core.pNext, &m_deviceInfo.khrDeviceDriverProperties);
|
||||||
|
}
|
||||||
|
|
||||||
// Query full device properties for all enabled extensions
|
// Query full device properties for all enabled extensions
|
||||||
m_vki->vkGetPhysicalDeviceProperties2KHR(m_handle, &m_deviceInfo.core);
|
m_vki->vkGetPhysicalDeviceProperties2KHR(m_handle, &m_deviceInfo.core);
|
||||||
|
|
||||||
|
@ -214,6 +214,22 @@ namespace dxvk {
|
|||||||
uint32_t heap,
|
uint32_t heap,
|
||||||
VkDeviceSize bytes);
|
VkDeviceSize bytes);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Tests if the driver matches certain criteria
|
||||||
|
*
|
||||||
|
* \param [in] vendor GPU vendor
|
||||||
|
* \param [in] driver Driver. Ignored when the
|
||||||
|
* driver properties extension is not supported.
|
||||||
|
* \param [in] minVer Match versions starting with this one
|
||||||
|
* \param [in] maxVer Match versions lower than this one
|
||||||
|
* \returns \c True if the driver matches these criteria
|
||||||
|
*/
|
||||||
|
bool matchesDriver(
|
||||||
|
DxvkGpuVendor vendor,
|
||||||
|
VkDriverIdKHR driver,
|
||||||
|
uint32_t minVer,
|
||||||
|
uint32_t maxVer) const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Logs DXVK adapter info
|
* \brief Logs DXVK adapter info
|
||||||
*
|
*
|
||||||
|
@ -18,6 +18,7 @@ namespace dxvk {
|
|||||||
VkPhysicalDeviceSubgroupProperties coreSubgroup;
|
VkPhysicalDeviceSubgroupProperties coreSubgroup;
|
||||||
VkPhysicalDeviceTransformFeedbackPropertiesEXT extTransformFeedback;
|
VkPhysicalDeviceTransformFeedbackPropertiesEXT extTransformFeedback;
|
||||||
VkPhysicalDeviceVertexAttributeDivisorPropertiesEXT extVertexAttributeDivisor;
|
VkPhysicalDeviceVertexAttributeDivisorPropertiesEXT extVertexAttributeDivisor;
|
||||||
|
VkPhysicalDeviceDriverPropertiesKHR khrDeviceDriverProperties;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user