138 VkInstance vk_instance_ = VK_NULL_HANDLE;
139 VkPhysicalDevice vk_physical_device_ = VK_NULL_HANDLE;
140 VkDevice vk_device_ = VK_NULL_HANDLE;
141 uint32_t vk_queue_family_ = 0;
142 VkQueue vk_queue_ = VK_NULL_HANDLE;
143 std::mutex *queue_mutex_ =
nullptr;
145 bool is_initialized_ =
false;
154 TaskPool *submission_pool_ =
nullptr;
161 VkSemaphore vk_timeline_semaphore_ = VK_NULL_HANDLE;
184 VmaAllocator mem_allocator_ = VK_NULL_HANDLE;
187 VkPhysicalDeviceProperties vk_physical_device_properties_ = {};
188 VkPhysicalDeviceDriverProperties vk_physical_device_driver_properties_ = {};
189 VkPhysicalDeviceIDProperties vk_physical_device_id_properties_ = {};
190 VkPhysicalDeviceMemoryProperties vk_physical_device_memory_properties_ = {};
191 VkPhysicalDeviceMaintenance4Properties vk_physical_device_maintenance4_properties_ = {
192 VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_4_PROPERTIES};
193 VkPhysicalDeviceDescriptorBufferPropertiesEXT vk_physical_device_descriptor_buffer_properties_ =
196 VkPhysicalDeviceFeatures vk_physical_device_features_ = {};
197 VkPhysicalDeviceVulkan11Features vk_physical_device_vulkan_11_features_ = {};
198 VkPhysicalDeviceVulkan12Features vk_physical_device_vulkan_12_features_ = {};
208 std::string glsl_vert_patch_;
209 std::string glsl_geom_patch_;
210 std::string glsl_frag_patch_;
211 std::string glsl_comp_patch_;
214 Shader *vk_backbuffer_blit_sh_ =
nullptr;
245 PFN_vkGetMemoryWin32HandleKHR vkGetMemoryWin32Handle =
nullptr;
261 return device_extensions_[index].extensionName;
266 return vk_physical_device_;
271 return vk_physical_device_properties_;
274 inline const VkPhysicalDeviceMaintenance4Properties &
277 return vk_physical_device_maintenance4_properties_;
282 return vk_physical_device_id_properties_;
285 inline const VkPhysicalDeviceDescriptorBufferPropertiesEXT &
288 return vk_physical_device_descriptor_buffer_properties_;
293 return vk_physical_device_features_;
298 return vk_physical_device_vulkan_11_features_;
303 return vk_physical_device_vulkan_12_features_;
318 return vk_queue_family_;
323 return mem_allocator_;
328 return descriptor_set_layouts_;
333 return debugging_tools_;
338 return debugging_tools_;
346 void init(
void *ghost_context);
351 return is_initialized_;
390 bool submit_to_device,
391 bool wait_for_completion,
392 VkPipelineStageFlags wait_dst_stage_mask,
393 VkSemaphore wait_semaphore,
394 VkSemaphore signal_semaphore,
395 VkFence signal_fence);
404 BLI_assert(vk_timeline_semaphore_ != VK_NULL_HANDLE);
406 VkResult
result = vkGetSemaphoreCounterValue(
407 vk_device_, vk_timeline_semaphore_, ¤t_timeline);
411 "Potential driver crash has happened. Several drivers will report UINT64_MAX when "
412 "requesting a counter value of an timeline semaphore right after/during a driver reset. "
413 "If this happen we should investigate what makes the driver crash. In the past this has "
414 "been detected on QUALCOMM and NVIDIA drivers. The result code of the call is "
416 return current_timeline;
445 VKDiscardPool &discard_pool_for_current_thread(
bool thread_safe =
false);
460 if (vk_backbuffer_blit_sh_ ==
nullptr) {
463#if defined(_WIN32) || defined(__APPLE__)
469 return vk_backbuffer_blit_sh_;
473 void init_physical_device_properties();
474 void init_physical_device_memory_properties();
475 void init_physical_device_features();
476 void init_physical_device_extensions();
477 void init_debug_callbacks();
478 void init_submission_pool();
479 void deinit_submission_pool();
483 void init_functions();
488 void init_dummy_buffer();
#define BLI_assert_msg(a, msg)
blender::gpu::Shader * GPU_shader_create_from_info_name(const char *info_name)
NonCopyable(const NonCopyable &other)=delete
NonMovable(NonMovable &&other)=delete
uint32_t queue_family_get() const
PFN_vkGetDescriptorSetLayoutBindingOffsetEXT vkGetDescriptorSetLayoutBindingOffset
const char * extension_name_get(int index) const
PFN_vkCmdBindDescriptorBuffersEXT vkCmdBindDescriptorBuffers
render_graph::VKResourceStateTracker resources
PFN_vkCmdSetDescriptorBufferOffsetsEXT vkCmdSetDescriptorBufferOffsets
const VkPhysicalDeviceFeatures & physical_device_features_get() const
PFN_vkGetMemoryFdKHR vkGetMemoryFd
GPUDriverType driver_type() const
PFN_vkSetDebugUtilsObjectNameEXT vkSetDebugUtilsObjectName
VmaAllocator mem_allocator_get() const
VKDescriptorSetLayouts & descriptor_set_layouts_get()
VkDevice vk_handle() const
bool supports_extension(const char *extension_name) const
const VKExtensions & extensions_get() const
const VkPhysicalDeviceProperties & physical_device_properties_get() const
const VKSamplers & samplers() const
std::string vendor_name() const
std::string driver_version() const
TimelineValue submission_finished_timeline_get() const
const VkPhysicalDeviceMaintenance4Properties & physical_device_maintenance4_properties_get() const
std::string glsl_fragment_patch_get() const
PFN_vkCreateDebugUtilsMessengerEXT vkCreateDebugUtilsMessenger
render_graph::VKRenderGraph * render_graph_new()
PFN_vkGetDescriptorEXT vkGetDescriptor
Shader * vk_backbuffer_blit_sh_get()
VKDiscardPool orphaned_data
debug::VKDebuggingTools & debugging_tools_get()
GPUDeviceType device_type() const
VKThreadData & current_thread_data()
const VkPhysicalDeviceIDProperties & physical_device_id_properties_get() const
PFN_vkGetDescriptorSetLayoutSizeEXT vkGetDescriptorSetLayoutSize
static void submission_runner(TaskPool *__restrict pool, void *task_data)
const debug::VKDebuggingTools & debugging_tools_get() const
void context_register(VKContext &context)
bool is_initialized() const
VkPhysicalDevice physical_device_get() const
shader::GeneratedSource extensions_define(StringRefNull stage_define) const
const VKWorkarounds & workarounds_get() const
PFN_vkCmdEndDebugUtilsLabelEXT vkCmdEndDebugUtilsLabel
std::string glsl_vertex_patch_get() const
VkInstance instance_get() const
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)
PFN_vkDestroyDebugUtilsMessengerEXT vkDestroyDebugUtilsMessenger
void context_unregister(VKContext &context)
const VkPhysicalDeviceVulkan12Features & physical_device_vulkan_12_features_get() const
PFN_vkCmdBeginDebugUtilsLabelEXT vkCmdBeginDebugUtilsLabel
void memory_statistics_get(int *r_total_mem_kb, int *r_free_mem_kb) const
std::string glsl_geometry_patch_get() const
void wait_for_timeline(TimelineValue timeline)
const VkPhysicalDeviceDescriptorBufferPropertiesEXT & physical_device_descriptor_buffer_properties_get() const
PFN_vkCmdBeginRendering vkCmdBeginRendering
std::string glsl_compute_patch_get() const
const VkPhysicalDeviceVulkan11Features & physical_device_vulkan_11_features_get() const
Span< std::reference_wrapper< VKContext > > contexts_get() const
PFN_vkCmdEndRendering vkCmdEndRendering
struct blender::gpu::VKDevice::@152120360333013146246346216002113345357100126073 functions
VKDiscardPool orphaned_data_render
VKDescriptorSetTracker descriptor_set
VKThreadData(VKDevice &device, pthread_t thread_id)
VKDescriptorPools descriptor_pools
bool dynamic_rendering_unused_attachments
bool fragment_shader_barycentric
bool pageable_device_local_memory
bool dynamic_rendering_local_read
bool shader_output_viewport_index
bool not_aligned_pixel_formats
struct blender::gpu::VKWorkarounds::@332200143060210304170234105102153121344114125320 vertex_formats