|
Blender V4.3
|
#include <mtl_context.hh>
Public Member Functions | |
| MTLComputeState (MTLContext &context, MTLCommandBufferManager &command_buffer_manager) | |
Render Pass State for active RenderCommandEncoder | |
| void | reset_state () |
| void | bind_pso (id< MTLComputePipelineState > pso) |
| void | bind_compute_texture (id< MTLTexture > tex, uint slot) |
| void | bind_compute_sampler (MTLSamplerBinding &sampler_binding, bool use_argument_buffer_for_samplers, uint slot) |
| void | bind_compute_buffer (id< MTLBuffer > buffer, uint64_t buffer_offset, uint index) |
| void | bind_compute_bytes (const void *bytes, uint64_t length, uint index) |
Public Attributes | |
| MTLContext & | ctx |
| MTLCommandBufferManager & | cmd |
| id< MTLComputePipelineState > | bound_pso = nil |
| BufferBindingCached | cached_compute_buffer_bindings [MTL_MAX_BUFFER_BINDINGS] |
| TextureBindingCached | cached_compute_texture_bindings [MTL_MAX_TEXTURE_SLOTS] |
| SamplerStateBindingCached | cached_compute_sampler_state_bindings [MTL_MAX_TEXTURE_SLOTS] |
Friends | |
| class | MTLContext |
Definition at line 153 of file mtl_context.hh.
|
inline |
Definition at line 157 of file mtl_context.hh.
| void blender::gpu::MTLComputeState::bind_compute_buffer | ( | id< MTLBuffer > | buffer, |
| uint64_t | buffer_offset, | ||
| uint | index ) |
Definition at line 969 of file mtl_command_buffer.mm.
References BLI_assert, cached_compute_buffer_bindings, cmd, blender::gpu::MTLCommandBufferManager::get_active_compute_command_encoder(), blender::gpu::BufferBindingCached::is_bytes, blender::gpu::BufferBindingCached::metal_buffer, MTL_MAX_BUFFER_BINDINGS, and blender::gpu::BufferBindingCached::offset.
Referenced by bind_compute_bytes(), blender::gpu::MTLStorageBuf::clear(), blender::gpu::MTLContext::ensure_buffer_bindings(), blender::gpu::MTLContext::ensure_texture_bindings(), and blender::gpu::MTLTexture::update_sub().
| void blender::gpu::MTLComputeState::bind_compute_bytes | ( | const void * | bytes, |
| uint64_t | length, | ||
| uint | index ) |
Definition at line 1049 of file mtl_command_buffer.mm.
References bind_compute_buffer(), BLI_assert, cached_compute_buffer_bindings, cmd, ctx, blender::gpu::MTLCommandBufferManager::get_active_compute_command_encoder(), blender::gpu::MTLContext::get_scratchbuffer_manager(), blender::gpu::BufferBindingCached::is_bytes, length(), blender::gpu::BufferBindingCached::metal_buffer, blender::gpu::MTLBufferRange::metal_buffer, MTL_MAX_BUFFER_BINDINGS, MTL_MAX_SET_BYTES_SIZE, blender::gpu::BufferBindingCached::offset, and blender::gpu::MTLScratchBufferManager::scratch_buffer_allocate_range_aligned().
Referenced by blender::gpu::MTLStorageBuf::clear(), blender::gpu::MTLTexture::clear(), blender::gpu::MTLContext::ensure_buffer_bindings(), and blender::gpu::MTLTexture::update_sub().
| void blender::gpu::MTLComputeState::bind_compute_sampler | ( | MTLSamplerBinding & | sampler_binding, |
| bool | use_argument_buffer_for_samplers, | ||
| uint | slot ) |
Definition at line 864 of file mtl_command_buffer.mm.
References blender::gpu::MTLContextGlobalShaderPipelineState::active_shader, blender::gpu::SamplerStateBindingCached::binding_state, BLI_assert, cached_compute_sampler_state_bindings, cmd, ctx, blender::gpu::DEFAULT_SAMPLER_STATE, blender::gpu::MTLCommandBufferManager::get_active_compute_command_encoder(), blender::gpu::MTLContext::get_default_sampler_state(), blender::gpu::MTLShader::get_interface(), blender::gpu::MTLContext::get_sampler_from_state(), blender::gpu::SamplerStateBindingCached::is_arg_buffer_binding, MTL_MAX_TEXTURE_SLOTS, blender::gpu::MTLSamplerArray::mtl_sampler, blender::gpu::MTLSamplerArray::mtl_sampler_flags, blender::gpu::MTLContext::pipeline_state, blender::gpu::sampler_binding(), blender::gpu::SamplerStateBindingCached::sampler_state, blender::gpu::MTLSamplerState::state, and UNUSED_VARS_NDEBUG.
Referenced by blender::gpu::MTLContext::ensure_texture_bindings().
| void blender::gpu::MTLComputeState::bind_compute_texture | ( | id< MTLTexture > | tex, |
| uint | slot ) |
Definition at line 772 of file mtl_command_buffer.mm.
References BLI_assert, cached_compute_texture_bindings, cmd, blender::gpu::MTLCommandBufferManager::get_active_compute_command_encoder(), blender::gpu::TextureBindingCached::metal_texture, and tex.
Referenced by blender::gpu::MTLTexture::clear(), blender::gpu::MTLContext::ensure_texture_bindings(), and blender::gpu::MTLTexture::update_sub().
| void blender::gpu::MTLComputeState::bind_pso | ( | id< MTLComputePipelineState > | pso | ) |
Definition at line 1074 of file mtl_command_buffer.mm.
References bound_pso, cmd, and blender::gpu::MTLCommandBufferManager::get_active_compute_command_encoder().
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().
| void blender::gpu::MTLComputeState::reset_state | ( | ) |
Definition at line 731 of file mtl_command_buffer.mm.
References bound_pso, cached_compute_buffer_bindings, cached_compute_sampler_state_bindings, cached_compute_texture_bindings, blender::gpu::SamplerStateBindingCached::is_arg_buffer_binding, blender::gpu::BufferBindingCached::is_bytes, blender::gpu::BufferBindingCached::metal_buffer, blender::gpu::TextureBindingCached::metal_texture, MTL_MAX_BUFFER_BINDINGS, MTL_MAX_TEXTURE_SLOTS, blender::gpu::BufferBindingCached::offset, blender::gpu::SamplerStateBindingCached::sampler_state, and tex.
Referenced by blender::gpu::MTLCommandBufferManager::ensure_begin_compute_encoder(), and blender::gpu::MTLCommandBufferManager::prepare().
|
friend |
Definition at line 154 of file mtl_context.hh.
| id<MTLComputePipelineState> blender::gpu::MTLComputeState::bound_pso = nil |
Definition at line 165 of file mtl_context.hh.
Referenced by bind_pso(), and reset_state().
| BufferBindingCached blender::gpu::MTLComputeState::cached_compute_buffer_bindings[MTL_MAX_BUFFER_BINDINGS] |
Definition at line 166 of file mtl_context.hh.
Referenced by bind_compute_buffer(), bind_compute_bytes(), and reset_state().
| SamplerStateBindingCached blender::gpu::MTLComputeState::cached_compute_sampler_state_bindings[MTL_MAX_TEXTURE_SLOTS] |
Definition at line 168 of file mtl_context.hh.
Referenced by bind_compute_sampler(), and reset_state().
| TextureBindingCached blender::gpu::MTLComputeState::cached_compute_texture_bindings[MTL_MAX_TEXTURE_SLOTS] |
Definition at line 167 of file mtl_context.hh.
Referenced by bind_compute_texture(), and reset_state().
| MTLCommandBufferManager& blender::gpu::MTLComputeState::cmd |
Definition at line 163 of file mtl_context.hh.
Referenced by bind_compute_buffer(), bind_compute_bytes(), bind_compute_sampler(), bind_compute_texture(), and bind_pso().
| MTLContext& blender::gpu::MTLComputeState::ctx |
Definition at line 162 of file mtl_context.hh.
Referenced by bind_compute_bytes(), and bind_compute_sampler().