-
Notifications
You must be signed in to change notification settings - Fork 238
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Vk] Add VulkanPhysicalDevice::physicalDeviceID to compare physical d…
…evice with new one obtained from fresh VkInstance. TODO: use deviceLUID/UUID if available, rather than name hash
- Loading branch information
Showing
3 changed files
with
15 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -43,6 +43,12 @@ THE SOFTWARE. | |
# include "swappy/swappyVk.h" | ||
#endif | ||
|
||
#if OGRE_ARCH_TYPE == OGRE_ARCHITECTURE_32 | ||
# define OGRE_HASH128_FUNC MurmurHash3_x86_128 | ||
#else | ||
# define OGRE_HASH128_FUNC MurmurHash3_x64_128 | ||
#endif | ||
|
||
#define OGRE_VK_KHR_WIN32_SURFACE_EXTENSION_NAME "VK_KHR_win32_surface" | ||
#define OGRE_VK_KHR_XCB_SURFACE_EXTENSION_NAME "VK_KHR_xcb_surface" | ||
#define OGRE_VK_KHR_ANDROID_SURFACE_EXTENSION_NAME "VK_KHR_android_surface" | ||
|
@@ -428,8 +434,13 @@ namespace Ogre | |
if( sameNameIndex != 0 ) | ||
name += " (" + Ogre::StringConverter::toString( sameNameIndex + 1 ) + ")"; | ||
|
||
// TODO: use deviceLUID or deviceUUID if available | ||
uint64 hashResult[2] = {}; | ||
OGRE_HASH128_FUNC( name.c_str(), (int)name.size(), IdString::Seed, hashResult ); | ||
long long deviceLUID = hashResult[0]; | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
eugenegff
Author
Member
|
||
|
||
LogManager::getSingleton().logMessage( "Vulkan: \"" + name + "\"" ); | ||
mVulkanPhysicalDevices.push_back( { device, name } ); | ||
mVulkanPhysicalDevices.push_back( { device, deviceLUID, name } ); | ||
} | ||
|
||
LogManager::getSingleton().logMessage( "Vulkan: Device detection ends" ); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
GCC & Clang warn of unsigned -> signed conversion.
Shouldn't deviceLUID be uint64_t?
Besides that, since
VkPhysicalDeviceIDProperties::deviceUUID
is 128 bits / 16 bytes and our hashing function also returns a 128 bit output, perhaps it's just better to makeOgre::VulkanPhysicalDevice::physicalDeviceID
a uint64_t [2] variable?