mirror of
https://github.com/doitsujin/dxvk.git
synced 2025-01-31 14:52:11 +01:00
[dxvk] Skip over adapters not supporting Vulkan 1.1
Even with a 1.1 instance it appears to be possible to retrieve 1.0 adapters, so we'll just ignore them.
This commit is contained in:
parent
976d3b5ee4
commit
ce51431860
@ -15,15 +15,12 @@ namespace dxvk {
|
||||
}
|
||||
|
||||
|
||||
bool DxvkDeviceFilter::testAdapter(
|
||||
const Rc<DxvkAdapter>& adapter) const {
|
||||
const auto& deviceProps = adapter->deviceProperties();
|
||||
|
||||
bool DxvkDeviceFilter::testAdapter(const VkPhysicalDeviceProperties& properties) const {
|
||||
if (m_flags.test(DxvkDeviceFilterFlag::MatchDeviceName)) {
|
||||
if (std::string (deviceProps.deviceName).find(m_matchDeviceName) == std::string::npos)
|
||||
if (std::string(properties.deviceName).find(m_matchDeviceName) == std::string::npos)
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -36,11 +36,11 @@ namespace dxvk {
|
||||
/**
|
||||
* \brief Tests an adapter
|
||||
*
|
||||
* \param [in] adapter Adapter handle
|
||||
* \param [in] properties Adapter properties
|
||||
* \returns \c true if the test passes
|
||||
*/
|
||||
bool testAdapter(
|
||||
const Rc<DxvkAdapter>& adapter) const;
|
||||
const VkPhysicalDeviceProperties& properties) const;
|
||||
|
||||
private:
|
||||
|
||||
|
@ -154,10 +154,13 @@ namespace dxvk {
|
||||
|
||||
std::vector<Rc<DxvkAdapter>> result;
|
||||
for (uint32_t i = 0; i < numAdapters; i++) {
|
||||
Rc<DxvkAdapter> adapter = new DxvkAdapter(m_vki, adapters[i]);
|
||||
|
||||
if (filter.testAdapter(adapter))
|
||||
result.push_back(adapter);
|
||||
VkPhysicalDeviceProperties deviceProperties;
|
||||
m_vki->vkGetPhysicalDeviceProperties(adapters[i], &deviceProperties);
|
||||
|
||||
if (deviceProperties.apiVersion < VK_MAKE_VERSION(1, 1, 0))
|
||||
Logger::warn(str::format("Skipping Vulkan 1.0 adapter: ", deviceProperties.deviceName));
|
||||
else if (filter.testAdapter(deviceProperties))
|
||||
result.push_back(new DxvkAdapter(m_vki, adapters[i]));
|
||||
}
|
||||
|
||||
std::sort(result.begin(), result.end(),
|
||||
|
Loading…
x
Reference in New Issue
Block a user