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

#include <vk_backend.hh>

Inherits blender::gpu::GPUBackend.

Public Member Functions

 VKBackend ()
virtual ~VKBackend ()
void init_resources () override
void delete_resources () override
void compute_dispatch (int groups_x_len, int groups_y_len, int groups_z_len) override
void compute_dispatch_indirect (StorageBuf *indirect_buf) override
Context * context_alloc (GHOST_IWindow *ghost_window, GHOST_IContext *ghost_context) override
Batch * batch_alloc () override
Fence * fence_alloc () override
WorkInFlight * work_in_flight_alloc (unsigned int max_in_flight) override
FrameBuffer * framebuffer_alloc (const char *name) override
IndexBuf * indexbuf_alloc () override
PixelBuffer * pixelbuf_alloc (size_t size) override
QueryPool * querypool_alloc () override
Shader * shader_alloc (const char *name) override
Texture * texture_alloc (const char *name) override
TexturePool * texturepool_alloc () override
UniformBuf * uniformbuf_alloc (size_t size, const char *name) override
StorageBuf * storagebuf_alloc (size_t size, GPUUsageType usage, const char *name) override
VertBuf * vertbuf_alloc () override
TopLevelAS * tlas_alloc (const char *name) override
BottomLevelAS * blas_alloc (const char *name) override
void shader_cache_dir_clear_old () override
void render_begin () override
void render_end () override
void render_step (bool) override
bool debug_capture_begin (const char *title)
void debug_capture_end ()
Public Member Functions inherited from blender::gpu::GPUBackend
virtual ~GPUBackend ()=default
ShaderCompiler * get_compiler ()

Static Public Member Functions

static bool is_supported ()
static void supported_devices_print (FILE *fp)
static VKBackend & get ()
static void platform_init (const VKDevice &device)
static void capabilities_init (VKDevice &device)
Static Public Member Functions inherited from blender::gpu::GPUBackend
static GPUBackend * get ()

Public Attributes

VKDevice device

Friends

class VKContext
class VKDescriptorSet
class VKDescriptorSetTracker

Additional Inherited Members

Protected Attributes inherited from blender::gpu::GPUBackend
ShaderCompiler * compiler_

Detailed Description

Definition at line 29 of file vk_backend.hh.

Constructor & Destructor Documentation

◆ VKBackend()

blender::gpu::VKBackend::VKBackend ( )
inline

Definition at line 39 of file vk_backend.hh.

References platform_init().

Referenced by get().

◆ ~VKBackend()

virtual blender::gpu::VKBackend::~VKBackend ( )
inlinevirtual

Definition at line 44 of file vk_backend.hh.

Member Function Documentation

◆ batch_alloc()

Batch * blender::gpu::VKBackend::batch_alloc ( )
overridevirtual

Implements blender::gpu::GPUBackend.

Definition at line 744 of file vk_backend.cc.

◆ blas_alloc()

BottomLevelAS * blender::gpu::VKBackend::blas_alloc ( const char * name)
overridevirtual

◆ capabilities_init()

void blender::gpu::VKBackend::capabilities_init ( VKDevice & device)
static

Definition at line 866 of file vk_backend.cc.

References blender::BLI_system_thread_count(), device, blender::gpu::GPUCapabilities::extension_get, blender::gpu::GPUCapabilities::extensions_len, blender::G, blender::G_DEBUG_GPU_NO_HW_RAYTRACING, blender::gpu::GCaps, blender::gpu::GPUCapabilities::geometry_shader_support, INT_MAX, blender::gpu::GPUCapabilities::max_batch_indices, blender::gpu::GPUCapabilities::max_batch_vertices, blender::gpu::GPUCapabilities::max_buffer_texture_size, blender::gpu::GPUCapabilities::max_compute_shader_storage_blocks, blender::max_ii(), blender::gpu::GPUCapabilities::max_images, blender::gpu::GPUCapabilities::max_parallel_compilations, blender::gpu::GPUCapabilities::max_shader_storage_buffer_bindings, blender::gpu::GPUCapabilities::max_storage_buffer_size, blender::gpu::GPUCapabilities::max_texture_3d_size, blender::gpu::GPUCapabilities::max_texture_layers, blender::gpu::GPUCapabilities::max_texture_size, blender::gpu::GPUCapabilities::max_textures, blender::gpu::GPUCapabilities::max_uniform_buffer_size, blender::gpu::GPUCapabilities::max_uniforms_frag, blender::gpu::GPUCapabilities::max_uniforms_vert, blender::gpu::GPUCapabilities::max_varying_floats, blender::gpu::GPUCapabilities::max_vertex_attribs, blender::gpu::GPUCapabilities::max_work_group_count, blender::gpu::GPUCapabilities::max_work_group_size, blender::gpu::GPUCapabilities::mem_stats_support, blender::min_uu(), blender::gpu::GPUCapabilities::multi_viewport_support, blender::gpu::VKDevice::physical_device_acceleration_structure_properties_get(), blender::gpu::VKDevice::physical_device_features_get(), blender::gpu::VKDevice::physical_device_get(), blender::gpu::VKDevice::physical_device_properties_get(), blender::gpu::GPUCapabilities::ray_query_support, blender::gpu::GPUCapabilities::srgb_write_view_support, blender::gpu::GPUCapabilities::stencil_export_support, blender::gpu::GPUCapabilities::storage_buffer_alignment, blender::gpu::VKDevice::supports_extension(), UINT_MAX, blender::gpu::GPUCapabilities::vertex_pipeline_stores_and_atomics_support, and blender::gpu::vk_extension_get().

Referenced by blender::gpu::VKDevice::init().

◆ compute_dispatch()

◆ compute_dispatch_indirect()

◆ context_alloc()

◆ debug_capture_begin()

bool blender::gpu::VKBackend::debug_capture_begin ( const char * title)

◆ debug_capture_end()

void blender::gpu::VKBackend::debug_capture_end ( )

◆ delete_resources()

void blender::gpu::VKBackend::delete_resources ( )
overridevirtual

Implements blender::gpu::GPUBackend.

Definition at line 694 of file vk_backend.cc.

References blender::gpu::GPUBackend::compiler_.

◆ fence_alloc()

Fence * blender::gpu::VKBackend::fence_alloc ( )
overridevirtual

Implements blender::gpu::GPUBackend.

Definition at line 749 of file vk_backend.cc.

◆ framebuffer_alloc()

FrameBuffer * blender::gpu::VKBackend::framebuffer_alloc ( const char * name)
overridevirtual

Implements blender::gpu::GPUBackend.

Definition at line 759 of file vk_backend.cc.

References blender::gpu::VKFrameBuffer::VKFrameBuffer().

◆ get()

VKBackend & blender::gpu::VKBackend::get ( )
inlinestatic

Definition at line 103 of file vk_backend.hh.

References blender::gpu::GPUBackend::get(), and VKBackend().

Referenced by blender::gpu::VKContext::activate(), blender::gpu::VKBottomLevelAS::add_geometry(), blender::gpu::VKTopLevelAS::add_instance(), blender::gpu::VKDescriptorPools::allocate(), blender::gpu::VKQueryPool::begin_query(), blender::gpu::VKWorkInFlight::begin_work(), blender::gpu::VKVertexAttributeObject::bind(), blender::gpu::VKBottomLevelAS::build(), blender::gpu::VKTopLevelAS::build(), blender::gpu::render_graph::VKCommandBufferWrapper::build_acceleration_structure(), blender::gpu::compile_ex(), 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::VKContext::debug_capture_begin(), blender::gpu::VKContext::debug_capture_end(), blender::gpu::VKContext::debug_capture_scope_begin(), blender::gpu::VKContext::debug_capture_scope_end(), blender::gpu::VKDescriptorSetLayouts::deinit(), blender::gpu::VKImageCache::discard_all_of(), blender::gpu::VKDiscardPool::discard_pool_get(), blender::gpu::VKImmediate::end(), blender::gpu::VKShader::ensure_and_get_compute_pipeline(), blender::gpu::VKShader::ensure_and_get_graphics_pipeline(), blender::gpu::VKVertexBuffer::ensure_buffer_view(), blender::gpu::VKShader::ensure_graphics_pipelines(), blender::gpu::VKTexture::export_memory(), blender::gpu::VKBuffer::export_memory_get(), blender::gpu::VKShader::finalize(), blender::gpu::VKShaderModule::finalize(), blender::gpu::VKBuffer::flush(), blender::gpu::VKBuffer::flush_mapped_memory(), blender::gpu::VKContext::flush_render_graph(), blender::gpu::VKShader::fragment_interface_declare(), blender::gpu::VKBuffer::free(), blender::gpu::VKSampler::free(), blender::gpu::get_image_memory_requirements(), blender::gpu::VKPixelBuffer::get_native_handle(), blender::gpu::VKQueryPool::get_occlusion_result(), blender::gpu::VKDescriptorSetLayouts::get_or_create(), blender::gpu::VKPipelinePool::init(), blender::gpu::VKTexture::init_internal(), blender::gpu::VKBuffer::invalidate_mapped_memory(), blender::gpu::VKContext::memory_statistics_get(), blender::gpu::debug::object_label(), blender::gpu::VKBuffer::read_async(), blender::gpu::VKPipelinePool::read_from_disk(), blender::gpu::VKDescriptorPools::recycle(), blender::gpu::VKTexturePool::release_texture(), blender::gpu::VKFrameBuffer::render_area_update(), blender::gpu::VKFrameBuffer::rendering_ensure(), blender::gpu::VKFrameBuffer::rendering_ensure_dynamic_rendering(), blender::gpu::VKImageCache::reset(), blender::gpu::render_graph::VKCommandBufferWrapper::set_front_face(), blender::gpu::render_graph::VKCommandBufferWrapper::set_vertex_input(), blender::gpu::spirv_target_version_get(), blender::gpu::VKFrameBuffer::subpass_transition_impl(), blender::gpu::to_vk_image_usage(), blender::gpu::VKStorageBuffer::update(), blender::gpu::VKDescriptorSetTracker::update_descriptor_set(), blender::gpu::VKContext::update_pipeline_data(), blender::gpu::VKTexture::update_sub(), blender::gpu::VKDescriptorSetPoolUpdator::upload_descriptor_sets(), blender::gpu::VKShader::vertex_interface_declare(), blender::gpu::vk_extension_get(), blender::gpu::render_graph::vk_pipeline_dynamic_graphics_build_commands(), blender::gpu::VKImageView::VKImageView(), blender::gpu::VKFence::wait(), blender::gpu::VKPipelinePool::write_to_disk(), blender::gpu::VKContext::~VKContext(), blender::gpu::VKDescriptorPools::~VKDescriptorPools(), blender::gpu::VKQueryPool::~VKQueryPool(), blender::gpu::VKShader::~VKShader(), and blender::gpu::VKTexture::~VKTexture().

◆ indexbuf_alloc()

IndexBuf * blender::gpu::VKBackend::indexbuf_alloc ( )
overridevirtual

Implements blender::gpu::GPUBackend.

Definition at line 764 of file vk_backend.cc.

◆ init_resources()

void blender::gpu::VKBackend::init_resources ( )
overridevirtual

◆ is_supported()

bool blender::gpu::VKBackend::is_supported ( )
static

Does the running platform contain any device that meets the minimum requirements to start the Vulkan backend.

Function is used to validate that a Blender UI can be started. It calls vulkan API commands directly to ensure no parts of Blender needs to be initialized.

Definition at line 263 of file vk_backend.cc.

References CLG_logref_init(), CLOG_DEBUG, CLOG_ERROR, CLOG_WARN, blender::Array< T, InlineBufferCapacity, Allocator >::data(), blender::gpu::GPU_vulkan_is_supported_driver(), blender::LOG, blender::gpu::missing_capabilities_get(), and blender::gpu::vk_instance_create_for_platform_checks().

Referenced by blender::gpu_backend_supported().

◆ pixelbuf_alloc()

PixelBuffer * blender::gpu::VKBackend::pixelbuf_alloc ( size_t size)
overridevirtual

Implements blender::gpu::GPUBackend.

Definition at line 769 of file vk_backend.cc.

References blender::gpu::VKPixelBuffer::VKPixelBuffer().

◆ platform_init()

◆ querypool_alloc()

QueryPool * blender::gpu::VKBackend::querypool_alloc ( )
overridevirtual

Implements blender::gpu::GPUBackend.

Definition at line 774 of file vk_backend.cc.

◆ render_begin()

void blender::gpu::VKBackend::render_begin ( )
overridevirtual

◆ render_end()

void blender::gpu::VKBackend::render_end ( )
overridevirtual

◆ render_step()

void blender::gpu::VKBackend::render_step ( bool force_resource_release)
overridevirtual

Implements blender::gpu::GPUBackend.

Definition at line 857 of file vk_backend.cc.

References device, and lock.

◆ shader_alloc()

Shader * blender::gpu::VKBackend::shader_alloc ( const char * name)
overridevirtual

Implements blender::gpu::GPUBackend.

Definition at line 779 of file vk_backend.cc.

References blender::gpu::VKShader::VKShader().

◆ shader_cache_dir_clear_old()

void blender::gpu::VKBackend::shader_cache_dir_clear_old ( )
inlineoverridevirtual

◆ storagebuf_alloc()

StorageBuf * blender::gpu::VKBackend::storagebuf_alloc ( size_t size,
GPUUsageType usage,
const char * name )
overridevirtual

◆ supported_devices_print()

void blender::gpu::VKBackend::supported_devices_print ( FILE * fp)
static

Print one line per Vulkan device that meets minimum requirements, in the format used by --gpu-device help. Each line is <vendor-hex>/<device-hex>/<index> <name>. Operates without an active backend (creates a temporary Vulkan instance).

Definition at line 326 of file vk_backend.cc.

References CLG_logref_init(), blender::Array< T, InlineBufferCapacity, Allocator >::data(), blender::gpu::GPU_vulkan_is_supported_driver(), blender::LOG, blender::gpu::missing_capabilities_get(), SNPRINTF_RLEN, and blender::gpu::vk_instance_create_for_platform_checks().

◆ texture_alloc()

Texture * blender::gpu::VKBackend::texture_alloc ( const char * name)
overridevirtual

Implements blender::gpu::GPUBackend.

Definition at line 784 of file vk_backend.cc.

References blender::gpu::VKTexture::VKTexture().

◆ texturepool_alloc()

TexturePool * blender::gpu::VKBackend::texturepool_alloc ( )
overridevirtual

◆ tlas_alloc()

TopLevelAS * blender::gpu::VKBackend::tlas_alloc ( const char * name)
overridevirtual

Implements blender::gpu::GPUBackend.

Definition at line 814 of file vk_backend.cc.

References blender::gpu::VKTopLevelAS::VKTopLevelAS().

◆ uniformbuf_alloc()

UniformBuf * blender::gpu::VKBackend::uniformbuf_alloc ( size_t size,
const char * name )
overridevirtual

◆ vertbuf_alloc()

VertBuf * blender::gpu::VKBackend::vertbuf_alloc ( )
overridevirtual

Implements blender::gpu::GPUBackend.

Definition at line 809 of file vk_backend.cc.

◆ work_in_flight_alloc()

WorkInFlight * blender::gpu::VKBackend::work_in_flight_alloc ( unsigned int max_in_flight)
overridevirtual

◆ VKContext

friend class VKContext
friend

Definition at line 117 of file vk_backend.hh.

References VKContext.

Referenced by compute_dispatch(), compute_dispatch_indirect(), context_alloc(), render_end(), and VKContext.

◆ VKDescriptorSet

friend class VKDescriptorSet
friend

Definition at line 118 of file vk_backend.hh.

References VKDescriptorSet.

Referenced by VKDescriptorSet.

◆ VKDescriptorSetTracker

friend class VKDescriptorSetTracker
friend

Definition at line 119 of file vk_backend.hh.

References VKDescriptorSetTracker.

Referenced by VKDescriptorSetTracker.

Member Data Documentation

◆ device

VKDevice blender::gpu::VKBackend::device

Definition at line 37 of file vk_backend.hh.

Referenced by blender::gpu::VKContext::activate(), blender::gpu::VKBottomLevelAS::add_geometry(), blender::gpu::VKTopLevelAS::add_instance(), blender::gpu::VKDescriptorPools::allocate(), blender::gpu::VKQueryPool::begin_query(), blender::gpu::VKWorkInFlight::begin_work(), blender::gpu::VKVertexAttributeObject::bind(), blender::gpu::VKBottomLevelAS::build(), blender::gpu::VKTopLevelAS::build(), blender::gpu::render_graph::VKCommandBufferWrapper::build_acceleration_structure(), capabilities_init(), blender::gpu::compile_ex(), context_alloc(), 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(), debug_capture_begin(), debug_capture_end(), blender::gpu::VKDescriptorSetLayouts::deinit(), blender::gpu::VKImageCache::discard_all_of(), blender::gpu::VKDiscardPool::discard_pool_get(), blender::gpu::VKImmediate::end(), blender::gpu::VKShader::ensure_and_get_compute_pipeline(), blender::gpu::VKShader::ensure_and_get_graphics_pipeline(), blender::gpu::VKVertexBuffer::ensure_buffer_view(), blender::gpu::VKShader::ensure_graphics_pipelines(), blender::gpu::VKTexture::export_memory(), blender::gpu::VKBuffer::export_memory_get(), blender::gpu::VKShader::finalize(), blender::gpu::VKShaderModule::finalize(), blender::gpu::VKBuffer::flush(), blender::gpu::VKBuffer::flush_mapped_memory(), blender::gpu::VKContext::flush_render_graph(), blender::gpu::VKShader::fragment_interface_declare(), blender::gpu::VKBuffer::free(), blender::gpu::VKSampler::free(), blender::gpu::get_image_memory_requirements(), blender::gpu::VKPixelBuffer::get_native_handle(), blender::gpu::VKQueryPool::get_occlusion_result(), blender::gpu::VKDescriptorSetLayouts::get_or_create(), blender::gpu::VKPipelinePool::init(), blender::gpu::VKTexture::init_internal(), blender::gpu::VKBuffer::invalidate_mapped_memory(), blender::gpu::VKContext::memory_statistics_get(), blender::gpu::debug::object_label(), platform_init(), blender::gpu::VKBuffer::read_async(), blender::gpu::VKPipelinePool::read_from_disk(), blender::gpu::VKDescriptorPools::recycle(), blender::gpu::VKTexturePool::release_texture(), blender::gpu::VKFrameBuffer::render_area_update(), render_begin(), render_end(), render_step(), blender::gpu::VKFrameBuffer::rendering_ensure(), blender::gpu::VKFrameBuffer::rendering_ensure_dynamic_rendering(), blender::gpu::VKImageCache::reset(), blender::gpu::render_graph::VKCommandBufferWrapper::set_front_face(), blender::gpu::render_graph::VKCommandBufferWrapper::set_vertex_input(), blender::gpu::spirv_target_version_get(), blender::gpu::VKFrameBuffer::subpass_transition_impl(), blender::gpu::to_vk_image_usage(), blender::gpu::VKStorageBuffer::update(), blender::gpu::VKDescriptorSetTracker::update_descriptor_set(), blender::gpu::VKContext::update_pipeline_data(), blender::gpu::VKTexture::update_sub(), blender::gpu::VKDescriptorSetPoolUpdator::upload_descriptor_sets(), blender::gpu::VKShader::vertex_interface_declare(), blender::gpu::vk_extension_get(), blender::gpu::render_graph::vk_pipeline_dynamic_graphics_build_commands(), blender::gpu::VKImageView::VKImageView(), blender::gpu::VKFence::wait(), blender::gpu::VKPipelinePool::write_to_disk(), blender::gpu::VKContext::~VKContext(), blender::gpu::VKDescriptorPools::~VKDescriptorPools(), blender::gpu::VKQueryPool::~VKQueryPool(), blender::gpu::VKShader::~VKShader(), and blender::gpu::VKTexture::~VKTexture().


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