diff options
author | Campbell Barton <campbell@blender.org> | 2022-05-19 03:02:52 +0300 |
---|---|---|
committer | Campbell Barton <campbell@blender.org> | 2022-05-19 04:17:01 +0300 |
commit | 3e2017491ae62ed1b6436484b227ef7542f599aa (patch) | |
tree | f951f2b9e8a866ef64115f11cc5c1d9b035dd699 /source/blender/draw | |
parent | 30e666f747bae89d50029cbcc505ffa9a12ab05e (diff) |
Cleanup: spelling in comments & move doc-strings to headers
Diffstat (limited to 'source/blender/draw')
5 files changed, 20 insertions, 17 deletions
diff --git a/source/blender/draw/engines/eevee_next/eevee_camera.cc b/source/blender/draw/engines/eevee_next/eevee_camera.cc index 11cc6453817..e6d2e2db764 100644 --- a/source/blender/draw/engines/eevee_next/eevee_camera.cc +++ b/source/blender/draw/engines/eevee_next/eevee_camera.cc @@ -69,7 +69,7 @@ void Camera::init() data.type = DRW_view_is_persp_get(inst_.drw_view) ? CAMERA_PERSP : CAMERA_ORTHO; } else { - /* Lightprobe baking. */ + /* Light-probe baking. */ data.type = CAMERA_PERSP; } } @@ -91,7 +91,7 @@ void Camera::sync() DRW_view_camtexco_get(inst_.drw_view, data.uv_scale); } else if (inst_.render) { - /* TODO(fclem) Overscan */ + /* TODO(@fclem): Over-scan. */ // RE_GetCameraWindowWithOverscan(inst_.render->re, g_data->overscan, data.winmat); RE_GetCameraWindow(inst_.render->re, camera_eval, data.winmat.ptr()); RE_GetCameraModelMatrix(inst_.render->re, camera_eval, data.viewinv.ptr()); diff --git a/source/blender/draw/engines/eevee_next/eevee_material.cc b/source/blender/draw/engines/eevee_next/eevee_material.cc index 33204ed9474..1676c89d679 100644 --- a/source/blender/draw/engines/eevee_next/eevee_material.cc +++ b/source/blender/draw/engines/eevee_next/eevee_material.cc @@ -51,7 +51,6 @@ DefaultSurfaceNodeTree::~DefaultSurfaceNodeTree() MEM_SAFE_FREE(ntree_); } -/* Configure a default nodetree with the given material. */ bNodeTree *DefaultSurfaceNodeTree::nodetree_get(::Material *ma) { /* WARNING: This function is not threadsafe. Which is not a problem for the moment. */ @@ -223,7 +222,7 @@ MaterialPass MaterialModule::material_pass_get(::Material *blender_mat, /* IMPORTANT: We always create a subgroup so that all subgroups are inserted after the * first "empty" shgroup. This avoids messing the order of subgroups when there is more * nested subgroup (i.e: hair drawing). */ - /* TODO(fclem) Remove material resource binding from the first group creation. */ + /* TODO(@fclem): Remove material resource binding from the first group creation. */ matpass.shgrp = DRW_shgroup_create_sub(grp); DRW_shgroup_add_material_resources(matpass.shgrp, matpass.gpumat); } @@ -244,13 +243,13 @@ Material &MaterialModule::material_sync(::Material *blender_mat, (has_motion ? MAT_PIPE_DEFERRED_PREPASS_VELOCITY : MAT_PIPE_DEFERRED_PREPASS); - /* TEST until we have defered pipeline up and running. */ + /* TEST until we have deferred pipeline up and running. */ surface_pipe = MAT_PIPE_FORWARD; prepass_pipe = has_motion ? MAT_PIPE_FORWARD_PREPASS_VELOCITY : MAT_PIPE_FORWARD_PREPASS; MaterialKey material_key(blender_mat, geometry_type, surface_pipe); - /* TODO allocate in blocks to avoid memory fragmentation. */ + /* TODO: allocate in blocks to avoid memory fragmentation. */ auto add_cb = [&]() { return new Material(); }; Material &mat = *material_map_.lookup_or_add_cb(material_key, add_cb); @@ -274,7 +273,6 @@ Material &MaterialModule::material_sync(::Material *blender_mat, return mat; } -/* Return correct material or empty default material if slot is empty. */ ::Material *MaterialModule::material_from_slot(Object *ob, int slot) { if (ob->base_flag & BASE_HOLDOUT) { @@ -290,8 +288,6 @@ Material &MaterialModule::material_sync(::Material *blender_mat, return ma; } -/* Returned Material references are valid until the next call to this function or - * material_get(). */ MaterialArray &MaterialModule::material_array_get(Object *ob, bool has_motion) { material_array_.materials.clear(); @@ -308,8 +304,6 @@ MaterialArray &MaterialModule::material_array_get(Object *ob, bool has_motion) return material_array_; } -/* Returned Material references are valid until the next call to this function or - * material_array_get(). */ Material &MaterialModule::material_get(Object *ob, bool has_motion, int mat_nr, @@ -322,4 +316,4 @@ Material &MaterialModule::material_get(Object *ob, /** \} */ -} // namespace blender::eevee
\ No newline at end of file +} // namespace blender::eevee diff --git a/source/blender/draw/engines/eevee_next/eevee_material.hh b/source/blender/draw/engines/eevee_next/eevee_material.hh index bdf9b7824c5..23165a741b9 100644 --- a/source/blender/draw/engines/eevee_next/eevee_material.hh +++ b/source/blender/draw/engines/eevee_next/eevee_material.hh @@ -191,6 +191,7 @@ class DefaultSurfaceNodeTree { DefaultSurfaceNodeTree(); ~DefaultSurfaceNodeTree(); + /** Configure a default node-tree with the given material. */ bNodeTree *nodetree_get(::Material *ma); }; @@ -242,7 +243,14 @@ class MaterialModule { void begin_sync(); + /** + * Returned Material references are valid until the next call to this function or material_get(). + */ MaterialArray &material_array_get(Object *ob, bool has_motion); + /** + * Returned Material references are valid until the next call to this function or + * material_array_get(). + */ Material &material_get(Object *ob, bool has_motion, int mat_nr, eMaterialGeometry geometry_type); private: @@ -250,6 +258,7 @@ class MaterialModule { eMaterialGeometry geometry_type, bool has_motion); + /** Return correct material or empty default material if slot is empty. */ ::Material *material_from_slot(Object *ob, int slot); MaterialPass material_pass_get(::Material *blender_mat, eMaterialPipeline pipeline_type, diff --git a/source/blender/draw/engines/eevee_next/eevee_shader_shared.hh b/source/blender/draw/engines/eevee_next/eevee_shader_shared.hh index d9fee1b6073..1261c855a82 100644 --- a/source/blender/draw/engines/eevee_next/eevee_shader_shared.hh +++ b/source/blender/draw/engines/eevee_next/eevee_shader_shared.hh @@ -53,7 +53,7 @@ struct CameraData { float4x4 viewinv; float4x4 winmat; float4x4 wininv; - /** Camera UV scale and bias. Also known as viewcamtexcofac. */ + /** Camera UV scale and bias. Also known as `viewcamtexcofac`. */ float2 uv_scale; float2 uv_bias; /** Panorama parameters. */ diff --git a/source/blender/draw/engines/eevee_next/eevee_velocity.cc b/source/blender/draw/engines/eevee_next/eevee_velocity.cc index c556ba21fb5..9f8dce43910 100644 --- a/source/blender/draw/engines/eevee_next/eevee_velocity.cc +++ b/source/blender/draw/engines/eevee_next/eevee_velocity.cc @@ -74,7 +74,7 @@ void VelocityModule::step_camera_sync() bool VelocityModule::step_object_sync(Object *ob, ObjectKey &object_key, - int /* IDRecalcFlag */ recalc) + int /*IDRecalcFlag*/ recalc) { bool has_motion = object_has_velocity(ob) || (recalc & ID_RECALC_TRANSFORM); /* NOTE: Fragile. This will only work with 1 frame of lag since we can't record every geometry @@ -175,7 +175,7 @@ bool VelocityModule::step_object_sync(Object *ob, void VelocityModule::step_swap() { { - /* Now that vertex buffers are garanteed to be updated, proceed with + /* Now that vertex buffers are guaranteed to be updated, proceed with * offset computation and copy into the geometry step buffer. */ uint dst_ofs = 0; for (VelocityGeometryData &geom : geometry_map.values()) { @@ -184,8 +184,8 @@ void VelocityModule::step_swap() geom.ofs = dst_ofs; dst_ofs += src_len; } - /* TODO(fclem): Fail gracefully (disable motion blur + warning print) if tot_len * - * sizeof(float4) is greater than max SSBO size. */ + /* TODO(@fclem): Fail gracefully (disable motion blur + warning print) if + `tot_len * sizeof(float4)` is greater than max SSBO size. */ geometry_steps[step_]->resize(max_ii(16, dst_ofs)); for (VelocityGeometryData &geom : geometry_map.values()) { |