From de886884c07f1fcb5ad9473035cc2e471d3b13c8 Mon Sep 17 00:00:00 2001 From: YimingWu Date: Sat, 19 Feb 2022 22:35:22 +0800 Subject: Fix T95470: LineArt GPU subdiv fix. Use evaluated mesh instead of ob->data. Reviewed by: Antonio Vazquez (antoniov) Differential Revision: https://developer.blender.org/D14040 --- source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source') diff --git a/source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c b/source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c index a9ec136831d..19548f6ffa3 100644 --- a/source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c +++ b/source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c @@ -2221,7 +2221,7 @@ static void lineart_main_load_geometries( } if (use_ob->type == OB_MESH) { - use_mesh = use_ob->data; + use_mesh = BKE_object_get_evaluated_mesh(use_ob); } else { /* If DEG_ITER_OBJECT_FLAG_DUPLI is set, some curve objects may also have an evaluated mesh @@ -4469,7 +4469,7 @@ static void lineart_gpencil_generate(LineartCache *cache, if ((match_output || (gpdg = BKE_object_defgroup_name_index(gpencil_object, vgname)) >= 0)) { if (eval_ob && eval_ob->type == OB_MESH) { int dindex = 0; - Mesh *me = (Mesh *)eval_ob->data; + Mesh *me = BKE_object_get_evaluated_mesh(eval_ob); if (me->dvert) { LISTBASE_FOREACH (bDeformGroup *, db, &me->vertex_group_names) { if ((!source_vgname) || strstr(db->name, source_vgname) == db->name) { -- cgit v1.2.3 From 1a0a22f95a22496dec2791441249265d553dc2d7 Mon Sep 17 00:00:00 2001 From: Habib Gahbiche Date: Wed, 9 Feb 2022 20:17:48 +0100 Subject: Fix T95413: Blur node size input crash Bug was introduced in D12167. Reading input size from an input socket is not possible in tiled compositor before execution is initialized. A similar change was done for the base class, see BlurBaseOperation::init_data(). Reviewed by: Jeroen Bakker Differential Revision: https://developer.blender.org/D14067 --- .../operations/COM_GaussianBokehBlurOperation.cc | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) (limited to 'source') diff --git a/source/blender/compositor/operations/COM_GaussianBokehBlurOperation.cc b/source/blender/compositor/operations/COM_GaussianBokehBlurOperation.cc index db5f9c7c35d..49e761d6221 100644 --- a/source/blender/compositor/operations/COM_GaussianBokehBlurOperation.cc +++ b/source/blender/compositor/operations/COM_GaussianBokehBlurOperation.cc @@ -44,8 +44,10 @@ void GaussianBokehBlurOperation::init_data() const float width = this->get_width(); const float height = this->get_height(); - if (!sizeavailable_) { - update_size(); + if(execution_model_ == eExecutionModel::FullFrame) { + if (!sizeavailable_) { + update_size(); + } } radxf_ = size_ * (float)data_.sizex; @@ -111,6 +113,22 @@ void GaussianBokehBlurOperation::update_gauss() void GaussianBokehBlurOperation::execute_pixel(float output[4], int x, int y, void *data) { + float result[4]; + input_size_->read_sampled(result, 0, 0, PixelSampler::Nearest); + size_ = result[0]; + + const float width = this->get_width(); + const float height = this->get_height(); + + radxf_ = size_ * (float)data_.sizex; + CLAMP(radxf_, 0.0f, width / 2.0f); + + radyf_ = size_ * (float)data_.sizey; + CLAMP(radyf_, 0.0f, height / 2.0f); + + radx_ = ceil(radxf_); + rady_ = ceil(radyf_); + float temp_color[4]; temp_color[0] = 0; temp_color[1] = 0; -- cgit v1.2.3