Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <campbell@blender.org>2022-06-29 02:40:16 +0300
committerCampbell Barton <campbell@blender.org>2022-06-29 02:40:16 +0300
commit45645936e91a8379b19f4fbe02732780dc6f60c1 (patch)
treed688e97e2bfd65051fbf9ca90af57ea6dbb0d7d4 /source/blender/gpu/metal
parentc0e453233132ac0b1c217191c645bc01ea726400 (diff)
Cleanup: spelling in comments
Diffstat (limited to 'source/blender/gpu/metal')
-rw-r--r--source/blender/gpu/metal/mtl_command_buffer.mm12
-rw-r--r--source/blender/gpu/metal/mtl_context.hh10
-rw-r--r--source/blender/gpu/metal/mtl_context.mm10
-rw-r--r--source/blender/gpu/metal/mtl_framebuffer.hh10
-rw-r--r--source/blender/gpu/metal/mtl_framebuffer.mm32
5 files changed, 37 insertions, 37 deletions
diff --git a/source/blender/gpu/metal/mtl_command_buffer.mm b/source/blender/gpu/metal/mtl_command_buffer.mm
index 375295e589e..434bc664ee6 100644
--- a/source/blender/gpu/metal/mtl_command_buffer.mm
+++ b/source/blender/gpu/metal/mtl_command_buffer.mm
@@ -16,7 +16,7 @@ namespace blender::gpu {
/* Global sync event used across MTLContext's.
* This resolves flickering artifacts from command buffer
- * dependencies not being honoured for work submitted between
+ * dependencies not being honored for work submitted between
* different GPUContext's. */
id<MTLEvent> MTLCommandBufferManager::sync_event = nil;
unsigned long long MTLCommandBufferManager::event_signal_val = 0;
@@ -305,7 +305,7 @@ id<MTLRenderCommandEncoder> MTLCommandBufferManager::ensure_begin_render_command
active_frame_buffer_->apply_state();
/* FLAG FRAMEBUFFER AS CLEARED -- A clear only lasts as long as one has been specified.
- * After this, resets to Load attachments to parallel GL behaviour. */
+ * After this, resets to Load attachments to parallel GL behavior. */
active_frame_buffer_->mark_cleared();
/* Reset RenderPassState to ensure resource bindings are re-applied. */
@@ -404,7 +404,7 @@ bool MTLCommandBufferManager::do_break_submission()
return false;
}
- /* Use optimised heuristic to split heavy command buffer submissions to better saturate the
+ /* Use optimized heuristic to split heavy command buffer submissions to better saturate the
* hardware and also reduce stalling from individual large submissions. */
if (GPU_type_matches(GPU_DEVICE_INTEL, GPU_OS_ANY, GPU_DRIVER_ANY) ||
GPU_type_matches(GPU_DEVICE_ATI, GPU_OS_ANY, GPU_DRIVER_ANY)) {
@@ -440,12 +440,12 @@ void MTLCommandBufferManager::pop_debug_group()
}
}
-/* Workload Synchronisation. */
+/* Workload Synchronization. */
bool MTLCommandBufferManager::insert_memory_barrier(eGPUBarrier barrier_bits,
eGPUStageBarrierBits before_stages,
eGPUStageBarrierBits after_stages)
{
- /* Only supporting Metal on 10.14 onwards anyway - Check required for warnings. */
+ /* Only supporting Metal on 10.14 onward anyway - Check required for warnings. */
if (@available(macOS 10.14, *)) {
/* Resolve scope. */
@@ -527,7 +527,7 @@ void MTLRenderPassState::prepare(MTLCommandBufferManager *cmd, MTLContext *mtl_c
/* Reset binding state when a new RenderCommandEncoder is bound, to ensure
* pipeline resources are re-applied to the new Encoder.
- * Note: In Metal, state is only persistent within an MTLCommandEncoder,
+ * NOTE: In Metal, state is only persistent within an MTLCommandEncoder,
* not globally. */
void MTLRenderPassState::reset_state()
{
diff --git a/source/blender/gpu/metal/mtl_context.hh b/source/blender/gpu/metal/mtl_context.hh
index 92276a34b63..1b2af6a584b 100644
--- a/source/blender/gpu/metal/mtl_context.hh
+++ b/source/blender/gpu/metal/mtl_context.hh
@@ -508,7 +508,7 @@ class MTLCommandBufferManager {
MTLFrameBuffer *active_frame_buffer_ = nullptr;
MTLRenderPassDescriptor *active_pass_descriptor_ = nullptr;
- /* Workload heuristics - We may need to split command buffers to optimise workload and balancing.
+ /* Workload heuristics - We may need to split command buffers to optimize workload and balancing.
*/
int current_draw_call_count_ = 0;
int encoder_count_ = 0;
@@ -552,7 +552,7 @@ class MTLCommandBufferManager {
id<MTLBlitCommandEncoder> ensure_begin_blit_encoder();
id<MTLComputeCommandEncoder> ensure_begin_compute_encoder();
- /* Workload Synchronisation. */
+ /* Workload Synchronization. */
bool insert_memory_barrier(eGPUBarrier barrier_bits,
eGPUStageBarrierBits before_stages,
eGPUStageBarrierBits after_stages);
@@ -634,13 +634,13 @@ class MTLContext : public Context {
/** Metal Context Core functions. **/
- /* Bind framebuffer to context. */
+ /* Bind frame-buffer to context. */
void framebuffer_bind(MTLFrameBuffer *framebuffer);
- /* Restore framebuffer used by active context to default backbuffer. */
+ /* Restore frame-buffer used by active context to default back-buffer. */
void framebuffer_restore();
- /* Ensure a render-pass using the Context framebuffer (active_fb_) is in progress. */
+ /* Ensure a render-pass using the Context frame-buffer (active_fb_) is in progress. */
id<MTLRenderCommandEncoder> ensure_begin_render_pass();
MTLFrameBuffer *get_current_framebuffer();
diff --git a/source/blender/gpu/metal/mtl_context.mm b/source/blender/gpu/metal/mtl_context.mm
index d4e25defecf..6ecdb3f48b3 100644
--- a/source/blender/gpu/metal/mtl_context.mm
+++ b/source/blender/gpu/metal/mtl_context.mm
@@ -49,7 +49,7 @@ MTLContext::MTLContext(void *ghost_window)
/* Init debug. */
debug::mtl_debug_init();
- /* Initialise command buffer state. */
+ /* Initialize command buffer state. */
this->main_command_buffer.prepare(this);
/* Frame management. */
@@ -61,14 +61,14 @@ MTLContext::MTLContext(void *ghost_window)
this->front_left = mtl_front_left;
this->back_left = mtl_back_left;
this->active_fb = this->back_left;
- /* Prepare platform and capabilities. (Note: With METAL, this needs to be done after CTX
- * initialisation). */
+ /* Prepare platform and capabilities. (NOTE: With METAL, this needs to be done after CTX
+ * initialization). */
MTLBackend::platform_init(this);
MTLBackend::capabilities_init(this);
/* Initialize Metal modules. */
this->state_manager = new MTLStateManager(this);
- /* Initialise texture read/update structures. */
+ /* Initialize texture read/update structures. */
this->get_texture_utils().init();
/* Bound Samplers struct. */
@@ -77,7 +77,7 @@ MTLContext::MTLContext(void *ghost_window)
samplers_.mtl_sampler_flags[i] = DEFAULT_SAMPLER_STATE;
}
- /* Initialise samplers. */
+ /* Initialize samplers. */
for (uint i = 0; i < GPU_SAMPLER_MAX; i++) {
MTLSamplerState state;
state.state = static_cast<eGPUSamplerState>(i);
diff --git a/source/blender/gpu/metal/mtl_framebuffer.hh b/source/blender/gpu/metal/mtl_framebuffer.hh
index 6849e574d81..d6fa1850109 100644
--- a/source/blender/gpu/metal/mtl_framebuffer.hh
+++ b/source/blender/gpu/metal/mtl_framebuffer.hh
@@ -1,7 +1,7 @@
/** \file
* \ingroup gpu
*
- * Encapsulation of Framebuffer states (attached textures, viewport, scissors).
+ * Encapsulation of Frame-buffer states (attached textures, viewport, scissors).
*/
#pragma once
@@ -64,17 +64,17 @@ class MTLFrameBuffer : public FrameBuffer {
MTLContext *dirty_state_ctx_;
/* Whether a clear is pending -- Used to toggle between clear and load FB configurations
- * (without dirtying the state) - Framebuffer load config is used if no GPU_clear_* command
+ * (without dirtying the state) - Frame-buffer load config is used if no `GPU_clear_*` command
* was issued after binding the FrameBuffer. */
bool has_pending_clear_;
/* Render Pass Descriptors:
- * There are 3 MTLRenderPassDescriptors for different ways in which a framebuffer
+ * There are 3 MTLRenderPassDescriptors for different ways in which a frame-buffer
* can be configured:
* [0] = CLEAR CONFIG -- Used when a GPU_framebuffer_clear_* command has been issued.
* [1] = LOAD CONFIG -- Used if bound, but no clear is required.
* [2] = CUSTOM CONFIG -- When using GPU_framebuffer_bind_ex to manually specify
- * load-store configuration for optimal bandwidth utilisation.
+ * load-store configuration for optimal bandwidth utilization.
* -- We cache these different configs to avoid re-generation --
*/
typedef enum {
@@ -91,7 +91,7 @@ class MTLFrameBuffer : public FrameBuffer {
bool descriptor_dirty_[MTL_FB_CONFIG_MAX];
/* Whether SRGB is enabled for this framebuffer configuration. */
bool srgb_enabled_;
- /* Whether the primary Framebuffer attachment is an SRGB target or not. */
+ /* Whether the primary Frame-buffer attachment is an SRGB target or not. */
bool is_srgb_;
public:
diff --git a/source/blender/gpu/metal/mtl_framebuffer.mm b/source/blender/gpu/metal/mtl_framebuffer.mm
index b2cab3f8af6..22de255bf63 100644
--- a/source/blender/gpu/metal/mtl_framebuffer.mm
+++ b/source/blender/gpu/metal/mtl_framebuffer.mm
@@ -59,7 +59,7 @@ MTLFrameBuffer::~MTLFrameBuffer()
/* Restore default frame-buffer if this frame-buffer was bound. */
if (context_->active_fb == this && context_->back_left != this) {
/* If this assert triggers it means the frame-buffer is being freed while in use by another
- * context which, by the way, is TOTALLY UNSAFE!!! (Copy from GL behaviour). */
+ * context which, by the way, is TOTALLY UNSAFE!!! (Copy from GL behavior). */
BLI_assert(context_ == static_cast<MTLContext *>(unwrap(GPU_context_active_get())));
GPU_framebuffer_restore();
}
@@ -129,7 +129,7 @@ bool MTLFrameBuffer::check(char err_out[256])
/* Ensure local MTLAttachment data is up to date. */
this->update_attachments(true);
- /* Ensure there is atleast one attachment. */
+ /* Ensure there is at least one attachment. */
bool valid = (this->get_attachment_count() > 0 ||
this->has_depth_attachment() | this->has_stencil_attachment());
if (!valid) {
@@ -144,7 +144,7 @@ bool MTLFrameBuffer::check(char err_out[256])
}
/* Ensure all attachments have identical dimensions. */
- /* Ensure all attachments are rendertargets. */
+ /* Ensure all attachments are render-targets. */
bool first = true;
uint dim_x = 0;
uint dim_y = 0;
@@ -160,7 +160,7 @@ bool MTLFrameBuffer::check(char err_out[256])
else {
if (dim_x != att.texture->width_get() || dim_y != att.texture->height_get()) {
const char *format =
- "Framebuffer %s:Colour attachment dimensions do not match those of previous "
+ "Framebuffer %s: Color attachment dimensions do not match those of previous "
"attachment\n";
if (err_out) {
BLI_snprintf(err_out, 256, format, name_);
@@ -175,7 +175,7 @@ bool MTLFrameBuffer::check(char err_out[256])
}
else {
const char *format =
- "Framebuffer %s: Colour attachment texture does not have usage flag "
+ "Framebuffer %s: Color attachment texture does not have usage flag "
"'GPU_TEXTURE_USAGE_ATTACHMENT'\n";
if (err_out) {
BLI_snprintf(err_out, 256, format, name_);
@@ -276,7 +276,7 @@ void MTLFrameBuffer::force_clear()
MTLFrameBuffer *current_framebuffer = mtl_context->get_current_framebuffer();
if (current_framebuffer) {
BLI_assert(current_framebuffer == this);
- /* End current renderpass. */
+ /* End current render-pass. */
if (mtl_context->main_command_buffer.is_inside_render_pass()) {
mtl_context->main_command_buffer.end_active_command_encoder();
}
@@ -326,10 +326,10 @@ void MTLFrameBuffer::clear(eGPUFrameBufferBits buffers,
/* Apply state before clear. */
this->apply_state();
- /* TODO(Metal): Optimise - Currently force-clear always used. Consider moving clear state to
+ /* TODO(Metal): Optimize - Currently force-clear always used. Consider moving clear state to
* MTLTexture instead. */
/* Force clear if RP is not yet active -- not the most efficient, but there is no distinction
- * between clears where no draws occur. Can optimise at the high-level by using explicit
+ * between clears where no draws occur. Can optimize at the high-level by using explicit
* load-store flags. */
this->force_clear();
}
@@ -356,10 +356,10 @@ void MTLFrameBuffer::clear_multi(const float (*clear_cols)[4])
/* Apply state before clear. */
this->apply_state();
- /* TODO(Metal): Optimise - Currently force-clear always used. Consider moving clear state to
+ /* TODO(Metal): Optimize - Currently force-clear always used. Consider moving clear state to
* MTLTexture instead. */
/* Force clear if RP is not yet active -- not the most efficient, but there is no distinction
- * between clears where no draws occur. Can optimise at the high-level by using explicit
+ * between clears where no draws occur. Can optimize at the high-level by using explicit
* load-store flags. */
this->force_clear();
}
@@ -442,10 +442,10 @@ void MTLFrameBuffer::clear_attachment(GPUAttachmentType type,
/* Apply state before clear. */
this->apply_state();
- /* TODO(Metal): Optimise - Currently force-clear always used. Consider moving clear state to
+ /* TODO(Metal): Optimize - Currently force-clear always used. Consider moving clear state to
* MTLTexture instead. */
/* Force clear if RP is not yet active -- not the most efficient, but there is no distinction
- * between clears where no draws occur. Can optimise at the high-level by using explicit
+ * between clears where no draws occur. Can optimize at the high-level by using explicit
* load-store flags. */
this->force_clear();
}
@@ -676,7 +676,7 @@ void MTLFrameBuffer::update_attachments(bool update_viewport)
}
}
- /* Flag depth as added -- mirrors the behaviour in gl_framebuffer.cc to exit the for-loop
+ /* Flag depth as added -- mirrors the behavior in gl_framebuffer.cc to exit the for-loop
* after GPU_FB_DEPTH_STENCIL_ATTACHMENT has executed. */
depth_added = true;
@@ -765,7 +765,7 @@ void MTLFrameBuffer::apply_state(void)
return;
}
- /* Ensure viewport has been set. Note: This should no longer happen, but kept for safety to
+ /* Ensure viewport has been set. NOTE: This should no longer happen, but kept for safety to
* track bugs. */
if (viewport_[2] == 0 || viewport_[3] == 0) {
MTL_LOG_WARNING(
@@ -1538,7 +1538,7 @@ MTLRenderPassDescriptor *MTLFrameBuffer::bake_render_pass_descriptor(bool load_c
#if defined(MAC_OS_X_VERSION_11_0) && __MAC_OS_X_VERSION_MAX_ALLOWED > MAC_OS_X_VERSION_11_0
if (@available(macOS 11.00, *)) {
- /* Optimisation: Use smaller tile size on Apple Silicon if exceeding a certain bpp limit. */
+ /* Optimization: Use smaller tile size on Apple Silicon if exceeding a certain bpp limit. */
bool is_tile_based_gpu = [metal_ctx->device hasUnifiedMemory];
if (is_tile_based_gpu) {
uint framebuffer_bpp = this->get_bits_per_pixel();
@@ -1597,7 +1597,7 @@ MTLRenderPassDescriptor *MTLFrameBuffer::bake_render_pass_descriptor(bool load_c
framebuffer_descriptor_[descriptor_config].renderTargetArrayLength = 0;
}
- /* Colour attachments. */
+ /* Color attachments. */
int colour_attachments = 0;
for (int attachment_ind = 0; attachment_ind < GPU_FB_MAX_COLOR_ATTACHMENT; attachment_ind++) {