From 198a7639441536681a257debd905917e02d52b7f Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 28 Apr 2022 14:03:49 +1000 Subject: Cleanup: spelling in comments Also use back-slashes for doxy commands. --- source/blender/gpu/metal/mtl_context.hh | 2 +- source/blender/gpu/metal/mtl_debug.hh | 2 +- source/blender/gpu/metal/mtl_texture.hh | 22 +++++++++--------- source/blender/gpu/metal/mtl_texture.mm | 34 ++++++++++++++-------------- source/blender/gpu/metal/mtl_texture_util.mm | 4 ++-- 5 files changed, 32 insertions(+), 32 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 e855f9cb91a..a317cd03e37 100644 --- a/source/blender/gpu/metal/mtl_context.hh +++ b/source/blender/gpu/metal/mtl_context.hh @@ -133,7 +133,7 @@ class MTLContext : public Context { friend class MTLBackend; private: - /* Compute and specialisation caches */ + /* Compute and specialization caches. */ MTLContextTextureUtils texture_utils_; public: diff --git a/source/blender/gpu/metal/mtl_debug.hh b/source/blender/gpu/metal/mtl_debug.hh index 455a6da5ddc..25aaf30892b 100644 --- a/source/blender/gpu/metal/mtl_debug.hh +++ b/source/blender/gpu/metal/mtl_debug.hh @@ -13,7 +13,7 @@ namespace debug { extern CLG_LogRef LOG; -/* Initialise debugging. */ +/* Initialize debugging. */ void mtl_debug_init(); /* Using Macro's instead of variadic template due to non-string-literal diff --git a/source/blender/gpu/metal/mtl_texture.hh b/source/blender/gpu/metal/mtl_texture.hh index 0762470dd88..94892544f96 100644 --- a/source/blender/gpu/metal/mtl_texture.hh +++ b/source/blender/gpu/metal/mtl_texture.hh @@ -58,7 +58,7 @@ template<> struct blender::DefaultHash { } }; -/* Type of data is being writen to the depth target: +/* Type of data is being written to the depth target: * 0 = floating point (0.0 - 1.0) * 1 = 24 bit integer (0 - 2^24) * 2 = 32 bit integer (0 - 2^32) */ @@ -179,9 +179,9 @@ class MTLTexture : public Texture { private: /* Where the textures data comes from. */ enum { - MTL_TEXTURE_MODE_DEFAULT, /* Texture is self-initialised (Standard). */ + MTL_TEXTURE_MODE_DEFAULT, /* Texture is self-initialized (Standard). */ MTL_TEXTURE_MODE_EXTERNAL, /* Texture source from external id handle */ - MTL_TEXTURE_MODE_VBO, /* Texture source initialised from VBO */ + MTL_TEXTURE_MODE_VBO, /* Texture source initialized from VBO */ MTL_TEXTURE_MODE_TEXTURE_VIEW /* Texture is a view into an existing texture. */ } resource_mode_; @@ -197,15 +197,15 @@ class MTLTexture : public Texture { id texture_buffer_; unsigned int aligned_w_ = 0; - /* Blit Framebuffer. */ + /* Blit Frame-buffer. */ GPUFrameBuffer *blit_fb_ = nullptr; unsigned int blit_fb_slice_ = 0; unsigned int blit_fb_mip_ = 0; - /* Texure view properties */ + /* Texture view properties */ /* In Metal, we use texture views to either limit mipmap ranges, * , apply a swizzle mask, or both. - + * * We apply the mip limit in the view rather than in the sampler, as * certain effects and functionality such as textureSize rely on the base level * being modified. @@ -214,7 +214,7 @@ class MTLTexture : public Texture { * texture if MTL_TEXTURE_MODE_TEXTURE_VIEW is used. * If this mode is used, source_texture points to a GPUTexture from which * we pull their texture handle as a root. - */ + */ const GPUTexture *source_texture_ = nullptr; enum TextureViewDirtyState { @@ -286,10 +286,10 @@ class MTLTexture : public Texture { int layer_offset) override; /* Texture View */ private: - /* Common Constructor, default initialisation */ + /* Common Constructor, default initialization. */ void mtl_texture_init(); - /* Post-construction and member initialisation, prior to baking. + /* Post-construction and member initialization, prior to baking. * Called during init_internal */ void prepare_internal(); @@ -349,8 +349,8 @@ class MTLTexture : public Texture { MEM_CXX_CLASS_ALLOC_FUNCS("gpu::MTLTexture") /* Texture Update function Utilities. */ - /* Metal texture updating does not provide the same range of functionality for type conversiona - * and format compatibilities as are available in OpenGL. To achieve the same level of + /* Metal texture updating does not provide the same range of functionality for type conversion + * and format compatibility as are available in OpenGL. To achieve the same level of * functionality, we need to instead use compute kernels to perform texture data conversions * where appropriate. * There are a number of different inputs which affect permutations and thus require different diff --git a/source/blender/gpu/metal/mtl_texture.mm b/source/blender/gpu/metal/mtl_texture.mm index 5ffcd167df9..aedccc60920 100644 --- a/source/blender/gpu/metal/mtl_texture.mm +++ b/source/blender/gpu/metal/mtl_texture.mm @@ -71,7 +71,7 @@ void gpu::MTLTexture::mtl_texture_init() gpu::MTLTexture::MTLTexture(const char *name) : Texture(name) { - /* Common Initialisation. */ + /* Common Initialization. */ mtl_texture_init(); } @@ -81,7 +81,7 @@ gpu::MTLTexture::MTLTexture(const char *name, id metal_texture) : Texture(name) { - /* Common Initialisation. */ + /* Common Initialization. */ mtl_texture_init(); /* Prep texture from METAL handle. */ @@ -447,7 +447,7 @@ void gpu::MTLTexture::update_sub( int totalsize = 0; /* If unpack row length is used, size of input data uses the unpack row length, rather than the - * image lenght */ + * image length. */ int expected_update_w = ((ctx->pipeline_state.unpack_row_length == 0) ? extent[0] : ctx->pipeline_state.unpack_row_length); @@ -1168,7 +1168,7 @@ void gpu::MTLTexture::mip_range_set(int min, int max) * - For the time being, we are going to just need to generate a FULL mipmap chain * as we do not know ahead of time whether mipmaps will be used. * - * TODO(Metal): Add texture initialisation flag to determine whether mipmaps are used + * TODO(Metal): Add texture initialization flag to determine whether mipmaps are used * or not. Will be important for saving memory for big textures. */ this->mip_min_ = min; this->mip_max_ = max; @@ -1236,7 +1236,7 @@ void gpu::MTLTexture::read_internal(int mip, int debug_data_size, void *r_data) { - /* Verify texures are baked. */ + /* Verify textures are baked. */ if (!this->is_baked_) { MTL_LOG_WARNING("gpu::MTLTexture::read_internal - Trying to read from a non-baked texture!\n"); return; @@ -1308,7 +1308,7 @@ void gpu::MTLTexture::read_internal(int mip, unsigned int destination_offset = 0; void *destination_buffer_host_ptr = nullptr; - /* TODO(Metal): Optimise buffer allocation. */ + /* TODO(Metal): Optimize buffer allocation. */ MTLResourceOptions bufferOptions = MTLResourceStorageModeManaged; destination_buffer = [ctx->device newBufferWithLength:max_ii(total_bytes, 256) options:bufferOptions]; @@ -1592,7 +1592,7 @@ bool gpu::MTLTexture::init_internal(void) bool gpu::MTLTexture::init_internal(GPUVertBuf *vbo) { - /* Zero initialise. */ + /* Zero initialize. */ this->prepare_internal(); /* TODO(Metal): Add implementation for GPU Vert buf. */ @@ -1603,7 +1603,7 @@ bool gpu::MTLTexture::init_internal(const GPUTexture *src, int mip_offset, int l { BLI_assert(src); - /* Zero initialise. */ + /* Zero initialize. */ this->prepare_internal(); /* Flag as using texture view. */ @@ -1618,7 +1618,7 @@ bool gpu::MTLTexture::init_internal(const GPUTexture *src, int mip_offset, int l BLI_assert(this->texture_); [this->texture_ retain]; - /* Flag texture as baked -- we do not need explicit initialisation. */ + /* Flag texture as baked -- we do not need explicit initialization. */ this->is_baked_ = true; this->is_dirty_ = false; @@ -1638,7 +1638,7 @@ bool gpu::MTLTexture::texture_is_baked() return this->is_baked_; } -/* Prepare texture parameters after initialisation, but before baking. */ +/* Prepare texture parameters after initialization, but before baking. */ void gpu::MTLTexture::prepare_internal() { @@ -1647,7 +1647,7 @@ void gpu::MTLTexture::prepare_internal() this->gpu_image_usage_flags_ |= GPU_TEXTURE_USAGE_ATTACHMENT; } - /* Derive maxmimum number of mip levels by default. + /* Derive maximum number of mip levels by default. * TODO(Metal): This can be removed if max mip counts are specified upfront. */ if (this->type_ == GPU_TEXTURE_1D || this->type_ == GPU_TEXTURE_1D_ARRAY || this->type_ == GPU_TEXTURE_BUFFER) { @@ -1684,7 +1684,7 @@ void gpu::MTLTexture::ensure_baked() BLI_assert(this->resource_mode_ != MTL_TEXTURE_MODE_TEXTURE_VIEW); BLI_assert(this->resource_mode_ != MTL_TEXTURE_MODE_VBO); - /* Format and mip levels (TODO(Metal): Optimise mipmaps counts, specify up-front). */ + /* Format and mip levels (TODO(Metal): Optimize mipmaps counts, specify up-front). */ MTLPixelFormat mtl_format = gpu_texture_format_to_metal(this->format_); /* Create texture descriptor. */ @@ -1709,7 +1709,7 @@ void gpu::MTLTexture::ensure_baked() 1; this->texture_descriptor_.usage = MTLTextureUsageRenderTarget | MTLTextureUsageShaderRead | MTLTextureUsageShaderWrite | - MTLTextureUsagePixelFormatView; /* TODO(Metal): Optimise usage flags. */ + MTLTextureUsagePixelFormatView; /* TODO(Metal): Optimize usage flags. */ this->texture_descriptor_.storageMode = MTLStorageModePrivate; this->texture_descriptor_.sampleCount = 1; this->texture_descriptor_.cpuCacheMode = MTLCPUCacheModeDefaultCache; @@ -1735,7 +1735,7 @@ void gpu::MTLTexture::ensure_baked() 1; this->texture_descriptor_.usage = MTLTextureUsageRenderTarget | MTLTextureUsageShaderRead | MTLTextureUsageShaderWrite | - MTLTextureUsagePixelFormatView; /* TODO(Metal): Optimise usage flags. */ + MTLTextureUsagePixelFormatView; /* TODO(Metal): Optimize usage flags. */ this->texture_descriptor_.storageMode = MTLStorageModePrivate; this->texture_descriptor_.sampleCount = 1; this->texture_descriptor_.cpuCacheMode = MTLCPUCacheModeDefaultCache; @@ -1757,7 +1757,7 @@ void gpu::MTLTexture::ensure_baked() 1; this->texture_descriptor_.usage = MTLTextureUsageRenderTarget | MTLTextureUsageShaderRead | MTLTextureUsageShaderWrite | - MTLTextureUsagePixelFormatView; /* TODO(Metal): Optimise usage flags. */ + MTLTextureUsagePixelFormatView; /* TODO(Metal): Optimize usage flags. */ this->texture_descriptor_.storageMode = MTLStorageModePrivate; this->texture_descriptor_.sampleCount = 1; this->texture_descriptor_.cpuCacheMode = MTLCPUCacheModeDefaultCache; @@ -1786,7 +1786,7 @@ void gpu::MTLTexture::ensure_baked() 1; this->texture_descriptor_.usage = MTLTextureUsageRenderTarget | MTLTextureUsageShaderRead | MTLTextureUsageShaderWrite | - MTLTextureUsagePixelFormatView; /* TODO(Metal): Optimise usage flags. */ + MTLTextureUsagePixelFormatView; /* TODO(Metal): Optimize usage flags. */ this->texture_descriptor_.storageMode = MTLStorageModePrivate; this->texture_descriptor_.sampleCount = 1; this->texture_descriptor_.cpuCacheMode = MTLCPUCacheModeDefaultCache; @@ -1807,7 +1807,7 @@ void gpu::MTLTexture::ensure_baked() 1; this->texture_descriptor_.usage = MTLTextureUsageShaderRead | MTLTextureUsageShaderWrite | - MTLTextureUsagePixelFormatView; /* TODO(Metal): Optimise usage flags. */ + MTLTextureUsagePixelFormatView; /* TODO(Metal): Optimize usage flags. */ this->texture_descriptor_.storageMode = MTLStorageModePrivate; this->texture_descriptor_.sampleCount = 1; this->texture_descriptor_.cpuCacheMode = MTLCPUCacheModeDefaultCache; diff --git a/source/blender/gpu/metal/mtl_texture_util.mm b/source/blender/gpu/metal/mtl_texture_util.mm index c166a9362c8..698aec77fc3 100644 --- a/source/blender/gpu/metal/mtl_texture_util.mm +++ b/source/blender/gpu/metal/mtl_texture_util.mm @@ -325,7 +325,7 @@ id gpu::MTLTexture::mtl_texture_update_impl( NSString *tex_update_kernel_src = [NSString stringWithUTF8String:datatoc_compute_texture_update_msl]; - /* Prepare options and specialisations. */ + /* Prepare options and specializations. */ MTLCompileOptions *options = [[[MTLCompileOptions alloc] init] autorelease]; options.languageVersion = MTLLanguageVersion2_2; options.preprocessorMacros = @{ @@ -635,7 +635,7 @@ id gpu::MTLTexture::mtl_texture_read_impl( } } - /* Prepare options and specialisations. */ + /* Prepare options and specializations. */ MTLCompileOptions *options = [[[MTLCompileOptions alloc] init] autorelease]; options.languageVersion = MTLLanguageVersion2_2; options.preprocessorMacros = @{ -- cgit v1.2.3