|
Blender V5.3
|
#include <mtl_context.hh>
Static Public Attributes | |
| static volatile std::atomic< int > | num_active_cmd_bufs_in_system = 0 |
Friends | |
| class | MTLContext |
MTLCommandBuffer initialization and render coordination. | |
| void | prepare (bool supports_render=true) |
| bool | submit (bool wait) |
Command buffer debugging. | |
| bool | insert_memory_barrier (GPUBarrier barrier_bits, GPUStageBarrierBits before_stages, GPUStageBarrierBits after_stages) |
| void | encode_signal_event (id< MTLEvent > event, uint64_t value) |
| void | encode_wait_for_event (id< MTLEvent > event, uint64_t value) |
| void | push_debug_group (const char *name, int index) |
| void | pop_debug_group () |
| void | unfold_pending_debug_groups () |
Definition at line 463 of file mtl_context.hh.
|
inline |
Definition at line 519 of file mtl_context.hh.
References MTLContext.
|
inline |
Definition at line 584 of file mtl_context.hh.
References blender::BLI_assert(), and num_active_cmd_bufs_in_system.
Referenced by blender::gpu::present().
| bool blender::gpu::MTLCommandBufferManager::do_break_submission | ( | ) |
Definition at line 513 of file mtl_command_buffer.mm.
References blender::GPU_DEVICE_ATI, blender::GPU_DEVICE_INTEL, blender::GPU_DRIVER_ANY, blender::GPU_OS_ANY, and blender::GPU_type_matches().
Referenced by blender::gpu::MTLContext::ensure_begin_render_pass().
| void blender::gpu::MTLCommandBufferManager::encode_signal_event | ( | id< MTLEvent > | event, |
| uint64_t | value ) |
Definition at line 752 of file mtl_command_buffer.mm.
References blender::BLI_assert(), and end_active_command_encoder().
Referenced by blender::gpu::MTLStorageBuf::async_flush_to_host(), blender::gpu::MTLWorkInFlight::end_work(), and blender::gpu::MTLFence::signal().
| void blender::gpu::MTLCommandBufferManager::encode_wait_for_event | ( | id< MTLEvent > | event, |
| uint64_t | value ) |
Definition at line 762 of file mtl_command_buffer.mm.
References blender::BLI_assert(), and end_active_command_encoder().
Referenced by blender::gpu::MTLFence::wait().
| bool blender::gpu::MTLCommandBufferManager::end_active_command_encoder | ( | bool | retain_framebuffers = false | ) |
Definition at line 245 of file mtl_command_buffer.mm.
References blender::BLI_assert(), blender::G, and blender::G_DEBUG_GPU.
Referenced by encode_signal_event(), encode_wait_for_event(), ensure_begin_acceleration_structure_encoder(), ensure_begin_blit_encoder(), ensure_begin_compute_encoder(), ensure_begin_render_command_encoder(), insert_memory_barrier(), and submit().
| id< MTLAccelerationStructureCommandEncoder > blender::gpu::MTLCommandBufferManager::ensure_begin_acceleration_structure_encoder | ( | ) |
Definition at line 452 of file mtl_command_buffer.mm.
References blender::BLI_assert(), end_active_command_encoder(), blender::G, blender::G_DEBUG_GPU, blender::GPU_debug_get_groups_names(), and unfold_pending_debug_groups().
Referenced by blender::gpu::MTLBottomLevelAS::build(), and blender::gpu::MTLTopLevelAS::build().
| id< MTLBlitCommandEncoder > blender::gpu::MTLCommandBufferManager::ensure_begin_blit_encoder | ( | ) |
Definition at line 377 of file mtl_command_buffer.mm.
References blender::BLI_assert(), end_active_command_encoder(), blender::G, blender::G_DEBUG_GPU, blender::GPU_debug_get_groups_names(), and unfold_pending_debug_groups().
Referenced by blender::gpu::MTLStorageBuf::async_flush_to_host(), blender::gpu::MTLVertBuf::bind(), blender::gpu::MTLFrameBuffer::blit(), blender::gpu::MTLStorageBuf::clear(), blender::gpu::MTLTexture::clear(), blender::gpu::MTLIndexBuf::copy_sub(), blender::gpu::MTLStorageBuf::copy_sub(), blender::gpu::MTLVertBuf::copy_sub(), blender::gpu::MTLTexture::copy_to(), blender::gpu::MTLTexture::generate_mipmap(), blender::gpu::MTLQueryPool::get_occlusion_result(), blender::gpu::MTLIndexBuf::read(), blender::gpu::MTLStorageBuf::read(), blender::gpu::MTLVertBuf::read(), blender::gpu::MTLStorageBuf::update(), blender::gpu::MTLIndexBuf::update_sub(), blender::gpu::MTLTexture::update_sub(), blender::gpu::MTLTexture::update_sub(), blender::gpu::MTLVertBuf::update_sub(), and blender::gpu::MTLTexture::xr_blit.
| id< MTLComputeCommandEncoder > blender::gpu::MTLCommandBufferManager::ensure_begin_compute_encoder | ( | ) |
Definition at line 413 of file mtl_command_buffer.mm.
References blender::BLI_assert(), end_active_command_encoder(), blender::G, blender::G_DEBUG_GPU, blender::GPU_debug_get_groups_names(), and unfold_pending_debug_groups().
Referenced by blender::gpu::MTLStorageBuf::clear(), blender::gpu::MTLContext::compute_dispatch(), blender::gpu::MTLContext::compute_dispatch_indirect(), and blender::gpu::MTLTexture::update_sub().
| id< MTLRenderCommandEncoder > blender::gpu::MTLCommandBufferManager::ensure_begin_render_command_encoder | ( | MTLFrameBuffer * | ctx_framebuffer, |
| bool | force_begin, | ||
| bool * | r_new_pass ) |
Definition at line 299 of file mtl_command_buffer.mm.
References blender::gpu::MTLFrameBuffer::bake_render_pass_descriptor(), blender::BLI_assert(), end_active_command_encoder(), blender::G, blender::G_DEBUG_GPU, blender::gpu::MTLBuffer::get_metal_buffer(), and unfold_pending_debug_groups().
Referenced by blender::gpu::MTLContext::ensure_begin_render_pass().
| id< MTLBlitCommandEncoder > blender::gpu::MTLCommandBufferManager::get_active_blit_command_encoder | ( | ) |
Definition at line 222 of file mtl_command_buffer.mm.
|
inline |
Definition at line 591 of file mtl_context.hh.
Referenced by wait_until_active_command_buffers_complete().
| id< MTLComputeCommandEncoder > blender::gpu::MTLCommandBufferManager::get_active_compute_command_encoder | ( | ) |
Definition at line 228 of file mtl_command_buffer.mm.
Referenced by blender::gpu::MTLComputeState::bind_compute_buffer(), blender::gpu::MTLComputeState::bind_compute_bytes(), blender::gpu::MTLComputeState::bind_compute_sampler(), blender::gpu::MTLComputeState::bind_compute_texture(), blender::gpu::MTLComputeState::bind_pso(), and insert_memory_barrier().
| MTLFrameBuffer * blender::gpu::MTLCommandBufferManager::get_active_framebuffer | ( | ) |
Definition at line 234 of file mtl_command_buffer.mm.
References is_inside_render_pass().
Referenced by blender::gpu::MTLBatch::bind(), blender::gpu::MTLContext::ensure_begin_render_pass(), blender::gpu::MTLContext::ensure_render_pipeline_state(), and blender::gpu::MTLRenderPassState::reset_state().
| id< MTLRenderCommandEncoder > blender::gpu::MTLCommandBufferManager::get_active_render_command_encoder | ( | ) |
Definition at line 216 of file mtl_command_buffer.mm.
Referenced by blender::gpu::MTLQueryPool::begin_query(), blender::gpu::MTLRenderPassState::bind_fragment_buffer(), blender::gpu::MTLRenderPassState::bind_fragment_bytes(), blender::gpu::MTLRenderPassState::bind_fragment_sampler(), blender::gpu::MTLRenderPassState::bind_fragment_texture(), blender::gpu::MTLRenderPassState::bind_vertex_buffer(), blender::gpu::MTLRenderPassState::bind_vertex_bytes(), blender::gpu::MTLRenderPassState::bind_vertex_sampler(), blender::gpu::MTLRenderPassState::bind_vertex_texture(), blender::gpu::MTLQueryPool::end_query(), blender::gpu::MTLContext::ensure_begin_render_pass(), blender::gpu::MTLContext::ensure_depth_stencil_state(), blender::gpu::MTLContext::ensure_render_pipeline_state(), and insert_memory_barrier().
|
inline |
Definition at line 544 of file mtl_context.hh.
References blender::BLI_assert(), and is_inside_compute().
Referenced by blender::gpu::MTLStorageBuf::clear(), blender::gpu::MTLContext::compute_dispatch(), blender::gpu::MTLContext::compute_dispatch_indirect(), and blender::gpu::MTLTexture::update_sub().
|
inline |
Definition at line 536 of file mtl_context.hh.
References blender::BLI_assert(), and is_inside_render_pass().
Referenced by blender::gpu::MTLBatch::bind(), blender::gpu::MTLContext::ensure_depth_stencil_state(), and blender::gpu::MTLContext::ensure_render_pipeline_state().
|
inline |
Definition at line 578 of file mtl_context.hh.
References num_active_cmd_bufs_in_system.
Referenced by blender::gpu::present().
| bool blender::gpu::MTLCommandBufferManager::insert_memory_barrier | ( | GPUBarrier | barrier_bits, |
| GPUStageBarrierBits | before_stages, | ||
| GPUStageBarrierBits | after_stages ) |
Definition at line 664 of file mtl_command_buffer.mm.
References blender::BLI_assert(), end_active_command_encoder(), get_active_compute_command_encoder(), get_active_render_command_encoder(), blender::GPU_ARCHITECTURE_TBDR, blender::GPU_BARRIER_BUFFER_UPDATE, blender::GPU_BARRIER_ELEMENT_ARRAY, blender::GPU_BARRIER_SHADER_IMAGE_ACCESS, blender::GPU_BARRIER_SHADER_STORAGE, blender::GPU_BARRIER_STAGE_FRAGMENT, blender::GPU_BARRIER_STAGE_VERTEX, blender::GPU_BARRIER_TEXTURE_FETCH, blender::GPU_BARRIER_UNIFORM, blender::GPU_BARRIER_VERTEX_ATTRIB_ARRAY, and blender::GPU_platform_architecture().
Referenced by blender::gpu::MTLStateManager::issue_barrier().
| bool blender::gpu::MTLCommandBufferManager::is_inside_blit | ( | ) |
Definition at line 206 of file mtl_command_buffer.mm.
| bool blender::gpu::MTLCommandBufferManager::is_inside_compute | ( | ) |
Definition at line 211 of file mtl_command_buffer.mm.
Referenced by get_compute_state().
| bool blender::gpu::MTLCommandBufferManager::is_inside_render_pass | ( | ) |
Definition at line 201 of file mtl_command_buffer.mm.
Referenced by blender::gpu::MTLContext::ensure_begin_render_pass(), get_active_framebuffer(), and get_render_pass_state().
| void blender::gpu::MTLCommandBufferManager::pop_debug_group | ( | ) |
Definition at line 570 of file mtl_command_buffer.mm.
Referenced by unfold_pending_debug_groups().
| void blender::gpu::MTLCommandBufferManager::prepare | ( | bool | supports_render = true | ) |
Definition at line 37 of file mtl_command_buffer.mm.
Referenced by blender::gpu::MTLContext::MTLContext().
| void blender::gpu::MTLCommandBufferManager::push_debug_group | ( | const char * | name, |
| int | index ) |
Definition at line 539 of file mtl_command_buffer.mm.
Referenced by unfold_pending_debug_groups().
| void blender::gpu::MTLCommandBufferManager::register_draw_counters | ( | int | vertex_submission | ) |
Definition at line 496 of file mtl_command_buffer.mm.
| void blender::gpu::MTLCommandBufferManager::reset_counters | ( | ) |
Definition at line 504 of file mtl_command_buffer.mm.
| bool blender::gpu::MTLCommandBufferManager::submit | ( | bool | wait | ) |
Definition at line 96 of file mtl_command_buffer.mm.
References blender::BLI_assert(), CLOG_ERROR, blender::gpu::MTLSafeFreeList::decrement_reference(), end_active_command_encoder(), blender::G, blender::G_DEBUG_GPU, blender::gpu::MTLBackend::get(), blender::gpu::LOG, GHOST_ContextMTL::max_command_buffer_count, MTL_LOG_WARNING, num_active_cmd_bufs_in_system, and wait_until_active_command_buffers_complete().
Referenced by blender::gpu::MTLContext::finish(), blender::gpu::MTLContext::flush(), and blender::gpu::MTLTexture::update_sub().
| void blender::gpu::MTLCommandBufferManager::unfold_pending_debug_groups | ( | ) |
Definition at line 601 of file mtl_command_buffer.mm.
References blender::BLI_assert(), blender::gpu::Context::debug_stack, blender::Span< T >::drop_front(), blender::gpu::MTLContext::get(), MTLContext, pop_debug_group(), push_debug_group(), blender::Span< T >::size(), and lexit::Vector< T >::size().
Referenced by blender::gpu::MTLBatch::bind(), blender::gpu::MTLContext::compute_dispatch(), blender::gpu::MTLContext::compute_dispatch_indirect(), ensure_begin_acceleration_structure_encoder(), ensure_begin_blit_encoder(), ensure_begin_compute_encoder(), and ensure_begin_render_command_encoder().
|
inline |
Definition at line 596 of file mtl_context.hh.
References get_active_command_buffer_count().
Referenced by submit(), and blender::gpu::MTLContext::~MTLContext().
|
friend |
Definition at line 464 of file mtl_context.hh.
References MTLContext.
Referenced by MTLCommandBufferManager(), MTLContext, and unfold_pending_debug_groups().
|
static |
Definition at line 468 of file mtl_context.hh.
Referenced by dec_active_command_buffer_count(), inc_active_command_buffer_count(), blender::gpu::present(), and submit().