Blender V5.3
GHOST_ContextVK Class Reference

#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 *, bool)> 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
bool hasAlpha () const
virtual GHOST_TVSyncModes getVSync ()
unsigned int getDefaultFramebuffer () override
Public Member Functions inherited from GHOST_IContext
virtual ~GHOST_IContext ()=default

Static Public Member Functions

Vulkan Instance Extensions Query
static bool is_instance_extension_enabled (blender::StringRefNull extension_name)
 Is the given extension name enabled on instance level?
static bool is_device_extension_enabled (blender::StringRefNull extension_name)
 Is the given extension name enabled on device level?
Static Public Member Functions inherited from GHOST_Context
static GHOST_Context * getActiveDrawingContext ()
Static Public Member Functions inherited from GHOST_IContext
static GHOST_IContext * getActiveDrawingContext ()

Friends

class GHOST_XrGraphicsBindingVulkan
class GHOST_XrGraphicsBindingVulkanD3D

Additional Inherited Members

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_

Detailed Description

Definition at line 107 of file GHOST_ContextVK.hh.

Constructor & Destructor Documentation

◆ 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 1273 of file GHOST_ContextVK.cc.

References GHOST_Context::active_context_, and GHOST_kSuccess.

Referenced by GHOST_XrGraphicsBindingVulkanD3D.

◆ getSwapInterval()

GHOST_TSuccess GHOST_ContextVK::getSwapInterval ( int & )
inlineoverridevirtual

Gets the current swap interval for swapBuffers.

Parameters
interval_outVariable 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 217 of file GHOST_ContextVK.hh.

References GHOST_kFailure.

◆ getVulkanHandles()

GHOST_TSuccess GHOST_ContextVK::getVulkanHandles ( GHOST_VulkanHandles & r_handles)
override

◆ getVulkanSwapChainFormat()

GHOST_TSuccess GHOST_ContextVK::getVulkanSwapChainFormat ( GHOST_VulkanSwapChainData * r_swap_chain_data)
override

Definition at line 1220 of file GHOST_ContextVK.cc.

References GHOST_kSuccess.

Referenced by GHOST_XrGraphicsBindingVulkanD3D.

◆ initializeDrawingContext()

◆ is_device_extension_enabled()

bool GHOST_ContextVK::is_device_extension_enabled ( blender::StringRefNull extension_name)
static

Is the given extension name enabled on device level?

Returns
false, when extension isn't enabled on device level or when no instance or device exists. Will return true when instance exists and extension name has been enabled on the instance.

Definition at line 883 of file GHOST_ContextVK.cc.

References blender::StringRefNull::c_str(), and vulkan_instance.

◆ is_instance_extension_enabled()

bool GHOST_ContextVK::is_instance_extension_enabled ( blender::StringRefNull extension_name)
static

Is the given extension name enabled on instance level?

Returns
false, when extension isn't enabled on instance level or when no instance exists. Will return true when instance exists and extension name has been enabled on the instance.

Definition at line 875 of file GHOST_ContextVK.cc.

References blender::StringRefNull::c_str(), and vulkan_instance.

◆ isUpsideDown()

bool GHOST_ContextVK::isUpsideDown ( ) const
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 227 of file GHOST_ContextVK.hh.

◆ 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 1279 of file GHOST_ContextVK.cc.

References GHOST_Context::active_context_, and GHOST_kSuccess.

Referenced by GHOST_XrGraphicsBindingVulkanD3D.

◆ 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 2035 of file GHOST_ContextVK.cc.

References GHOST_kSuccess.

Referenced by GHOST_XrGraphicsBindingVulkanD3D.

◆ 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 207 of file GHOST_ContextVK.hh.

References GHOST_kFailure.

◆ setVulkanSwapBuffersCallbacks()

GHOST_TSuccess GHOST_ContextVK::setVulkanSwapBuffersCallbacks ( std::function< void(const GHOST_VulkanSwapChainData *, bool)> 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

Definition at line 1260 of file GHOST_ContextVK.cc.

References GHOST_kSuccess.

Referenced by GHOST_XrGraphicsBindingVulkanD3D.

◆ swapBufferAcquire()

◆ swapBufferRelease()

◆ GHOST_XrGraphicsBindingVulkan

friend class GHOST_XrGraphicsBindingVulkan
friend

Definition at line 108 of file GHOST_ContextVK.hh.

References GHOST_XrGraphicsBindingVulkan.

Referenced by GHOST_XrGraphicsBindingVulkan.

◆ GHOST_XrGraphicsBindingVulkanD3D


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