|
Blender V5.3
|
Graphics binding between OpenXR and Vulkan. More...
#include <GHOST_XrGraphicsBindingVulkan.hh>
Inherits GHOST_IXrGraphicsBinding.
Public Member Functions | |
| bool | loadExtensionFunctions (XrInstance instance) override |
| load the functions for the graphics binding. | |
| bool | checkVersionRequirements (GHOST_Context &ghost_ctx, XrInstance instance, XrSystemId system_id, std::string *r_requirement_info) const override |
| void | initFromGhostContext (GHOST_Context &ghost_ctx, XrInstance instance, XrSystemId system_id) override |
| std::optional< int64_t > | chooseSwapchainFormat (const std::vector< int64_t > &runtime_formats, GHOST_TXrSwapchainFormat &r_format, bool &r_is_srgb_format) const override |
| std::vector< XrSwapchainImageBaseHeader * > | createSwapchainImages (uint32_t image_count) override |
| void | submitToSwapchainBegin () override |
| void | submitToSwapchainImage (XrSwapchainImageBaseHeader &swapchain_image, const GHOST_XrDrawViewInfo &draw_info) override |
| void | submitToSwapchainEnd () override |
| bool | needsUpsideDownDrawing (GHOST_Context &ghost_ctx) const override |
Constructor | |
| GHOST_XrGraphicsBindingVulkan (GHOST_Context &ghost_ctx) | |
Destroying resources. | |
| ~GHOST_XrGraphicsBindingVulkan () override | |
| Public Member Functions inherited from GHOST_IXrGraphicsBinding | |
| virtual | ~GHOST_IXrGraphicsBinding ()=default |
Additional Inherited Members | |
| Public Attributes inherited from GHOST_IXrGraphicsBinding | |
| union | oxr_binding |
| Protected Member Functions inherited from GHOST_IXrGraphicsBinding | |
| GHOST_IXrGraphicsBinding ()=default | |
Graphics binding between OpenXR and Vulkan.
OpenXR and Blender can have different requirements for a Vulkan device to be used. Some platforms require extensions that Blender didn't enable and other want to use a specific device.
Depending on the enabled extensions and device selection process one of the next three behaviors can be done.
Reusing Blender Vulkan Instance
Blender tries to reuse the already created vulkan instance of GHOST_ContextVK. This is only possible when:
This is typically the fastest way as almost everything can be done using Blenders' rendergraph.
Create a OpenXR Vulkan Instance
When we cannot reuse the existing instance an Xr specific Vulkan instance is being created. The data is transferred using external memory. Additional synchronization is needed as part of the pipeline cannot be done by Blender.
Use CPU transfer
This is a fallback when devices don't match. In that case the results are transferred from the device that Blender is using to draw the UI to RAM and then transferred to the GPU that OpenXR is using.
Definition at line 69 of file GHOST_XrGraphicsBindingVulkan.hh.
| GHOST_XrGraphicsBindingVulkan::GHOST_XrGraphicsBindingVulkan | ( | GHOST_Context & | ghost_ctx | ) |
Definition at line 29 of file GHOST_XrGraphicsBindingVulkan.cc.
References GHOST_IXrGraphicsBinding::GHOST_IXrGraphicsBinding().
|
override |
Definition at line 40 of file GHOST_XrGraphicsBindingVulkan.cc.
|
overridevirtual |
Check the version requirements to use OpenXR with the Vulkan backend.
Implements GHOST_IXrGraphicsBinding.
Definition at line 122 of file GHOST_XrGraphicsBindingVulkan.cc.
References CLOG_INFO, and LOG_GHOST_XR.
|
overridevirtual |
Implements GHOST_IXrGraphicsBinding.
Definition at line 561 of file GHOST_XrGraphicsBindingVulkan.cc.
References choose_swapchain_format_from_candidates(), VK_FORMAT_R8G8B8A8_SRGB, and VK_FORMAT_R8G8B8A8_UNORM.
|
overridevirtual |
Implements GHOST_IXrGraphicsBinding.
Definition at line 611 of file GHOST_XrGraphicsBindingVulkan.cc.
References image.
|
overridevirtual |
Implements GHOST_IXrGraphicsBinding.
Definition at line 206 of file GHOST_XrGraphicsBindingVulkan.cc.
References CHECK_XR, and GHOST_IXrGraphicsBinding::oxr_binding.
|
overridevirtual |
load the functions for the graphics binding.
A graphic binding uses an extension. These extensions provide graphics platform specific functions. This function is called before checkVersionRequirements allowing to preload the function pointers.
| instance | XrInstance where to retrieve the functions from. |
Implements GHOST_IXrGraphicsBinding.
Definition at line 91 of file GHOST_XrGraphicsBindingVulkan.cc.
References CLOG_INFO, LOAD_FUNCTION, and LOG_GHOST_XR.
|
overridevirtual |
Implements GHOST_IXrGraphicsBinding.
Definition at line 1005 of file GHOST_XrGraphicsBindingVulkan.cc.
References GHOST_Context::isUpsideDown().
|
overridevirtual |
Implements GHOST_IXrGraphicsBinding.
Definition at line 625 of file GHOST_XrGraphicsBindingVulkan.cc.
|
overridevirtual |
Implements GHOST_IXrGraphicsBinding.
Definition at line 647 of file GHOST_XrGraphicsBindingVulkan.cc.
|
overridevirtual |
Implements GHOST_IXrGraphicsBinding.
Definition at line 626 of file GHOST_XrGraphicsBindingVulkan.cc.