|
Blender V5.0
|
#include <GHOST_ContextVK.hh>
Inherits GHOST_Context.
Public Member Functions | |
| GHOST_ContextVK (const GHOST_ContextParams &context_params, GHOST_TVulkanPlatformType platform, Window window, Display *display, wl_surface *wayland_surface, wl_display *wayland_display, const GHOST_ContextVK_WindowInfo *wayland_window_info, int contextMajorVersion, int contextMinorVersion, const GHOST_GPUDevice &preferred_device, const GHOST_WindowHDRInfo *hdr_info_=nullptr) | |
| ~GHOST_ContextVK () override | |
| GHOST_TSuccess | swapBufferAcquire () override |
| GHOST_TSuccess | swapBufferRelease () override |
| GHOST_TSuccess | activateDrawingContext () override |
| GHOST_TSuccess | releaseDrawingContext () override |
| GHOST_TSuccess | initializeDrawingContext () override |
| GHOST_TSuccess | releaseNativeHandles () override |
| GHOST_TSuccess | getVulkanHandles (GHOST_VulkanHandles &r_handles) override |
| GHOST_TSuccess | getVulkanSwapChainFormat (GHOST_VulkanSwapChainData *r_swap_chain_data) override |
| GHOST_TSuccess | setVulkanSwapBuffersCallbacks (std::function< void(const GHOST_VulkanSwapChainData *)> swap_buffer_draw_callback, std::function< void(void)> swap_buffer_acquired_callback, std::function< void(GHOST_VulkanOpenXRData *)> openxr_acquire_framebuffer_image_callback, std::function< void(GHOST_VulkanOpenXRData *)> openxr_release_framebuffer_image_callback) override |
| GHOST_TSuccess | setSwapInterval (int) override |
| GHOST_TSuccess | getSwapInterval (int &) override |
| bool | isUpsideDown () const override |
| Public Member Functions inherited from GHOST_Context | |
| GHOST_Context (const GHOST_ContextParams &context_params) | |
| ~GHOST_Context () override | |
| virtual GHOST_TSuccess | updateDrawingContext () |
| void * | getUserData () |
| void | setUserData (void *user_data) |
| bool | isStereoVisual () const |
| virtual GHOST_TVSyncModes | getVSync () |
| unsigned int | getDefaultFramebuffer () override |
| Public Member Functions inherited from GHOST_IContext | |
| virtual | ~GHOST_IContext ()=default |
Friends | |
| class | GHOST_XrGraphicsBindingVulkan |
| class | GHOST_XrGraphicsBindingVulkanD3D |
Additional Inherited Members | |
| Static Public Member Functions inherited from GHOST_Context | |
| static GHOST_Context * | getActiveDrawingContext () |
| Static Public Member Functions inherited from GHOST_IContext | |
| static GHOST_IContext * | getActiveDrawingContext () |
| Protected Attributes inherited from GHOST_Context | |
| GHOST_ContextParams | context_params_ |
| void * | user_data_ = nullptr |
| Static Protected Attributes inherited from GHOST_Context | |
| static GHOST_Context * | active_context_ |
Definition at line 96 of file GHOST_ContextVK.hh.
| GHOST_ContextVK::GHOST_ContextVK | ( | const GHOST_ContextParams & | context_params, |
| GHOST_TVulkanPlatformType | platform, | ||
| Window | window, | ||
| Display * | display, | ||
| wl_surface * | wayland_surface, | ||
| wl_display * | wayland_display, | ||
| const GHOST_ContextVK_WindowInfo * | wayland_window_info, | ||
| int | contextMajorVersion, | ||
| int | contextMinorVersion, | ||
| const GHOST_GPUDevice & | preferred_device, | ||
| const GHOST_WindowHDRInfo * | hdr_info_ = nullptr ) |
Constructor.
Definition at line 667 of file GHOST_ContextVK.cc.
References Display, false, GHOST_Context::GHOST_Context(), Window, wl_display, and wl_surface.
|
override |
Destructor.
Definition at line 714 of file GHOST_ContextVK.cc.
References GHOST_InstanceVK::device, GHOST_DeviceVK::users, GHOST_DeviceVK::vk_device, GHOST_InstanceVK::vk_instance, vulkan_instance, and GHOST_DeviceVK::wait_idle().
|
overridevirtual |
Activates the drawing context of this window.
Implements GHOST_Context.
Definition at line 1023 of file GHOST_ContextVK.cc.
References GHOST_Context::active_context_, and GHOST_kSuccess.
|
inlineoverridevirtual |
Gets the current swap interval for swapBuffers.
| interval_out | Variable to store the swap interval if it can be read. |
Reimplemented from GHOST_Context.
Definition at line 193 of file GHOST_ContextVK.hh.
References GHOST_kFailure.
|
override |
Gets the Vulkan context related resource handles.
Definition at line 981 of file GHOST_ContextVK.cc.
References GHOST_InstanceVK::device, GHOST_DeviceVK::generic_queue, GHOST_DeviceVK::generic_queue_family, GHOST_kSuccess, GHOST_DeviceVK::queue_mutex, GHOST_DeviceVK::vk_device, GHOST_InstanceVK::vk_instance, GHOST_DeviceVK::vk_physical_device, GHOST_DeviceVK::vma_allocator, and vulkan_instance.
|
override |
Definition at line 970 of file GHOST_ContextVK.cc.
References GHOST_kSuccess.
|
overridevirtual |
Call immediately after new to initialize. If this fails then immediately delete the object.
Implements GHOST_Context.
Definition at line 1432 of file GHOST_ContextVK.cc.
References GHOST_Context::active_context_, GHOST_Context::context_params_, GHOST_InstanceVK::create_device(), GHOST_InstanceVK::create_instance(), GHOST_InstanceVK::device, GHOST_ExtensionsVK::enable(), GHOST_InstanceVK::extensions, GHOST_kFailure, GHOST_kSuccess, GHOST_kVulkanPlatformHeadless, GHOST_ExtensionsVK::is_supported(), GHOST_InstanceVK::select_physical_device(), GHOST_DeviceVK::users, VK_CHECK, GHOST_InstanceVK::vk_instance, vulkan_instance, and Window.
|
inlineoverridevirtual |
Returns if the context is rendered upside down compared to OpenGL.
Vulkan is always rendered upside down.
Reimplemented from GHOST_Context.
Definition at line 203 of file GHOST_ContextVK.hh.
|
overridevirtual |
Release the drawing context of the calling thread.
Implements GHOST_Context.
Definition at line 1029 of file GHOST_ContextVK.cc.
References GHOST_Context::active_context_, and GHOST_kSuccess.
|
overridevirtual |
Removes references to native handles from this context and then returns
Implements GHOST_Context.
Definition at line 1600 of file GHOST_ContextVK.cc.
References GHOST_kSuccess.
|
inlineoverridevirtual |
Sets the swap interval for swapBuffers.
| interval | The swap interval to use. |
Reimplemented from GHOST_Context.
Definition at line 183 of file GHOST_ContextVK.hh.
References GHOST_kFailure.
|
override |
Definition at line 1010 of file GHOST_ContextVK.cc.
References GHOST_kSuccess.
|
overridevirtual |
Implements GHOST_Context.
Definition at line 737 of file GHOST_ContextVK.cc.
References GHOST_Frame::acquire_semaphore, assert, CLOG_DEBUG, CLOG_TRACE, GHOST_FrameDiscard::destroy(), GHOST_Frame::discard_pile, GHOST_kFailure, GHOST_kSuccess, LOG, GHOST_Frame::submission_fence, GHOST_FrameDiscard::swapchains, UINT64_MAX, GHOST_DeviceVK::use_vk_ext_swapchain_colorspace, GHOST_DeviceVK::vk_device, and vulkan_instance.
|
overridevirtual |
Swaps front and back buffers of a window.
Implements GHOST_Context.
Definition at line 890 of file GHOST_ContextVK.cc.
References GHOST_Frame::acquire_semaphore, assert, CLOG_ERROR, GHOST_DeviceVK::generic_queue, GHOST_kFailure, GHOST_kSuccess, lock, LOG, GHOST_SwapchainImage::present_semaphore, GHOST_DeviceVK::queue_mutex, GHOST_Frame::submission_fence, GHOST_DeviceVK::use_vk_ext_swapchain_colorspace, GHOST_DeviceVK::use_vk_ext_swapchain_maintenance_1, GHOST_DeviceVK::vk_device, GHOST_SwapchainImage::vk_image, vulkan_error_as_string(), and vulkan_instance.
|
friend |
Definition at line 97 of file GHOST_ContextVK.hh.
References GHOST_XrGraphicsBindingVulkan.
Referenced by GHOST_XrGraphicsBindingVulkan.
|
friend |
Definition at line 98 of file GHOST_ContextVK.hh.
References Display, GHOST_XrGraphicsBindingVulkanD3D, Window, wl_display, and wl_surface.
Referenced by GHOST_XrGraphicsBindingVulkanD3D.