|
Blender V4.3
|
#include <mtl_context.hh>
Public Member Functions | |
| MTLCommandBufferManager (MTLContext &context) | |
| MTLRenderPassState & | get_render_pass_state () |
| MTLComputeState & | get_compute_state () |
Render Command Encoder Utility and management functions. | |
| bool | is_inside_render_pass () |
| bool | is_inside_blit () |
| bool | is_inside_compute () |
| id< MTLRenderCommandEncoder > | get_active_render_command_encoder () |
| id< MTLBlitCommandEncoder > | get_active_blit_command_encoder () |
| id< MTLComputeCommandEncoder > | get_active_compute_command_encoder () |
| MTLFrameBuffer * | get_active_framebuffer () |
| bool | end_active_command_encoder () |
| id< MTLRenderCommandEncoder > | ensure_begin_render_command_encoder (MTLFrameBuffer *ctx_framebuffer, bool force_begin, bool *r_new_pass) |
| id< MTLBlitCommandEncoder > | ensure_begin_blit_encoder () |
| id< MTLComputeCommandEncoder > | ensure_begin_compute_encoder () |
Command buffer heuristics. | |
| void | register_draw_counters (int vertex_submission) |
| void | reset_counters () |
| bool | do_break_submission () |
Static Public Attributes | |
| static int | num_active_cmd_bufs = 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 (eGPUBarrier barrier_bits, eGPUStageBarrierBits before_stages, eGPUStageBarrierBits 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 () |
Definition at line 547 of file mtl_context.hh.
|
inline |
Definition at line 598 of file mtl_context.hh.
| bool blender::gpu::MTLCommandBufferManager::do_break_submission | ( | ) |
Definition at line 471 of file mtl_command_buffer.mm.
References GPU_DEVICE_ATI, GPU_DEVICE_INTEL, GPU_DRIVER_ANY, GPU_OS_ANY, and 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 662 of file mtl_command_buffer.mm.
References BLI_assert, and end_active_command_encoder().
Referenced by blender::gpu::MTLStorageBuf::async_flush_to_host(), and blender::gpu::MTLFence::signal().
| void blender::gpu::MTLCommandBufferManager::encode_wait_for_event | ( | id< MTLEvent > | event, |
| uint64_t | value ) |
Definition at line 672 of file mtl_command_buffer.mm.
References BLI_assert, and end_active_command_encoder().
Referenced by blender::gpu::MTLFence::wait().
| bool blender::gpu::MTLCommandBufferManager::end_active_command_encoder | ( | ) |
Definition at line 226 of file mtl_command_buffer.mm.
References BLI_assert.
Referenced by encode_signal_event(), encode_wait_for_event(), ensure_begin_blit_encoder(), ensure_begin_compute_encoder(), ensure_begin_render_command_encoder(), insert_memory_barrier(), pop_debug_group(), push_debug_group(), submit(), blender::gpu::MTLFrameBuffer::subpass_transition_impl(), and blender::gpu::MTLFrameBuffer::~MTLFrameBuffer().
| id< MTLBlitCommandEncoder > blender::gpu::MTLCommandBufferManager::ensure_begin_blit_encoder | ( | ) |
Definition at line 366 of file mtl_command_buffer.mm.
References BLI_assert, end_active_command_encoder(), G, and G_DEBUG_GPU.
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::MTLStorageBuf::copy_sub(), blender::gpu::MTLTexture::copy_to(), blender::gpu::MTLVertBuf::duplicate_data(), 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(), and blender::gpu::MTLVertBuf::update_sub().
| id< MTLComputeCommandEncoder > blender::gpu::MTLCommandBufferManager::ensure_begin_compute_encoder | ( | ) |
Definition at line 405 of file mtl_command_buffer.mm.
References BLI_assert, end_active_command_encoder(), G, G_DEBUG_GPU, and blender::gpu::MTLComputeState::reset_state().
Referenced by blender::gpu::MTLStorageBuf::clear(), blender::gpu::MTLTexture::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 284 of file mtl_command_buffer.mm.
References blender::gpu::MTLFrameBuffer::apply_state(), blender::gpu::MTLFrameBuffer::bake_render_pass_descriptor(), BLI_assert, blender::gpu::MTLContext::clear_visibility_dirty(), end_active_command_encoder(), G, G_DEBUG_GPU, blender::gpu::MTLBuffer::get_metal_buffer(), blender::gpu::MTLFrameBuffer::get_pending_clear(), blender::gpu::MTLContext::get_visibility_buffer(), blender::gpu::MTLFrameBuffer::mark_cleared(), blender::gpu::FrameBuffer::name_get(), and blender::gpu::MTLRenderPassState::reset_state().
Referenced by blender::gpu::MTLContext::ensure_begin_render_pass().
| id< MTLBlitCommandEncoder > blender::gpu::MTLCommandBufferManager::get_active_blit_command_encoder | ( | ) |
Definition at line 203 of file mtl_command_buffer.mm.
| id< MTLComputeCommandEncoder > blender::gpu::MTLCommandBufferManager::get_active_compute_command_encoder | ( | ) |
Definition at line 209 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 215 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(), blender::gpu::MTLRenderPassState::reset_state(), and blender::gpu::MTLFrameBuffer::~MTLFrameBuffer().
| id< MTLRenderCommandEncoder > blender::gpu::MTLCommandBufferManager::get_active_render_command_encoder | ( | ) |
Definition at line 197 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 623 of file mtl_context.hh.
References BLI_assert, and is_inside_compute().
Referenced by blender::gpu::MTLStorageBuf::clear(), blender::gpu::MTLTexture::clear(), blender::gpu::MTLContext::compute_dispatch(), blender::gpu::MTLContext::compute_dispatch_indirect(), blender::gpu::MTLContext::ensure_buffer_bindings(), blender::gpu::MTLContext::ensure_texture_bindings(), and blender::gpu::MTLTexture::update_sub().
|
inline |
Definition at line 615 of file mtl_context.hh.
References BLI_assert, and is_inside_render_pass().
Referenced by blender::gpu::MTLBatch::bind(), blender::gpu::MTLImmediate::end(), blender::gpu::MTLContext::ensure_buffer_bindings(), blender::gpu::MTLContext::ensure_depth_stencil_state(), blender::gpu::MTLContext::ensure_render_pipeline_state(), blender::gpu::MTLContext::ensure_texture_bindings(), and blender::gpu::MTLShader::ssbo_vertex_fetch_bind_attributes_end().
| bool blender::gpu::MTLCommandBufferManager::insert_memory_barrier | ( | eGPUBarrier | barrier_bits, |
| eGPUStageBarrierBits | before_stages, | ||
| eGPUStageBarrierBits | after_stages ) |
Definition at line 573 of file mtl_command_buffer.mm.
References BLI_assert, end_active_command_encoder(), get_active_compute_command_encoder(), get_active_render_command_encoder(), GPU_ARCHITECTURE_TBDR, GPU_BARRIER_BUFFER_UPDATE, GPU_BARRIER_ELEMENT_ARRAY, GPU_BARRIER_SHADER_IMAGE_ACCESS, GPU_BARRIER_SHADER_STORAGE, GPU_BARRIER_STAGE_FRAGMENT, GPU_BARRIER_STAGE_VERTEX, GPU_BARRIER_TEXTURE_FETCH, GPU_BARRIER_UNIFORM, GPU_BARRIER_VERTEX_ATTRIB_ARRAY, and GPU_platform_architecture().
Referenced by blender::gpu::MTLStateManager::issue_barrier().
| bool blender::gpu::MTLCommandBufferManager::is_inside_blit | ( | ) |
Definition at line 187 of file mtl_command_buffer.mm.
| bool blender::gpu::MTLCommandBufferManager::is_inside_compute | ( | ) |
Definition at line 192 of file mtl_command_buffer.mm.
Referenced by get_compute_state().
| bool blender::gpu::MTLCommandBufferManager::is_inside_render_pass | ( | ) |
Definition at line 182 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 517 of file mtl_command_buffer.mm.
References end_active_command_encoder(), and METAL_DEBUG_CAPTURE_MAX_NESTED_GROUPS.
Referenced by blender::gpu::MTLContext::debug_group_end().
| void blender::gpu::MTLCommandBufferManager::prepare | ( | bool | supports_render = true | ) |
Definition at line 29 of file mtl_command_buffer.mm.
References blender::gpu::MTLComputeState::reset_state(), and blender::gpu::MTLRenderPassState::reset_state().
Referenced by blender::gpu::MTLContext::MTLContext().
| void blender::gpu::MTLCommandBufferManager::push_debug_group | ( | const char * | name, |
| int | index ) |
Definition at line 499 of file mtl_command_buffer.mm.
References end_active_command_encoder().
Referenced by blender::gpu::MTLContext::debug_group_begin().
| void blender::gpu::MTLCommandBufferManager::register_draw_counters | ( | int | vertex_submission | ) |
Definition at line 454 of file mtl_command_buffer.mm.
Referenced by blender::gpu::MTLImmediate::end(), and blender::gpu::MTLDrawList::submit().
| void blender::gpu::MTLCommandBufferManager::reset_counters | ( | ) |
Definition at line 462 of file mtl_command_buffer.mm.
| bool blender::gpu::MTLCommandBufferManager::submit | ( | bool | wait | ) |
Definition at line 89 of file mtl_command_buffer.mm.
References BLI_assert, blender::gpu::MTLSafeFreeList::decrement_reference(), end_active_command_encoder(), error(), blender::gpu::MTLScratchBufferManager::flush_active_scratch_buffer(), G, G_DEBUG_GPU, blender::gpu::MTLBackend::get(), blender::gpu::MTLBufferPool::get_current_safe_list(), blender::gpu::MTLContext::get_global_memory_manager(), blender::gpu::MTLSafeFreeList::increment_reference(), GHOST_ContextCGL::max_command_buffer_count, blender::gpu::MTLContext::memory_manager, MTL_LOG_WARNING, and num_active_cmd_bufs.
Referenced by blender::gpu::MTLContext::finish(), blender::gpu::MTLContext::flush(), and blender::gpu::MTLTexture::update_sub().
|
friend |
Definition at line 548 of file mtl_context.hh.
|
static |
Definition at line 552 of file mtl_context.hh.
Referenced by blender::gpu::present(), and submit().