Cleanup: comment blocks

This commit is contained in:
2019-03-19 15:17:46 +11:00
parent 5ef4b0438c
commit e7fd6c8f30
80 changed files with 198 additions and 213 deletions

View File

@@ -71,7 +71,7 @@
* \ingroup audaspace * \ingroup audaspace
*/ */
/** \defgroup audsrc Audaspace SRC /** \defgroup audsrc Audaspace SRC
*
* \ingroup audaspace * \ingroup audaspace
*/ */
/** \defgroup audffmpeg Audaspace FFMpeg /** \defgroup audffmpeg Audaspace FFMpeg
@@ -91,4 +91,3 @@
* \ingroup intern GUI * \ingroup intern GUI
* \ref GHOSTPage * \ref GHOSTPage
*/ */

View File

@@ -118,7 +118,7 @@ public:
return m_stereoVisual; return m_stereoVisual;
} }
/** Number of samples used in anti-aliasing, set to 0 if no AA **/ /** Number of samples used in anti-aliasing, set to 0 if no AA */
inline GHOST_TUns16 getNumOfAASamples() const { inline GHOST_TUns16 getNumOfAASamples() const {
return m_numOfAASamples; return m_numOfAASamples;
} }

View File

@@ -277,7 +277,7 @@ extern "C" int GHOST_HACK_getFirstFile(char buf[FIRSTFILEBUFLG])
/** /**
* CocoaAppDelegate * CocoaAppDelegate
* ObjC object to capture applicationShouldTerminate, and send quit event * ObjC object to capture applicationShouldTerminate, and send quit event
**/ */
@interface CocoaAppDelegate : NSObject <NSApplicationDelegate> { @interface CocoaAppDelegate : NSObject <NSApplicationDelegate> {
GHOST_SystemCocoa *systemCocoa; GHOST_SystemCocoa *systemCocoa;

View File

@@ -382,7 +382,7 @@ protected:
/** Console status */ /** Console status */
int m_consoleStatus; int m_consoleStatus;
/** Wheel delta accumulator **/ /** Wheel delta accumulator */
int m_wheelDeltaAccum; int m_wheelDeltaAccum;
}; };

View File

@@ -24,9 +24,6 @@
/** /**
* Copyright (C) 2001 NaN Technologies B.V.
*
* \page IK - Blender inverse kinematics module. * \page IK - Blender inverse kinematics module.
* *
* \section about About the IK module * \section about About the IK module
@@ -162,4 +159,3 @@ int IK_Solve(IK_Solver *solver, float tolerance, int max_iterations);
#endif #endif
#endif // __IK_SOLVER_H__ #endif // __IK_SOLVER_H__

View File

@@ -21,14 +21,6 @@
* \ingroup string * \ingroup string
*/ */
/**
* Copyright (C) 2001 NaN Technologies B.V.
* This file was formerly known as: GEN_StdString.h.
* @date April, 25, 2001
*/
#ifndef __STR_STRING_H__ #ifndef __STR_STRING_H__
#define __STR_STRING_H__ #define __STR_STRING_H__

View File

@@ -79,7 +79,7 @@ static SpinLock ft_lib_mutex;
* Since most of the Text elems are not covered by other UI elements, we can * Since most of the Text elems are not covered by other UI elements, we can
* group some strings together and render them in one drawcall. This behavior * group some strings together and render them in one drawcall. This behavior
* is on demand only, between BLF_batch_start() and BLF_batch_end(). * is on demand only, between BLF_batch_start() and BLF_batch_end().
**/ */
static void blf_batch_draw_init(void) static void blf_batch_draw_init(void)
{ {
GPUVertFormat format = {0}; GPUVertFormat format = {0};

View File

@@ -53,7 +53,7 @@ typedef struct {
DerivedMesh dm; DerivedMesh dm;
/* these point to data in the DerivedMesh custom data layers, /* these point to data in the DerivedMesh custom data layers,
* they are only here for efficiency and convenience **/ * they are only here for efficiency and convenience */
MVert *mvert; MVert *mvert;
MEdge *medge; MEdge *medge;
MFace *mface; MFace *mface;

View File

@@ -584,9 +584,8 @@ void cloth_free_modifier_extern(ClothModifierData *clmd )
******************************************************************************/ ******************************************************************************/
/** /**
* cloth_to_object - copies the deformed vertices to the object. * Copies the deformed vertices to the object.
* */
**/
static void cloth_to_object (Object *ob, ClothModifierData *clmd, float (*vertexCos)[3]) static void cloth_to_object (Object *ob, ClothModifierData *clmd, float (*vertexCos)[3])
{ {
unsigned int i = 0; unsigned int i = 0;
@@ -614,12 +613,11 @@ int cloth_uses_vgroup(ClothModifierData *clmd)
} }
/** /**
* cloth_apply_vgroup - applies a vertex group as specified by type * Applies a vertex group as specified by type.
* */
**/
/* can be optimized to do all groups in one loop */
static void cloth_apply_vgroup ( ClothModifierData *clmd, Mesh *mesh ) static void cloth_apply_vgroup ( ClothModifierData *clmd, Mesh *mesh )
{ {
/* Can be optimized to do all groups in one loop. */
int i = 0; int i = 0;
int j = 0; int j = 0;
MDeformVert *dvert = NULL; MDeformVert *dvert = NULL;

View File

@@ -618,7 +618,6 @@ int get_effector_data(EffectorCache *eff, EffectorData *efd, EffectedPoint *poin
efd->size = 0.0f; efd->size = 0.0f;
/**/
ret = 1; ret = 1;
} }
} }

View File

@@ -76,7 +76,7 @@ typedef enum {
static void multires_mvert_to_ss(DerivedMesh *dm, MVert *mvert); static void multires_mvert_to_ss(DerivedMesh *dm, MVert *mvert);
static void multiresModifier_disp_run(DerivedMesh *dm, Mesh *me, DerivedMesh *dm2, DispOp op, CCGElem **oldGridData, int totlvl); static void multiresModifier_disp_run(DerivedMesh *dm, Mesh *me, DerivedMesh *dm2, DispOp op, CCGElem **oldGridData, int totlvl);
/** Customdata **/ /** Customdata */
void multires_customdata_delete(Mesh *me) void multires_customdata_delete(Mesh *me)
{ {
@@ -102,7 +102,7 @@ void multires_customdata_delete(Mesh *me)
} }
} }
/** Grid hiding **/ /** Grid hiding */
static BLI_bitmap *multires_mdisps_upsample_hidden( static BLI_bitmap *multires_mdisps_upsample_hidden(
BLI_bitmap *lo_hidden, BLI_bitmap *lo_hidden,
int lo_level, int hi_level, int lo_level, int hi_level,

View File

@@ -68,7 +68,7 @@
* before being re-evaluated. * before being re-evaluated.
* For example, we need to call this before BKE_mesh_new_from_object(), * For example, we need to call this before BKE_mesh_new_from_object(),
* in case we removed/added modifiers in the evaluated object. * in case we removed/added modifiers in the evaluated object.
**/ */
void BKE_object_eval_reset(Object *ob_eval) void BKE_object_eval_reset(Object *ob_eval)
{ {
BKE_object_free_derived_caches(ob_eval); BKE_object_free_derived_caches(ob_eval);

View File

@@ -1863,7 +1863,6 @@ static void sb_spring_force(Object *ob, int bpi, BodySpring *bs, float iks, floa
} }
else { else {
/* TODO make this debug option */ /* TODO make this debug option */
/**/
CLOG_WARN(&LOG, "bodypoint <bpi> is not attached to spring <*bs>"); CLOG_WARN(&LOG, "bodypoint <bpi> is not attached to spring <*bs>");
return; return;
} }

View File

@@ -15,9 +15,8 @@
* *
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
* All rights reserved. * All rights reserved.
* The Original Code is: some of this file.
* *
* The Original Code is: some of this file.
* */ * */
#ifndef __BLI_MATH_MATRIX_H__ #ifndef __BLI_MATH_MATRIX_H__

View File

@@ -57,7 +57,7 @@ void *BLI_mempool_as_arrayN(BLI_mempool *pool, const char *allocstr) ATTR_
void BLI_mempool_set_memory_debug(void); void BLI_mempool_set_memory_debug(void);
#endif #endif
/** iteration stuff. note: this may easy to produce bugs with **/ /** iteration stuff. note: this may easy to produce bugs with */
/* private structure */ /* private structure */
typedef struct BLI_mempool_iter { typedef struct BLI_mempool_iter {
BLI_mempool *pool; BLI_mempool *pool;

View File

@@ -87,7 +87,7 @@ RNG_THREAD_ARRAY *BLI_rng_threaded_new(void);
void BLI_rng_threaded_free(struct RNG_THREAD_ARRAY *rngarr) ATTR_NONNULL(1); void BLI_rng_threaded_free(struct RNG_THREAD_ARRAY *rngarr) ATTR_NONNULL(1);
int BLI_rng_thread_rand(RNG_THREAD_ARRAY *rngarr, int thread) ATTR_WARN_UNUSED_RESULT; int BLI_rng_thread_rand(RNG_THREAD_ARRAY *rngarr, int thread) ATTR_WARN_UNUSED_RESULT;
/** Low-discrepancy sequences **/ /* Low-discrepancy sequences. */
/** Return the _n_th number of the given low-discrepancy sequence. */ /** Return the _n_th number of the given low-discrepancy sequence. */
void BLI_halton_1D(unsigned int prime, double offset, int n, double *r); void BLI_halton_1D(unsigned int prime, double offset, int n, double *r);

View File

@@ -15,10 +15,9 @@
* *
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
* All rights reserved. * All rights reserved.
* The Original Code is: some of this file.
* *
* */ * The Original Code is: some of this file.
*/
/** \file /** \file
* \ingroup bli * \ingroup bli

View File

@@ -519,7 +519,7 @@ int BLI_str_utf8_size_safe(const char *p)
* instead. * instead.
* *
* Return value: the resulting character * Return value: the resulting character
**/ */
uint BLI_str_utf8_as_unicode(const char *p) uint BLI_str_utf8_as_unicode(const char *p)
{ {
int i, len; int i, len;
@@ -625,7 +625,7 @@ uint BLI_str_utf8_as_unicode_step(const char *__restrict p, size_t *__restrict i
* Converts a single character to UTF-8. * Converts a single character to UTF-8.
* *
* \return number of bytes written * \return number of bytes written
**/ */
size_t BLI_str_utf8_from_unicode(uint c, char *outbuf) size_t BLI_str_utf8_from_unicode(uint c, char *outbuf)
{ {
/* If this gets modified, also update the copy in g_string_insert_unichar() */ /* If this gets modified, also update the copy in g_string_insert_unichar() */
@@ -684,7 +684,7 @@ size_t BLI_str_utf8_from_unicode(uint c, char *outbuf)
* it starts with an appropriate byte. * it starts with an appropriate byte.
* *
* Return value: a pointer to the found character or %NULL. * Return value: a pointer to the found character or %NULL.
**/ */
char *BLI_str_find_prev_char_utf8(const char *str, const char *p) char *BLI_str_find_prev_char_utf8(const char *str, const char *p)
{ {
for (--p; p >= str; --p) { for (--p; p >= str; --p) {
@@ -709,7 +709,7 @@ char *BLI_str_find_prev_char_utf8(const char *str, const char *p)
* it starts with an appropriate byte. * it starts with an appropriate byte.
* *
* Return value: a pointer to the found character or %NULL * Return value: a pointer to the found character or %NULL
**/ */
char *BLI_str_find_next_char_utf8(const char *p, const char *end) char *BLI_str_find_next_char_utf8(const char *p, const char *end)
{ {
if (*p) { if (*p) {
@@ -740,7 +740,7 @@ char *BLI_str_find_next_char_utf8(const char *p, const char *end)
* character of the string, you must use g_utf8_find_prev_char() instead. * character of the string, you must use g_utf8_find_prev_char() instead.
* *
* Return value: a pointer to the found character. * Return value: a pointer to the found character.
**/ */
char *BLI_str_prev_char_utf8(const char *p) char *BLI_str_prev_char_utf8(const char *p)
{ {
while (1) { while (1) {

View File

@@ -5664,14 +5664,15 @@ static double find_superellipse_chord_endpoint(double x0, double dtarget, float
return xnew; return xnew;
} }
/* This search procedure to find equidistant points (x,y) in the first /**
* This search procedure to find equidistant points (x,y) in the first
* superellipse quadrant works for every superellipse exponent but is more * superellipse quadrant works for every superellipse exponent but is more
* expensive than known solutions for special cases. * expensive than known solutions for special cases.
* Call the point on superellipse that intersects x=y line mx. * Call the point on superellipse that intersects x=y line mx.
* For r>=1 use only the range x in [0,mx] and mirror the rest along x=y line, * For r>=1 use only the range x in [0,mx] and mirror the rest along x=y line,
* for r<1 use only x in [mx,1]. Points are initially spaced and iteratively * for r<1 use only x in [mx,1]. Points are initially spaced and iteratively
* repositioned to have the same distance. */ * repositioned to have the same distance.
*/
static void find_even_superellipse_chords_general(int seg, float r, double *xvals, double *yvals) static void find_even_superellipse_chords_general(int seg, float r, double *xvals, double *yvals)
{ {
const int smoothitermax = 10; const int smoothitermax = 10;
@@ -5770,13 +5771,14 @@ static void find_even_superellipse_chords_general(int seg, float r, double *xval
} }
} }
/* Find equidistant points (x0,y0), (x1,y1)... (xn,yn) on the superellipse /**
* Find equidistant points (x0,y0), (x1,y1)... (xn,yn) on the superellipse
* function in the first quadrant. For special profiles (linear, arc, * function in the first quadrant. For special profiles (linear, arc,
* rectangle) the point can be calculated easily, for any other profile a more * rectangle) the point can be calculated easily, for any other profile a more
* expensive search procedure must be used because there is no known closed * expensive search procedure must be used because there is no known closed
* form for equidistant parametrization * form for equidistant parametrization
* xvals and yvals should be size n+1 */ * xvals and yvals should be size n+1
*/
static void find_even_superellipse_chords(int n, float r, double *xvals, double *yvals) static void find_even_superellipse_chords(int n, float r, double *xvals, double *yvals)
{ {
int i, n2; int i, n2;

View File

@@ -212,7 +212,7 @@ int ArmatureImporter::create_bone(SkinInfo *skin, COLLADAFW::Node *node, EditBon
* don't have a defined length. This function guesses reasonable * don't have a defined length. This function guesses reasonable
* tail locations for the affected bones (nodes which don't have any connected child) * tail locations for the affected bones (nodes which don't have any connected child)
* Hint: The extended_bones set gets populated in ArmatureImporter::create_bone * Hint: The extended_bones set gets populated in ArmatureImporter::create_bone
**/ */
void ArmatureImporter::fix_leaf_bone_hierarchy(bArmature *armature, Bone *bone, bool fix_orientation) void ArmatureImporter::fix_leaf_bone_hierarchy(bArmature *armature, Bone *bone, bool fix_orientation)
{ {
if (bone == NULL) if (bone == NULL)
@@ -677,7 +677,7 @@ void ArmatureImporter::set_pose(Object *ob_arm, COLLADAFW::Node *root_node, con
* root - if this joint is the top joint in hierarchy, if a joint * root - if this joint is the top joint in hierarchy, if a joint
* is a child of a node (not joint), root should be true since * is a child of a node (not joint), root should be true since
* this is where we build armature bones from * this is where we build armature bones from
**/ */
void ArmatureImporter::add_root_joint(COLLADAFW::Node *node, Object *parent) void ArmatureImporter::add_root_joint(COLLADAFW::Node *node, Object *parent)
{ {
root_joints.push_back(node); root_joints.push_back(node);

View File

@@ -876,7 +876,7 @@ std::string *MeshImporter::get_geometry_name(const std::string &mesh_name)
* this function checks if both objects have the same * this function checks if both objects have the same
* materials assigned to Object (in the same order) * materials assigned to Object (in the same order)
* returns true if condition matches, otherwise false; * returns true if condition matches, otherwise false;
**/ */
static bool bc_has_same_material_configuration(Object *ob1, Object *ob2) static bool bc_has_same_material_configuration(Object *ob1, Object *ob2)
{ {
if (ob1->totcol != ob2->totcol) return false; // not same number of materials if (ob1->totcol != ob2->totcol) return false; // not same number of materials
@@ -897,7 +897,7 @@ static bool bc_has_same_material_configuration(Object *ob1, Object *ob2)
* and no material is assigned to Data. * and no material is assigned to Data.
* That is true right after the objects have been imported. * That is true right after the objects have been imported.
* *
**/ */
static void bc_copy_materials_to_data(Object *ob, Mesh *me) static void bc_copy_materials_to_data(Object *ob, Mesh *me)
{ {
for (int index = 0; index < ob->totcol; index++) { for (int index = 0; index < ob->totcol; index++) {
@@ -910,7 +910,7 @@ static void bc_copy_materials_to_data(Object *ob, Mesh *me)
* *
* Remove all references to materials from the object * Remove all references to materials from the object
* *
**/ */
static void bc_remove_materials_from_object(Object *ob, Mesh *me) static void bc_remove_materials_from_object(Object *ob, Mesh *me)
{ {
for (int index = 0; index < ob->totcol; index++) { for (int index = 0; index < ob->totcol; index++) {
@@ -923,7 +923,7 @@ static void bc_remove_materials_from_object(Object *ob, Mesh *me)
* Returns the list of Users of the given Mesh object. * Returns the list of Users of the given Mesh object.
* Note: This function uses the object user flag to control * Note: This function uses the object user flag to control
* which objects have already been processed. * which objects have already been processed.
**/ */
std::vector<Object *> MeshImporter::get_all_users_of(Mesh *reference_mesh) std::vector<Object *> MeshImporter::get_all_users_of(Mesh *reference_mesh)
{ {
std::vector<Object *> mesh_users; std::vector<Object *> mesh_users;
@@ -958,7 +958,7 @@ std::vector<Object *> MeshImporter::get_all_users_of(Mesh *reference_mesh)
* Add the materials of the first user to the geometry * Add the materials of the first user to the geometry
* adjust all other users accordingly. * adjust all other users accordingly.
* *
**/ */
void MeshImporter::optimize_material_assignements() void MeshImporter::optimize_material_assignements()
{ {
for (std::vector<Object *>::iterator it = imported_objects.begin(); for (std::vector<Object *>::iterator it = imported_objects.begin();

View File

@@ -51,7 +51,6 @@ public:
void deinitExecution(); void deinitExecution();
}; };
/**/
class OutputStereoOperation : public OutputSingleLayerOperation { class OutputStereoOperation : public OutputSingleLayerOperation {
private: private:
char m_name[FILE_MAX]; char m_name[FILE_MAX];

View File

@@ -238,7 +238,7 @@ void EEVEE_bloom_cache_init(EEVEE_ViewLayerData *UNUSED(sldata), EEVEE_Data *ved
* [Downsample] [Upsample] * [Downsample] [Upsample]
* v | * v |
* Color Downsampled [1/N] ─────────────────────────┘ * Color Downsampled [1/N] ─────────────────────────┘
**/ */
DRWShadingGroup *grp; DRWShadingGroup *grp;
const bool use_highres = true; const bool use_highres = true;
const bool use_antiflicker = true; const bool use_antiflicker = true;

View File

@@ -194,7 +194,7 @@ void EEVEE_depth_of_field_cache_init(EEVEE_ViewLayerData *UNUSED(sldata), EEVEE_
* - Shoot quads for every pixel and expand it depending on the CoC. * - Shoot quads for every pixel and expand it depending on the CoC.
* Do one pass for near Dof and one pass for far Dof. * Do one pass for near Dof and one pass for far Dof.
* - Finally composite the 2 blurred buffers with the original render. * - Finally composite the 2 blurred buffers with the original render.
**/ */
DRWShadingGroup *grp; DRWShadingGroup *grp;
struct GPUBatch *quad = DRW_cache_fullscreen_quad_get(); struct GPUBatch *quad = DRW_cache_fullscreen_quad_get();
const bool use_alpha = !DRW_state_draw_background(); const bool use_alpha = !DRW_state_draw_background();

View File

@@ -465,7 +465,7 @@ void EEVEE_create_minmax_buffer(EEVEE_Data *vedata, GPUTexture *depth_src, int l
/** /**
* Simple downsampling algorithm. Reconstruct mip chain up to mip level. * Simple downsampling algorithm. Reconstruct mip chain up to mip level.
**/ */
void EEVEE_downsample_buffer(EEVEE_Data *vedata, GPUTexture *texture_src, int level) void EEVEE_downsample_buffer(EEVEE_Data *vedata, GPUTexture *texture_src, int level)
{ {
EEVEE_FramebufferList *fbl = vedata->fbl; EEVEE_FramebufferList *fbl = vedata->fbl;
@@ -481,7 +481,7 @@ void EEVEE_downsample_buffer(EEVEE_Data *vedata, GPUTexture *texture_src, int le
/** /**
* Simple downsampling algorithm for cubemap. Reconstruct mip chain up to mip level. * Simple downsampling algorithm for cubemap. Reconstruct mip chain up to mip level.
**/ */
void EEVEE_downsample_cube_buffer(EEVEE_Data *vedata, GPUTexture *texture_src, int level) void EEVEE_downsample_cube_buffer(EEVEE_Data *vedata, GPUTexture *texture_src, int level)
{ {
EEVEE_FramebufferList *fbl = vedata->fbl; EEVEE_FramebufferList *fbl = vedata->fbl;

View File

@@ -721,7 +721,7 @@ static void eevee_light_setup(Object *ob, EEVEE_Light *evli)
* Point are distributed in a way that when they are orthogonaly * Point are distributed in a way that when they are orthogonaly
* projected into any plane, the resulting distribution is (close to) * projected into any plane, the resulting distribution is (close to)
* a uniform disc distribution. * a uniform disc distribution.
**/ */
static void sample_ball(int sample_ofs, float radius, float rsample[3]) static void sample_ball(int sample_ofs, float radius, float rsample[3])
{ {
double ht_point[3]; double ht_point[3];

View File

@@ -354,7 +354,7 @@ static char *eevee_get_volume_defines(int options)
/** /**
* ssr_id can be null to disable ssr contribution. * ssr_id can be null to disable ssr contribution.
**/ */
static void add_standard_uniforms( static void add_standard_uniforms(
DRWShadingGroup *shgrp, EEVEE_ViewLayerData *sldata, EEVEE_Data *vedata, DRWShadingGroup *shgrp, EEVEE_ViewLayerData *sldata, EEVEE_Data *vedata,
int *ssr_id, float *refract_depth, int *ssr_id, float *refract_depth,
@@ -539,7 +539,7 @@ static void EEVEE_update_viewvecs(float invproj[4][4], float winmat[4][4], float
* when Z = 1, and top-left corner if Z = 1. * when Z = 1, and top-left corner if Z = 1.
* view_vecs[0].z the near clip distance and view_vecs[1].z is the (signed) * view_vecs[0].z the near clip distance and view_vecs[1].z is the (signed)
* distance from the near plane to the far clip plane. * distance from the near plane to the far clip plane.
**/ */
copy_v4_v4(r_viewvecs[0], view_vecs[0]); copy_v4_v4(r_viewvecs[0], view_vecs[0]);
/* we need to store the differences */ /* we need to store the differences */
@@ -842,7 +842,7 @@ struct GPUMaterial *EEVEE_material_hair_get(
/** /**
* Create a default shading group inside the given pass. * Create a default shading group inside the given pass.
**/ */
static struct DRWShadingGroup *EEVEE_default_shading_group_create( static struct DRWShadingGroup *EEVEE_default_shading_group_create(
EEVEE_ViewLayerData *sldata, EEVEE_Data *vedata, DRWPass *pass, EEVEE_ViewLayerData *sldata, EEVEE_Data *vedata, DRWPass *pass,
bool is_hair, bool is_flat_normal, bool use_blend, bool use_ssr, int shadow_method) bool is_hair, bool is_flat_normal, bool use_blend, bool use_ssr, int shadow_method)
@@ -871,7 +871,7 @@ static struct DRWShadingGroup *EEVEE_default_shading_group_create(
/** /**
* Create a default shading group inside the default pass without standard uniforms. * Create a default shading group inside the default pass without standard uniforms.
**/ */
static struct DRWShadingGroup *EEVEE_default_shading_group_get( static struct DRWShadingGroup *EEVEE_default_shading_group_get(
EEVEE_ViewLayerData *sldata, EEVEE_Data *vedata, EEVEE_ViewLayerData *sldata, EEVEE_Data *vedata,
Object *ob, ParticleSystem *psys, ModifierData *md, Object *ob, ParticleSystem *psys, ModifierData *md,
@@ -919,7 +919,7 @@ static struct DRWShadingGroup *EEVEE_default_shading_group_get(
/** /**
* Create a default shading group inside the lookdev pass without standard uniforms. * Create a default shading group inside the lookdev pass without standard uniforms.
**/ */
static struct DRWShadingGroup *EEVEE_lookdev_shading_group_get( static struct DRWShadingGroup *EEVEE_lookdev_shading_group_get(
EEVEE_ViewLayerData *sldata, EEVEE_Data *vedata, EEVEE_ViewLayerData *sldata, EEVEE_Data *vedata,
bool use_ssr, int shadow_method) bool use_ssr, int shadow_method)

View File

@@ -195,7 +195,7 @@ void EEVEE_occlusion_cache_init(EEVEE_ViewLayerData *sldata, EEVEE_Data *vedata)
* - Then we use this angle to compute occlusion with the shading normal at * - Then we use this angle to compute occlusion with the shading normal at
* the shading stage. This let us do correct shadowing for each diffuse / specular * the shading stage. This let us do correct shadowing for each diffuse / specular
* lobe present in the shader using the correct normal. * lobe present in the shader using the correct normal.
**/ */
psl->ao_horizon_search = DRW_pass_create("GTAO Horizon Search", DRW_STATE_WRITE_COLOR); psl->ao_horizon_search = DRW_pass_create("GTAO Horizon Search", DRW_STATE_WRITE_COLOR);
DRWShadingGroup *grp = DRW_shgroup_create(e_data.gtao_sh, psl->ao_horizon_search); DRWShadingGroup *grp = DRW_shgroup_create(e_data.gtao_sh, psl->ao_horizon_search);
DRW_shgroup_uniform_texture(grp, "utilTex", EEVEE_materials_get_util_tex()); DRW_shgroup_uniform_texture(grp, "utilTex", EEVEE_materials_get_util_tex());

View File

@@ -378,7 +378,7 @@ void EEVEE_volumes_cache_init(EEVEE_ViewLayerData *sldata, EEVEE_Data *vedata)
* for "every" positions in the frustum. We only need to sample * for "every" positions in the frustum. We only need to sample
* them and blend the scene color with those factors. This also * them and blend the scene color with those factors. This also
* work for alpha blended materials. * work for alpha blended materials.
**/ */
/* World pass is not additive as it also clear the buffer. */ /* World pass is not additive as it also clear the buffer. */
psl->volumetric_world_ps = DRW_pass_create("Volumetric World", DRW_STATE_WRITE_COLOR); psl->volumetric_world_ps = DRW_pass_create("Volumetric World", DRW_STATE_WRITE_COLOR);

View File

@@ -24,7 +24,7 @@
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE. * THE SOFTWARE.
**/ */
uniform sampler2D sourceBuffer; /* Buffer to filter */ uniform sampler2D sourceBuffer; /* Buffer to filter */
uniform vec2 sourceBufferTexelSize; uniform vec2 sourceBufferTexelSize;

View File

@@ -81,7 +81,7 @@ void main()
* | Origin \ * | Origin \
* -1 0 --------------- 2 * -1 0 --------------- 2
* -1 0 1 ex * -1 0 1 ex
**/ */
gl_Position.x = float(v_id / 2) * extend - 1.0; /* int divisor round down */ gl_Position.x = float(v_id / 2) * extend - 1.0; /* int divisor round down */
gl_Position.y = float(v_id % 2) * extend - 1.0; gl_Position.y = float(v_id % 2) * extend - 1.0;
gl_Position.z = 0.0; gl_Position.z = 0.0;

View File

@@ -1,6 +1,6 @@
/** /**
* Simple downsample shader. Takes the average of the 4 texels of lower mip. * Simple downsample shader. Takes the average of the 4 texels of lower mip.
**/ */
uniform samplerCube source; uniform samplerCube source;
uniform float texelSize; uniform float texelSize;

View File

@@ -1,6 +1,6 @@
/** /**
* Simple downsample shader. Takes the average of the 4 texels of lower mip. * Simple downsample shader. Takes the average of the 4 texels of lower mip.
**/ */
uniform sampler2D source; uniform sampler2D source;
uniform float fireflyFactor; uniform float fireflyFactor;

View File

@@ -1,7 +1,7 @@
/** /**
* This shader only compute maximum horizon angles for each directions. * This shader only compute maximum horizon angles for each directions.
* The final integration is done at the resolve stage with the shading normal. * The final integration is done at the resolve stage with the shading normal.
**/ */
uniform float rotationOffset; uniform float rotationOffset;

View File

@@ -2,7 +2,7 @@
* Shader that downsample depth buffer, * Shader that downsample depth buffer,
* saving min and max value of each texel in the above mipmaps. * saving min and max value of each texel in the above mipmaps.
* Adapted from http://rastergrid.com/blog/2010/10/hierarchical-z-map-based-occlusion-culling/ * Adapted from http://rastergrid.com/blog/2010/10/hierarchical-z-map-based-occlusion-culling/
**/ */
#ifdef LAYERED #ifdef LAYERED
uniform sampler2DArray depthBuffer; uniform sampler2DArray depthBuffer;

View File

@@ -1,6 +1,6 @@
/** /**
* Simple downsample shader. Takes the average of the 4 texels of lower mip. * Simple downsample shader. Takes the average of the 4 texels of lower mip.
**/ */
uniform sampler2DArray source; uniform sampler2DArray source;
uniform float fireflyFactor; uniform float fireflyFactor;

View File

@@ -4,7 +4,7 @@
* Eric Heitz, Jonathan Dupuy, Stephen Hill and David Neubelt. * Eric Heitz, Jonathan Dupuy, Stephen Hill and David Neubelt.
* ACM Transactions on Graphics (Proceedings of ACM SIGGRAPH 2016) 35(4), 2016. * ACM Transactions on Graphics (Proceedings of ACM SIGGRAPH 2016) 35(4), 2016.
* Project page: https://eheitzresearch.wordpress.com/415-2/ * Project page: https://eheitzresearch.wordpress.com/415-2/
**/ */
#define USE_LTC #define USE_LTC
@@ -33,7 +33,7 @@ float diffuse_sphere_integral(float avg_dir_z, float form_factor)
* An extended version of the implementation from * An extended version of the implementation from
* "How to solve a cubic equation, revisited" * "How to solve a cubic equation, revisited"
* http://momentsingraphics.de/?p=105 * http://momentsingraphics.de/?p=105
**/ */
vec3 solve_cubic(vec4 coefs) vec3 solve_cubic(vec4 coefs)
{ {
/* Normalize the polynomial */ /* Normalize the polynomial */

View File

@@ -19,7 +19,7 @@ void main()
* | \ * | \
* -1 0 --------------- 2 * -1 0 --------------- 2
* -1 0 1 ex * -1 0 1 ex
**/ */
vPos.x = float(v_id / 2) * 4.0 - 1.0; /* int divisor round down */ vPos.x = float(v_id / 2) * 4.0 - 1.0; /* int divisor round down */
vPos.y = float(v_id % 2) * 4.0 - 1.0; vPos.y = float(v_id % 2) * 4.0 - 1.0;
vPos.z = float(t_id); vPos.z = float(t_id);

View File

@@ -2,7 +2,7 @@
* Separable Hexagonal Bokeh Blur by Colin Barré-Brisebois * Separable Hexagonal Bokeh Blur by Colin Barré-Brisebois
* https://colinbarrebrisebois.com/2017/04/18/hexagonal-bokeh-blur-revisited-part-1-basic-3-pass-version/ * https://colinbarrebrisebois.com/2017/04/18/hexagonal-bokeh-blur-revisited-part-1-basic-3-pass-version/
* Converted and adapted from HLSL to GLSL by Clément Foucault * Converted and adapted from HLSL to GLSL by Clément Foucault
**/ */
uniform mat4 ProjectionMatrix; uniform mat4 ProjectionMatrix;
uniform vec2 invertedViewportSize; uniform vec2 invertedViewportSize;
@@ -44,7 +44,7 @@ float decode_signed_coc(vec2 cocs) { return ((cocs.x > cocs.y) ? cocs.x : -cocs.
/** /**
* ----------------- STEP 0 ------------------ * ----------------- STEP 0 ------------------
* Custom Coc aware downsampling. Half res pass. * Custom Coc aware downsampling. Half res pass.
**/ */
#ifdef PREPARE #ifdef PREPARE
layout(location = 0) out vec4 halfResColor; layout(location = 0) out vec4 halfResColor;
@@ -91,7 +91,7 @@ void main()
/** /**
* ----------------- STEP 0.5 ------------------ * ----------------- STEP 0.5 ------------------
* Custom Coc aware downsampling. Quater res pass. * Custom Coc aware downsampling. Quater res pass.
**/ */
#ifdef DOWNSAMPLE #ifdef DOWNSAMPLE
layout(location = 0) out vec4 outColor; layout(location = 0) out vec4 outColor;
@@ -135,7 +135,7 @@ void main()
/** /**
* ----------------- STEP 1 ------------------ * ----------------- STEP 1 ------------------
* Flatten COC buffer using max filter. * Flatten COC buffer using max filter.
**/ */
#if defined(FLATTEN_VERTICAL) || defined(FLATTEN_HORIZONTAL) #if defined(FLATTEN_VERTICAL) || defined(FLATTEN_HORIZONTAL)
layout(location = 0) out vec2 flattenedCoc; layout(location = 0) out vec2 flattenedCoc;
@@ -170,7 +170,7 @@ void main()
/** /**
* ----------------- STEP 1.ax------------------ * ----------------- STEP 1.ax------------------
* Dilate COC buffer using min filter. * Dilate COC buffer using min filter.
**/ */
#if defined(DILATE_VERTICAL) || defined(DILATE_HORIZONTAL) #if defined(DILATE_VERTICAL) || defined(DILATE_HORIZONTAL)
layout(location = 0) out vec2 dilatedCoc; layout(location = 0) out vec2 dilatedCoc;
@@ -205,7 +205,7 @@ void main()
* ----------------- STEP 2 ------------------ * ----------------- STEP 2 ------------------
* Blur vertically and diagonally. * Blur vertically and diagonally.
* Outputs vertical blur and combined blur in MRT * Outputs vertical blur and combined blur in MRT
**/ */
#ifdef BLUR1 #ifdef BLUR1
layout(location = 0) out vec4 blurColor; layout(location = 0) out vec4 blurColor;
@@ -290,7 +290,7 @@ void main()
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
**/ */
#ifdef BLUR2 #ifdef BLUR2
out vec4 finalColor; out vec4 finalColor;
@@ -344,7 +344,7 @@ void main()
/** /**
* ----------------- STEP 4 ------------------ * ----------------- STEP 4 ------------------
**/ */
#ifdef RESOLVE #ifdef RESOLVE
out vec4 finalColor; out vec4 finalColor;

View File

@@ -763,7 +763,7 @@ void workbench_deferred_cache_init(WORKBENCH_Data *vedata)
* Similar to workbench forward. Duplicated code to avoid * Similar to workbench forward. Duplicated code to avoid
* spaghetti with workbench forward. It would be great if we unify * spaghetti with workbench forward. It would be great if we unify
* this in a clean way. * this in a clean way.
**/ */
if (OIT_ENABLED(wpd)) { if (OIT_ENABLED(wpd)) {
const bool do_cull = CULL_BACKFACE_ENABLED(wpd); const bool do_cull = CULL_BACKFACE_ENABLED(wpd);
const int cull_state = (do_cull) ? DRW_STATE_CULL_BACK : 0; const int cull_state = (do_cull) ? DRW_STATE_CULL_BACK : 0;

View File

@@ -47,7 +47,7 @@ extern char datatoc_workbench_effect_dof_frag_glsl[];
/** /**
* Transform [-1..1] square to unit circle. * Transform [-1..1] square to unit circle.
**/ */
static void square_to_circle(float x, float y, float *r, float *T) static void square_to_circle(float x, float y, float *r, float *T)
{ {
if (x > -y) { if (x > -y) {

View File

@@ -2009,7 +2009,7 @@ static const uint bone_octahedral_solid_tris[8][3] = {
* According to opengl specification it becomes (starting from * According to opengl specification it becomes (starting from
* the first vertex of the first face aka. vertex 2): * the first vertex of the first face aka. vertex 2):
* {0, 12, 1, 10, 2, 3} * {0, 12, 1, 10, 2, 3}
**/ */
static const uint bone_octahedral_wire_lines_adjacency[12][4] = { static const uint bone_octahedral_wire_lines_adjacency[12][4] = {
{ 0, 1, 2, 6}, { 0, 12, 1, 6}, { 0, 3, 12, 6}, { 0, 2, 3, 6}, { 0, 1, 2, 6}, { 0, 12, 1, 6}, { 0, 3, 12, 6}, { 0, 2, 3, 6},
{ 1, 6, 2, 3}, { 1, 12, 6, 3}, { 1, 0, 12, 3}, { 1, 2, 0, 3}, { 1, 6, 2, 3}, { 1, 12, 6, 3}, { 1, 0, 12, 3}, { 1, 2, 0, 3},
@@ -2161,7 +2161,7 @@ static const uint bone_box_solid_tris[12][3] = {
/** /**
* Store indices of generated verts from bone_box_solid_tris to define adjacency infos. * Store indices of generated verts from bone_box_solid_tris to define adjacency infos.
* See bone_octahedral_solid_tris for more infos. * See bone_octahedral_solid_tris for more infos.
**/ */
static const uint bone_box_wire_lines_adjacency[12][4] = { static const uint bone_box_wire_lines_adjacency[12][4] = {
{ 4, 2, 0, 11}, { 0, 1, 2, 8}, { 2, 4, 1, 14}, { 1, 0, 4, 20}, /* bottom */ { 4, 2, 0, 11}, { 0, 1, 2, 8}, { 2, 4, 1, 14}, { 1, 0, 4, 20}, /* bottom */
{ 0, 8, 11, 14}, { 2, 14, 8, 20}, { 1, 20, 14, 11}, { 4, 11, 20, 8}, /* top */ { 0, 8, 11, 14}, { 2, 14, 8, 20}, { 1, 20, 14, 11}, { 4, 11, 20, 8}, /* top */

View File

@@ -4885,7 +4885,7 @@ void DRW_mesh_batch_cache_create_requested(
* TODO: The code and data structure is ready to support modified UV display * TODO: The code and data structure is ready to support modified UV display
* but the selection code for UVs needs to support it first. So for now, only * but the selection code for UVs needs to support it first. So for now, only
* display the cage in all cases. * display the cage in all cases.
**/ */
if (rdata && rdata->mapped.supported) { if (rdata && rdata->mapped.supported) {
rdata->mapped.use = false; rdata->mapped.use = false;
} }

View File

@@ -246,7 +246,7 @@ void DRW_hair_update(void)
* readback the result to system memory and reupload as VBO data. * readback the result to system memory and reupload as VBO data.
* It is really not ideal performance wise, but it is the simplest * It is really not ideal performance wise, but it is the simplest
* and the most local workaround that still uses the power of the GPU. * and the most local workaround that still uses the power of the GPU.
**/ */
if (g_tf_calls == NULL) { if (g_tf_calls == NULL) {
return; return;

View File

@@ -24,10 +24,10 @@
* DRW Instance Data Manager * DRW Instance Data Manager
* This is a special memory manager that keeps memory blocks ready to send as vbo data in one continuous allocation. * This is a special memory manager that keeps memory blocks ready to send as vbo data in one continuous allocation.
* This way we avoid feeding gawain each instance data one by one and unnecessary memcpy. * This way we avoid feeding gawain each instance data one by one and unnecessary memcpy.
* Since we loose which memory block was used each DRWShadingGroup we need to redistribute them in the same order/size * Since we loose which memory block was used each #DRWShadingGroup we need to redistribute them in the same order/size
* to avoid to realloc each frame. * to avoid to realloc each frame.
* This is why DRWInstanceDatas are sorted in a list for each different data size. * This is why #DRWInstanceDatas are sorted in a list for each different data size.
**/ */
#include "draw_instance_data.h" #include "draw_instance_data.h"
#include "DRW_engine.h" #include "DRW_engine.h"
@@ -94,15 +94,14 @@ static ListBase g_idatalists = {NULL, NULL};
* be static so that it's pointer never changes (because we are using * be static so that it's pointer never changes (because we are using
* this pointer as identifier [we don't want to check the full format * this pointer as identifier [we don't want to check the full format
* that would be too slow]). * that would be too slow]).
**/ */
static void instance_batch_free(GPUBatch *batch, void *UNUSED(user_data)) static void instance_batch_free(GPUBatch *batch, void *UNUSED(user_data))
{ {
if (batch->verts[0] == NULL) { if (batch->verts[0] == NULL) {
/** XXX This is a false positive case. /** XXX This is a false positive case.
* The batch has been requested but not init yet * The batch has been requested but not init yet
* and there is a chance that it might become init. * and there is a chance that it might become init.
**/ */
return; return;
} }
/* Free all batches that have the same key before they are reused. */ /* Free all batches that have the same key before they are reused. */
@@ -313,7 +312,7 @@ static void DRW_instance_data_free(DRWInstanceData *idata)
/** /**
* Return a pointer to the next instance data space. * Return a pointer to the next instance data space.
**/ */
void *DRW_instance_data_next(DRWInstanceData *idata) void *DRW_instance_data_next(DRWInstanceData *idata)
{ {
return BLI_mempool_alloc(idata->mempool); return BLI_mempool_alloc(idata->mempool);

View File

@@ -375,9 +375,11 @@ void DRW_transform_none(GPUTexture *tex)
/** \name Multisample Resolve /** \name Multisample Resolve
* \{ */ * \{ */
/* Use manual multisample resolve pass. /**
* Use manual multisample resolve pass.
* Much quicker than blitting back and forth. * Much quicker than blitting back and forth.
* Assume destination fb is bound*/ * Assume destination fb is bound.
*/
void DRW_multisamples_resolve(GPUTexture *src_depth, GPUTexture *src_color, bool use_depth) void DRW_multisamples_resolve(GPUTexture *src_depth, GPUTexture *src_color, bool use_depth)
{ {
DRWState state = DRW_STATE_WRITE_COLOR | DRW_STATE_BLEND_PREMUL; DRWState state = DRW_STATE_WRITE_COLOR | DRW_STATE_BLEND_PREMUL;

View File

@@ -83,7 +83,7 @@
* Data structure containing all drawcalls organized by passes and materials. * Data structure containing all drawcalls organized by passes and materials.
* DRWPass > DRWShadingGroup > DRWCall > DRWCallState * DRWPass > DRWShadingGroup > DRWCall > DRWCallState
* > DRWUniform * > DRWUniform
**/ */
/* Used by DRWCallState.flag */ /* Used by DRWCallState.flag */
enum { enum {

View File

@@ -1217,7 +1217,7 @@ static int pass_shgroup_dist_sort(void *thunk, const void *a, const void *b)
/** /**
* Sort Shading groups by decreasing Z of their first draw call. * Sort Shading groups by decreasing Z of their first draw call.
* This is useful for order dependent effect such as transparency. * This is useful for order dependent effect such as transparency.
**/ */
void DRW_pass_sort_shgroup_z(DRWPass *pass) void DRW_pass_sort_shgroup_z(DRWPass *pass)
{ {
float (*viewinv)[4]; float (*viewinv)[4];

View File

@@ -426,7 +426,7 @@ void DRW_state_invert_facing(void)
* This only works if DRWPasses have been tagged with DRW_STATE_CLIP_PLANES, * This only works if DRWPasses have been tagged with DRW_STATE_CLIP_PLANES,
* and if the shaders have support for it (see usage of gl_ClipDistance). * and if the shaders have support for it (see usage of gl_ClipDistance).
* Be sure to call DRW_state_clip_planes_reset() after you finish drawing. * Be sure to call DRW_state_clip_planes_reset() after you finish drawing.
**/ */
void DRW_state_clip_planes_len_set(uint plane_len) void DRW_state_clip_planes_len_set(uint plane_len)
{ {
BLI_assert(plane_len <= MAX_CLIP_PLANES); BLI_assert(plane_len <= MAX_CLIP_PLANES);

View File

@@ -3,13 +3,13 @@
* This is less bandwidth intensive than fetching the vertex attributes * This is less bandwidth intensive than fetching the vertex attributes
* but does more ALU work per vertex. This also reduce the number * but does more ALU work per vertex. This also reduce the number
* of data the CPU has to precompute and transfert for each update. * of data the CPU has to precompute and transfert for each update.
**/ */
/** /**
* hairStrandsRes: Number of points per hair strand. * hairStrandsRes: Number of points per hair strand.
* 2 - no subdivision * 2 - no subdivision
* 3+ - 1 or more interpolated points per hair. * 3+ - 1 or more interpolated points per hair.
**/ */
uniform int hairStrandsRes = 8; uniform int hairStrandsRes = 8;
/** /**
@@ -17,7 +17,7 @@ uniform int hairStrandsRes = 8;
* 1 - Wire Hair: Only one pixel thick, independent of view distance. * 1 - Wire Hair: Only one pixel thick, independent of view distance.
* 2 - Polystrip Hair: Correct width, flat if camera is parallel. * 2 - Polystrip Hair: Correct width, flat if camera is parallel.
* 3+ - Cylinder Hair: Massive calculation but potentially perfect. Still need proper support. * 3+ - Cylinder Hair: Massive calculation but potentially perfect. Still need proper support.
**/ */
uniform int hairThicknessRes = 1; uniform int hairThicknessRes = 1;
/* Hair thickness shape. */ /* Hair thickness shape. */
@@ -58,7 +58,7 @@ void unpack_strand_data(uint data, out int strand_offset, out int strand_segment
* children particle modifiers being evaluated at this stage. * children particle modifiers being evaluated at this stage.
* *
* If no more subdivision is needed, we can skip this step. * If no more subdivision is needed, we can skip this step.
**/ */
#ifdef HAIR_PHASE_SUBDIV #ifdef HAIR_PHASE_SUBDIV
int hair_get_base_id(float local_time, int strand_segments, out float interp_time) int hair_get_base_id(float local_time, int strand_segments, out float interp_time)
@@ -104,7 +104,7 @@ void hair_get_interp_attrs(out vec4 data0, out vec4 data1, out vec4 data2, out v
/* -- Drawing stage -- */ /* -- Drawing stage -- */
/** /**
* For final drawing, the vertex index and the number of vertex per segment * For final drawing, the vertex index and the number of vertex per segment
**/ */
#ifndef HAIR_PHASE_SUBDIV #ifndef HAIR_PHASE_SUBDIV
int hair_get_strand_id(void) int hair_get_strand_id(void)

View File

@@ -7,7 +7,7 @@
* The area we search is the circular segment. https://en.wikipedia.org/wiki/Circular_segment * The area we search is the circular segment. https://en.wikipedia.org/wiki/Circular_segment
* The formula for the area uses inverse trig function and is quite complexe. * The formula for the area uses inverse trig function and is quite complexe.
* Instead, we approximate it by using the smoothstep function and a 1.05 factor to the disc radius. * Instead, we approximate it by using the smoothstep function and a 1.05 factor to the disc radius.
**/ */
#define DISC_RADIUS (M_1_SQRTPI * 1.05) #define DISC_RADIUS (M_1_SQRTPI * 1.05)
#define GRID_LINE_SMOOTH_START (0.5 - DISC_RADIUS) #define GRID_LINE_SMOOTH_START (0.5 - DISC_RADIUS)
#define GRID_LINE_SMOOTH_END (0.5 + DISC_RADIUS) #define GRID_LINE_SMOOTH_END (0.5 + DISC_RADIUS)

View File

@@ -42,7 +42,7 @@ uniform int gridFlag;
* The area we search is the circular segment. https://en.wikipedia.org/wiki/Circular_segment * The area we search is the circular segment. https://en.wikipedia.org/wiki/Circular_segment
* The formula for the area uses inverse trig function and is quite complexe. * The formula for the area uses inverse trig function and is quite complexe.
* Instead, we approximate it by using the smoothstep function and a 1.05 factor to the disc radius. * Instead, we approximate it by using the smoothstep function and a 1.05 factor to the disc radius.
**/ */
#define DISC_RADIUS (M_1_SQRTPI * 1.05) #define DISC_RADIUS (M_1_SQRTPI * 1.05)
#define GRID_LINE_SMOOTH_START (0.5 - DISC_RADIUS) #define GRID_LINE_SMOOTH_START (0.5 - DISC_RADIUS)
#define GRID_LINE_SMOOTH_END (0.5 + DISC_RADIUS) #define GRID_LINE_SMOOTH_END (0.5 + DISC_RADIUS)

View File

@@ -293,8 +293,10 @@ static void pose_slide_refresh(bContext *C, tPoseSlideOp *pso)
} }
} }
/** Although this lookup is not ideal, we won't be dealing with a lot of objects at a given time. /**
* But if it comes to that we can instead store prev/next frme in the tPChanFCurveLink. */ * Although this lookup is not ideal, we won't be dealing with a lot of objects at a given time.
* But if it comes to that we can instead store prev/next frme in the #tPChanFCurveLink.
*/
static bool pose_frame_range_from_object_get(tPoseSlideOp *pso, Object *ob, float *prevFrameF, float *nextFrameF) static bool pose_frame_range_from_object_get(tPoseSlideOp *pso, Object *ob, float *prevFrameF, float *nextFrameF)
{ {
for (uint ob_index = 0; ob_index < pso->objects_len; ob_index++) { for (uint ob_index = 0; ob_index < pso->objects_len; ob_index++) {

View File

@@ -125,7 +125,7 @@ static void fcurves_to_pchan_links_get(ListBase *pfLinks, Object *ob, bAction *a
/** /**
* Returns a valid pose armature for this object, else returns NULL. * Returns a valid pose armature for this object, else returns NULL.
**/ */
Object *poseAnim_object_get(Object *ob_) Object *poseAnim_object_get(Object *ob_)
{ {
Object *ob = BKE_object_pose_armature_get(ob_); Object *ob = BKE_object_pose_armature_get(ob_);

View File

@@ -783,7 +783,7 @@ static void ui_keymap_but_cb(bContext *UNUSED(C), void *but_v, void *UNUSED(key_
* *
* \param w_hint: For varying width layout, this becomes the label width. * \param w_hint: For varying width layout, this becomes the label width.
* Otherwise it's used to fit both items into it. * Otherwise it's used to fit both items into it.
**/ */
static uiBut *ui_item_with_label( static uiBut *ui_item_with_label(
uiLayout *layout, uiBlock *block, const char *name, int icon, uiLayout *layout, uiBlock *block, const char *name, int icon,
PointerRNA *ptr, PropertyRNA *prop, int index, PointerRNA *ptr, PropertyRNA *prop, int index,

View File

@@ -219,7 +219,7 @@ static const uint g_shape_preset_hold_action_face[2][3] = {{2, 0, 1}, {3, 5, 4}}
* In order to speed up UI drawing we create some batches that are then * In order to speed up UI drawing we create some batches that are then
* modified by specialized shaders to draw certain elements really fast. * modified by specialized shaders to draw certain elements really fast.
* TODO: find a better place. Maybe it's own file? * TODO: find a better place. Maybe it's own file?
**/ */
/* offset in triavec[] in shader per type */ /* offset in triavec[] in shader per type */
static const int tria_ofs[ROUNDBOX_TRIA_MAX] = { static const int tria_ofs[ROUNDBOX_TRIA_MAX] = {

View File

@@ -86,13 +86,14 @@
/** \name Public Object Selection API /** \name Public Object Selection API
* \{ */ * \{ */
/* simple API for object selection, rather than just using the flag /**
* simple API for object selection, rather than just using the flag
* this takes into account the 'restrict selection in 3d view' flag. * this takes into account the 'restrict selection in 3d view' flag.
* deselect works always, the restriction just prevents selection */ * deselect works always, the restriction just prevents selection
*
/* Note: send a NC_SCENE|ND_OB_SELECT notifier yourself! (or * \note Caller must send a `NC_SCENE | ND_OB_SELECT` notifier
* or a NC_SCENE|ND_OB_VISIBLE in case of visibility toggling */ * (or a `NC_SCENE | ND_OB_VISIBLE` in case of visibility toggling).
*/
void ED_object_base_select(Base *base, eObjectSelect_Mode mode) void ED_object_base_select(Base *base, eObjectSelect_Mode mode)
{ {
if (mode == BA_INVERT) { if (mode == BA_INVERT) {

View File

@@ -64,7 +64,7 @@ static bool snap_calc_active_center(bContext *C, const bool select_only, float r
/* *********************** operators ******************** */ /* *********************** operators ******************** */
/** Snaps every individual object center to its nearest point on the grid. **/ /** Snaps every individual object center to its nearest point on the grid. */
static int snap_sel_to_grid_exec(bContext *C, wmOperator *UNUSED(op)) static int snap_sel_to_grid_exec(bContext *C, wmOperator *UNUSED(op))
{ {
Depsgraph *depsgraph = CTX_data_depsgraph(C); Depsgraph *depsgraph = CTX_data_depsgraph(C);
@@ -230,7 +230,7 @@ void VIEW3D_OT_snap_selected_to_grid(wmOperatorType *ot)
* \param snap_target_global: a location in global space to snap to (eg. 3D cursor or active object). * \param snap_target_global: a location in global space to snap to (eg. 3D cursor or active object).
* \param use_offset: if the selected objects should maintain their relative offsets and be snapped by the selection * \param use_offset: if the selected objects should maintain their relative offsets and be snapped by the selection
* pivot point (median, active), or if every object origin should be snapped to the given location. * pivot point (median, active), or if every object origin should be snapped to the given location.
**/ */
static int snap_selected_to_location(bContext *C, const float snap_target_global[3], const bool use_offset) static int snap_selected_to_location(bContext *C, const float snap_target_global[3], const bool use_offset)
{ {
Depsgraph *depsgraph = CTX_data_depsgraph(C); Depsgraph *depsgraph = CTX_data_depsgraph(C);
@@ -479,7 +479,7 @@ void VIEW3D_OT_snap_selected_to_cursor(wmOperatorType *ot)
/* *************************************************** */ /* *************************************************** */
/** Snaps each selected object to the location of the active selected object. **/ /** Snaps each selected object to the location of the active selected object. */
static int snap_selected_to_active_exec(bContext *C, wmOperator *op) static int snap_selected_to_active_exec(bContext *C, wmOperator *op)
{ {
float snap_target_global[3]; float snap_target_global[3];
@@ -510,7 +510,7 @@ void VIEW3D_OT_snap_selected_to_active(wmOperatorType *ot)
/* *************************************************** */ /* *************************************************** */
/** Snaps the 3D cursor location to its nearest point on the grid. **/ /** Snaps the 3D cursor location to its nearest point on the grid. */
static int snap_curs_to_grid_exec(bContext *C, wmOperator *UNUSED(op)) static int snap_curs_to_grid_exec(bContext *C, wmOperator *UNUSED(op))
{ {
Scene *scene = CTX_data_scene(C); Scene *scene = CTX_data_scene(C);
@@ -604,7 +604,7 @@ static void bundle_midpoint(Scene *scene, Object *ob, float r_vec[3])
} }
} }
/** Snaps the 3D cursor location to the median point of the selection. **/ /** Snaps the 3D cursor location to the median point of the selection. */
static bool snap_curs_to_sel_ex(bContext *C, float cursor[3]) static bool snap_curs_to_sel_ex(bContext *C, float cursor[3])
{ {
Depsgraph *depsgraph = CTX_data_depsgraph(C); Depsgraph *depsgraph = CTX_data_depsgraph(C);
@@ -800,7 +800,7 @@ void VIEW3D_OT_snap_cursor_to_active(wmOperatorType *ot)
/* **************************************************** */ /* **************************************************** */
/** Snaps the 3D cursor location to the origin. **/ /** Snaps the 3D cursor location to the origin. */
static int snap_curs_to_center_exec(bContext *C, wmOperator *UNUSED(op)) static int snap_curs_to_center_exec(bContext *C, wmOperator *UNUSED(op))
{ {
Scene *scene = CTX_data_scene(C); Scene *scene = CTX_data_scene(C);

View File

@@ -81,7 +81,7 @@ static bool dependsOnTime(GpencilModifierData *UNUSED(md))
* - Stroke points are generally equally spaced. This implies that we can just add/remove points, * - Stroke points are generally equally spaced. This implies that we can just add/remove points,
* without worrying about distances between them / adding extra interpolated points between * without worrying about distances between them / adding extra interpolated points between
* an visible point and one about to be added/removed (or any similar tapering effects). * an visible point and one about to be added/removed (or any similar tapering effects).
*
* - All strokes present are fully visible (i.e. we don't have to ignore any) * - All strokes present are fully visible (i.e. we don't have to ignore any)
*/ */

View File

@@ -84,22 +84,24 @@ void GPU_framebuffer_texture_detach_slot(
GPUFrameBuffer *fb, struct GPUTexture *tex, int type); GPUFrameBuffer *fb, struct GPUTexture *tex, int type);
/** /**
* How to use GPU_framebuffer_ensure_config(). * How to use #GPU_framebuffer_ensure_config().
* *
* Example: * Example:
* \code{.c}
* GPU_framebuffer_ensure_config(&fb, { * GPU_framebuffer_ensure_config(&fb, {
* GPU_ATTACHMENT_TEXTURE(depth), // must be depth buffer * GPU_ATTACHMENT_TEXTURE(depth), // must be depth buffer
* GPU_ATTACHMENT_TEXTURE(tex1), * GPU_ATTACHMENT_TEXTURE(tex1),
* GPU_ATTACHMENT_TEXTURE_CUBEFACE(tex2, 0), * GPU_ATTACHMENT_TEXTURE_CUBEFACE(tex2, 0),
* GPU_ATTACHMENT_TEXTURE_LAYER_MIP(tex2, 0, 0) * GPU_ATTACHMENT_TEXTURE_LAYER_MIP(tex2, 0, 0)
* }) * })
* \encode
* *
* Note : Unspecified attachements (i.e: those beyond the last * \note Unspecified attachements (i.e: those beyond the last
* GPU_ATTACHMENT_* in GPU_framebuffer_ensure_config list) * GPU_ATTACHMENT_* in GPU_framebuffer_ensure_config list) are left unchanged.
* are left unchanged. *
* Note : Make sure that the dimensions of your textures matches * \note Make sure that the dimensions of your textures matches
* otherwise you will have an invalid framebuffer error. * otherwise you will have an invalid framebuffer error.
**/ */
#define GPU_framebuffer_ensure_config(_fb, ...) do { \ #define GPU_framebuffer_ensure_config(_fb, ...) do { \
if (*(_fb) == NULL) { \ if (*(_fb) == NULL) { \
*(_fb) = GPU_framebuffer_create(); \ *(_fb) = GPU_framebuffer_create(); \

View File

@@ -97,7 +97,7 @@ int GPU_vertformat_attr_id_get(const GPUVertFormat *, const char *name);
* IMPORTANT: * IMPORTANT:
* - Call this before creating the vertex buffer and after creating all attributes * - Call this before creating the vertex buffer and after creating all attributes
* - Only first vertex out of 3 has the correct information. Use flat output with GL_FIRST_VERTEX_CONVENTION. * - Only first vertex out of 3 has the correct information. Use flat output with GL_FIRST_VERTEX_CONVENTION.
**/ */
void GPU_vertformat_triple_load(GPUVertFormat *format); void GPU_vertformat_triple_load(GPUVertFormat *format);
/* format conversion */ /* format conversion */

View File

@@ -64,7 +64,7 @@ static char *glsl_material_library = NULL;
* Internal shader cache: This prevent the shader recompilation / stall when * Internal shader cache: This prevent the shader recompilation / stall when
* using undo/redo AND also allows for GPUPass reuse if the Shader code is the * using undo/redo AND also allows for GPUPass reuse if the Shader code is the
* same for 2 different Materials. Unused GPUPasses are free by Garbage collection. * same for 2 different Materials. Unused GPUPasses are free by Garbage collection.
**/ */
/* Only use one linklist that contains the GPUPasses grouped by hash. */ /* Only use one linklist that contains the GPUPasses grouped by hash. */
static GPUPass *pass_cache = NULL; static GPUPass *pass_cache = NULL;

View File

@@ -306,7 +306,7 @@ void GPU_framebuffer_texture_detach(GPUFrameBuffer *fb, GPUTexture *tex)
* Following GPUAttachments are color buffers. * Following GPUAttachments are color buffers.
* Setting GPUAttachment.mip to -1 will leave the texture in this slot. * Setting GPUAttachment.mip to -1 will leave the texture in this slot.
* Setting GPUAttachment.tex to NULL will detach the texture in this slot. * Setting GPUAttachment.tex to NULL will detach the texture in this slot.
**/ */
void GPU_framebuffer_config_array(GPUFrameBuffer *fb, const GPUAttachment *config, int config_len) void GPU_framebuffer_config_array(GPUFrameBuffer *fb, const GPUAttachment *config, int config_len)
{ {
if (config[0].tex) { if (config[0].tex) {
@@ -414,7 +414,7 @@ static void gpu_framebuffer_update_attachments(GPUFrameBuffer *fb)
* Hack to solve the problem of some bugged AMD GPUs (see `GPU_unused_fb_slot_workaround`). * Hack to solve the problem of some bugged AMD GPUs (see `GPU_unused_fb_slot_workaround`).
* If there is an empty color slot between the color slots, * If there is an empty color slot between the color slots,
* all textures after this slot are apparently skipped/discarded. * all textures after this slot are apparently skipped/discarded.
**/ */
static void gpu_framebuffer_update_attachments_and_fill_empty_slots(GPUFrameBuffer *fb) static void gpu_framebuffer_update_attachments_and_fill_empty_slots(GPUFrameBuffer *fb)
{ {
GLenum gl_attachments[GPU_FB_MAX_COLOR_ATTACHMENT]; GLenum gl_attachments[GPU_FB_MAX_COLOR_ATTACHMENT];
@@ -702,7 +702,7 @@ void GPU_framebuffer_blit(
/** /**
* Use this if you need to custom downsample your texture and use the previous mip level as input. * Use this if you need to custom downsample your texture and use the previous mip level as input.
* This function only takes care of the correct texture handling. It execute the callback for each texture level. * This function only takes care of the correct texture handling. It execute the callback for each texture level.
**/ */
void GPU_framebuffer_recursive_downsample( void GPU_framebuffer_recursive_downsample(
GPUFrameBuffer *fb, int max_lvl, GPUFrameBuffer *fb, int max_lvl,
void (*callback)(void *userData, int level), void *userData) void (*callback)(void *userData, int level), void *userData)

View File

@@ -405,9 +405,9 @@ static GLenum gpu_get_gl_internalformat(eGPUTextureFormat format)
case GPU_DEPTH24_STENCIL8: return GL_DEPTH24_STENCIL8; case GPU_DEPTH24_STENCIL8: return GL_DEPTH24_STENCIL8;
case GPU_DEPTH32F_STENCIL8: return GL_DEPTH32F_STENCIL8; case GPU_DEPTH32F_STENCIL8: return GL_DEPTH32F_STENCIL8;
/* Texture only format */ /* Texture only format */
/* ** Add Format here **/ /* ** Add Format here */
/* Special formats texture only */ /* Special formats texture only */
/* ** Add Format here **/ /* ** Add Format here */
/* Depth Formats */ /* Depth Formats */
case GPU_DEPTH_COMPONENT32F: return GL_DEPTH_COMPONENT32F; case GPU_DEPTH_COMPONENT32F: return GL_DEPTH_COMPONENT32F;
case GPU_DEPTH_COMPONENT24: return GL_DEPTH_COMPONENT24; case GPU_DEPTH_COMPONENT24: return GL_DEPTH_COMPONENT24;

View File

@@ -1,7 +1,7 @@
/** /**
* Simple shader that just draw multiple icons at the specified locations * Simple shader that just draw multiple icons at the specified locations
* does not need any vertex input (producing less call to immBegin/End) * does not need any vertex input (producing less call to immBegin/End)
**/ */
/* Same as ICON_DRAW_CACHE_SIZE */ /* Same as ICON_DRAW_CACHE_SIZE */
#define MAX_CALLS 16 #define MAX_CALLS 16

View File

@@ -1,7 +1,7 @@
/** /**
* Simple shader that just draw one icon at the specified location * Simple shader that just draw one icon at the specified location
* does not need any vertex input (producing less call to immBegin/End) * does not need any vertex input (producing less call to immBegin/End)
**/ */
uniform mat4 ModelViewProjectionMatrix; uniform mat4 ModelViewProjectionMatrix;
uniform vec4 rect_icon; uniform vec4 rect_icon;

View File

@@ -1,6 +1,6 @@
/** /**
* 2D Quadratic Bezier thick line drawing * 2D Quadratic Bezier thick line drawing
**/ */
#define MID_VERTEX 57 #define MID_VERTEX 57

View File

@@ -340,8 +340,7 @@ typedef struct PreviewImage {
* *
* The tags represent types! This is a dirty way of enabling RTTI. The * The tags represent types! This is a dirty way of enabling RTTI. The
* sig_byte end endian defines aren't really used much. * sig_byte end endian defines aren't really used much.
* */
**/
#ifdef __BIG_ENDIAN__ #ifdef __BIG_ENDIAN__
/* big endian */ /* big endian */

View File

@@ -277,7 +277,7 @@ typedef struct MDisps {
unsigned int *hidden; unsigned int *hidden;
} MDisps; } MDisps;
/** Multires structs kept for compatibility with old files **/ /** Multires structs kept for compatibility with old files. */
typedef struct MultiresCol { typedef struct MultiresCol {
float a, r, g, b; float a, r, g, b;
} MultiresCol; } MultiresCol;
@@ -326,7 +326,7 @@ typedef struct Multires {
char *edge_creases; char *edge_creases;
} Multires; } Multires;
/** End Multires **/ /* End Multires */
typedef struct MRecast { typedef struct MRecast {
int i; int i;

View File

@@ -1339,7 +1339,7 @@ static void rna_def_library(BlenderRNA *brna)
/** /**
* \attention This is separate from the above. It allows for RNA functions to * \attention This is separate from the above. It allows for RNA functions to
* return an IDProperty *. See MovieClip.metadata for a usage example. * return an IDProperty *. See MovieClip.metadata for a usage example.
**/ */
static void rna_def_idproperty_wrap_ptr(BlenderRNA *brna) static void rna_def_idproperty_wrap_ptr(BlenderRNA *brna)
{ {
StructRNA *srna; StructRNA *srna;

View File

@@ -219,7 +219,6 @@ PointerRNA rna_pointer_inherit_refine(PointerRNA *ptr, StructRNA *type, void *da
} }
} }
/**/
void RNA_pointer_recast(PointerRNA *ptr, PointerRNA *r_ptr) void RNA_pointer_recast(PointerRNA *ptr, PointerRNA *r_ptr)
{ {
#if 0 /* works but this case if covered by more general code below. */ #if 0 /* works but this case if covered by more general code below. */

View File

@@ -920,7 +920,7 @@ static void rna_def_keyblock(BlenderRNA *brna)
/* XXX multi-dim dynamic arrays are very badly supported by (py)rna currently, those are defined for the day /* XXX multi-dim dynamic arrays are very badly supported by (py)rna currently, those are defined for the day
* it works better, for now user will get a 1D tuple... * it works better, for now user will get a 1D tuple...
**/ */
func = RNA_def_function(srna, "normals_vertex_get", "rna_KeyBlock_normals_vert_calc"); func = RNA_def_function(srna, "normals_vertex_get", "rna_KeyBlock_normals_vert_calc");
RNA_def_function_ui_description(func, "Compute local space vertices' normals for this shape key"); RNA_def_function_ui_description(func, "Compute local space vertices' normals for this shape key");
RNA_def_function_flag(func, FUNC_USE_SELF_ID); RNA_def_function_flag(func, FUNC_USE_SELF_ID);

View File

@@ -53,7 +53,6 @@
/* -------------------------------------------------------------------- */ /* -------------------------------------------------------------------- */
/** \name GPUOffScreen Common Utilities /** \name GPUOffScreen Common Utilities
* \{ */ * \{ */

View File

@@ -165,7 +165,7 @@ void WM_init_state_start_with_console_set(bool value)
* scripts) we deferre the ghost initialization the most as possible * scripts) we deferre the ghost initialization the most as possible
* so that it does not break anything that can run in headless mode (as in * so that it does not break anything that can run in headless mode (as in
* without display server attached). * without display server attached).
**/ */
static bool opengl_is_init = false; static bool opengl_is_init = false;
void WM_init_opengl(Main *bmain) void WM_init_opengl(Main *bmain)