From 427a2c920a249c066e324e4a5e40dd141a4968aa Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Fri, 13 May 2022 09:24:28 +1000 Subject: Cleanup: spelling in comments, capitalize tags Also add missing task-ID reference & remove colon after \note as it doesn't render properly in doxygen. --- source/blender/gpu/metal/mtl_context.hh | 8 ++++---- source/blender/gpu/metal/mtl_context.mm | 6 +++--- source/blender/gpu/metal/mtl_state.mm | 22 +++++++++++----------- source/blender/gpu/metal/mtl_texture.mm | 2 +- 4 files changed, 19 insertions(+), 19 deletions(-) (limited to 'source/blender/gpu/metal') diff --git a/source/blender/gpu/metal/mtl_context.hh b/source/blender/gpu/metal/mtl_context.hh index 938ea8edc13..1849a04ea48 100644 --- a/source/blender/gpu/metal/mtl_context.hh +++ b/source/blender/gpu/metal/mtl_context.hh @@ -57,12 +57,12 @@ typedef struct MTLContextDepthStencilState { MTLStencilOperation stencil_op_back_depth_fail; MTLStencilOperation stencil_op_back_depthstencil_pass; - /* Framebuffer State -- We need to mark this, incase stencil state remains unchanged, + /* Frame-buffer State -- We need to mark this, in case stencil state remains unchanged, * but attachment state has changed. */ bool has_depth_target; bool has_stencil_target; - /* TODO(Metal): Consider optimising this function using memcmp. + /* TODO(Metal): Consider optimizing this function using memcmp. * Un-used, but differing, stencil state leads to over-generation * of state objects when doing trivial compare. */ inline bool operator==(const MTLContextDepthStencilState &other) const @@ -297,7 +297,7 @@ typedef struct MTLContextGlobalShaderPipelineState { /* Whether the pipeline state has been modified since application. * `dirty_flags` is a bitmask of the types of state which have been updated. - * This is in order to optimise calls and only re-apply state as needed. + * This is in order to optimize calls and only re-apply state as needed. * Some state parameters are dynamically applied on the RenderCommandEncoder, * others may be encapsulated in GPU-resident state objects such as * MTLDepthStencilState or MTLRenderPipelineState. */ @@ -374,7 +374,7 @@ typedef struct MTLTemporaryBufferRange { } MTLTemporaryBufferRange; /** MTLContext -- Core render loop and state management. **/ -/* Note(Metal): Partial MTLContext stub to provide wrapper functionality +/* NOTE(Metal): Partial MTLContext stub to provide wrapper functionality * for work-in-progress MTL* classes. */ class MTLContext : public Context { diff --git a/source/blender/gpu/metal/mtl_context.mm b/source/blender/gpu/metal/mtl_context.mm index de72340a9a8..94f5682b11b 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 Metal modules. */ + /* Initialize Metal modules. */ this->state_manager = new MTLStateManager(this); /* TODO(Metal): Implement. */ @@ -121,7 +121,7 @@ bool MTLContext::is_render_pass_active() /* Metal Context Pipeline State. */ void MTLContext::pipeline_state_init() { - /*** Initialise state only once. ***/ + /*** Initialize state only once. ***/ if (!this->pipeline_state.initialised) { this->pipeline_state.initialised = true; this->pipeline_state.active_shader = NULL; @@ -277,7 +277,7 @@ id MTLContext::get_sampler_from_state(MTLSamplerState sampler_s id MTLContext::generate_sampler_from_state(MTLSamplerState sampler_state) { - /* Check if samper already exists for given state. */ + /* Check if sampler already exists for given state. */ id st = this->sampler_state_cache_[(unsigned int)sampler_state]; if (st != nil) { return st; diff --git a/source/blender/gpu/metal/mtl_state.mm b/source/blender/gpu/metal/mtl_state.mm index 5cd88c4ff7b..5f52bc55f72 100644 --- a/source/blender/gpu/metal/mtl_state.mm +++ b/source/blender/gpu/metal/mtl_state.mm @@ -24,7 +24,7 @@ void MTLStateManager::mtl_state_init(void) MTLStateManager::MTLStateManager(MTLContext *ctx) : StateManager() { - /* Initialise State. */ + /* Initialize State. */ this->context_ = ctx; mtl_state_init(); @@ -92,10 +92,10 @@ void MTLStateManager::set_state(const GPUState &state) /* TODO remove (Following GLState). */ if (changed.polygon_smooth) { - /* Note: Unsupported in Metal. */ + /* NOTE: Unsupported in Metal. */ } if (changed.line_smooth) { - /* Note: Unsupported in Metal. */ + /* NOTE: Unsupported in Metal. */ } current_ = state; @@ -341,7 +341,7 @@ void MTLStateManager::set_clip_distances(const int new_dist_len, const int old_d void MTLStateManager::set_logic_op(const bool enable) { - /* Note(Metal): Logic Operations not directly supported. */ + /* NOTE(Metal): Logic Operations not directly supported. */ } void MTLStateManager::set_facing(const bool invert) @@ -376,9 +376,9 @@ void MTLStateManager::set_backface_culling(const eGPUFaceCullTest test) void MTLStateManager::set_provoking_vert(const eGPUProvokingVertex vert) { - /* Note(Metal): Provoking vertex is not a feature in the Metal API. + /* NOTE(Metal): Provoking vertex is not a feature in the Metal API. * Shaders are handled on a case-by-case basis using a modified vertex shader. - * For example, wireframe rendering and edit-mesh shaders utilise an SSBO-based + * For example, wireframe rendering and edit-mesh shaders utilize an SSBO-based * vertex fetching mechanism which considers the inverse convention for flat * shading, to ensure consistent results with OpenGL. */ } @@ -439,7 +439,7 @@ void MTLStateManager::set_blend(const eGPUBlend value) break; } case GPU_BLEND_ADDITIVE: { - /* Do not let alpha accumulate but premult the source RGB by it. */ + /* Do not let alpha accumulate but pre-multiply the source RGB by it. */ src_rgb = MTLBlendFactorSourceAlpha; dst_rgb = MTLBlendFactorOne; src_alpha = MTLBlendFactorZero; @@ -530,14 +530,14 @@ void MTLStateManager::set_blend(const eGPUBlend value) /** \name Memory barrier * \{ */ -/* Note(Metal): Granular option for specifying before/after stages for a barrier +/* NOTE(Metal): Granular option for specifying before/after stages for a barrier * Would be a useful feature. */ /*void MTLStateManager::issue_barrier(eGPUBarrier barrier_bits, eGPUStageBarrierBits before_stages, eGPUStageBarrierBits after_stages) */ void MTLStateManager::issue_barrier(eGPUBarrier barrier_bits) { - /* Note(Metal): The Metal API implictly tracks dependencies between resources. + /* NOTE(Metal): The Metal API implicitly tracks dependencies between resources. * Memory barriers and execution barriers (Fences/Events) can be used to coordinate * this explicitly, however, in most cases, the driver will be able to * resolve these dependencies automatically. @@ -551,7 +551,7 @@ void MTLStateManager::issue_barrier(eGPUBarrier barrier_bits) /* Apple Silicon does not support memory barriers. * We do not currently need these due to implicit API guarantees. - * Note(Metal): MTLFence/MTLEvent may be required to synchronize work if + * NOTE(Metal): MTLFence/MTLEvent may be required to synchronize work if * untracked resources are ever used. */ if ([ctx->device hasUnifiedMemory]) { return; @@ -562,7 +562,7 @@ void MTLStateManager::issue_barrier(eGPUBarrier barrier_bits) id rec = nil; // ctx->get_active_render_command_encoder(); BLI_assert(rec); - /* Only supporting Metal on 10.15 onwards anyway - Check required for warnings. */ + /* Only supporting Metal on 10.15 onward anyway - Check required for warnings. */ if (@available(macOS 10.14, *)) { MTLBarrierScope scope = 0; if (barrier_bits & GPU_BARRIER_SHADER_IMAGE_ACCESS || diff --git a/source/blender/gpu/metal/mtl_texture.mm b/source/blender/gpu/metal/mtl_texture.mm index 7ec3d390416..ca19d1f9e4b 100644 --- a/source/blender/gpu/metal/mtl_texture.mm +++ b/source/blender/gpu/metal/mtl_texture.mm @@ -1163,7 +1163,7 @@ void gpu::MTLTexture::mip_range_set(int min, int max) { BLI_assert(min <= max && min >= 0 && max <= mipmaps_); - /* Note: + /* NOTE: * - mip_min_ and mip_max_ are used to Clamp LODs during sampling. * - Given functions like Framebuffer::recursive_downsample modifies the mip range * between each layer, we do not want to be re-baking the texture. -- cgit v1.2.3