Ensures that bindings on the pass are not redundantly set or updated. Avoids making the driver do additional checks and makes the frame insights during profiling and instrumentation not complain about the same.
More...
#include <compute_pass_bindings_cache_mtl.h>
Ensures that bindings on the pass are not redundantly set or updated. Avoids making the driver do additional checks and makes the frame insights during profiling and instrumentation not complain about the same.
There should be no change to rendering if this caching was absent.
Definition at line 24 of file compute_pass_bindings_cache_mtl.h.
◆ ComputePassBindingsCacheMTL() [1/3]
impeller::ComputePassBindingsCacheMTL::ComputePassBindingsCacheMTL |
( |
| ) |
|
|
inlineexplicit |
◆ ComputePassBindingsCacheMTL() [2/3]
◆ ComputePassBindingsCacheMTL() [3/3]
◆ GetPipeline()
id< MTLComputePipelineState > impeller::ComputePassBindingsCacheMTL::GetPipeline |
( |
| ) |
const |
◆ SetBuffer()
void impeller::ComputePassBindingsCacheMTL::SetBuffer |
( |
uint64_t |
index, |
|
|
uint64_t |
offset, |
|
|
id< MTLBuffer > |
buffer |
|
) |
| |
Definition at line 27 of file compute_pass_bindings_cache_mtl.mm.
30 auto found = buffers_.find(index);
31 if (found != buffers_.end() && found->second.buffer == buffer) {
33 if (found->second.offset == offset) {
39 found->second.offset = offset;
41 [encoder_ setBufferOffset:offset atIndex:index];
45 buffers_[index] = {buffer,
static_cast<size_t>(offset)};
46 [encoder_ setBuffer:buffer offset:offset atIndex:index];
◆ SetComputePipelineState()
void impeller::ComputePassBindingsCacheMTL::SetComputePipelineState |
( |
id< MTLComputePipelineState > |
pipeline | ) |
|
◆ SetEncoder()
void impeller::ComputePassBindingsCacheMTL::SetEncoder |
( |
id< MTLComputeCommandEncoder > |
encoder | ) |
|
◆ SetSampler()
void impeller::ComputePassBindingsCacheMTL::SetSampler |
( |
uint64_t |
index, |
|
|
id< MTLSamplerState > |
sampler |
|
) |
| |
Definition at line 61 of file compute_pass_bindings_cache_mtl.mm.
63 auto found = samplers_.find(index);
64 if (found != samplers_.end() && found->second == sampler) {
68 samplers_[index] = sampler;
69 [encoder_ setSamplerState:sampler atIndex:index];
◆ SetTexture()
void impeller::ComputePassBindingsCacheMTL::SetTexture |
( |
uint64_t |
index, |
|
|
id< MTLTexture > |
texture |
|
) |
| |
Definition at line 49 of file compute_pass_bindings_cache_mtl.mm.
51 auto found = textures_.find(index);
52 if (found != textures_.end() && found->second == texture) {
56 textures_[index] = texture;
57 [encoder_ setTexture:texture atIndex:index];
The documentation for this struct was generated from the following files: