[Bf-blender-cvs] [7f726b48ace] master: Cleanup: Remove unused variables, adjust comments

Hans Goudey noreply at git.blender.org
Fri Apr 22 18:49:27 CEST 2022


Commit: 7f726b48ace40a90b707bc5c68bf7e3f5477f21b
Author: Hans Goudey
Date:   Fri Apr 22 11:48:38 2022 -0500
Branches: master
https://developer.blender.org/rB7f726b48ace40a90b707bc5c68bf7e3f5477f21b

Cleanup: Remove unused variables, adjust comments

===================================================================

M	source/blender/draw/intern/draw_cache_impl_curves.cc
M	source/blender/draw/intern/draw_curves_private.h

===================================================================

diff --git a/source/blender/draw/intern/draw_cache_impl_curves.cc b/source/blender/draw/intern/draw_cache_impl_curves.cc
index f2e747cb276..f2742f3bcc7 100644
--- a/source/blender/draw/intern/draw_cache_impl_curves.cc
+++ b/source/blender/draw/intern/draw_cache_impl_curves.cc
@@ -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;
   }
 
diff --git a/source/blender/draw/intern/draw_curves_private.h b/source/blender/draw/intern/draw_curves_private.h
index f92e051daca..76d5f15319d 100644
--- a/source/blender/draw/intern/draw_curves_private.h
+++ b/source/blender/draw/intern/draw_curves_private.h
@@ -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;



More information about the Bf-blender-cvs mailing list