|
Blender V4.3
|
#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 |
| VKDescriptorSetLayouts & | descriptor_set_layouts_get () |
| debug::VKDebuggingTools & | debugging_tools_get () |
| const debug::VKDebuggingTools & | debugging_tools_get () const |
| const VKSamplers & | samplers () const |
| bool | is_initialized () const |
| void | init (void *ghost_context) |
| void | reinit () |
| void | deinit () |
| bool | supports_extension (const char *extension_name) const |
| const VKWorkarounds & | workarounds_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 | |
| 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 | |
| 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 | |
| VKThreadData & | current_thread_data () |
| VKDiscardPool & | discard_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) |
Definition at line 125 of file vk_device.hh.
| void blender::gpu::VKDevice::context_register | ( | VKContext & | context | ) |
Definition at line 414 of file vk_device.cc.
| void blender::gpu::VKDevice::context_unregister | ( | VKContext & | context | ) |
Definition at line 419 of file vk_device.cc.
Referenced by blender::gpu::VKContext::~VKContext().
Definition at line 423 of file vk_device.cc.
| 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().
| void blender::gpu::VKDevice::debug_print | ( | ) |
Definition at line 486 of file vk_device.cc.
References BLI_assert_msg, BLI_thread_is_main(), debug_print(), blender::gpu::VKResourcePool::discard_pool, orphaned_data, pipelines, and blender::gpu::VKDescriptorSetLayouts::size().
Referenced by debug_print().
|
static |
Definition at line 459 of file vk_device.cc.
References blender::Vector< T, InlineBufferCapacity, Allocator >::is_empty(), and blender::Vector< T, InlineBufferCapacity, Allocator >::size().
|
inline |
Definition at line 253 of file vk_device.hh.
|
inline |
Definition at line 258 of file vk_device.hh.
| void blender::gpu::VKDevice::deinit | ( | ) |
Definition at line 36 of file vk_device.cc.
References blender::gpu::debug::VKDebuggingTools::deinit(), blender::gpu::VKDescriptorSetLayouts::deinit(), blender::gpu::VKThreadData::deinit(), dummy_buffer, blender::gpu::VKBuffer::free(), blender::gpu::VKSamplers::free(), blender::gpu::VKPipelinePool::free_data(), is_initialized(), pipelines, and blender::gpu::VKPipelinePool::write_to_disk().
|
inline |
Definition at line 248 of file vk_device.hh.
| eGPUDeviceType blender::gpu::VKDevice::device_type | ( | ) | const |
Definition at line 266 of file vk_device.cc.
References GPU_DEVICE_APPLE, GPU_DEVICE_ATI, GPU_DEVICE_INTEL, GPU_DEVICE_NVIDIA, GPU_DEVICE_QUALCOMM, GPU_DEVICE_SOFTWARE, and GPU_DEVICE_UNKNOWN.
Referenced by blender::gpu::VKBackend::platform_init().
| 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().
| eGPUDriverType blender::gpu::VKDevice::driver_type | ( | ) | const |
Definition at line 298 of file vk_device.cc.
References GPU_DRIVER_ANY, GPU_DRIVER_OFFICIAL, GPU_DRIVER_OPENSOURCE, and GPU_DRIVER_SOFTWARE.
Referenced by blender::gpu::VKBackend::platform_init().
| std::string blender::gpu::VKDevice::driver_version | ( | ) | const |
Definition at line 351 of file vk_device.cc.
Referenced by blender::gpu::VKBackend::platform_init().
| const char * blender::gpu::VKDevice::glsl_patch_get | ( | ) | const |
Definition at line 250 of file vk_device.cc.
References BLI_assert.
| void blender::gpu::VKDevice::init | ( | void * | ghost_context | ) |
Definition at line 75 of file vk_device.cc.
References BLI_assert, blender::gpu::VKBackend::capabilities_init(), blender::gpu::VKPipelinePool::init(), blender::gpu::VKSamplers::init(), init_glsl_patch(), is_initialized(), blender::gpu::debug::object_label(), pipelines, queue_get(), blender::gpu::VKPipelinePool::read_from_disk(), and vk_handle().
| void blender::gpu::VKDevice::init_glsl_patch | ( | ) |
Definition at line 210 of file vk_device.cc.
References datatoc_glsl_shader_defines_glsl, blender::gpu::VKWorkarounds::fragment_shader_barycentric, GPU_shader_draw_parameters_support(), GPU_stencil_export_support(), blender::gpu::VKWorkarounds::shader_output_layer, and blender::gpu::VKWorkarounds::shader_output_viewport_index.
Referenced by init().
|
inline |
Definition at line 219 of file vk_device.hh.
Referenced by blender::gpu::VKBackend::debug_capture_begin(), and blender::gpu::VKBackend::debug_capture_end().
| 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().
|
inline |
Definition at line 243 of file vk_device.hh.
Referenced by blender::gpu::VKBuffer::create(), blender::gpu::VKDiscardPool::destroy_discarded_resources(), blender::gpu::VKBuffer::flush(), blender::gpu::VKBuffer::free_immediately(), and 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().
|
inline |
Definition at line 204 of file vk_device.hh.
Referenced by blender::gpu::VKSampler::create().
|
inline |
Definition at line 194 of file vk_device.hh.
|
inline |
Definition at line 199 of file vk_device.hh.
Referenced by blender::gpu::VKBackend::capabilities_init(), blender::gpu::VKPushConstants::Layout::determine_storage_type(), and blender::gpu::VKBackend::platform_init().
|
inline |
Definition at line 209 of file vk_device.hh.
Referenced by blender::gpu::VKBackend::capabilities_init().
|
inline |
Definition at line 214 of file vk_device.hh.
|
inline |
Definition at line 238 of file vk_device.hh.
Referenced by blender::gpu::render_graph::VKCommandBufferWrapper::begin_recording(), and blender::gpu::VKBuffer::create().
|
inline |
Definition at line 229 of file vk_device.hh.
Referenced by init(), and blender::gpu::render_graph::VKCommandBufferWrapper::submit_with_cpu_synchronization().
|
inline |
Definition at line 233 of file vk_device.hh.
Referenced by blender::gpu::render_graph::VKCommandBufferWrapper::submit_with_cpu_synchronization().
| void blender::gpu::VKDevice::reinit | ( | ) |
Definition at line 30 of file vk_device.cc.
References blender::gpu::VKSamplers::free(), and blender::gpu::VKSamplers::init().
Referenced by blender::gpu::VKBackend::samplers_update().
|
inline |
Definition at line 263 of file vk_device.hh.
| 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().
| std::string blender::gpu::VKDevice::vendor_name | ( | ) | const |
Definition at line 324 of file vk_device.cc.
References blender::gpu::PCI_ID_AMD, blender::gpu::PCI_ID_APPLE, blender::gpu::PCI_ID_ATI, blender::gpu::PCI_ID_INTEL, and blender::gpu::PCI_ID_NVIDIA.
Referenced by blender::gpu::VKBackend::platform_init().
|
inline |
Definition at line 224 of file vk_device.hh.
Referenced by blender::gpu::VKDescriptorPools::allocate(), blender::gpu::VKQueryPool::begin_query(), blender::gpu::render_graph::VKCommandBufferWrapper::begin_recording(), blender::gpu::VKSampler::create(), blender::gpu::VKDescriptorSetLayouts::deinit(), blender::gpu::VKDiscardPool::destroy_discarded_resources(), blender::gpu::VKVertexBuffer::ensure_buffer_view(), blender::gpu::VKShader::finalize(), blender::gpu::VKShaderModule::finalize(), blender::gpu::VKPipelinePool::free_data(), blender::gpu::VKQueryPool::get_occlusion_result(), blender::gpu::VKDescriptorSetLayouts::get_or_create(), blender::gpu::VKPipelinePool::get_or_create_compute_pipeline(), blender::gpu::VKPipelinePool::get_or_create_graphics_pipeline(), init(), blender::gpu::VKPipelinePool::init(), blender::gpu::debug::object_label(), blender::gpu::VKPipelinePool::read_from_disk(), blender::gpu::VKVertexBuffer::release_data(), blender::gpu::VKPipelinePool::remove(), blender::gpu::VKDescriptorPools::reset(), blender::gpu::render_graph::VKCommandBufferWrapper::submit_with_cpu_synchronization(), blender::gpu::VKDescriptorSetTracker::upload_descriptor_sets(), blender::gpu::VKImageView::VKImageView(), blender::gpu::render_graph::VKCommandBufferWrapper::wait_for_cpu_synchronization(), blender::gpu::VKPipelinePool::write_to_disk(), blender::gpu::render_graph::VKCommandBufferWrapper::~VKCommandBufferWrapper(), and blender::gpu::VKQueryPool::~VKQueryPool().
|
inline |
Definition at line 286 of file vk_device.hh.
Referenced by blender::gpu::VKImmediate::begin(), blender::gpu::VKVertexBuffer::device_format_ensure(), blender::gpu::VKShader::fragment_interface_declare(), blender::gpu::VKTexture::init_internal(), blender::gpu::VKFrameBuffer::rendering_ensure(), and blender::gpu::VKShader::vertex_interface_declare().
| 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 { ... } blender::gpu::VKDevice::functions |
This struct contains the functions pointer to extension provided functions.
Referenced by blender::gpu::render_graph::VKCommandBufferWrapper::begin_debug_utils_label(), blender::gpu::render_graph::VKCommandBufferWrapper::begin_rendering(), blender::gpu::debug::VKDebuggingTools::destroy_messenger(), blender::gpu::render_graph::VKCommandBufferWrapper::end_debug_utils_label(), blender::gpu::render_graph::VKCommandBufferWrapper::end_rendering(), blender::gpu::debug::VKDebuggingTools::init_messenger(), and blender::gpu::debug::object_label().
| VKDiscardPool blender::gpu::VKDevice::orphaned_data |
Definition at line 173 of file vk_device.hh.
Referenced by debug_print(), discard_pool_for_current_thread(), and blender::gpu::VKContext::sync_backbuffer().
| VKPipelinePool blender::gpu::VKDevice::pipelines |
Definition at line 174 of file vk_device.hh.
Referenced by debug_print(), deinit(), blender::gpu::VKShader::ensure_and_get_compute_pipeline(), blender::gpu::VKShader::ensure_and_get_graphics_pipeline(), and init().
| render_graph::VKResourceStateTracker blender::gpu::VKDevice::resources |
Definition at line 172 of file vk_device.hh.
Referenced by blender::gpu::VKBuffer::create(), current_thread_data(), blender::gpu::VKDiscardPool::destroy_discarded_resources(), discard_pool_for_current_thread(), and blender::gpu::VKBuffer::free_immediately().
| PFN_vkCmdBeginDebugUtilsLabelEXT blender::gpu::VKDevice::vkCmdBeginDebugUtilsLabel = nullptr |
Definition at line 187 of file vk_device.hh.
Referenced by blender::gpu::render_graph::VKCommandBufferWrapper::begin_debug_utils_label().
| PFN_vkCmdBeginRendering blender::gpu::VKDevice::vkCmdBeginRendering = nullptr |
Definition at line 183 of file vk_device.hh.
Referenced by blender::gpu::render_graph::VKCommandBufferWrapper::begin_rendering().
| PFN_vkCmdEndDebugUtilsLabelEXT blender::gpu::VKDevice::vkCmdEndDebugUtilsLabel = nullptr |
Definition at line 188 of file vk_device.hh.
Referenced by blender::gpu::render_graph::VKCommandBufferWrapper::end_debug_utils_label().
| PFN_vkCmdEndRendering blender::gpu::VKDevice::vkCmdEndRendering = nullptr |
Definition at line 184 of file vk_device.hh.
Referenced by blender::gpu::render_graph::VKCommandBufferWrapper::end_rendering().
| PFN_vkCreateDebugUtilsMessengerEXT blender::gpu::VKDevice::vkCreateDebugUtilsMessenger = nullptr |
Definition at line 190 of file vk_device.hh.
Referenced by blender::gpu::debug::VKDebuggingTools::init_messenger().
| PFN_vkDestroyDebugUtilsMessengerEXT blender::gpu::VKDevice::vkDestroyDebugUtilsMessenger = nullptr |
Definition at line 191 of file vk_device.hh.
Referenced by blender::gpu::debug::VKDebuggingTools::destroy_messenger().
| PFN_vkSetDebugUtilsObjectNameEXT blender::gpu::VKDevice::vkSetDebugUtilsObjectName = nullptr |
Definition at line 189 of file vk_device.hh.
Referenced by blender::gpu::debug::object_label().