From 5ee72e812c0bb670397a51e2668fbe01de365ee8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Foucault?= Date: Fri, 2 Feb 2024 19:34:58 +0100 Subject: [PATCH] Fix: DRW: Missing pointcloud dummy binding Fixes a GPU error on opengl. --- source/blender/draw/intern/draw_pointcloud.cc | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/source/blender/draw/intern/draw_pointcloud.cc b/source/blender/draw/intern/draw_pointcloud.cc index 4d6e2566042..911e9c1a9a3 100644 --- a/source/blender/draw/intern/draw_pointcloud.cc +++ b/source/blender/draw/intern/draw_pointcloud.cc @@ -123,13 +123,12 @@ GPUBatch *point_cloud_sub_pass_setup_implementation(PassT &sub_ps, if (gpu_material != nullptr) { ListBase gpu_attrs = GPU_material_attributes(gpu_material); LISTBASE_FOREACH (GPUMaterialAttribute *, gpu_attr, &gpu_attrs) { + char sampler_name[32]; + /** NOTE: Reusing curve attribute function. */ + drw_curves_get_attribute_sampler_name(gpu_attr->name, sampler_name); + GPUVertBuf **attribute_buf = DRW_pointcloud_evaluated_attribute(&pointcloud, gpu_attr->name); - if (attribute_buf) { - char sampler_name[32]; - /** NOTE: Reusing curve attribute function. */ - drw_curves_get_attribute_sampler_name(gpu_attr->name, sampler_name); - sub_ps.bind_texture(sampler_name, attribute_buf); - } + sub_ps.bind_texture(sampler_name, (attribute_buf) ? attribute_buf : &g_dummy_vbo); } }