|
Blender V4.5
|
#include <vk_device.hh>
Inherits 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 VkPhysicalDeviceIDProperties & | physical_device_id_properties_get () const |
| const VkPhysicalDeviceDescriptorBufferPropertiesEXT & | physical_device_descriptor_buffer_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 |
| 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 (void *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 |
| const char * | glsl_vertex_patch_get () const |
| const char * | glsl_geometry_patch_get () const |
| const char * | glsl_fragment_patch_get () const |
| const char * | glsl_compute_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 |
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_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 (TaskPool *__restrict pool, void *task_data) |
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 () |
| static void | debug_print (std::ostream &os, const VKDiscardPool &discard_pool) |
Definition at line 164 of file vk_device.hh.
| void blender::gpu::VKDevice::context_register | ( | VKContext & | context | ) |
Definition at line 536 of file vk_device.cc.
| void blender::gpu::VKDevice::context_unregister | ( | VKContext & | context | ) |
Definition at line 541 of file vk_device.cc.
References BLI_assert_msg, BLI_thread_queue_push(), lock, and orphaned_data.
Referenced by blender::gpu::VKContext::~VKContext().
Definition at line 558 of file vk_device.cc.
| VKThreadData & blender::gpu::VKDevice::current_thread_data | ( | ) |
Get or create current thread data.
Definition at line 520 of file vk_device.cc.
References mutex, and resources.
Referenced by blender::gpu::VKContext::activate().
| void blender::gpu::VKDevice::debug_print | ( | ) |
Definition at line 628 of file vk_device.cc.
References BLI_assert_msg, BLI_thread_is_main(), debug_print(), memory_statistics_get(), orphaned_data, orphaned_data_render, and pipelines.
Referenced by debug_print().
|
static |
Definition at line 594 of file vk_device.cc.
References blender::gpu::TimelineResources< Item >::is_empty(), and blender::gpu::TimelineResources< Item >::size().
|
inline |
Definition at line 356 of file vk_device.hh.
|
inline |
Definition at line 361 of file vk_device.hh.
| void blender::gpu::VKDevice::deinit | ( | ) |
Definition at line 69 of file vk_device.cc.
References dummy_buffer, is_initialized(), orphaned_data, orphaned_data_render, pipelines, and vma_pools.
|
inline |
Definition at line 351 of file vk_device.hh.
Referenced by blender::gpu::VKDescriptorBufferUpdator::allocate_new_descriptor_set().
| eGPUDeviceType blender::gpu::VKDevice::device_type | ( | ) | const |
Definition at line 410 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.
| eGPUDriverType blender::gpu::VKDevice::driver_type | ( | ) | const |
Definition at line 442 of file vk_device.cc.
References GPU_DRIVER_ANY, GPU_DRIVER_OFFICIAL, GPU_DRIVER_OPENSOURCE, and GPU_DRIVER_SOFTWARE.
| std::string blender::gpu::VKDevice::driver_version | ( | ) | const |
Definition at line 495 of file vk_device.cc.
|
inline |
Definition at line 290 of file vk_device.hh.
Referenced by blender::gpu::vk_extension_get().
|
inline |
Definition at line 396 of file vk_device.hh.
Referenced by blender::gpu::VKBuffer::create(), blender::gpu::VKTexture::export_memory(), blender::gpu::VKContext::flush_render_graph(), blender::gpu::VKShader::fragment_interface_declare(), blender::gpu::VKPixelBuffer::get_native_handle(), blender::gpu::VKDescriptorSetLayouts::get_or_create(), blender::gpu::VKPipelinePool::get_or_create_compute_pipeline(), blender::gpu::VKPipelinePool::get_or_create_graphics_pipeline(), blender::gpu::VKShaderInterface::init(), blender::gpu::VKFrameBuffer::rendering_end(), blender::gpu::VKFrameBuffer::rendering_ensure(), blender::gpu::VKFrameBuffer::rendering_ensure_dynamic_rendering(), blender::gpu::VKFrameBuffer::subpass_transition_impl(), blender::gpu::to_vk_image_usage(), blender::gpu::VKDescriptorSetTracker::update_descriptor_set(), and blender::gpu::VKDescriptorSetTracker::upload_descriptor_sets().
| const char * blender::gpu::VKDevice::glsl_compute_patch_get | ( | ) | const |
Definition at line 394 of file vk_device.cc.
References BLI_assert.
| const char * blender::gpu::VKDevice::glsl_fragment_patch_get | ( | ) | const |
Definition at line 388 of file vk_device.cc.
References BLI_assert.
| const char * blender::gpu::VKDevice::glsl_geometry_patch_get | ( | ) | const |
Definition at line 382 of file vk_device.cc.
References BLI_assert.
| const char * blender::gpu::VKDevice::glsl_vertex_patch_get | ( | ) | const |
Definition at line 376 of file vk_device.cc.
References BLI_assert.
| void blender::gpu::VKDevice::init | ( | void * | ghost_context | ) |
Definition at line 116 of file vk_device.cc.
References BLI_assert, blender::gpu::VKBackend::capabilities_init(), handles, init_glsl_patch(), is_initialized(), blender::gpu::debug::object_label(), orphaned_data, pipelines, blender::gpu::VKBackend::platform_init(), resources, and vk_handle().
| void blender::gpu::VKDevice::init_glsl_patch | ( | ) |
Definition at line 341 of file vk_device.cc.
References datatoc_glsl_shader_defines_glsl, GPU_shader_draw_parameters_support(), and GPU_stencil_export_support().
Referenced by init().
|
inline |
Definition at line 331 of file vk_device.hh.
|
inline |
Definition at line 374 of file vk_device.hh.
|
inline |
Definition at line 346 of file vk_device.hh.
Referenced by blender::gpu::VKBuffer::create(), blender::gpu::VKDiscardPool::destroy_discarded_resources(), blender::gpu::VKBuffer::export_memory_get(), 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 563 of file vk_device.cc.
References mem_allocator_get().
Referenced by debug_print(), and blender::gpu::VKContext::memory_statistics_get().
|
inline |
Definition at line 311 of file vk_device.hh.
Referenced by blender::gpu::VKDescriptorBufferUpdator::bind_buffer(), blender::gpu::VKDescriptorBufferUpdator::bind_image(), and blender::gpu::VKDescriptorBufferUpdator::bind_texel_buffer().
|
inline |
Definition at line 316 of file vk_device.hh.
Referenced by blender::gpu::VKSampler::create().
|
inline |
Definition at line 295 of file vk_device.hh.
|
inline |
Definition at line 305 of file vk_device.hh.
|
inline |
Definition at line 300 of file vk_device.hh.
Referenced by blender::gpu::VKPushConstants::Layout::determine_storage_type().
|
inline |
Definition at line 321 of file vk_device.hh.
|
inline |
Definition at line 326 of file vk_device.hh.
|
inline |
Definition at line 341 of file vk_device.hh.
Referenced by blender::gpu::VKBuffer::create().
| void blender::gpu::VKDevice::reinit | ( | ) |
Definition at line 63 of file vk_device.cc.
| render_graph::VKRenderGraph * blender::gpu::VKDevice::render_graph_new | ( | ) |
Definition at line 113 of file vk_device_submission.cc.
References BLI_thread_queue_pop_timeout(), lock, and resources.
Referenced by blender::gpu::VKContext::activate(), and blender::gpu::VKContext::flush_render_graph().
| TimelineValue blender::gpu::VKDevice::render_graph_submit | ( | render_graph::VKRenderGraph * | render_graph, |
| VKDiscardPool & | context_discard_pool, | ||
| bool | submit_to_device, | ||
| bool | wait_for_completion, | ||
| VkPipelineStageFlags | wait_dst_stage_mask, | ||
| VkSemaphore | wait_semaphore, | ||
| VkSemaphore | signal_semaphore, | ||
| VkFence | signal_fence ) |
Definition at line 45 of file vk_device_submission.cc.
References BLI_thread_queue_push(), blender::gpu::VKRenderGraphWait::is_submitted, blender::gpu::VKRenderGraphWait::is_submitted_condition, blender::gpu::VKRenderGraphWait::is_submitted_mutex, lock, orphaned_data, blender::gpu::VKRenderGraphSubmitTask::render_graph, blender::gpu::VKRenderGraphSubmitTask::signal_fence, blender::gpu::VKRenderGraphSubmitTask::signal_semaphore, blender::gpu::VKRenderGraphSubmitTask::submit_to_device, blender::gpu::VKRenderGraphSubmitTask::timeline, blender::gpu::VKRenderGraphSubmitTask::wait_dst_stage_mask, blender::gpu::VKRenderGraphSubmitTask::wait_for_submission, wait_for_timeline(), and blender::gpu::VKRenderGraphSubmitTask::wait_semaphore.
Referenced by blender::gpu::VKContext::flush_render_graph().
|
inline |
Definition at line 366 of file vk_device.hh.
|
inline |
Retrieve the last finished submission timeline.
Definition at line 427 of file vk_device.hh.
References BLI_assert.
Referenced by blender::gpu::VKDiscardPool::destroy_discarded_resources(), and submission_runner().
|
static |
Definition at line 127 of file vk_device_submission.cc.
References blender::Vector< T, InlineBufferCapacity, Allocator >::append(), blender::gpu::TimelineResources< Item >::append_timeline(), blender::assign_if_different(), BLI_assert, BLI_task_pool_current_canceled(), BLI_task_pool_user_data(), BLI_thread_queue_pop_timeout(), BLI_thread_queue_push(), blender::gpu::render_graph::VKCommandBuilder::build_nodes(), blender::Vector< T, InlineBufferCapacity, Allocator >::clear(), CLOG_INFO, blender::Vector< T, InlineBufferCapacity, Allocator >::data(), blender::gpu::VKDiscardPool::destroy_discarded_resources(), blender::Vector< T, InlineBufferCapacity, Allocator >::is_empty(), blender::gpu::VKRenderGraphWait::is_submitted, blender::gpu::VKRenderGraphWait::is_submitted_condition, blender::gpu::VKRenderGraphWait::is_submitted_mutex, blender::Vector< T, InlineBufferCapacity, Allocator >::last(), lock, blender::gpu::LOG, blender::gpu::render_graph::VKResourceStateTracker::mutex, orphaned_data, blender::Vector< T, InlineBufferCapacity, Allocator >::pop_last(), blender::gpu::render_graph::VKCommandBuilder::record_commands(), blender::gpu::TimelineResources< Item >::remove_old(), blender::gpu::VKRenderGraphSubmitTask::render_graph, blender::Vector< T, InlineBufferCapacity, Allocator >::reserve(), blender::Vector< T, InlineBufferCapacity, Allocator >::resize(), resources, blender::gpu::render_graph::VKScheduler::select_nodes(), blender::gpu::VKRenderGraphSubmitTask::signal_fence, blender::gpu::VKRenderGraphSubmitTask::signal_semaphore, blender::Vector< T, InlineBufferCapacity, Allocator >::size(), submission_finished_timeline_get(), blender::gpu::VKRenderGraphSubmitTask::submit_to_device, blender::gpu::VKRenderGraphSubmitTask::timeline, UINT64_MAX, UNUSED_VARS, blender::gpu::VKRenderGraphSubmitTask::wait_dst_stage_mask, blender::gpu::VKRenderGraphSubmitTask::wait_for_submission, and blender::gpu::VKRenderGraphSubmitTask::wait_semaphore.
| 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 253 of file vk_device.cc.
References STREQ.
| std::string blender::gpu::VKDevice::vendor_name | ( | ) | const |
Definition at line 468 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.
|
inline |
Definition at line 336 of file vk_device.hh.
Referenced by blender::gpu::VKDescriptorPools::allocate(), blender::gpu::VKQueryPool::begin_query(), blender::gpu::VKDescriptorBufferUpdator::bind_buffer(), blender::gpu::VKDescriptorBufferUpdator::bind_image(), blender::gpu::VKDescriptorBufferUpdator::bind_texel_buffer(), blender::gpu::VKBuffer::create(), blender::gpu::VKSampler::create(), 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::VKPixelBuffer::get_native_handle(), 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::VKFrameBuffer::rendering_ensure_render_pass(), blender::gpu::VKDescriptorSetPoolUpdator::upload_descriptor_sets(), blender::gpu::VKImageView::VKImageView(), blender::gpu::VKPipelinePool::write_to_disk(), blender::gpu::VKDescriptorPools::~VKDescriptorPools(), and blender::gpu::VKQueryPool::~VKQueryPool().
| void blender::gpu::VKDevice::wait_for_timeline | ( | TimelineValue | timeline | ) |
Definition at line 97 of file vk_device_submission.cc.
References UINT64_MAX.
Referenced by blender::gpu::VKBuffer::read_async(), render_graph_submit(), and blender::gpu::VKFence::wait().
| void blender::gpu::VKDevice::wait_queue_idle | ( | ) |
Definition at line 107 of file vk_device_submission.cc.
References lock.
|
inline |
Definition at line 392 of file vk_device.hh.
Referenced by blender::gpu::VKTexture::init_internal().
| VKBuffer blender::gpu::VKDevice::dummy_buffer |
Buffer to bind to unbound resource locations.
Definition at line 248 of file vk_device.hh.
Referenced by blender::gpu::VKVertexAttributeObject::bind(), and deinit().
| VmaPool blender::gpu::VKDevice::external_memory = VK_NULL_HANDLE |
Definition at line 287 of file vk_device.hh.
Referenced by blender::gpu::VKBuffer::create().
| VkExportMemoryAllocateInfoKHR blender::gpu::VKDevice::external_memory_info |
Definition at line 285 of file vk_device.hh.
| 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::VKDescriptorBufferUpdator::bind_buffer(), blender::gpu::render_graph::VKCommandBufferWrapper::bind_descriptor_buffers(), blender::gpu::VKDescriptorBufferUpdator::bind_image(), blender::gpu::VKDescriptorBufferUpdator::bind_texel_buffer(), blender::gpu::debug::VKDebuggingTools::destroy_messenger(), blender::gpu::render_graph::VKCommandBufferWrapper::end_debug_utils_label(), blender::gpu::render_graph::VKCommandBufferWrapper::end_rendering(), blender::gpu::VKTexture::export_memory(), blender::gpu::VKPixelBuffer::get_native_handle(), blender::gpu::debug::VKDebuggingTools::init_messenger(), blender::gpu::debug::object_label(), and blender::gpu::render_graph::VKCommandBufferWrapper::set_descriptor_buffer_offsets().
| VKDiscardPool blender::gpu::VKDevice::orphaned_data |
Definition at line 243 of file vk_device.hh.
Referenced by context_unregister(), debug_print(), deinit(), blender::gpu::VKDiscardPool::discard_pool_get(), init(), render_graph_submit(), and submission_runner().
| VKDiscardPool blender::gpu::VKDevice::orphaned_data_render |
Discard pool for resources that could still be used during rendering.
Definition at line 245 of file vk_device.hh.
Referenced by debug_print(), deinit(), and blender::gpu::VKDiscardPool::discard_pool_get().
| VKPipelinePool blender::gpu::VKDevice::pipelines |
Definition at line 246 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(), init(), and blender::gpu::VKShader::~VKShader().
| render_graph::VKResourceStateTracker blender::gpu::VKDevice::resources |
Definition at line 242 of file vk_device.hh.
Referenced by blender::gpu::VKBuffer::create(), current_thread_data(), blender::gpu::VKDiscardPool::destroy_discarded_resources(), blender::gpu::VKBuffer::free_immediately(), init(), render_graph_new(), and submission_runner().
| PFN_vkCmdBeginDebugUtilsLabelEXT blender::gpu::VKDevice::vkCmdBeginDebugUtilsLabel = nullptr |
Definition at line 259 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 255 of file vk_device.hh.
Referenced by blender::gpu::render_graph::VKCommandBufferWrapper::begin_rendering().
| PFN_vkCmdBindDescriptorBuffersEXT blender::gpu::VKDevice::vkCmdBindDescriptorBuffers = nullptr |
Definition at line 277 of file vk_device.hh.
Referenced by blender::gpu::render_graph::VKCommandBufferWrapper::bind_descriptor_buffers().
| PFN_vkCmdEndDebugUtilsLabelEXT blender::gpu::VKDevice::vkCmdEndDebugUtilsLabel = nullptr |
Definition at line 260 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 256 of file vk_device.hh.
Referenced by blender::gpu::render_graph::VKCommandBufferWrapper::end_rendering().
| PFN_vkCmdSetDescriptorBufferOffsetsEXT blender::gpu::VKDevice::vkCmdSetDescriptorBufferOffsets = nullptr |
Definition at line 278 of file vk_device.hh.
Referenced by blender::gpu::render_graph::VKCommandBufferWrapper::set_descriptor_buffer_offsets().
| PFN_vkCreateDebugUtilsMessengerEXT blender::gpu::VKDevice::vkCreateDebugUtilsMessenger = nullptr |
Definition at line 262 of file vk_device.hh.
Referenced by blender::gpu::debug::VKDebuggingTools::init_messenger().
| PFN_vkDestroyDebugUtilsMessengerEXT blender::gpu::VKDevice::vkDestroyDebugUtilsMessenger = nullptr |
Definition at line 263 of file vk_device.hh.
Referenced by blender::gpu::debug::VKDebuggingTools::destroy_messenger().
| PFN_vkGetDescriptorEXT blender::gpu::VKDevice::vkGetDescriptor = nullptr |
Definition at line 276 of file vk_device.hh.
Referenced by blender::gpu::VKDescriptorBufferUpdator::bind_buffer(), blender::gpu::VKDescriptorBufferUpdator::bind_image(), and blender::gpu::VKDescriptorBufferUpdator::bind_texel_buffer().
| PFN_vkGetDescriptorSetLayoutBindingOffsetEXT blender::gpu::VKDevice::vkGetDescriptorSetLayoutBindingOffset = nullptr |
Definition at line 275 of file vk_device.hh.
| PFN_vkGetDescriptorSetLayoutSizeEXT blender::gpu::VKDevice::vkGetDescriptorSetLayoutSize = nullptr |
Definition at line 274 of file vk_device.hh.
| PFN_vkGetMemoryFdKHR blender::gpu::VKDevice::vkGetMemoryFd = nullptr |
Definition at line 266 of file vk_device.hh.
Referenced by blender::gpu::VKTexture::export_memory(), and blender::gpu::VKPixelBuffer::get_native_handle().
| PFN_vkSetDebugUtilsObjectNameEXT blender::gpu::VKDevice::vkSetDebugUtilsObjectName = nullptr |
Definition at line 261 of file vk_device.hh.
Referenced by blender::gpu::debug::object_label().
| struct { ... } blender::gpu::VKDevice::vma_pools |
Referenced by blender::gpu::VKBuffer::create(), and deinit().