Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClément Foucault <foucault.clem@gmail.com>2019-03-19 16:25:32 +0300
committerClément Foucault <foucault.clem@gmail.com>2019-03-19 16:26:30 +0300
commite72dc667c4d3ef0b4a4c306dd6b12cae9d37287b (patch)
treeae19d0d25bf0ee2a42c27facaefbe261c8e97342 /source/blender/draw/intern/draw_cache_impl_particles.c
parent58e27cca97c4dc348949c2df8138ba08b17743fc (diff)
Fix T61475 Particle edit does not render children if path step > 7
Gives 2 more bits to the segment count. Also subtract 1 because segment count cannot be negative.
Diffstat (limited to 'source/blender/draw/intern/draw_cache_impl_particles.c')
-rw-r--r--source/blender/draw/intern/draw_cache_impl_particles.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/source/blender/draw/intern/draw_cache_impl_particles.c b/source/blender/draw/intern/draw_cache_impl_particles.c
index 6790a8aa0cc..2c940f9bab8 100644
--- a/source/blender/draw/intern/draw_cache_impl_particles.c
+++ b/source/blender/draw/intern/draw_cache_impl_particles.c
@@ -793,8 +793,12 @@ static int particle_batch_cache_fill_strands_data(
continue;
}
+ /* XXX: We might need something more robust.
+ * Adjust shader code accordingly. (see unpack_strand_data() ) */
+ BLI_assert((path->segments - 1) <= 0x3FF);
+
uint *seg_data = (uint *)GPU_vertbuf_raw_step(data_step);
- *seg_data = (curr_point & 0xFFFFFF) | (path->segments << 24);
+ *seg_data = (curr_point & 0x3FFFFF) | ((path->segments - 1) << 22);
curr_point += path->segments + 1;
if (psmd != NULL) {