Cleanup: spelling in comments, odd comment block spacing

This commit is contained in:
Campbell Barton
2023-06-02 10:16:16 +10:00
parent f47aa50d7e
commit 9b97123bf9
36 changed files with 56 additions and 53 deletions

View File

@@ -1650,8 +1650,8 @@ static void dynamicPaint_setInitialColor(const Scene *scene, DynamicPaintSurface
return;
}
/* for vertex surface loop through tfaces and find uv color
* that provides highest alpha */
/* For vertex surface loop through `looptris` and find UV color
* that provides highest alpha. */
if (surface->format == MOD_DPAINT_SURFACE_F_VERTEX) {
struct ImagePool *pool = BKE_image_pool_new();

View File

@@ -93,7 +93,7 @@ void legacy_gpencil_frame_to_grease_pencil_drawing(const bGPDframe &gpf,
int stroke_i = 0;
LISTBASE_FOREACH_INDEX (bGPDstroke *, gps, &gpf.strokes, stroke_i) {
/* TODO: check if gps->editcurve is not nullptr and parse bezier curve instead. */
/* TODO: check if `gps->editcurve` is not nullptr and parse bezier curve instead. */
/* Write curve attributes. */
stroke_cyclic.span[stroke_i] = (gps->flag & GP_STROKE_CYCLIC) != 0;

View File

@@ -2272,7 +2272,7 @@ static bool lib_override_library_resync(Main *bmain,
RNA_OVERRIDE_APPLY_FLAG_NOP);
/* Clear the old shape key pointer again, otherwise it won't make ID management code happy
* when freeing (at least from user count side of things). */
* when freeing (at least from user count side of things). */
if (key_override_old_p != nullptr) {
*key_override_old_p = nullptr;
}

View File

@@ -1178,7 +1178,7 @@ static int mesh_tessface_calc(Mesh &mesh,
/* NOTE: quad detection issue - fourth vertex-index vs fourth loop-index:
* Polygons take care of their loops ordering, hence not of their vertices ordering.
* Currently, our tfaces' fourth vertex index might be 0 even for a quad.
* Currently, the #TFace fourth vertex index might be 0 even for a quad.
* However, we know our fourth loop index is never 0 for quads
* (because they are sorted for polygons, and our quads are still mere copies of their polygons).
* So we pass nullptr as #MFace pointer, and #mesh_loops_to_tessdata

View File

@@ -1776,7 +1776,7 @@ void nodeModifySocketType(bNodeTree *ntree,
if (sock->type != socktype->type) {
/* Only reallocate the default value if the type changed so that UI data like min and max
* isn't removed. This assumes that the default value is stored in the same format for all
* socket types with the same #eNodeSocketDatatype. */
* socket types with the same #eNodeSocketDatatype. */
socket_id_user_decrement(sock);
MEM_freeN(sock->default_value);
sock->default_value = nullptr;

View File

@@ -228,7 +228,7 @@ void BKE_screen_foreach_id_screen_area(LibraryForeachIDData *data, ScrArea *area
/* Embedded ID pointers are not remapped (besides exceptions), ensure it still matches
* actual data. Note that `snode->id` was already processed (and therefore potentially
* remapped) above.*/
* remapped) above. */
if (!is_readonly) {
snode->nodetree = (snode->id == NULL) ? NULL : ntreeFromID(snode->id);
if (path != NULL) {

View File

@@ -149,7 +149,7 @@ class ImplicitSharingInfo : NonCopyable, NonMovable {
* data can be freed though. */
const_cast<ImplicitSharingInfo *>(this)->delete_data_only();
/* Also remove the "fake" weak user that indicated that there was at least one strong
* user.*/
* user. */
this->remove_weak_user_and_delete_if_last();
}
}

View File

@@ -343,7 +343,7 @@ bool BLI_dir_create_recursive(const char *dirname)
if (mode != 0) {
/* The file exists, either it's a directory (ok), or not,
* in which case this function can't do anything useful
* (the caller could remove it and re-run this function). */
* (the caller could remove it and re-run this function). */
return S_ISDIR(mode) ? true : false;
}

View File

@@ -341,7 +341,7 @@ static int64_t get_size_before_gap(const Span<int16_t> indices)
BLI_assert(indices.size() >= 2);
if (indices[1] > indices[0] + 1) {
/* For sparse indices, often the next gap is just after the next index.
* In this case we can skip the logarithmic check below.*/
* In this case we can skip the logarithmic check below. */
return 1;
}
return unique_sorted_indices::find_size_of_next_range(indices);

View File

@@ -125,7 +125,7 @@ TEST(string, StrCopyUTF8_TerminateEncodingEarly)
/** \} */
/* -------------------------------------------------------------------- */
/** \name String Concatinate
/** \name String Concatenate
* \{ */
TEST(string, StrCat)

View File

@@ -86,7 +86,7 @@ class AntiAliasing {
pass.framebuffer_set(&output_fb_);
pass.state_set(DRW_STATE_WRITE_COLOR | DRW_STATE_BLEND_CUSTOM);
pass.shader_set(shaders_.static_shader_get(ANTIALIASING_RESOLVE));
/** \note use color_tx as dummy if AA is diabled. */
/** \note use color_tx as dummy if AA is disabled. */
pass.bind_texture("blendTex", anti_aliasing_enabled_ ? &blend_weight_tx_ : &color_tx);
pass.bind_texture("colorTex", &color_tx);
pass.bind_texture("revealTex", &reveal_tx);

View File

@@ -103,7 +103,7 @@ class Instance {
objects.init(v3d, scene);
lights.init(v3d);
/* TODO(fclem): Vfx. */
/* TODO(@fclem): VFX. */
// vfx.init(use_vfx_, camera_, rv3d);
anti_aliasing.init(v3d, scene);
}

View File

@@ -13,7 +13,7 @@
namespace blender::draw::greasepencil {
enum eShaderType {
/* SMAA antialiasing */
/* SMAA anti-aliasing. */
ANTIALIASING_EDGE_DETECT = 0,
ANTIALIASING_BLEND_WEIGHT,
ANTIALIASING_RESOLVE,

View File

@@ -133,7 +133,7 @@ BLI_STATIC_ASSERT_ALIGN(gpLight, 16)
#endif
struct gpObject {
/** Wether or not to apply lighting to the GPencil object. */
/** Weather or not to apply lighting to the GPencil object. */
bool1 is_shadeless;
/** Switch between 2d and 3D stroke order. */
bool1 stroke_order3d;

View File

@@ -18,8 +18,10 @@
namespace blender::draw::overlay {
/* Selection engine reuse most of the Overlay engine by creating selection IDs for each
* selectable component and using a special shaders for drawing.*/
/**
* Selection engine reuse most of the Overlay engine by creating selection IDs for each
* selectable component and using a special shaders for drawing.
*/
class Instance {
const SelectionType selection_type_;

View File

@@ -160,12 +160,12 @@ BLI_INLINE int32_t pack_rotation_aspect_hardness(float rot, float asp, float har
/* Aspect uses 9 bits */
float asp_normalized = (asp > 1.0f) ? (1.0f / asp) : asp;
packed |= int32_t(unit_float_to_uchar_clamp(asp_normalized));
/* Store if inversed in the 9th bit. */
/* Store if inverted in the 9th bit. */
if (asp > 1.0f) {
packed |= 1 << 8;
}
/* Rotation uses 9 bits */
/* Rotation are in [-90°..90°] range, so we can encode the sign of the angle + the cosine
/* Rotation are in [-90..90] degree range, so we can encode the sign of the angle + the cosine
* because the cosine will always be positive. */
packed |= int32_t(unit_float_to_uchar_clamp(cosf(rot))) << 9;
/* Store sine sign in 9th bit. */
@@ -197,7 +197,7 @@ static void grease_pencil_batches_ensure(GreasePencil &grease_pencil, int cfra)
cfra, [&](GreasePencilDrawing &drawing) { drawings.append(&drawing); });
/* First, count how many vertices and triangles are needed for the whole object. Also record the
* offsets into the curves for the verticies and triangles. */
* offsets into the curves for the vertices and triangles. */
int total_points_num = 0;
int total_triangles_num = 0;
int v_offset = 0;
@@ -240,7 +240,7 @@ static void grease_pencil_batches_ensure(GreasePencil &grease_pencil, int cfra)
}
/* One vertex is stored before and after as padding. Cyclic strokes have one extra
* vertex.*/
* vertex. */
total_points_num += curves.points_num() + num_cyclic + curves.curves_num() * 2;
total_triangles_num += (curves.points_num() + num_cyclic) * 2;
total_triangles_num += drawing.triangles().size();

View File

@@ -3354,7 +3354,7 @@ static int click_select_channel_object(bContext *C,
* to avoid getting stuck there, see: #48747. */
ED_object_base_activate_with_mode_exit_if_needed(C, base); /* adds notifier */
/* Similar to outliner, do not change active element when selecting elements in range.*/
/* Similar to outliner, do not change active element when selecting elements in range. */
if ((adt) && (adt->flag & ADT_UI_SELECTED) && (selectmode != SELECT_EXTEND_RANGE)) {
adt->flag |= ADT_UI_ACTIVE;
}

View File

@@ -1688,7 +1688,7 @@ static int gpencil_weight_sample_invoke(bContext *C, wmOperator *UNUSED(op), con
}
}
/* Set brush weight, based on points found.*/
/* Set brush weight, based on points found. */
if (closest_count > 0) {
if (closest_count == 1) {
brush->weight = closest_weight[0];

View File

@@ -1332,7 +1332,7 @@ void ED_view3d_shade_update(struct Main *bmain, struct View3D *v3d, struct ScrAr
#define OVERLAY_RETOPOLOGY_ENABLED(overlay) \
(((overlay).edit_flag & V3D_OVERLAY_EDIT_RETOPOLOGY) != 0)
#ifdef __APPLE__
/* Apple silicon tile depth test requires a higher value to reduce drawing artifacts.*/
/* Apple silicon tile depth test requires a higher value to reduce drawing artifacts. */
# define OVERLAY_RETOPOLOGY_MIN_OFFSET_ENABLED 0.0015f
# define OVERLAY_RETOPOLOGY_MIN_OFFSET_DISABLED 0.0015f
#else

View File

@@ -951,11 +951,11 @@ static void gizmo_ruler_draw(const bContext *C, wmGizmo *gz)
if ((len < (numstr_size[1] * 2.5f)) ||
((len < (numstr_size[0] + bg_margin + bg_margin)) && (fabs(rot_90_vec[0]) < 0.5f)))
{
/* Super short, or quite short and also shallow angle. Position below line.*/
/* Super short, or quite short and also shallow angle. Position below line. */
posit[1] = MIN2(co_ss[0][1], co_ss[2][1]) - numstr_size[1] - bg_margin - bg_margin;
}
else if (fabs(rot_90_vec[0]) < 0.2f) {
/* Very shallow angle. Shift down by text height.*/
/* Very shallow angle. Shift down by text height. */
posit[1] -= numstr_size[1];
}

View File

@@ -185,7 +185,7 @@ static bool can_rotate(const Span<PackIsland *> islands, const UVPackIsland_Para
return true;
}
/** Angle rounding helper for "D4" transforms. */
/** Angle rounding helper for "D4" transforms. */
static float angle_match(float angle_radians, float target_radians)
{
if (fabsf(angle_radians - target_radians) < DEG2RADF(0.1f)) {
@@ -194,7 +194,7 @@ static float angle_match(float angle_radians, float target_radians)
return angle_radians;
}
/** Angle rounding helper for "D4" transforms. */
/** Angle rounding helper for "D4" transforms. */
static float plusminus_90_angle(float angle_radians)
{
angle_radians = angle_radians - floorf((angle_radians + M_PI_2) / M_PI) * M_PI;
@@ -1109,7 +1109,7 @@ static bool rotate_inside_square(const Span<std::unique_ptr<UVAABBIsland>> islan
}
if (params.shape_method == ED_UVPACK_SHAPE_AABB) {
/* AABB margin calculations are not preserved under rotations. */
if (island_indices.size() > 1) { /* Unless there's only one island...*/
if (island_indices.size() > 1) { /* Unless there's only one island. */
if (params.target_aspect_y != 1.0f) {
/* TODO: Check for possible 90 degree rotation. */
@@ -1146,10 +1146,10 @@ static bool rotate_inside_square(const Span<std::unique_ptr<UVAABBIsland>> islan
/* Now we have all the points in the correct space, compute the 2D convex hull. */
const float(*source)[2] = reinterpret_cast<const float(*)[2]>(square_finder.points.data());
square_finder.indices.resize(square_finder.points.size()); /* Allocate worst-case.*/
square_finder.indices.resize(square_finder.points.size()); /* Allocate worst-case. */
int convex_size = BLI_convexhull_2d(
source, int(square_finder.points.size()), square_finder.indices.data());
square_finder.indices.resize(convex_size); /* Resize to actual size.*/
square_finder.indices.resize(convex_size); /* Resize to actual size. */
/* Run the computation to find the best angle. (Slow!) */
const float quad_180 = square_finder.update(DEG2RADF(-180.0f));

View File

@@ -1265,7 +1265,7 @@ bool MTLContext::ensure_buffer_bindings(
const MTLShaderBufferBlock &ssbo = shader_interface->get_storage_block(ssbo_index);
if (ssbo.buffer_index >= 0 && ssbo.location >= 0) {
/* Explicit lookup location for SSBO in bind table.*/
/* Explicit lookup location for SSBO in bind table. */
const uint32_t ssbo_location = ssbo.location;
/* buffer(N) index of where to bind the SSBO. */
const uint32_t buffer_index = ssbo.buffer_index;
@@ -1444,7 +1444,7 @@ bool MTLContext::ensure_buffer_bindings(
const MTLShaderBufferBlock &ssbo = shader_interface->get_storage_block(ssbo_index);
if (ssbo.buffer_index >= 0 && ssbo.location >= 0) {
/* Explicit lookup location for UBO in bind table.*/
/* Explicit lookup location for UBO in bind table. */
const uint32_t ssbo_location = ssbo.location;
/* buffer(N) index of where to bind the UBO. */
const uint32_t buffer_index = ssbo.buffer_index;

View File

@@ -11,7 +11,7 @@
#include "BKE_global.h"
#include "CLG_log.h"
/** Options for organising Metal GPU debug captures. */
/** Options for organizing Metal GPU debug captures. */
/* Maximum nested debug group depth. Groups beyond this will still have the pass name pulled into
* the RenderCommandEncoder, but will not display in the trace.
* Use -1 for unlimited. */

View File

@@ -249,7 +249,7 @@ struct MSLTextureResource {
MSLTextureSamplerAccess access;
/* Whether resource is a texture sampler or an image. */
bool is_texture_sampler;
/* Index in shader bind table [[texture(N)]].*/
/* Index in shader bind table `[[texture(N)]]`. */
uint slot;
/* Explicit bind index provided by ShaderCreateInfo. */
uint location;

View File

@@ -19,7 +19,7 @@ namespace blender::gpu {
void VKBatch::draw(int vertex_first, int vertex_count, int instance_first, int instance_count)
{
/* Currently the pipeline is rebuild on each draw command. Clearing the dirty flag for
* consistency with the internals of GPU module. */
* consistency with the internals of GPU module. */
flag &= ~GPU_BATCH_DIRTY;
/* Finalize graphics pipeline */

View File

@@ -41,7 +41,7 @@ void VKCommandBuffer::init(const VkDevice vk_device,
/* When a the last GHOST context is destroyed the device is deallocate. A moment later the GPU
* context is destroyed. The first step is to activate it. Activating would retrieve the device
* from GHOST which in that case is a VK_NULL_HANDLE.*/
* from GHOST which in that case is a #VK_NULL_HANDLE. */
if (vk_device == VK_NULL_HANDLE) {
return;
}

View File

@@ -441,7 +441,7 @@ void VKFrameBuffer::render_pass_create()
size_set(size[0], size[1]);
}
else {
/* A framebuffer should at least be 1 by 1.*/
/* A frame-buffer should at least be 1 by 1. */
this->size_set(1, 1);
}
viewport_reset();

View File

@@ -113,9 +113,9 @@ class VKFrameBuffer : public FrameBuffer {
}
/**
* Is this framebuffer immutable?
* Is this frame-buffer immutable?
*
* Framebuffers that are owned by GHOST are immutable and
* Frame-buffers that are owned by GHOST are immutable and
* don't have any attachments assigned. It should be assumed that there is a single color texture
* in slot 0.
*/

View File

@@ -78,9 +78,8 @@ void VKPipelineStateManager::finalize_color_blend_state(const VKFrameBuffer &fra
{
color_blend_attachments.clear();
if (framebuffer.is_immutable()) {
/* Immutable framebuffers are owned by GHOST and don't have any attachments assigned. In this
* case we assume that there is a single color texture assigned.
*/
/* Immutable frame-buffers are owned by GHOST and don't have any attachments assigned. In this
* case we assume that there is a single color texture assigned. */
color_blend_attachments.append(color_blend_attachment_template);
}
else {
@@ -95,7 +94,7 @@ void VKPipelineStateManager::finalize_color_blend_state(const VKFrameBuffer &fra
else {
/* Test to detect if all color textures are sequential attached from the first slot. We
* assume at this moment that this is the case. Otherwise we need to rewire how attachments
* and bindings work.*/
* and bindings work. */
is_sequential = false;
}
}

View File

@@ -20,7 +20,7 @@ class VKUniformBuffer;
class VKVertexBuffer;
class VKStateManager : public StateManager {
/* Dummy sampler for now.*/
/* Dummy sampler for now. */
VKSampler sampler_;
uint texture_unpack_row_length_ = 0;
@@ -48,7 +48,7 @@ class VKStateManager : public StateManager {
void issue_barrier(eGPUBarrier barrier_bits) override;
/** Apply resources to the bindings of the active shader.*/
/** Apply resources to the bindings of the active shader. */
void apply_bindings();
void texture_bind(Texture *tex, GPUSamplerState sampler, int unit) override;

View File

@@ -54,7 +54,7 @@ class VKVertexBuffer : public VertBuf {
void allocate();
void *convert() const;
/* VKTexture requires access to `buffer_` to convert a vertex buffer to a texture.*/
/* VKTexture requires access to `buffer_` to convert a vertex buffer to a texture. */
friend class VKTexture;
};

View File

@@ -119,10 +119,12 @@ static bool export_params_valid(const USDExportParams &params)
return valid;
}
/* Create the root Xform primitive, if the Root Prim path has been set
/**
* Create the root Xform primitive, if the Root Prim path has been set
* in the export options. In the future, this function can be extended
* to author transforms and additional schema data (e.g., model Kind)
* on the root prim. */
* on the root prim.
*/
static void ensure_root_prim(pxr::UsdStageRefPtr stage, const USDExportParams &params)
{
if (params.root_prim_path[0] == '\0') {

View File

@@ -34,7 +34,7 @@ struct NodePlacementContext {
/* Map a USD shader prim path to the Blender node converted
* from that shader. This map is updated during shader
* conversion and is used to avoid creating duplicate nodes
* for a given shader. */
* for a given shader. */
ShaderToNodeMap node_cache;
NodePlacementContext(float in_origx,

View File

@@ -275,7 +275,7 @@ static void populate_curve_props_for_nurbs(const bke::CurvesGeometry &geometry,
const bool is_cyclic)
{
/* Order and range, when representing a batched NurbsCurve should be authored one value per
* curve.*/
* curve. */
const int num_curves = geometry.curve_num;
orders.resize(num_curves);

View File

@@ -528,7 +528,7 @@ void RE_RenderBuffer_assign_shared(RenderBuffer *lhs, const RenderBuffer *rhs);
void RE_RenderBuffer_data_free(RenderBuffer *render_buffer);
/* Implementation of above, but for byte buffer. */
/* TODO(sergey): Once everything is C++ we can remove the duplicated API. */
/* TODO(sergey): Once everything is C++ we can remove the duplicated API. */
RenderByteBuffer RE_RenderByteBuffer_new(uint8_t *data);
void RE_RenderByteBuffer_assign_data(RenderByteBuffer *render_buffer, uint8_t *data);
void RE_RenderByteBuffer_assign_shared(RenderByteBuffer *lhs, const RenderByteBuffer *rhs);

View File

@@ -555,7 +555,7 @@ static void print_help(bArgs *ba, bool all)
struct BuildDefs defs;
build_defs_init(&defs, all);
/* All printing must go via `PRINT` macro. */
/* All printing must go via `PRINT` macro. */
# define printf __ERROR__
# define PRINT(...) BLI_args_printf(ba, __VA_ARGS__)