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

#include <vk_device.hh>

Inherits blender::blender::NonCopyable.

Public Member Functions

const char * extension_name_get (int index) const
VkPhysicalDevice physical_device_get () const
const VkPhysicalDeviceProperties & physical_device_properties_get () const
const VkPhysicalDeviceMaintenance4Properties & physical_device_maintenance4_properties_get () const
const VkPhysicalDeviceIDProperties & physical_device_id_properties_get () const
const VkPhysicalDeviceGraphicsPipelineLibraryPropertiesEXT & physical_device_graphics_pipeline_properties_get ()
const VkPhysicalDeviceAccelerationStructurePropertiesKHR & physical_device_acceleration_structure_properties_get ()
const VkPhysicalDeviceFeatures & physical_device_features_get () const
const VkPhysicalDeviceAccelerationStructureFeaturesKHR & physical_device_acceleration_structure_features_get () const
VkInstance instance_get () const
VkDevice vk_handle () const
uint32_t queue_family_get () const
VmaAllocator mem_allocator_get () const
VKDescriptorSetLayouts & descriptor_set_layouts_get ()
debug::VKDebuggingTools & debugging_tools_get ()
const debug::VKDebuggingTools & debugging_tools_get () const
const VKSamplers & samplers () const
void init (GHOST_IContext *ghost_context)
void reinit ()
void deinit ()
bool is_initialized () const
bool supports_extension (const char *extension_name) const
const VKWorkarounds & workarounds_get () const
const VKExtensions & extensions_get () const
std::string glsl_vertex_patch_get (bool use_ray_query) const
std::string glsl_geometry_patch_get () const
std::string glsl_fragment_patch_get (bool use_ray_query) const
std::string glsl_compute_patch_get (bool use_ray_query) const
shader::GeneratedSource extensions_define (StringRefNull stage_define, bool use_ray_query) const
uint32_t glsl_patch_version_get (bool use_ray_query) const
Shader * vk_backbuffer_blit_sh_get ()
Platform/driver/device information
GPUDeviceType device_type () const
GPUDriverType driver_type () const
std::string vendor_name () const
std::string driver_version () const
Resource management
VKThreadData & current_thread_data ()
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 () const
Public Member Functions inherited from blender::blender::NonCopyable
 NonCopyable (const NonCopyable &other)=delete
NonCopyable & operator= (const NonCopyable &other)=delete
 NonCopyable ()=default
 NonCopyable (NonCopyable &&other)=default
NonCopyable & operator= (NonCopyable &&other)=default

Public Attributes

render_graph::VKResourceStateTracker resources
VKDiscardPool orphaned_data
VKDiscardPool orphaned_data_render
VKPipelinePool pipelines
VKVertexInputDescriptionPool vertex_input_descriptions
VKBuffer dummy_buffer
VolkDeviceTable functions = {}
VKMemoryPools vma_pools

Render graph

render_graph::VKRenderGraph * render_graph_new ()
TimelineValue render_graph_submit (render_graph::VKRenderGraph *render_graph, VKDiscardPool &context_discard_pool, bool submit_to_device, bool wait_for_submission, bool wait_for_completion, VkPipelineStageFlags wait_dst_stage_mask, VkSemaphore wait_semaphore, VkSemaphore signal_semaphore, VkFence signal_fence)
void wait_for_timeline (TimelineValue timeline)
void wait_queue_idle ()
TimelineValue submission_finished_timeline_get () const
static void submission_runner (VKDevice *device)

Detailed Description

Definition at line 180 of file vk_device.hh.

Member Function Documentation

◆ context_register()

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

Definition at line 504 of file vk_device.cc.

◆ context_unregister()

◆ contexts_get()

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

Definition at line 527 of file vk_device.cc.

◆ current_thread_data()

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

◆ debug_print()

◆ debugging_tools_get() [1/2]

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

Definition at line 358 of file vk_device.hh.

◆ debugging_tools_get() [2/2]

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

Definition at line 363 of file vk_device.hh.

◆ deinit()

◆ descriptor_set_layouts_get()

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

Definition at line 353 of file vk_device.hh.

◆ device_type()

◆ driver_type()

◆ driver_version()

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

◆ extension_name_get()

const char * blender::gpu::VKDevice::extension_name_get ( int index) const
inline

Definition at line 284 of file vk_device.hh.

Referenced by blender::gpu::vk_extension_get().

◆ extensions_define()

shader::GeneratedSource blender::gpu::VKDevice::extensions_define ( StringRefNull stage_define,
bool use_ray_query ) const

◆ extensions_get()

◆ glsl_compute_patch_get()

std::string blender::gpu::VKDevice::glsl_compute_patch_get ( bool use_ray_query) const

◆ glsl_fragment_patch_get()

std::string blender::gpu::VKDevice::glsl_fragment_patch_get ( bool use_ray_query) const

◆ glsl_geometry_patch_get()

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

◆ glsl_patch_version_get()

uint32_t blender::gpu::VKDevice::glsl_patch_version_get ( bool use_ray_query) const

Definition at line 293 of file vk_device.cc.

Referenced by blender::gpu::compile_ex(), and extensions_define().

◆ glsl_vertex_patch_get()

std::string blender::gpu::VKDevice::glsl_vertex_patch_get ( bool use_ray_query) const

◆ init()

◆ instance_get()

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

◆ is_initialized()

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

Definition at line 376 of file vk_device.hh.

Referenced by deinit(), and init().

◆ mem_allocator_get()

◆ memory_statistics_get()

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

◆ physical_device_acceleration_structure_features_get()

const VkPhysicalDeviceAccelerationStructureFeaturesKHR & blender::gpu::VKDevice::physical_device_acceleration_structure_features_get ( ) const
inline

Definition at line 328 of file vk_device.hh.

◆ physical_device_acceleration_structure_properties_get()

const VkPhysicalDeviceAccelerationStructurePropertiesKHR & blender::gpu::VKDevice::physical_device_acceleration_structure_properties_get ( )
inline

◆ physical_device_features_get()

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

◆ physical_device_get()

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

◆ physical_device_graphics_pipeline_properties_get()

const VkPhysicalDeviceGraphicsPipelineLibraryPropertiesEXT & blender::gpu::VKDevice::physical_device_graphics_pipeline_properties_get ( )
inline

Definition at line 311 of file vk_device.hh.

◆ physical_device_id_properties_get()

const VkPhysicalDeviceIDProperties & blender::gpu::VKDevice::physical_device_id_properties_get ( ) const
inline

Definition at line 305 of file vk_device.hh.

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

◆ physical_device_maintenance4_properties_get()

const VkPhysicalDeviceMaintenance4Properties & blender::gpu::VKDevice::physical_device_maintenance4_properties_get ( ) const
inline

Definition at line 300 of file vk_device.hh.

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

◆ physical_device_properties_get()

◆ queue_family_get()

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

Definition at line 343 of file vk_device.hh.

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

◆ reinit()

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

Definition at line 99 of file vk_device.cc.

◆ render_graph_new()

◆ render_graph_submit()

◆ samplers()

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

Definition at line 368 of file vk_device.hh.

◆ submission_finished_timeline_get()

TimelineValue blender::gpu::VKDevice::submission_finished_timeline_get ( ) const
inline

Retrieve the last finished submission timeline.

Definition at line 431 of file vk_device.hh.

References blender::BLI_assert(), BLI_assert_msg, functions, blender::result, UINT64_MAX, and UNUSED_VARS.

Referenced by submission_runner().

◆ submission_runner()

void blender::gpu::VKDevice::submission_runner ( VKDevice * device)
static

Definition at line 134 of file vk_device_submission.cc.

References blender::gpu::TimelineResources< Item >::append_timeline(), blender::assign_if_different(), blender::BLI_assert(), blender::BLI_thread_queue_pop_timeout(), blender::BLI_thread_queue_push(), blender::BLI_THREAD_QUEUE_WORK_PRIORITY_NORMAL, blender::gpu::render_graph::VKCommandBuilder::build_nodes(), CLOG_TRACE, lexit::Vector< T >::data(), blender::gpu::VKDiscardPool::destroy_discarded_resources(), blender::gpu::VKDiscardPool::discard_resources(), functions, blender::gpu::VKRenderGraphWait::is_submitted, blender::gpu::VKRenderGraphWait::is_submitted_condition, blender::gpu::VKRenderGraphWait::is_submitted_mutex, lock, blender::LOG, blender::gpu::render_graph::VKResourceStateTracker::mutex, orphaned_data, blender::gpu::render_graph::VKResourceStateTracker::pop_discardable_resources(), blender::gpu::render_graph::VKCommandBuilder::record_commands(), blender::gpu::TimelineResources< Item >::remove_old(), blender::gpu::VKRenderGraphSubmitTask::render_graph, lexit::Vector< T >::resize(), resources, blender::gpu::render_graph::VKScheduler::select_nodes(), blender::gpu::VKRenderGraphSubmitTask::signal_fence, blender::gpu::VKRenderGraphSubmitTask::signal_semaphore, blender::Span< T >::size(), lexit::Vector< T >::size(), submission_finished_timeline_get(), blender::gpu::VKRenderGraphSubmitTask::submit_to_device, blender::gpu::VKRenderGraphSubmitTask::timeline, UINT64_MAX, blender::gpu::VKRenderGraphSubmitTask::wait_dst_stage_mask, blender::gpu::VKRenderGraphSubmitTask::wait_for_submission, and blender::gpu::VKRenderGraphSubmitTask::wait_semaphore.

◆ 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 268 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_backbuffer_blit_sh_get()

Shader * blender::gpu::VKDevice::vk_backbuffer_blit_sh_get ( )
inline

Definition at line 468 of file vk_device.hh.

References blender::GPU_shader_create_from_info_name().

◆ vk_handle()

◆ wait_for_timeline()

◆ wait_queue_idle()

void blender::gpu::VKDevice::wait_queue_idle ( )

Definition at line 114 of file vk_device_submission.cc.

References functions, and lock.

◆ workarounds_get()

Member Data Documentation

◆ dummy_buffer

VKBuffer blender::gpu::VKDevice::dummy_buffer

Buffer to bind to unbound resource locations.

Definition at line 278 of file vk_device.hh.

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

◆ functions

VolkDeviceTable blender::gpu::VKDevice::functions = {}

Definition at line 280 of file vk_device.hh.

Referenced by blender::gpu::VKDescriptorPools::allocate(), blender::gpu::VKQueryPool::begin_query(), blender::gpu::VKBottomLevelAS::build(), blender::gpu::VKTopLevelAS::build(), blender::gpu::render_graph::VKCommandBufferWrapper::build_acceleration_structure(), blender::gpu::VKBuffer::create(), blender::gpu::VKSampler::create(), blender::gpu::create_and_bind_vk_image(), blender::gpu::create_graphics_pipeline_libs(), blender::gpu::create_graphics_pipeline_no_libs(), blender::gpu::VKDescriptorSetLayouts::deinit(), blender::gpu::VKDiscardPool::destroy_discarded_resources(), blender::gpu::VKVertexBuffer::ensure_buffer_view(), blender::gpu::VKTexture::export_memory(), blender::gpu::VKShaderModule::finalize(), blender::gpu::VKSampler::free(), blender::gpu::VKPipelinePool::free_data(), blender::gpu::get_image_memory_requirements(), blender::gpu::VKPixelBuffer::get_native_handle(), blender::gpu::VKQueryPool::get_occlusion_result(), blender::gpu::VKDescriptorSetLayouts::get_or_create(), init(), blender::gpu::VKPipelinePool::init(), blender::gpu::VKPipelinePool::read_from_disk(), blender::gpu::VKDescriptorPools::recycle(), blender::gpu::render_graph::VKCommandBufferWrapper::set_front_face(), blender::gpu::render_graph::VKCommandBufferWrapper::set_vertex_input(), submission_finished_timeline_get(), submission_runner(), blender::gpu::VKTexture::update_sub(), blender::gpu::VKDescriptorSetPoolUpdator::upload_descriptor_sets(), blender::gpu::VKImageView::VKImageView(), wait_for_timeline(), wait_queue_idle(), blender::gpu::VKPipelinePool::write_to_disk(), blender::gpu::VKDescriptorPools::~VKDescriptorPools(), and blender::gpu::VKQueryPool::~VKQueryPool().

◆ orphaned_data

◆ orphaned_data_render

VKDiscardPool blender::gpu::VKDevice::orphaned_data_render

Discard pool for resources that could still be used during rendering.

Definition at line 273 of file vk_device.hh.

Referenced by debug_print(), deinit(), and blender::gpu::VKDiscardPool::discard_pool_get().

◆ pipelines

◆ resources

◆ vertex_input_descriptions

VKVertexInputDescriptionPool blender::gpu::VKDevice::vertex_input_descriptions

◆ vma_pools

VKMemoryPools blender::gpu::VKDevice::vma_pools

Definition at line 282 of file vk_device.hh.

Referenced by blender::gpu::VKBuffer::create(), deinit(), and init().


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