Commit: 47912ef922651697013f1d0db31884d83b667b2b
Author: Lukas Toenne
Date:   Sun Jul 15 09:12:33 2018 +0100
Branches: tmp_hair_curves
https://developer.blender.org/rB47912ef922651697013f1d0db31884d83b667b2b

Rename proc_buf to proc_point_buf to make it consistent with the main control 
point buffer.

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

M       source/blender/draw/intern/draw_cache_impl_hair.c
M       source/blender/draw/intern/draw_cache_impl_particles.c
M       source/blender/draw/intern/draw_hair.c
M       source/blender/draw/intern/draw_hair_private.h

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

diff --git a/source/blender/draw/intern/draw_cache_impl_hair.c 
b/source/blender/draw/intern/draw_cache_impl_hair.c
index 0ee12d31ff2..df8f39745c5 100644
--- a/source/blender/draw/intern/draw_cache_impl_hair.c
+++ b/source/blender/draw/intern/draw_cache_impl_hair.c
@@ -417,16 +417,16 @@ static void 
hair_batch_cache_ensure_procedural_final_points(
        Gwn_VertFormat format = { 0 };
        GWN_vertformat_attr_add(&format, "pos", GWN_COMP_F32, 4, 
GWN_FETCH_FLOAT);
 
-       cache->final[subdiv].proc_buf = GWN_vertbuf_create_with_format(&format);
+       cache->final[subdiv].proc_point_buf = 
GWN_vertbuf_create_with_format(&format);
 
        /* Create a destination buffer for the tranform feedback. Sized 
appropriately */
        /* Thoses are points! not line segments. */
-    GWN_vertbuf_data_alloc(cache->final[subdiv].proc_buf, 
cache->final[subdiv].strands_res * cache->strands_len);
+    GWN_vertbuf_data_alloc(cache->final[subdiv].proc_point_buf, 
cache->final[subdiv].strands_res * cache->strands_len);
 
        /* Create vbo immediatly to bind to texture buffer. */
-       GWN_vertbuf_use(cache->final[subdiv].proc_buf);
+       GWN_vertbuf_use(cache->final[subdiv].proc_point_buf);
 
-       cache->final[subdiv].proc_tex = 
GPU_texture_create_from_vertbuf(cache->final[subdiv].proc_buf);
+       cache->final[subdiv].proc_tex = 
GPU_texture_create_from_vertbuf(cache->final[subdiv].proc_point_buf);
 }
 
 static int hair_batch_cache_fill_segments_indices(
@@ -519,7 +519,7 @@ bool hair_ensure_procedural_data(
        }
 
        /* Refreshed only on subdiv count change. */
-       if (cache->hair.final[subdiv].proc_buf == NULL) {
+       if (cache->hair.final[subdiv].proc_point_buf == NULL) {
                hair_batch_cache_ensure_procedural_final_points(&cache->hair, 
subdiv);
                need_ft_update = true;
        }
diff --git a/source/blender/draw/intern/draw_cache_impl_particles.c 
b/source/blender/draw/intern/draw_cache_impl_particles.c
index 56464b008ed..7181e36c4bf 100644
--- a/source/blender/draw/intern/draw_cache_impl_particles.c
+++ b/source/blender/draw/intern/draw_cache_impl_particles.c
@@ -726,16 +726,16 @@ static void 
particle_batch_cache_ensure_procedural_final_points(
        Gwn_VertFormat format = { 0 };
        GWN_vertformat_attr_add(&format, "pos", GWN_COMP_F32, 4, 
GWN_FETCH_FLOAT);
 
-       cache->final[subdiv].proc_buf = GWN_vertbuf_create_with_format(&format);
+       cache->final[subdiv].proc_point_buf = 
GWN_vertbuf_create_with_format(&format);
 
        /* Create a destination buffer for the tranform feedback. Sized 
appropriately */
        /* Thoses are points! not line segments. */
-       GWN_vertbuf_data_alloc(cache->final[subdiv].proc_buf, 
cache->final[subdiv].strands_res * cache->strands_len);
+       GWN_vertbuf_data_alloc(cache->final[subdiv].proc_point_buf, 
cache->final[subdiv].strands_res * cache->strands_len);
 
        /* Create vbo immediatly to bind to texture buffer. */
-       GWN_vertbuf_use(cache->final[subdiv].proc_buf);
+       GWN_vertbuf_use(cache->final[subdiv].proc_point_buf);
 
-       cache->final[subdiv].proc_tex = 
GPU_texture_create_from_vertbuf(cache->final[subdiv].proc_buf);
+       cache->final[subdiv].proc_tex = 
GPU_texture_create_from_vertbuf(cache->final[subdiv].proc_point_buf);
 }
 
 static void particle_batch_cache_ensure_procedural_strand_data(
@@ -1543,7 +1543,7 @@ bool particles_ensure_procedural_data(
        }
 
        /* Refreshed only on subdiv count change. */
-       if ((*r_hair_cache)->final[subdiv].proc_buf == NULL) {
+       if ((*r_hair_cache)->final[subdiv].proc_point_buf == NULL) {
                
particle_batch_cache_ensure_procedural_final_points(&cache->hair, subdiv);
                need_ft_update = true;
        }
diff --git a/source/blender/draw/intern/draw_hair.c 
b/source/blender/draw/intern/draw_hair.c
index 649226cc4a0..f7531ea0d3b 100644
--- a/source/blender/draw/intern/draw_hair.c
+++ b/source/blender/draw/intern/draw_hair.c
@@ -105,7 +105,7 @@ void particle_batch_cache_clear_hair(ParticleHairCache 
*hair_cache)
                DRW_TEXTURE_FREE_SAFE(hair_cache->col_tex[i]);
        }
        for (int i = 0; i < MAX_HAIR_SUBDIV; ++i) {
-               GWN_VERTBUF_DISCARD_SAFE(hair_cache->final[i].proc_buf);
+               GWN_VERTBUF_DISCARD_SAFE(hair_cache->final[i].proc_point_buf);
                DRW_TEXTURE_FREE_SAFE(hair_cache->final[i].proc_tex);
                for (int j = 0; j < MAX_THICKRES; ++j) {
                        
GWN_BATCH_DISCARD_SAFE(hair_cache->final[i].proc_hairs[j]);
@@ -173,7 +173,7 @@ static DRWShadingGroup 
*drw_shgroup_create_particle_hair_procedural_ex(
                int final_points_len = hair_cache->final[subdiv].strands_res * 
hair_cache->strands_len;
                GPUShader *tf_shader = 
hair_refine_shader_get(PART_REFINE_CATMULL_ROM);
                DRWShadingGroup *tf_shgrp = 
DRW_shgroup_transform_feedback_create(tf_shader, g_tf_pass,
-                                                                               
  hair_cache->final[subdiv].proc_buf);
+                                                                               
  hair_cache->final[subdiv].proc_point_buf);
                DRW_shgroup_uniform_texture(tf_shgrp, "hairPointBuffer", 
hair_cache->point_tex);
                DRW_shgroup_uniform_texture(tf_shgrp, "hairStrandBuffer", 
hair_cache->strand_tex);
                DRW_shgroup_uniform_int(tf_shgrp, "hairStrandsRes", 
&hair_cache->final[subdiv].strands_res, 1);
@@ -250,10 +250,10 @@ static DRWShadingGroup 
*drw_shgroup_create_hair_procedural_ex(
 
        /* Transform Feedback subdiv. */
        if (need_ft_update) {
-        int final_points_ct = hair_cache->final[subdiv].strands_res * 
hair_cache->strands_len;
+               int final_points_ct = hair_cache->final[subdiv].strands_res * 
hair_cache->strands_len;
                GPUShader *tf_shader = 
hair_refine_shader_get(PART_REFINE_CATMULL_ROM);
                DRWShadingGroup *tf_shgrp = 
DRW_shgroup_transform_feedback_create(tf_shader, g_tf_pass,
-                                                                               
  hair_cache->final[subdiv].proc_buf);
+                                                                               
  hair_cache->final[subdiv].proc_point_buf);
                DRW_shgroup_uniform_texture(tf_shgrp, "hairPointBuffer", 
hair_cache->point_tex);
                DRW_shgroup_uniform_texture(tf_shgrp, "hairStrandBuffer", 
hair_cache->strand_tex);
                DRW_shgroup_uniform_int(tf_shgrp, "hairStrandsRes", 
&hair_cache->final[subdiv].strands_res, 1);
diff --git a/source/blender/draw/intern/draw_hair_private.h 
b/source/blender/draw/intern/draw_hair_private.h
index 07bcce602a2..c31a071dd3b 100644
--- a/source/blender/draw/intern/draw_hair_private.h
+++ b/source/blender/draw/intern/draw_hair_private.h
@@ -43,7 +43,7 @@ struct HairSystem;
 
 typedef struct ParticleHairFinalCache {
        /* Output of the subdivision stage: vertex buff sized to subdiv level. 
*/
-       Gwn_VertBuf *proc_buf;
+       Gwn_VertBuf *proc_point_buf;
        GPUTexture *proc_tex;
 
         /* Just contains a huge index buffer used to draw the final hair. */

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to