Skip to content

Commit

Permalink
[Vk] consolidate device creation code into VulkanDevice::setPhysicalD…
Browse files Browse the repository at this point in the history
…evice(), that would also be called on each device lost
  • Loading branch information
eugenegff committed Nov 22, 2024
1 parent d85bb58 commit 16aeec8
Show file tree
Hide file tree
Showing 4 changed files with 273 additions and 365 deletions.
21 changes: 12 additions & 9 deletions RenderSystems/Vulkan/include/OgreVulkanDevice.h
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,10 @@ namespace Ogre
bool mIsExternal;

void fillDeviceFeatures();
bool fillDeviceFeatures2(
VkPhysicalDeviceFeatures2 &deviceFeatures2,
VkPhysicalDevice16BitStorageFeatures &device16BitStorageFeatures,
VkPhysicalDeviceShaderFloat16Int8Features &deviceShaderFloat16Int8Features );

static void destroyQueues( FastArray<VulkanQueue> &queueArray );

Expand All @@ -177,18 +181,17 @@ namespace Ogre
FastArray<VkDeviceQueueCreateInfo> &outQueueCiArray );

public:
VulkanDevice( const std::shared_ptr<VulkanInstance> &instance,
const VulkanPhysicalDevice &physicalDevice, VulkanRenderSystem *renderSystem );
VulkanDevice( const std::shared_ptr<VulkanInstance> &instance,
const VulkanExternalDevice &externalDevice, VulkanRenderSystem *renderSystem );
VulkanDevice( VulkanRenderSystem *renderSystem );
~VulkanDevice();

protected:
void setPhysicalDevice( const VulkanPhysicalDevice &physicalDevice );
void destroy();

public:
void createDevice( FastArray<const char *> &extensions, uint32 maxComputeQueues,
uint32 maxTransferQueues );
void setPhysicalDevice( const std::shared_ptr<VulkanInstance> &instance,
const VulkanPhysicalDevice &physicalDevice,
const VulkanExternalDevice *externalDevice );

void createDevice( const FastArray<VkExtensionProperties> &availableExtensions,
uint32 maxComputeQueues, uint32 maxTransferQueues );

bool hasDeviceExtension( const IdString extension ) const;

Expand Down
Loading

0 comments on commit 16aeec8

Please sign in to comment.