EEVEE-Next: Fix division by zero when copying motion vectors

Due to recent changes geometry without any vertices could lead to
a division by zero when copying motion vectors.

This PR fixes this by skipping the copy step when there are no
vertices to copy.

Pull Request: https://projects.blender.org/blender/blender/pulls/121516
This commit is contained in:
Jeroen Bakker 2024-05-07 15:43:51 +02:00
parent 3dd08beab3
commit 32e6042230

@ -262,7 +262,7 @@ void VelocityModule::geometry_steps_fill()
copy_ps.bind_ssbo("out_buf", *geometry_steps[step_]);
for (VelocityGeometryData &geom : geometry_map.values()) {
if (!geom.pos_buf) {
if (!geom.pos_buf || geom.len == 0) {
continue;
}
const GPUVertFormat *format = GPU_vertbuf_get_format(geom.pos_buf);