Hi!
Yes, you can.
And no, the sample there is meant for cases where you have multiple libraries, and that library insists on creating the Vulkan device (thus you give OgreNext that device instead of having OgreNext create another one).
As to how to use D3D11/Vk directly:
Code: Select all
// To get the proper typedef for ID3D11DeviceN
#include <OgreD3D11Prerequisites.h>
// To get VulkanQueue struct which contains everything you need to interact w/ Vulkan directly
#include <OgreVulkanDevice.h>
ID3D11DeviceN *d3d11Device = 0;
renderSystem->getCustomAttribute( "D3DDEVICE", &d3d11Device );
// Vulkan
VulkanQueue *vulkanQueue = 0;
renderSystem->getCustomAttribute( "VulkanQueue", &vulkanQueue );
There's also various other parts that have their own getCustomAttribute
you can retrieve.
For example TextureGpu::getCustomAttribute( TextureGpu::msFinalTextureBuffer, &res )
can be used to retrieve the internal D3D11Resource or VkImage.
Working with Vulkan directly may be harder than with D3D11, because Vulkan has explicit synchronization and you must make sure you issued the proper barriers and resources are in the proper layout. Vulkan Validation layers can help you with that, but after all it is a hard topic.