Blender V4.3
blender::gpu::VKDevice Class Reference

#include <vk_device.hh>

Inherits blender::NonCopyable.

Public Member Functions

VkPhysicalDevice physical_device_get () const
 
const VkPhysicalDeviceProperties & physical_device_properties_get () const
 
const VkPhysicalDeviceFeatures & physical_device_features_get () const
 
const VkPhysicalDeviceVulkan11Features & physical_device_vulkan_11_features_get () const
 
const VkPhysicalDeviceVulkan12Features & physical_device_vulkan_12_features_get () const
 
VkInstance instance_get () const
 
VkDevice vk_handle () const
 
VkQueue queue_get () const
 
std::mutex & queue_mutex_get ()
 
const uint32_t queue_family_get () const
 
VmaAllocator mem_allocator_get () const
 
VKDescriptorSetLayoutsdescriptor_set_layouts_get ()
 
debug::VKDebuggingToolsdebugging_tools_get ()
 
const debug::VKDebuggingToolsdebugging_tools_get () const
 
const VKSamplerssamplers () const
 
bool is_initialized () const
 
void init (void *ghost_context)
 
void reinit ()
 
void deinit ()
 
bool supports_extension (const char *extension_name) const
 
const VKWorkaroundsworkarounds_get () const
 
const char * glsl_patch_get () const
 
void init_glsl_patch ()
 
Platform/driver/device information
eGPUDeviceType device_type () const
 
eGPUDriverType driver_type () const
 
std::string vendor_name () const
 
std::string driver_version () const
 
- Public Member Functions inherited from blender::NonCopyable
 NonCopyable (const NonCopyable &other)=delete
 
NonCopyableoperator= (const NonCopyable &other)=delete
 
 NonCopyable ()=default
 
 NonCopyable (NonCopyable &&other)=default
 
NonCopyableoperator= (NonCopyable &&other)=default
 

Public Attributes

render_graph::VKResourceStateTracker resources
 
VKDiscardPool orphaned_data
 
VKPipelinePool pipelines
 
VKBuffer dummy_buffer
 
struct { 
 
   PFN_vkCmdBeginRendering   vkCmdBeginRendering = nullptr 
 
   PFN_vkCmdEndRendering   vkCmdEndRendering = nullptr 
 
   PFN_vkCmdBeginDebugUtilsLabelEXT   vkCmdBeginDebugUtilsLabel = nullptr 
 
   PFN_vkCmdEndDebugUtilsLabelEXT   vkCmdEndDebugUtilsLabel = nullptr 
 
   PFN_vkSetDebugUtilsObjectNameEXT   vkSetDebugUtilsObjectName = nullptr 
 
   PFN_vkCreateDebugUtilsMessengerEXT   vkCreateDebugUtilsMessenger = nullptr 
 
   PFN_vkDestroyDebugUtilsMessengerEXT   vkDestroyDebugUtilsMessenger = nullptr 
 
functions 
 

Resource management

VKThreadDatacurrent_thread_data ()
 
VKDiscardPooldiscard_pool_for_current_thread ()
 
void context_register (VKContext &context)
 
void context_unregister (VKContext &context)
 
Span< std::reference_wrapper< VKContext > > contexts_get () const
 
void memory_statistics_get (int *r_total_mem_kb, int *r_free_mem_kb) const
 
void debug_print ()
 
static void debug_print (std::ostream &os, const VKDiscardPool &discard_pool)
 

Detailed Description

Definition at line 125 of file vk_device.hh.

Member Function Documentation

◆ context_register()

void blender::gpu::VKDevice::context_register ( VKContext & context)

Definition at line 414 of file vk_device.cc.

◆ context_unregister()

void blender::gpu::VKDevice::context_unregister ( VKContext & context)

Definition at line 419 of file vk_device.cc.

Referenced by blender::gpu::VKContext::~VKContext().

◆ contexts_get()

Span< std::reference_wrapper< VKContext > > blender::gpu::VKDevice::contexts_get ( ) const

Definition at line 423 of file vk_device.cc.

◆ current_thread_data()

VKThreadData & blender::gpu::VKDevice::current_thread_data ( )

Get or create current thread data.

Definition at line 383 of file vk_device.cc.

References blender::gpu::render_graph::VKResourceStateTracker::mutex, mutex, and resources.

Referenced by blender::gpu::VKContext::activate().

◆ debug_print() [1/2]

◆ debug_print() [2/2]

void blender::gpu::VKDevice::debug_print ( std::ostream & os,
const VKDiscardPool & discard_pool )
static

◆ debugging_tools_get() [1/2]

debug::VKDebuggingTools & blender::gpu::VKDevice::debugging_tools_get ( )
inline

Definition at line 253 of file vk_device.hh.

◆ debugging_tools_get() [2/2]

const debug::VKDebuggingTools & blender::gpu::VKDevice::debugging_tools_get ( ) const
inline

Definition at line 258 of file vk_device.hh.

◆ deinit()

◆ descriptor_set_layouts_get()

VKDescriptorSetLayouts & blender::gpu::VKDevice::descriptor_set_layouts_get ( )
inline

Definition at line 248 of file vk_device.hh.

◆ device_type()

◆ discard_pool_for_current_thread()

VKDiscardPool & blender::gpu::VKDevice::discard_pool_for_current_thread ( )

Get the discard pool for the current thread.

When the active thread has a context a discard pool associated to the thread is returned. When there is no context the orphan discard pool is returned.

A thread with a context can have multiple discard pools. One for each swap-chain image. A thread without a context is most likely a discarded resource triggered during dependency graph update. A dependency graph update from the viewport during playback or editing; or a dependency graph update when rendering. These can happen from a different thread which will don't have a context at all.

Definition at line 399 of file vk_device.cc.

References BLI_thread_is_main(), blender::gpu::render_graph::VKResourceStateTracker::mutex, mutex, orphaned_data, and resources.

Referenced by blender::gpu::VKBuffer::free(), blender::gpu::VKImageView::~VKImageView(), blender::gpu::VKShader::~VKShader(), blender::gpu::VKShaderModule::~VKShaderModule(), and blender::gpu::VKTexture::~VKTexture().

◆ driver_type()

eGPUDriverType blender::gpu::VKDevice::driver_type ( ) const

◆ driver_version()

std::string blender::gpu::VKDevice::driver_version ( ) const

Definition at line 351 of file vk_device.cc.

Referenced by blender::gpu::VKBackend::platform_init().

◆ glsl_patch_get()

const char * blender::gpu::VKDevice::glsl_patch_get ( ) const

Definition at line 250 of file vk_device.cc.

References BLI_assert.

◆ init()

◆ init_glsl_patch()

◆ instance_get()

VkInstance blender::gpu::VKDevice::instance_get ( ) const
inline

◆ is_initialized()

bool blender::gpu::VKDevice::is_initialized ( ) const

Definition at line 70 of file vk_device.cc.

Referenced by deinit(), init(), and blender::gpu::VKBackend::samplers_update().

◆ mem_allocator_get()

◆ memory_statistics_get()

void blender::gpu::VKDevice::memory_statistics_get ( int * r_total_mem_kb,
int * r_free_mem_kb ) const

Definition at line 428 of file vk_device.cc.

References int, and mem_allocator_get().

Referenced by blender::gpu::VKContext::memory_statistics_get().

◆ physical_device_features_get()

const VkPhysicalDeviceFeatures & blender::gpu::VKDevice::physical_device_features_get ( ) const
inline

Definition at line 204 of file vk_device.hh.

Referenced by blender::gpu::VKSampler::create().

◆ physical_device_get()

VkPhysicalDevice blender::gpu::VKDevice::physical_device_get ( ) const
inline

Definition at line 194 of file vk_device.hh.

◆ physical_device_properties_get()

const VkPhysicalDeviceProperties & blender::gpu::VKDevice::physical_device_properties_get ( ) const
inline

◆ physical_device_vulkan_11_features_get()

const VkPhysicalDeviceVulkan11Features & blender::gpu::VKDevice::physical_device_vulkan_11_features_get ( ) const
inline

Definition at line 209 of file vk_device.hh.

Referenced by blender::gpu::VKBackend::capabilities_init().

◆ physical_device_vulkan_12_features_get()

const VkPhysicalDeviceVulkan12Features & blender::gpu::VKDevice::physical_device_vulkan_12_features_get ( ) const
inline

Definition at line 214 of file vk_device.hh.

◆ queue_family_get()

const uint32_t blender::gpu::VKDevice::queue_family_get ( ) const
inline

◆ queue_get()

VkQueue blender::gpu::VKDevice::queue_get ( ) const
inline

◆ queue_mutex_get()

std::mutex & blender::gpu::VKDevice::queue_mutex_get ( )
inline

◆ reinit()

void blender::gpu::VKDevice::reinit ( )

◆ samplers()

const VKSamplers & blender::gpu::VKDevice::samplers ( ) const
inline

Definition at line 263 of file vk_device.hh.

◆ supports_extension()

bool blender::gpu::VKDevice::supports_extension ( const char * extension_name) const

Check if a specific extension is supported by the device.

This should be called from vk_backend to set the correct capabilities and workarounds needed for this device.

Definition at line 176 of file vk_device.cc.

References STREQ.

Referenced by blender::gpu::VKBackend::capabilities_init().

◆ vendor_name()

std::string blender::gpu::VKDevice::vendor_name ( ) const

◆ vk_handle()

VkDevice blender::gpu::VKDevice::vk_handle ( ) const
inline

◆ workarounds_get()

Member Data Documentation

◆ dummy_buffer

VKBuffer blender::gpu::VKDevice::dummy_buffer

Buffer to bind to unbound resource locations.

Definition at line 176 of file vk_device.hh.

Referenced by blender::gpu::VKVertexAttributeObject::bind(), and deinit().

◆ [struct]

◆ orphaned_data

VKDiscardPool blender::gpu::VKDevice::orphaned_data

◆ pipelines

◆ resources

◆ vkCmdBeginDebugUtilsLabel

PFN_vkCmdBeginDebugUtilsLabelEXT blender::gpu::VKDevice::vkCmdBeginDebugUtilsLabel = nullptr

◆ vkCmdBeginRendering

PFN_vkCmdBeginRendering blender::gpu::VKDevice::vkCmdBeginRendering = nullptr

◆ vkCmdEndDebugUtilsLabel

PFN_vkCmdEndDebugUtilsLabelEXT blender::gpu::VKDevice::vkCmdEndDebugUtilsLabel = nullptr

◆ vkCmdEndRendering

PFN_vkCmdEndRendering blender::gpu::VKDevice::vkCmdEndRendering = nullptr

◆ vkCreateDebugUtilsMessenger

PFN_vkCreateDebugUtilsMessengerEXT blender::gpu::VKDevice::vkCreateDebugUtilsMessenger = nullptr

Definition at line 190 of file vk_device.hh.

Referenced by blender::gpu::debug::VKDebuggingTools::init_messenger().

◆ vkDestroyDebugUtilsMessenger

PFN_vkDestroyDebugUtilsMessengerEXT blender::gpu::VKDevice::vkDestroyDebugUtilsMessenger = nullptr

◆ vkSetDebugUtilsObjectName

PFN_vkSetDebugUtilsObjectNameEXT blender::gpu::VKDevice::vkSetDebugUtilsObjectName = nullptr

Definition at line 189 of file vk_device.hh.

Referenced by blender::gpu::debug::object_label().


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