Blender V4.3
GHOST_ContextVK Class Reference

#include <GHOST_ContextVK.hh>

Inherits GHOST_Context.

Public Member Functions

 GHOST_ContextVK (bool stereoVisual, 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, int debug, const GHOST_GPUDevice &preferred_device)
 
 ~GHOST_ContextVK ()
 
GHOST_TSuccess swapBuffers () override
 
GHOST_TSuccess activateDrawingContext () override
 
GHOST_TSuccess releaseDrawingContext () override
 
GHOST_TSuccess initializeDrawingContext () override
 
GHOST_TSuccess releaseNativeHandles () override
 
GHOST_TSuccess getVulkanHandles (void *r_instance, void *r_physical_device, void *r_device, uint32_t *r_graphic_queue_family, void *r_queue, void **r_queue_mutex) override
 
GHOST_TSuccess getVulkanSwapChainFormat (GHOST_VulkanSwapChainData *r_swap_chain_data) override
 
GHOST_TSuccess setVulkanSwapBuffersCallbacks (std::function< void(const GHOST_VulkanSwapChainData *)> swap_buffers_pre_callback, std::function< void(void)> swap_buffers_post_callback) override
 
GHOST_TSuccess setSwapInterval (int) override
 
GHOST_TSuccess getSwapInterval (int &) override
 
- Public Member Functions inherited from GHOST_Context
 GHOST_Context (bool stereoVisual)
 
virtual ~GHOST_Context ()
 
virtual GHOST_TSuccess updateDrawingContext ()
 
void * getUserData ()
 
void setUserData (void *user_data)
 
bool isStereoVisual () const
 
virtual bool isUpsideDown () const
 
virtual unsigned int getDefaultFramebuffer () override
 
- Public Member Functions inherited from GHOST_IContext
virtual ~GHOST_IContext ()
 

Additional Inherited Members

- Protected Attributes inherited from GHOST_Context
bool m_stereoVisual
 
void * m_user_data = nullptr
 

Detailed Description

Definition at line 60 of file GHOST_ContextVK.hh.

Constructor & Destructor Documentation

◆ GHOST_ContextVK()

GHOST_ContextVK::GHOST_ContextVK ( bool stereoVisual,
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,
int debug,
const GHOST_GPUDevice & preferred_device )

Constructor.

Definition at line 434 of file GHOST_ContextVK.cc.

◆ ~GHOST_ContextVK()

GHOST_ContextVK::~GHOST_ContextVK ( )

Member Function Documentation

◆ activateDrawingContext()

GHOST_TSuccess GHOST_ContextVK::activateDrawingContext ( )
overridevirtual

Activates the drawing context of this window.

Returns
A boolean success indicator.

Implements GHOST_Context.

Definition at line 649 of file GHOST_ContextVK.cc.

References GHOST_kSuccess.

◆ getSwapInterval()

GHOST_TSuccess GHOST_ContextVK::getSwapInterval ( int & )
inlineoverridevirtual

Gets the current swap interval for swapBuffers.

Parameters
intervalOutVariable to store the swap interval if it can be read.
Returns
Whether the swap interval can be read.

Reimplemented from GHOST_Context.

Definition at line 154 of file GHOST_ContextVK.hh.

References GHOST_kFailure.

◆ getVulkanHandles()

GHOST_TSuccess GHOST_ContextVK::getVulkanHandles ( void * r_instance,
void * r_physical_device,
void * r_device,
uint32_t * r_graphic_queue_family,
void * r_queue,
void ** r_queue_mutex )
override

Gets the Vulkan context related resource handles.

Returns
A boolean success indicator.

Definition at line 615 of file GHOST_ContextVK.cc.

References GHOST_kSuccess, and vulkan_device.

◆ getVulkanSwapChainFormat()

GHOST_TSuccess GHOST_ContextVK::getVulkanSwapChainFormat ( GHOST_VulkanSwapChainData * r_swap_chain_data)
override

Definition at line 604 of file GHOST_ContextVK.cc.

References GHOST_kSuccess.

◆ initializeDrawingContext()

GHOST_TSuccess GHOST_ContextVK::initializeDrawingContext ( )
overridevirtual

Call immediately after new to initialize. If this fails then immediately delete the object.

Returns
Indication as to whether initialization has succeeded.

Implements GHOST_Context.

Definition at line 955 of file GHOST_ContextVK.cc.

References ensure_vulkan_device(), getExtensionsAvailable(), GHOST_kFailure, GHOST_kSuccess, requireExtension(), VK_CHECK, and vulkan_device.

◆ releaseDrawingContext()

GHOST_TSuccess GHOST_ContextVK::releaseDrawingContext ( )
overridevirtual

Release the drawing context of the calling thread.

Returns
A boolean success indicator.

Implements GHOST_Context.

Definition at line 654 of file GHOST_ContextVK.cc.

References GHOST_kSuccess.

◆ releaseNativeHandles()

GHOST_TSuccess GHOST_ContextVK::releaseNativeHandles ( )
overridevirtual

Removes references to native handles from this context and then returns

Returns
GHOST_kSuccess if it is OK for the parent to release the handles and GHOST_kFailure if releasing the handles will interfere with sharing

Implements GHOST_Context.

Definition at line 1109 of file GHOST_ContextVK.cc.

References GHOST_kSuccess.

◆ setSwapInterval()

GHOST_TSuccess GHOST_ContextVK::setSwapInterval ( int )
inlineoverridevirtual

Sets the swap interval for swapBuffers.

Parameters
intervalThe swap interval to use.
Returns
A boolean success indicator.

Reimplemented from GHOST_Context.

Definition at line 144 of file GHOST_ContextVK.hh.

References GHOST_kFailure.

◆ setVulkanSwapBuffersCallbacks()

GHOST_TSuccess GHOST_ContextVK::setVulkanSwapBuffersCallbacks ( std::function< void(const GHOST_VulkanSwapChainData *)> swap_buffers_pre_callback,
std::function< void(void)> swap_buffers_post_callback )
override

Definition at line 640 of file GHOST_ContextVK.cc.

References GHOST_kSuccess.

◆ swapBuffers()

GHOST_TSuccess GHOST_ContextVK::swapBuffers ( )
overridevirtual

Swaps front and back buffers of a window.

Returns
A boolean success indicator.

Implements GHOST_Context.

Definition at line 521 of file GHOST_ContextVK.cc.

References GHOST_kFailure, GHOST_kSuccess, lock, GHOST_ContextVK_WindowInfo::size, UINT64_MAX, VK_CHECK, vulkan_device, and vulkan_error_as_string().


The documentation for this class was generated from the following files: