Cleanup: Remove unused variables, adjust comments

This commit is contained in:
Hans Goudey 2022-04-22 11:48:38 -05:00
parent 58be9708bf
commit 7f726b48ac
2 changed files with 10 additions and 18 deletions

View File

@ -92,11 +92,6 @@ static void curves_batch_cache_clear_data(CurvesEvalCache &curves_cache)
GPU_BATCH_DISCARD_SAFE(curves_cache.final[i].proc_hairs[j]);
}
}
/* "Normal" legacy hairs */
GPU_BATCH_DISCARD_SAFE(curves_cache.hairs);
GPU_VERTBUF_DISCARD_SAFE(curves_cache.pos);
GPU_INDEXBUF_DISCARD_SAFE(curves_cache.indices);
}
static void curves_batch_cache_clear(Curves &curves)
@ -148,8 +143,7 @@ void DRW_curves_batch_cache_free(Curves *curves)
static void ensure_seg_pt_count(const Curves &curves, CurvesEvalCache &curves_cache)
{
if ((curves_cache.pos != nullptr && curves_cache.indices != nullptr) ||
(curves_cache.proc_point_buf != nullptr)) {
if (curves_cache.proc_point_buf != nullptr) {
return;
}

View File

@ -26,30 +26,28 @@ struct GPUBatch;
struct GPUTexture;
typedef struct CurvesEvalFinalCache {
/* Output of the subdivision stage: vertex buff sized to subdiv level. */
/* Output of the subdivision stage: vertex buffer sized to subdiv level. */
GPUVertBuf *proc_buf;
GPUTexture *proc_tex;
/* Just contains a huge index buffer used to draw the final hair. */
/* Just contains a huge index buffer used to draw the final curves. */
GPUBatch *proc_hairs[MAX_THICKRES];
int strands_res; /* points per hair, at least 2 */
/* Points per curve, at least 2. */
int strands_res;
} CurvesEvalFinalCache;
/* Curves procedural display: Evaluation is done on the GPU. */
typedef struct CurvesEvalCache {
GPUVertBuf *pos;
GPUIndexBuf *indices;
GPUBatch *hairs;
/* Hair Procedural display: Interpolation is done on the GPU. */
GPUVertBuf *proc_point_buf; /* Input control points */
/* Input control points */
GPUVertBuf *proc_point_buf;
GPUTexture *point_tex;
/** Infos of control points strands (segment count and base index) */
/** Info of control points strands (segment count and base index) */
GPUVertBuf *proc_strand_buf;
GPUTexture *strand_tex;
/* Hair Length */
/* Curve length data. */
GPUVertBuf *proc_length_buf;
GPUTexture *length_tex;