Cleanup: Correct comments

This commit is contained in:
Hans Goudey 2022-06-07 11:55:52 +02:00
parent 4637f3e83c
commit 4fc7e1a880
2 changed files with 21 additions and 14 deletions

View File

@ -52,11 +52,14 @@ struct CurvesBatchCache {
GPUBatch *edit_points;
/* To determine if cache is invalid. */
/* Whether the cache is invalid. */
bool is_dirty;
/** Needed when updating material data (e.g. attributes) as the same curves might be used for
* multiple objects with different materials. */
/**
* The draw cache extraction is currently not multi-threaded for multiple objects, but if it was,
* some locking would be necessary because multiple objects can use the same curves data with
* different materials, etc. This is a placeholder to make multi-threading easier in the future.
*/
ThreadMutex render_mutex;
};

View File

@ -35,22 +35,26 @@ typedef struct CurvesEvalFinalCache {
GPUVertBuf *proc_buf;
GPUTexture *proc_tex;
/* Just contains a huge index buffer used to draw the final curves. */
/**Just contains a huge index buffer used to draw the final curves. */
GPUBatch *proc_hairs[MAX_THICKRES];
/* Points per curve, at least 2. */
/** Points per curve, at least 2. */
int strands_res;
/* Attributes currently being or about to be drawn. */
/** Attributes currently being drawn or about to be drawn. */
DRW_Attributes attr_used;
/* Attributes which were used at some point. This is used for garbage collection, to remove
* attributes which are not used in shaders anymore due to user edits. */
/**
* Attributes that were used at some point. This is used for garbage collection, to remove
* attributes that are not used in shaders anymore due to user edits.
*/
DRW_Attributes attr_used_over_time;
/* Last time, in seconds, the `attr_used` and `attr_used_over_time` were exactly the same.
/**
* The last time in seconds that the `attr_used` and `attr_used_over_time` were exactly the same.
* If the delta between this time and the current scene time is greater than the timeout set in
* user preferences (`U.vbotimeout`) then garbage collection is performed. */
* user preferences (`U.vbotimeout`) then garbage collection is performed.
*/
int last_attr_matching_time;
/* Output of the subdivision stage: vertex buffers sized to subdiv level. This is only attributes
@ -61,7 +65,7 @@ typedef struct CurvesEvalFinalCache {
/* Curves procedural display: Evaluation is done on the GPU. */
typedef struct CurvesEvalCache {
/* Input control points */
/* Input control point positions combined with parameter data. */
GPUVertBuf *proc_point_buf;
GPUTexture *point_tex;
@ -78,8 +82,8 @@ typedef struct CurvesEvalCache {
CurvesEvalFinalCache final[MAX_HAIR_SUBDIV];
/* For point attributes, which need subdivision, these are the input data.
* For spline attributes, which need not subdivision, these are the final data. */
/* For point attributes, which need subdivision, these buffers contain the input data.
* For curve domain attributes, which do not need subdivision, these are the final data. */
GPUVertBuf *proc_attributes_buf[GPU_MAX_ATTR];
GPUTexture *proc_attributes_tex[GPU_MAX_ATTR];
@ -89,7 +93,7 @@ typedef struct CurvesEvalCache {
} CurvesEvalCache;
/**
* Ensure all textures and buffers needed for GPU accelerated drawing.
* Ensure all necessary textures and buffers exist for GPU accelerated drawing.
*/
bool curves_ensure_procedural_data(struct Object *object,
struct CurvesEvalCache **r_hair_cache,