Cleanup: spelling in comments
This commit is contained in:
@@ -66,7 +66,7 @@ def draw_km(display_keymaps, kc, km, children, layout, level):
|
||||
|
||||
if km.is_user_modified:
|
||||
subrow.operator("preferences.keymap_restore", text="Restore")
|
||||
# Add margin to space the button from the scrollbar.
|
||||
# Add margin to space the button from the scroll-bar.
|
||||
subrow.separator()
|
||||
if km.is_modal:
|
||||
subrow.label(text="", icon='LINKED')
|
||||
@@ -159,7 +159,7 @@ def draw_kmi(display_keymaps, kc, km, kmi, layout, level):
|
||||
icon=('TRACKING_CLEAR_BACKWARDS' if kmi.is_user_defined else 'X')
|
||||
).item_id = kmi.id
|
||||
|
||||
# Add margin to space the buttons from the scrollbar.
|
||||
# Add margin to space the buttons from the scroll-bar.
|
||||
row.separator(factor=0.25 if kmi.show_expanded else 1.0)
|
||||
|
||||
# Expanded, additional event settings
|
||||
@@ -350,7 +350,7 @@ def draw_filtered(display_keymaps, filter_type, filter_text, layout):
|
||||
subrow = row.row()
|
||||
subrow.alignment = 'RIGHT'
|
||||
subrow.operator("preferences.keymap_restore", text="Restore")
|
||||
# Add margin to space the button from the scrollbar.
|
||||
# Add margin to space the button from the scroll-bar.
|
||||
subrow.separator()
|
||||
|
||||
for kmi in filtered_items:
|
||||
|
||||
@@ -153,7 +153,7 @@ int insert_bezt_fcurve(FCurve *fcu, const BezTriple *bezt, eInsertKeyFlags flag)
|
||||
|
||||
/* Replace an existing keyframe? */
|
||||
if (replace) {
|
||||
/* 'i' may in rare cases exceed arraylen. */
|
||||
/* `i` may in rare cases exceed array bounds. */
|
||||
if ((i >= 0) && (i < fcu->totvert)) {
|
||||
if (flag & INSERTKEY_OVERWRITE_FULL) {
|
||||
fcu->bezt[i] = *bezt;
|
||||
@@ -683,11 +683,11 @@ bool fcurve_frame_has_keyframe(const FCurve *fcu, const float frame)
|
||||
bool replace;
|
||||
const int i = BKE_fcurve_bezt_binarysearch_index(fcu->bezt, frame, fcu->totvert, &replace);
|
||||
|
||||
/* BKE_fcurve_bezt_binarysearch_index will set replace to be 0 or 1
|
||||
/* #BKE_fcurve_bezt_binarysearch_index will set replace to be 0 or 1
|
||||
* - obviously, 1 represents a match
|
||||
*/
|
||||
if (replace) {
|
||||
/* 'i' may in rare cases exceed arraylen. */
|
||||
/* `i` may in rare cases exceed array bounds. */
|
||||
if ((i >= 0) && (i < fcu->totvert)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -97,7 +97,7 @@ BMEditMesh *BKE_editmesh_copy(BMEditMesh *em);
|
||||
BMEditMesh *BKE_editmesh_from_object(Object *ob);
|
||||
|
||||
/**
|
||||
* Return whether the evaluated mesh is a "descendent" of the original mesh: whether it is a
|
||||
* Return whether the evaluated mesh is a "descendant" of the original mesh: whether it is a
|
||||
* version of the original mesh propagated during evaluation. This will be false if the mesh was
|
||||
* taken from from an different object during evaluation, with the object info node for example.
|
||||
*/
|
||||
|
||||
@@ -434,7 +434,8 @@ struct ARegionRuntime {
|
||||
* The visible part of the region, use with region overlap not to draw
|
||||
* on top of the overlapping regions.
|
||||
*
|
||||
* Lazy initialize, zero'd when unset, relative to #ARegion.winrct x/y min. */
|
||||
* Lazy initialize, zeroed when unset, relative to #ARegion.winrct x/y min.
|
||||
*/
|
||||
rcti visible_rect = {};
|
||||
|
||||
/* The offset needed to not overlap with window scroll-bars. Only used by HUD regions for now. */
|
||||
|
||||
@@ -1063,7 +1063,7 @@ Image *BKE_image_load_in_lib(Main *bmain,
|
||||
int file;
|
||||
char filepath_abs[FILE_MAX];
|
||||
|
||||
/* If no owner library is explicitely given, use the current library from the given Main. */
|
||||
/* If no owner library is explicitly given, use the current library from the given #Main. */
|
||||
Library *owner_lib = owner_library.value_or(bmain->curlib);
|
||||
|
||||
image_abs_path(bmain, owner_lib, filepath, filepath_abs);
|
||||
@@ -1105,12 +1105,12 @@ Image *BKE_image_load_exists_in_lib(Main *bmain,
|
||||
Image *ima;
|
||||
char filepath_abs[FILE_MAX], filepath_test[FILE_MAX];
|
||||
|
||||
/* If not owner library is explicitely given, use the current library from the given Main. */
|
||||
/* If not owner library is explicitly given, use the current library from the given Main. */
|
||||
Library *owner_lib = owner_library.value_or(bmain->curlib);
|
||||
|
||||
image_abs_path(bmain, owner_lib, filepath, filepath_abs);
|
||||
|
||||
/* first search an identical filepath */
|
||||
/* First search an identical filepath. */
|
||||
for (ima = static_cast<Image *>(bmain->images.first); ima;
|
||||
ima = static_cast<Image *>(ima->id.next))
|
||||
{
|
||||
|
||||
@@ -371,7 +371,7 @@ void invert_m4_m4_safe(float inverse[4][4], const float mat[4][4]);
|
||||
|
||||
void invert_m3_m3_safe_ortho(float inverse[3][3], const float mat[3][3]);
|
||||
/**
|
||||
* A safe version of invert that uses valid axes, calculating the zero'd axis
|
||||
* A safe version of invert that uses valid axes, calculating the zeroed axis
|
||||
* based on the non-zero ones.
|
||||
*
|
||||
* This works well for transformation matrices, when a single axis is zeroed.
|
||||
|
||||
@@ -846,8 +846,8 @@ uint BLI_scanfill_calc_ex(ScanFillContext *sf_ctx, const int flag, const float n
|
||||
|
||||
#ifndef NDEBUG
|
||||
for (eve = sf_ctx->fillvertbase.first; eve; eve = eve->next) {
|
||||
/* these values used to be set,
|
||||
* however they should always be zero'd so check instead */
|
||||
/* These values used to be set,
|
||||
* however they should always be zeroed so check instead. */
|
||||
BLI_assert(eve->f == 0);
|
||||
BLI_assert(sf_ctx->poly_nr || eve->poly_nr == 0);
|
||||
BLI_assert(eve->edge_count == 0);
|
||||
|
||||
@@ -51,7 +51,7 @@ void bmo_edgenet_fill_exec(BMesh *bm, BMOperator *op)
|
||||
if (use_smooth) {
|
||||
BM_elem_flag_enable(f, BM_ELEM_SMOOTH);
|
||||
}
|
||||
/* normals are zero'd */
|
||||
/* Normals are zeroed. */
|
||||
BM_face_normal_update(f);
|
||||
}
|
||||
|
||||
|
||||
@@ -59,7 +59,7 @@ void bmo_holes_fill_exec(BMesh *bm, BMOperator *op)
|
||||
BMFace *f;
|
||||
|
||||
BMO_ITER (f, &siter, op_attr.slots_out, "faces_fail.out", BM_FACE) {
|
||||
BM_face_normal_update(f); /* normals are zero'd */
|
||||
BM_face_normal_update(f); /* Normals are zeroed. */
|
||||
}
|
||||
|
||||
BMO_op_callf(bm, op->flag, "recalc_face_normals faces=%S", &op_attr, "faces_fail.out");
|
||||
|
||||
@@ -7554,10 +7554,10 @@ static float geometry_collide_offset(BevelParams *bp, EdgeHalf *eb)
|
||||
float sin2 = sinf(th2);
|
||||
float cos1 = cosf(th1);
|
||||
float cos2 = cosf(th2);
|
||||
/*the side offsets, overlap at the two corners, to create two corner vectors.
|
||||
*the intersection of these two corner vectors is the collapse point.
|
||||
*The length of edge B divided by the projection of these vectors onto edge B
|
||||
*is the number of 'offsets' that can be accomodated*/
|
||||
/* The side offsets, overlap at the two corners, to create two corner vectors.
|
||||
* The intersection of these two corner vectors is the collapse point.
|
||||
* The length of edge B divided by the projection of these vectors onto edge B
|
||||
* is the number of 'offsets' that can be accommodated. */
|
||||
float offsets_projected_on_B = (ka + cos1 * kb) / sin1 + (kc + cos2 * kb) / sin2;
|
||||
if (offsets_projected_on_B > BEVEL_EPSILON) {
|
||||
offsets_projected_on_B = bp->offset * (len_v3v3(vb->co, vc->co) / offsets_projected_on_B);
|
||||
|
||||
@@ -37,7 +37,7 @@ struct Overlay {
|
||||
* on a per object-data basis.
|
||||
*
|
||||
* IMPORTANT: Synchronization must be view agnostic. That is, not rely on view position,
|
||||
* projection matrix or framebuffer size to do conditional pass creation. This is because, by
|
||||
* projection matrix or frame-buffer size to do conditional pass creation. This is because, by
|
||||
* design, syncing can happen once and rendered multiple time (multi view rendering, stereo
|
||||
* rendering, orbiting view ...). Conditional pass creation, must be done in the drawing
|
||||
* callbacks, but they should remain the exception. Also there will be no access to object data
|
||||
@@ -92,10 +92,10 @@ struct Overlay {
|
||||
virtual void pre_draw(Manager & /*manager*/, View & /*view*/){};
|
||||
|
||||
/**
|
||||
* Drawing can be split into multiple passes. Each callback draws onto a specific framebuffer.
|
||||
* Drawing can be split into multiple passes. Each callback draws onto a specific frame-buffer.
|
||||
* The order between each draw function is guaranteed. But it is not guaranteed that no other
|
||||
* overlay will render in between. The overlay can render to a temporary framebuffer before
|
||||
* resolving to the given framebuffer.
|
||||
* overlay will render in between. The overlay can render to a temporary frame-buffer before
|
||||
* resolving to the given frame-buffer.
|
||||
*/
|
||||
|
||||
virtual void draw_on_render(GPUFrameBuffer * /*fb*/, Manager & /*manager*/, View & /*view*/){};
|
||||
|
||||
@@ -192,7 +192,7 @@ void Instance::object_sync(ObjectRef &ob_ref, Manager &manager)
|
||||
case OB_MESH:
|
||||
/* TODO(fclem): Make it part of a #Meshes. */
|
||||
layer.paints.object_sync(manager, ob_ref, resources, state);
|
||||
/* For wireframes. */
|
||||
/* For wire-frames. */
|
||||
layer.mesh_uvs.edit_object_sync(manager, ob_ref, resources, state);
|
||||
break;
|
||||
case OB_GREASE_PENCIL:
|
||||
|
||||
@@ -26,7 +26,7 @@ void main()
|
||||
outlineColor = colorOutline;
|
||||
|
||||
#ifdef SELECT_ENABLE
|
||||
/* Selection framebuffer can be very small.
|
||||
/* Selection frame-buffer can be very small.
|
||||
* Make sure to only rasterize one pixel to avoid making the selection radius very big. */
|
||||
gl_PointSize = 1.0;
|
||||
#endif
|
||||
|
||||
@@ -97,6 +97,6 @@ if (WITH_GPU_SHADER_CPP_COMPILATION)
|
||||
compile_sources_as_cpp(workbench_cpp_shaders_frag "${SRC_GLSL_FRAG}" "GPU_FRAGMENT_SHADER")
|
||||
compile_sources_as_cpp(workbench_cpp_shaders_comp "${SRC_GLSL_COMP}" "GPU_COMPUTE_SHADER")
|
||||
# Only enable to make sure they compile on their own.
|
||||
# Otherwise it creates a warning about pragma once.
|
||||
# Otherwise it creates a warning about `pragma once`.
|
||||
# compile_sources_as_cpp(workbench_cpp_shaders_lib "${SRC_GLSL_LIB}" "GPU_LIBRARY_SHADER")
|
||||
endif()
|
||||
|
||||
@@ -1690,7 +1690,7 @@ void DRW_mesh_batch_cache_create_requested(TaskGraph &task_graph,
|
||||
|
||||
mbuflist = (do_cage) ? &cache.cage.buff : &cache.final.buff;
|
||||
|
||||
/* When the msh doesn't correspond to the object's original mesh (i.e. the mesh was replaced by
|
||||
/* When the mesh doesn't correspond to the object's original mesh (i.e. the mesh was replaced by
|
||||
* another with the object info node during evaluation), don't extract edit mode data for it.
|
||||
* That data can be invalid because any original indices (#CD_ORIGINDEX) on the evaluated mesh
|
||||
* won't correspond to the correct mesh. */
|
||||
|
||||
@@ -249,7 +249,7 @@ bool ANIM_nla_mapping_allowed(const bAnimListElem *ale)
|
||||
/* I (Sybren) don't _think_ masks can use the NLA. */
|
||||
return false;
|
||||
default:
|
||||
/* NLA time remapping is the default behaviour, and only should be
|
||||
/* NLA time remapping is the default behavior, and only should be
|
||||
* prohibited for the above types. */
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -2829,7 +2829,7 @@ static size_t animdata_filter_ds_modifiers(bAnimContext *ac,
|
||||
* use to walk through the dependencies of the modifiers
|
||||
*
|
||||
* Assumes that all other unspecified values (i.e. accumulation buffers)
|
||||
* are zero'd out properly!
|
||||
* are zeroed out properly!
|
||||
*/
|
||||
afm.ac = ac;
|
||||
afm.ads = ac->ads; /* TODO: Remove this pointer from the struct and just use afm.ac->ads. */
|
||||
|
||||
@@ -54,7 +54,7 @@ void iterate(const AssetLibraryReference &library_reference,
|
||||
AssetListHandleIterFn fn,
|
||||
FunctionRef<bool(asset_system::AssetRepresentation &)> prefilter_fn = nullptr);
|
||||
/**
|
||||
* \note This override avoids the file caching system, so it's more performant and avoids pitfals
|
||||
* \note This override avoids the file caching system, so it's more performant and avoids pitfalls
|
||||
* from the other override. Prefer this when access to #AssetRepresentation is enough, and no
|
||||
* #AssetHandle is needed.
|
||||
*/
|
||||
|
||||
@@ -73,7 +73,7 @@ struct StrokeElem {
|
||||
float location_world[3];
|
||||
float location_local[3];
|
||||
|
||||
/* surface normal, may be zero'd */
|
||||
/* Surface normal, may be zeroed. */
|
||||
float normal_world[3];
|
||||
float normal_local[3];
|
||||
|
||||
|
||||
@@ -60,7 +60,7 @@ struct StrokeElem {
|
||||
float location_world[3];
|
||||
float location_local[3];
|
||||
|
||||
/* surface normal, may be zero'd */
|
||||
/* Surface normal, may be zeroed. */
|
||||
float normal_world[3];
|
||||
float normal_local[3];
|
||||
|
||||
|
||||
@@ -354,9 +354,9 @@ static void draw_grease_pencil_stroke(const float4x4 &transform,
|
||||
|
||||
immEnd();
|
||||
|
||||
/* Expanded drawcall. */
|
||||
/* Expanded `drawcall`. */
|
||||
GPUPrimType expand_prim_type = GPUPrimType::GPU_PRIM_TRIS;
|
||||
/* Hardcoded in shader. */
|
||||
/* Hard-coded in shader. */
|
||||
const uint expand_prim_len = 12;
|
||||
/* Do not count adjacency info for start and end primitives. */
|
||||
const uint final_vert_len = ((batch->vertex_count_get() - 2) * expand_prim_len) * 3;
|
||||
|
||||
@@ -59,7 +59,7 @@ struct SnapObjectParams {
|
||||
eSnapTargetOP snap_target_select;
|
||||
/** Geometry for snapping in edit mode. */
|
||||
eSnapEditType edit_mode_type;
|
||||
/** Snap to or ignore the frontmost object. */
|
||||
/** Snap to or ignore the front-most object. */
|
||||
eSnapOcclusionTest occlusion_test;
|
||||
/** Grid unit size. "0.0" is automatic. */
|
||||
float grid_size;
|
||||
|
||||
@@ -107,7 +107,7 @@ void ui_but_anim_flag(uiBut *but, const AnimationEvalContext *anim_eval_context)
|
||||
|
||||
/* This feature is not implemented at all for the NLA. However, if the NLA just consists of
|
||||
* stashed (i.e. deactivated) Actions, it doesn't do anything, and we can treat it as
|
||||
* non-existant here. Note that this is mostly to play nice with stashed Actions, and doesn't
|
||||
* non-existent here. Note that this is mostly to play nice with stashed Actions, and doesn't
|
||||
* fully look at all the track & strip flags. */
|
||||
if (adt) {
|
||||
LISTBASE_FOREACH (NlaTrack *, nla_track, &adt->nla_tracks) {
|
||||
|
||||
@@ -257,7 +257,7 @@ bool ED_workspace_delete(WorkSpace *workspace, Main *bmain, bContext *C, wmWindo
|
||||
}
|
||||
}
|
||||
|
||||
/* Also delete managed sceens if they have no other users. */
|
||||
/* Also delete managed screens if they have no other users. */
|
||||
LISTBASE_FOREACH (WorkSpaceLayout *, layout, &workspace->layouts) {
|
||||
BKE_id_free_us(bmain, layout->screen);
|
||||
layout->screen = nullptr;
|
||||
|
||||
@@ -1156,7 +1156,7 @@ static void paint_2d_lift_smear(ImBuf *ibuf, ImBuf *ibufb, int *pos, short paint
|
||||
|
||||
static ImBuf *paint_2d_lift_clone(ImBuf *ibuf, ImBuf *ibufb, const int *pos)
|
||||
{
|
||||
/* NOTE: allocImbuf returns zero'd memory, so regions outside image will
|
||||
/* NOTE: #allocImbuf returns zeroed memory, so regions outside image will
|
||||
* have zero alpha, and hence not be blended onto the image */
|
||||
int w = ibufb->x, h = ibufb->y, destx = 0, desty = 0, srcx = pos[0], srcy = pos[1];
|
||||
ImBuf *clonebuf = IMB_allocImBuf(w, h, ibufb->planes, ibufb->flags);
|
||||
|
||||
@@ -5039,11 +5039,11 @@ void flush_update_step(bContext *C, UpdateType update_type)
|
||||
|
||||
if (update_type == UpdateType::Position && !ss.shapekey_active) {
|
||||
if (pbvh.type() == bke::pbvh::Type::Mesh) {
|
||||
/* Various operations inside sculpt mode can cause either the MeshRuntimeData or the entire
|
||||
/* Various operations inside sculpt mode can cause either the #MeshRuntimeData or the entire
|
||||
* Mesh to be changed (e.g. Undoing the very first operation after opening a file, performing
|
||||
* remesh, etc).
|
||||
*
|
||||
* This is an unideal fix for the core issue here, but to mitigate the drastic performance
|
||||
* This isn't an ideal fix for the core issue here, but to mitigate the drastic performance
|
||||
* falloff, we refreeze the cache before we do any operation that would tag this runtime
|
||||
* cache as dirty.
|
||||
*
|
||||
|
||||
@@ -1658,8 +1658,9 @@ static void save_active_attribute(Object &object, SculptAttrRef *attr)
|
||||
}
|
||||
|
||||
/**
|
||||
* Does not save topology counts, as that data is unneded for full geometry pushes and
|
||||
* requires the PBVH to exist. */
|
||||
* Does not save topology counts, as that data is unneeded for full geometry pushes and
|
||||
* requires the PBVH to exist.
|
||||
*/
|
||||
static void save_common_data(Object &ob, SculptUndoStep *us)
|
||||
{
|
||||
us->data.object_name = ob.id.name;
|
||||
|
||||
@@ -1595,7 +1595,7 @@ static int image_file_browse_exec(bContext *C, wmOperator *op)
|
||||
char filepath[FILE_MAX];
|
||||
RNA_string_get(op->ptr, "filepath", filepath);
|
||||
if (BLI_path_is_rel(filepath)) {
|
||||
/* Relative path created by the filebrowser are always relative to the current blendfile, need
|
||||
/* Relative path created by the file-browser are always relative to the current blendfile, need
|
||||
* to be made relative to the library blendfile path in case image is an editable linked data.
|
||||
*/
|
||||
BLI_path_abs(filepath, BKE_main_blendfile_path(CTX_data_main(C)));
|
||||
|
||||
@@ -73,9 +73,9 @@ static int view3d_copybuffer_exec(bContext *C, wmOperator *op)
|
||||
}
|
||||
CTX_DATA_END;
|
||||
|
||||
/* Explicitely adding an object to the copypaste buffer _may_ add others as dependencies (e.g. a
|
||||
/* Explicitly adding an object to the copy/paste buffer _may_ add others as dependencies (e.g. a
|
||||
* parent object). So count to total amount of objects added, to get a matching number with the
|
||||
* one reported by the 'paste' operation. */
|
||||
* one reported by the "paste" operation. */
|
||||
const int num_copied = BLI_listbase_count(©buffer.bmain.objects);
|
||||
|
||||
char filepath[FILE_MAX];
|
||||
|
||||
@@ -45,7 +45,7 @@ static void create_aligned_handles_masks(
|
||||
CurvesTransformData &transform_data = *static_cast<CurvesTransformData *>(custom_data.data);
|
||||
|
||||
IndexMaskMemory memory;
|
||||
/* When control point is selected both handles are treaded as selected and transformed together.
|
||||
/* When control point is selected both handles are threaded as selected and transformed together.
|
||||
* So these will be excluded from alignment. */
|
||||
const IndexMask &selected_points = points_to_transform_per_attr[0];
|
||||
const IndexMask selected_left_handles = IndexMask::from_difference(
|
||||
|
||||
@@ -771,11 +771,11 @@ std::optional<Mesh *> mesh_triangulate(const Mesh &src_mesh,
|
||||
const IndexRange unselected_range(tris_range.one_after_last(), unselected.size());
|
||||
|
||||
/* Create a mesh with no face corners.
|
||||
* - We haven't yet counted the number of corners from unselected faces. Creating the final face
|
||||
* offsets will give us that number anyway, so wait to create the edges.
|
||||
* - The number of edges is a guess that doesn't include deduplication of new edges with
|
||||
* existing edges. If those are found, the mesh will be resized later.
|
||||
* - Don't create attributes to facilite implicit sharing of the positions array. */
|
||||
* - We haven't yet counted the number of corners from unselected faces. Creating the final face
|
||||
* offsets will give us that number anyway, so wait to create the edges.
|
||||
* - The number of edges is a guess that doesn't include deduplication of new edges with
|
||||
* existing edges. If those are found, the mesh will be resized later.
|
||||
* - Don't create attributes to facilitate implicit sharing of the positions array. */
|
||||
Mesh *mesh = bke::mesh_new_no_attributes(src_mesh.verts_num,
|
||||
src_edges.size() + tri_edges_range.size(),
|
||||
tris_range.size() + unselected.size(),
|
||||
@@ -828,7 +828,7 @@ std::optional<Mesh *> mesh_triangulate(const Mesh &src_mesh,
|
||||
|
||||
edges_with_duplicates.take_front(src_edges.size()).copy_from(src_edges);
|
||||
|
||||
/* Vertex attributes are totally unnaffected and can be shared with implicit sharing.
|
||||
/* Vertex attributes are totally unaffected and can be shared with implicit sharing.
|
||||
* Use the #CustomData API for simpler support for vertex groups. */
|
||||
CustomData_merge(&src_mesh.vert_data, &mesh->vert_data, CD_MASK_MESH.vmask, mesh->verts_num);
|
||||
|
||||
|
||||
@@ -486,7 +486,7 @@ void gpu_shader_create_info_init()
|
||||
}
|
||||
|
||||
if (GPU_stencil_clasify_buffer_workaround()) {
|
||||
/* WORKAROUND: Adding a dummy buffer that isn't used fixes a bug inside the Qualcom driver. */
|
||||
/* WORKAROUND: Adding a dummy buffer that isn't used fixes a bug inside the Qualcomm driver. */
|
||||
eevee_deferred_tile_classify.storage_buf(
|
||||
12, Qualifier::READ_WRITE, "uint", "dummy_workaround_buf[]");
|
||||
}
|
||||
|
||||
@@ -66,7 +66,7 @@ GPUStorageBuf *GPU_storagebuf_create_ex(size_t size,
|
||||
}
|
||||
else if (G.debug & G_DEBUG_GPU) {
|
||||
/* Fill the buffer with poison values.
|
||||
* (NaN for floats, -1 for ints and "max value" for uints). */
|
||||
* (NaN for floats, -1 for `int` and "max value" for `uint`). */
|
||||
blender::Vector<uchar> uninitialized_data(size, 0xFF);
|
||||
ssbo->update(uninitialized_data.data());
|
||||
}
|
||||
|
||||
@@ -199,7 +199,7 @@ GPUUniformBuf *GPU_uniformbuf_create_ex(size_t size, const void *data, const cha
|
||||
}
|
||||
else if (G.debug & G_DEBUG_GPU) {
|
||||
/* Fill the buffer with poison values.
|
||||
* (NaN for floats, -1 for ints and "max value" for uints). */
|
||||
* (NaN for floats, -1 for `int` and "max value" for `uint`). */
|
||||
blender::Vector<uchar> uninitialized_data(size, 0xFF);
|
||||
ubo->update(uninitialized_data.data());
|
||||
}
|
||||
|
||||
@@ -85,7 +85,7 @@ set(SRC_GLSL_FRAG
|
||||
)
|
||||
|
||||
set(SRC_GLSL_COMP
|
||||
# TODO rename them properly to enable compilatio
|
||||
# TODO rename them properly to enable compilation.
|
||||
# gpu_shader_index_2d_array_lines.glsl
|
||||
# gpu_shader_index_2d_array_points.glsl
|
||||
# gpu_shader_index_2d_array_tris.glsl
|
||||
|
||||
@@ -35,7 +35,7 @@ vec2 rotate_45(vec2 co)
|
||||
return from_rotation(Angle(M_PI * 0.25)) * co;
|
||||
}
|
||||
|
||||
/* Calculates an upper and lower limit for an antialiased cutoff of the squared distance. */
|
||||
/* Calculates an upper and lower limit for an anti-aliased cutoff of the squared distance. */
|
||||
vec2 calculate_thresholds(float threshold)
|
||||
{
|
||||
/* Use the absolute on one of the factors to preserve the sign. */
|
||||
|
||||
@@ -18,7 +18,7 @@ VERTEX_SHADER_CREATE_INFO(gpu_shader_2D_node_socket_inst)
|
||||
|
||||
void main()
|
||||
{
|
||||
/* Scale the original rectangle to accomodate the diagonal of the diamond shape. */
|
||||
/* Scale the original rectangle to accommodate the diagonal of the diamond shape. */
|
||||
vec2 originalRectSize = rect.yw - rect.xz;
|
||||
float offset = 0.125 * min(originalRectSize.x, originalRectSize.y) +
|
||||
outlineOffset * outlineThickness;
|
||||
|
||||
@@ -956,7 +956,7 @@ TEST(vk_render_graph, begin_update_draw_update_draw_update_draw_end)
|
||||
* When drawing, copying and continue drawing to an attachment, the attachment layout should be
|
||||
* transitioned.
|
||||
*
|
||||
* This case happens when updating the swapchain image with the result of editors.
|
||||
* This case happens when updating the swap-chain image with the result of editors.
|
||||
*/
|
||||
TEST(vk_render_graph, begin_draw_copy_to_attachment_draw_end)
|
||||
{
|
||||
|
||||
@@ -225,7 +225,7 @@ void VKFrameBuffer::clear(const eGPUFrameBufferBits buffers,
|
||||
needed_mask |= GPU_WRITE_STENCIL;
|
||||
}
|
||||
|
||||
/* Clearing depth via vkCmdClearAttachments requires a render pass with write depth or stencil
|
||||
/* Clearing depth via #vkCmdClearAttachments requires a render pass with write depth or stencil
|
||||
* enabled. When not enabled, clearing should be done via texture directly. */
|
||||
/* WORKAROUND: Clearing depth attachment when using dynamic rendering are not working on AMD
|
||||
* official drivers.
|
||||
@@ -616,7 +616,7 @@ void VKFrameBuffer::rendering_ensure_render_pass(VKContext &context)
|
||||
VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL;
|
||||
uint32_t attachment_reference = color_attachment_index - GPU_FB_COLOR_ATTACHMENT0;
|
||||
/* Depth attachment should always be right after the last color attachment. If not shaders
|
||||
* cannot be reused between framebuffers with and without depth/stencil attachment*/
|
||||
* cannot be reused between frame-buffers with and without depth/stencil attachment. */
|
||||
depth_attachment_reference.attachment = attachment_reference + 1;
|
||||
|
||||
VkAttachmentDescription vk_attachment_description = {};
|
||||
@@ -713,7 +713,7 @@ void VKFrameBuffer::rendering_ensure_render_pass(VKContext &context)
|
||||
}
|
||||
}
|
||||
|
||||
/* Subpass description */
|
||||
/* Sub-pass description. */
|
||||
VkSubpassDescription vk_subpass_description = {};
|
||||
vk_subpass_description.pipelineBindPoint = VK_PIPELINE_BIND_POINT_GRAPHICS;
|
||||
vk_subpass_description.colorAttachmentCount = color_attachments.size();
|
||||
@@ -725,7 +725,7 @@ void VKFrameBuffer::rendering_ensure_render_pass(VKContext &context)
|
||||
}
|
||||
|
||||
VKDevice &device = VKBackend::get().device;
|
||||
/* Renderpass create info */
|
||||
/* Render-pass create info. */
|
||||
VkRenderPassCreateInfo vk_render_pass_create_info = {};
|
||||
vk_render_pass_create_info.sType = VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO;
|
||||
vk_render_pass_create_info.subpassCount = 1;
|
||||
@@ -757,13 +757,14 @@ void VKFrameBuffer::rendering_ensure_render_pass(VKContext &context)
|
||||
|
||||
context.render_graph.add_node(begin_rendering);
|
||||
|
||||
/* Load store operations are not supported inside a render pass. It requires duplicating render
|
||||
* passes and framebuffers to support suspend/resume rendering. After suspension all the graphics
|
||||
* pipelines needs to be created using the resume handles. Due to command reordering it is
|
||||
* unclear when this switch needs to be made and would require to double the graphics pipelines.
|
||||
/* Load store operations are not supported inside a render pass.
|
||||
* It requires duplicating render passes and frame-buffers to support suspend/resume rendering.
|
||||
* After suspension all the graphics pipelines needs to be created using the resume handles.
|
||||
* Due to command reordering it is unclear when this switch needs to be made and would require
|
||||
* to double the graphics pipelines.
|
||||
*
|
||||
* This all adds a lot of complexity just to support clearing ops on legacy platforms. An easier
|
||||
* solution is to use vkCmdClearAttachments right after the begin rendering.
|
||||
* solution is to use #vkCmdClearAttachments right after the begin rendering.
|
||||
*/
|
||||
if (use_explicit_load_store_) {
|
||||
render_graph::VKClearAttachmentsNode::CreateInfo clear_attachments = {};
|
||||
|
||||
@@ -1058,9 +1058,9 @@ std::string VKShader::fragment_interface_declare(const shader::ShaderCreateInfo
|
||||
int fragment_out_location = 0;
|
||||
for (const ShaderCreateInfo::FragOut &output : info.fragment_outputs_) {
|
||||
/* When using dynamic rendering the attachment location doesn't change. When using render
|
||||
* passes and subpasses the location refers to the color attachment of the subpass.
|
||||
* passes and sub-passes the location refers to the color attachment of the sub-pass.
|
||||
*
|
||||
* LIMITATION: dual source blending cannot be used together with subpasses.
|
||||
* LIMITATION: dual source blending cannot be used together with sub-passes.
|
||||
*/
|
||||
const bool use_dual_blending = output.blend != DualBlend::NONE;
|
||||
BLI_assert_msg(!(use_dual_blending && !info.subpass_inputs_.is_empty()),
|
||||
|
||||
@@ -23,8 +23,9 @@ namespace blender::gpu {
|
||||
/**
|
||||
* Bind types to bind resources to a shader.
|
||||
*
|
||||
* Keep in sync with gpu::shader::ShaderCreateInfo::Resource::BindType.
|
||||
* We add the term `INPUT_ATTACHMENT` as it is stored as a subpass input in the shader create info.
|
||||
* Keep in sync with #gpu::shader::ShaderCreateInfo::Resource::BindType.
|
||||
* We add the term `INPUT_ATTACHMENT` as it is stored as a sub-pass
|
||||
* input in the shader create info.
|
||||
*/
|
||||
/* TODO: Investigate if `TEXEL_BUFFER` can be added as well.*/
|
||||
enum VKBindType {
|
||||
|
||||
@@ -992,9 +992,11 @@ static bNode *find_bsdf_node(Material *material)
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
/* Returns the first occurrence of a scalar Displacment node found in the given
|
||||
* material's node tree. Vector Displacement is not supported in the UsdPreviewSurface.
|
||||
* Returns null if no instance of either type was found. */
|
||||
/**
|
||||
* Returns the first occurrence of a scalar Displacement node found in the given
|
||||
* material's node tree. Vector Displacement is not supported in the #UsdPreviewSurface.
|
||||
* Returns null if no instance of either type was found.
|
||||
*/
|
||||
static bNode *find_displacement_node(Material *material)
|
||||
{
|
||||
for (bNode *node : material->nodetree->all_nodes()) {
|
||||
|
||||
@@ -144,7 +144,7 @@ std::optional<std::string> USDVolumeWriter::resolve_vdb_file(const Volume *volum
|
||||
const bool needs_vdb_save = volume->filepath[0] == '\0' || has_modifiers;
|
||||
if (needs_vdb_save) {
|
||||
/* Entering this section means that the Volume object contains OpenVDB data that is not
|
||||
* obtained soley from external `.vdb` files but is generated or modified inside of Blender.
|
||||
* obtained solely from external `.vdb` files but is generated or modified inside of Blender.
|
||||
* Write this data as a new `.vdb` files. */
|
||||
|
||||
vdb_file_path = construct_vdb_file_path(volume);
|
||||
|
||||
@@ -230,7 +230,7 @@ typedef struct Sequence {
|
||||
/* pointers for effects: */
|
||||
struct Sequence *seq1, *seq2;
|
||||
|
||||
/* This strange padding is needed due to how seqbasep deserialization is
|
||||
/* This strange padding is needed due to how `seqbasep` de-serialization is
|
||||
* done right now in #scene_blend_read_data. */
|
||||
void *_pad7;
|
||||
int _pad8[2];
|
||||
|
||||
@@ -507,7 +507,7 @@ static float get_factor_from_draw_speed(const bke::CurvesGeometry &curves,
|
||||
accumulated_shift_delta_time += math::max(shifted_start_time - start_times[curve], 0.0f);
|
||||
}
|
||||
|
||||
/* Caclulates the maximum time of this frame, which is the time between the beginning of the
|
||||
/* Calculates the maximum time of this frame, which is the time between the beginning of the
|
||||
* first stroke and the end of the last stroke. `start_times.last()` gives the starting time of
|
||||
* the last stroke related to frame beginning, and `delta_time.last()` gives how long that stroke
|
||||
* lasted. */
|
||||
|
||||
@@ -112,7 +112,7 @@ class DisplaceOperation : public NodeOperation {
|
||||
|
||||
/* In order to perform EWA sampling, we need to compute the partial derivative of the displaced
|
||||
* coordinates along the x and y directions using a finite difference approximation. But in
|
||||
* order to avoid loading multiple neighbouring displacement values for each pixel, we operate
|
||||
* order to avoid loading multiple neighboring displacement values for each pixel, we operate
|
||||
* on the image in 2x2 blocks of pixels, where the derivatives are computed horizontally and
|
||||
* vertically across the 2x2 block such that odd texels use a forward finite difference
|
||||
* equation while even invocations use a backward finite difference equation. */
|
||||
|
||||
@@ -166,7 +166,7 @@ class MapUVOperation : public NodeOperation {
|
||||
|
||||
/* In order to perform EWA sampling, we need to compute the partial derivative of the UV
|
||||
* coordinates along the x and y directions using a finite difference approximation. But in
|
||||
* order to avoid loading multiple neighbouring UV coordinates for each pixel, we operate on
|
||||
* order to avoid loading multiple neighboring UV coordinates for each pixel, we operate on
|
||||
* the image in 2x2 blocks of pixels, where the derivatives are computed horizontally and
|
||||
* vertically across the 2x2 block such that odd texels use a forward finite difference
|
||||
* equation while even invocations use a backward finite difference equation. */
|
||||
|
||||
@@ -282,7 +282,7 @@ class ToneMapOperation : public NodeOperation {
|
||||
float4 adaptation_level = math::interpolate(
|
||||
global_adaptation_level, local_adaptation_level, light_adaptation);
|
||||
|
||||
/* Equation (1) from Reinhard's 2005 paper, assuming Vmax is 1. */
|
||||
/* Equation (1) from Reinhard's 2005 paper, assuming `Vmax` is 1. */
|
||||
float4 semi_saturation = math::pow(intensity * adaptation_level, contrast);
|
||||
float4 tone_mapped_color = input_color / (input_color + semi_saturation);
|
||||
|
||||
|
||||
@@ -47,7 +47,7 @@ static char *bmp_slots_as_args(const BMOSlotType slot_types[BMO_OP_MAX_SLOTS], c
|
||||
while (*slot_types[i].name) {
|
||||
quoted = false;
|
||||
set = false;
|
||||
/* cut off '.out' by using a string size arg */
|
||||
/* Cut off `.out` by using a string size argument. */
|
||||
const int name_len = is_out ? (strchr(slot_types[i].name, '.') - slot_types[i].name) :
|
||||
sizeof(slot_types[i].name);
|
||||
const char *value = "<Unknown>";
|
||||
|
||||
@@ -837,7 +837,7 @@ PyObject *BPy_BMO_call(BPy_BMeshOpFunc *self, PyObject *args, PyObject *kw)
|
||||
}
|
||||
|
||||
#if 1
|
||||
/* temp code, strip off '.out' while we keep this convention */
|
||||
/* Temporary code, strip off `.out` while we keep this convention. */
|
||||
{
|
||||
char slot_name_strip[MAX_SLOTNAME];
|
||||
const char *ch = strchr(slot->slot_name, '.'); /* can't fail! */
|
||||
|
||||
@@ -6825,7 +6825,7 @@ PyTypeObject pyrna_struct_meta_idprop_Type = {
|
||||
* create property objects without initializing them, which avoids double-initialization from
|
||||
* functions like #pyrna_struct_CreatePyObject etc.
|
||||
*
|
||||
* \note: Subclassingfrom python isn't common since it's NOT related to registerable subclasses.
|
||||
* \note: Subclassing from Python isn't common since it's NOT related to registerable sub-classes.
|
||||
* eg:
|
||||
*
|
||||
* \code{.unparsed}
|
||||
@@ -6939,7 +6939,7 @@ static PyObject *pyrna_struct_new(PyTypeObject *type, PyObject *args, PyObject *
|
||||
* #pyrna_struct_init. */
|
||||
}
|
||||
|
||||
/* Only allocate the pyobject data, do not construct/initialize anything else. */
|
||||
/* Only allocate the #PyObject data, do not construct/initialize anything else. */
|
||||
PyObject *self = type->tp_alloc(type, 0);
|
||||
BPy_StructRNA *self_struct = reinterpret_cast<BPy_StructRNA *>(self);
|
||||
if (self) {
|
||||
@@ -7338,7 +7338,7 @@ static PyObject *pyrna_property_new(PyTypeObject *type, PyObject *args, PyObject
|
||||
* #pyrna_property_init. */
|
||||
}
|
||||
|
||||
/* Only allocate the pyobject data, do not construct/initialize anything else. */
|
||||
/* Only allocate the #PyObject data, do not construct/initialize anything else. */
|
||||
PyObject *self = type->tp_alloc(type, 0);
|
||||
BPy_PropertyRNA *self_property = reinterpret_cast<BPy_PropertyRNA *>(self);
|
||||
if (self) {
|
||||
@@ -7565,7 +7565,7 @@ static PyObject *pyrna_prop_collection_iter_new(PyTypeObject *type,
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
/* Only allocate the pyobject data, do not construct/initialize anything else. */
|
||||
/* Only allocate the #PyObject data, do not construct/initialize anything else. */
|
||||
PyObject *self = type->tp_alloc(type, 0);
|
||||
BPy_PropertyCollectionIterRNA *self_prop_iter =
|
||||
reinterpret_cast<BPy_PropertyCollectionIterRNA *>(self);
|
||||
@@ -7795,7 +7795,7 @@ static PyObject *pyrna_function_new(PyTypeObject *type, PyObject *args, PyObject
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
/* Only allocate the pyobject data, do not construct/initialize anything else. */
|
||||
/* Only allocate the #PyObject data, do not construct/initialize anything else. */
|
||||
PyObject *self = type->tp_alloc(type, 0);
|
||||
BPy_FunctionRNA *self_function = reinterpret_cast<BPy_FunctionRNA *>(self);
|
||||
if (self_function) {
|
||||
|
||||
@@ -1621,7 +1621,8 @@ static void glow_blur_bitmap(
|
||||
|
||||
Array<float4> temp(width * height);
|
||||
|
||||
/* Initialize the gaussian filter. @TODO: use code from RE_filter_value */
|
||||
/* Initialize the gaussian filter.
|
||||
* TODO: use code from #RE_filter_value. */
|
||||
Array<float> filter(halfWidth * 2);
|
||||
const float k = -1.0f / (2.0f * float(M_PI) * blur * blur);
|
||||
float weight = 0;
|
||||
|
||||
@@ -310,7 +310,7 @@ int main(int argc,
|
||||
_putenv_s("OMP_WAIT_POLICY", "PASSIVE");
|
||||
# endif
|
||||
/* Ensure the OpenMP runtime is initialized as soon as possible to make sure duplicate
|
||||
* libomp/libiomp5 runtime conflicts are detected as soon as a second runtime is initialized.
|
||||
* `libomp/libiomp5` runtime conflicts are detected as soon as a second runtime is initialized.
|
||||
* Initialization must be done after setting any relevant environment variables, but before
|
||||
* installing signal handlers. */
|
||||
omp_get_max_threads();
|
||||
|
||||
@@ -33,7 +33,7 @@ ALLOWED_LIBS = [
|
||||
"libcrypt.so",
|
||||
"libuuid.so",
|
||||
|
||||
# Bundled python ncurses deps
|
||||
# Bundled Python NCURSES dependencies.
|
||||
"libpanelw.so",
|
||||
"libncursesw.so",
|
||||
"libtinfo.so",
|
||||
@@ -195,7 +195,7 @@ class UnitTesting(unittest.TestCase):
|
||||
# Add all libraries the we bundle to the allowed list
|
||||
global ALLOWED_LIBS
|
||||
ALLOWED_LIBS += glob.glob("*.so", root_dir=args.directory + "/lib")
|
||||
# Add OIDN libs that do not have a .so symlink
|
||||
# Add OIDN libs that do not have an `.so` symbolic-link.
|
||||
for oidn_lib in glob.glob("libOpenImageDenoise_*.so*", root_dir=args.directory + "/lib"):
|
||||
ALLOWED_LIBS.append(stripLibraryABI(oidn_lib))
|
||||
# Add all bundled python libs
|
||||
|
||||
@@ -327,6 +327,7 @@ dict_custom = {
|
||||
"reimplemented",
|
||||
"reimplementing",
|
||||
"relink",
|
||||
"relinked",
|
||||
"relinking",
|
||||
"remappable",
|
||||
"remapper",
|
||||
@@ -849,6 +850,7 @@ dict_ignore = {
|
||||
|
||||
# Company names.
|
||||
"Logitech",
|
||||
"Qualcomm",
|
||||
"Wacom",
|
||||
|
||||
# Project Names.
|
||||
|
||||
@@ -26,8 +26,8 @@ from string import digits
|
||||
from typing import Generator
|
||||
|
||||
|
||||
# Regex matchers for libraries that might be seen in the libs folder, not directly referenced, but
|
||||
# yet are still required for the proper operation of the bpy module.
|
||||
# REGEX matching for libraries that might be seen in the libs folder, not directly referenced,
|
||||
# but yet are still required for the proper operation of the `bpy` module.
|
||||
KEEP_MATCHERS = (
|
||||
# libOpenImageDenoise.so loads core, device_cuda, etc libraries at runtime.
|
||||
re.compile("libOpenImageDenoise_.*"),
|
||||
@@ -52,7 +52,7 @@ def get_direct_elf_dependencies(elf: Path) -> set[str]:
|
||||
"""
|
||||
Get direct dependencies of the given library or executable in ELF format
|
||||
|
||||
Uses readelf command and parses its output.
|
||||
Uses ``readelf`` command and parses its output.
|
||||
"""
|
||||
output = subprocess.check_output(("readelf", "-d", elf))
|
||||
deps = set()
|
||||
@@ -74,7 +74,7 @@ def name_strip_abi_suffix(name: str) -> str:
|
||||
"""
|
||||
Strip any ABI suffix from the given file name
|
||||
|
||||
For example: libfoo.so.1.2-3 -> linfoo.so
|
||||
For example: ``libfoo.so.1.2-3`` -> ``linfoo.so``.
|
||||
"""
|
||||
|
||||
while name[-1] in digits:
|
||||
|
||||
Reference in New Issue
Block a user