183 VkInstance vk_instance_ = VK_NULL_HANDLE;
184 VkPhysicalDevice vk_physical_device_ = VK_NULL_HANDLE;
185 VkDevice vk_device_ = VK_NULL_HANDLE;
187 VkQueue vk_queue_ = VK_NULL_HANDLE;
188 std::mutex *queue_mutex_ =
nullptr;
190 bool is_initialized_ =
false;
198 std::thread submission_thread_;
199 std::atomic<bool> submission_thread_should_exit_ =
false;
207 VkSemaphore vk_timeline_semaphore_ = VK_NULL_HANDLE;
230 VmaAllocator mem_allocator_ = VK_NULL_HANDLE;
233 VkPhysicalDeviceProperties vk_physical_device_properties_ = {};
234 VkPhysicalDeviceDriverProperties vk_physical_device_driver_properties_ = {};
235 VkPhysicalDeviceIDProperties vk_physical_device_id_properties_ = {};
236 VkPhysicalDeviceMemoryProperties vk_physical_device_memory_properties_ = {};
237 VkPhysicalDeviceMaintenance4Properties vk_physical_device_maintenance4_properties_ = {
238 VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_4_PROPERTIES};
239 VkPhysicalDeviceGraphicsPipelineLibraryPropertiesEXT
240 vk_physical_device_graphics_pipeline_library_properties_ = {
241 VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_GRAPHICS_PIPELINE_LIBRARY_PROPERTIES_EXT};
242 VkPhysicalDeviceAccelerationStructurePropertiesKHR
243 vk_physical_device_acceleration_structure_properties_ = {
244 VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ACCELERATION_STRUCTURE_PROPERTIES_KHR};
246 VkPhysicalDeviceFeatures vk_physical_device_features_ = {};
247 VkPhysicalDeviceVulkan11Features vk_physical_device_vulkan_11_features_ = {};
248 VkPhysicalDeviceAccelerationStructureFeaturesKHR
249 vk_physical_device_acceleration_structure_features_ = {
250 VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ACCELERATION_STRUCTURE_FEATURES_KHR,
261 std::string glsl_vert_patch_;
262 std::string glsl_geom_patch_;
263 std::string glsl_frag_patch_;
264 std::string glsl_comp_patch_;
267 Shader *vk_backbuffer_blit_sh_ =
nullptr;
286 return device_extensions_[
index].extensionName;
291 return vk_physical_device_;
296 return vk_physical_device_properties_;
299 inline const VkPhysicalDeviceMaintenance4Properties &
302 return vk_physical_device_maintenance4_properties_;
307 return vk_physical_device_id_properties_;
310 inline const VkPhysicalDeviceGraphicsPipelineLibraryPropertiesEXT &
313 return vk_physical_device_graphics_pipeline_library_properties_;
316 inline const VkPhysicalDeviceAccelerationStructurePropertiesKHR &
319 return vk_physical_device_acceleration_structure_properties_;
324 return vk_physical_device_features_;
327 inline const VkPhysicalDeviceAccelerationStructureFeaturesKHR &
330 return vk_physical_device_acceleration_structure_features_;
345 return vk_queue_family_;
350 return mem_allocator_;
355 return descriptor_set_layouts_;
360 return debugging_tools_;
365 return debugging_tools_;
378 return is_initialized_;
418 bool submit_to_device,
419 bool wait_for_submission,
420 bool wait_for_completion,
421 VkPipelineStageFlags wait_dst_stage_mask,
422 VkSemaphore wait_semaphore,
423 VkSemaphore signal_semaphore,
424 VkFence signal_fence);
433 BLI_assert(vk_timeline_semaphore_ != VK_NULL_HANDLE);
436 vk_device_, vk_timeline_semaphore_, ¤t_timeline);
440 "Potential driver crash has happened. Several drivers will report UINT64_MAX when "
441 "requesting a counter value of an timeline semaphore right after/during a driver reset. "
442 "If this happen we should investigate what makes the driver crash. In the past this has "
443 "been detected on QUALCOMM and NVIDIA drivers. The result code of the call is "
445 return current_timeline;
470 if (vk_backbuffer_blit_sh_ ==
nullptr) {
473#if defined(_WIN32) || defined(__APPLE__)
479 return vk_backbuffer_blit_sh_;
483 void init_physical_device_properties();
484 void init_physical_device_memory_properties();
485 void init_physical_device_features();
486 void init_physical_device_extensions();
487 void init_debug_callbacks();
488 void init_submission_thread();
489 void deinit_submission_thread();
493 void init_functions();
498 void init_dummy_buffer();
#define BLI_assert_msg(a, msg)
NonCopyable(const NonCopyable &other)=delete
NonMovable(NonMovable &&other)=delete
uint32_t queue_family_get() const
const char * extension_name_get(int index) const
render_graph::VKResourceStateTracker resources
const VkPhysicalDeviceFeatures & physical_device_features_get() const
GPUDriverType driver_type() const
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
render_graph::VKRenderGraph * render_graph_new()
static void submission_runner(VKDevice *device)
Shader * vk_backbuffer_blit_sh_get()
VKDiscardPool orphaned_data
debug::VKDebuggingTools & debugging_tools_get()
GPUDeviceType device_type() const
const VkPhysicalDeviceAccelerationStructureFeaturesKHR & physical_device_acceleration_structure_features_get() const
VKThreadData & current_thread_data()
const VkPhysicalDeviceIDProperties & physical_device_id_properties_get() const
VolkDeviceTable functions
shader::GeneratedSource extensions_define(StringRefNull stage_define, bool use_ray_query) const
const VkPhysicalDeviceAccelerationStructurePropertiesKHR & physical_device_acceleration_structure_properties_get()
uint32_t glsl_patch_version_get(bool use_ray_query) const
const debug::VKDebuggingTools & debugging_tools_get() const
void context_register(VKContext &context)
bool is_initialized() const
VkPhysicalDevice physical_device_get() const
std::string glsl_compute_patch_get(bool use_ray_query) const
const VKWorkarounds & workarounds_get() const
VkInstance instance_get() const
void context_unregister(VKContext &context)
std::string glsl_vertex_patch_get(bool use_ray_query) const
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)
VKVertexInputDescriptionPool vertex_input_descriptions
std::string glsl_fragment_patch_get(bool use_ray_query) const
const VkPhysicalDeviceGraphicsPipelineLibraryPropertiesEXT & physical_device_graphics_pipeline_properties_get()
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)
Span< std::reference_wrapper< VKContext > > contexts_get() const
VKDiscardPool orphaned_data_render
VKDescriptorSetTracker descriptor_set
VKThreadData(VKDevice &device, pthread_t thread_id)
VKDescriptorPools descriptor_pools
BLI_assert(slot->slot_subtype.map==BMO_OP_SLOT_SUBTYPE_MAP_FLT)
gpu::Shader * GPU_shader_create_from_info_name(const char *info_name)
bool dynamic_rendering_unused_attachments
bool extended_dynamic_state
bool fragment_shader_barycentric
bool pageable_device_local_memory
bool shader_clip_distance
bool graphics_pipeline_library
bool dynamic_rendering_local_read
bool shader_viewport_index_layer
bool vertex_input_dynamic_state
bool not_aligned_pixel_formats
bool missing_srgb_clear_conversion
bool static_viewport_scissor