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:
authorKévin Dietrich <kevin.dietrich@mailoo.org>2022-01-06 18:23:37 +0300
committerKévin Dietrich <kevin.dietrich@mailoo.org>2022-01-06 18:25:09 +0300
commit0c6b29ee4378043493d1027e587a91a1e286dbb7 (patch)
tree373c5df4c7431f6f4a4541f8a51c5facac3db26c /source/blender/draw/intern/mesh_extractors/extract_mesh_ibo_lines_adjacency.cc
parentc2089ae53ca36e83181573752eb7dd622494b63f (diff)
Fix T94672: incorrect Workbench shadows with GPU subdivision
The `lines_adjacency` IBO build in the GPU subdivision case was missing edges at the boundaries of open meshes. As it is used for the shadow pass, the shadows were then not clipped properly. This would also make X-Ray mode render differently in those cases. To fix this, we can simply reuse the buffer finalization routine from the non-subdivision case, as such edges are handled there.
Diffstat (limited to 'source/blender/draw/intern/mesh_extractors/extract_mesh_ibo_lines_adjacency.cc')
-rw-r--r--source/blender/draw/intern/mesh_extractors/extract_mesh_ibo_lines_adjacency.cc8
1 files changed, 3 insertions, 5 deletions
diff --git a/source/blender/draw/intern/mesh_extractors/extract_mesh_ibo_lines_adjacency.cc b/source/blender/draw/intern/mesh_extractors/extract_mesh_ibo_lines_adjacency.cc
index dc3b170ddc2..f125593cff2 100644
--- a/source/blender/draw/intern/mesh_extractors/extract_mesh_ibo_lines_adjacency.cc
+++ b/source/blender/draw/intern/mesh_extractors/extract_mesh_ibo_lines_adjacency.cc
@@ -220,14 +220,12 @@ static void extract_lines_adjacency_iter_subdiv(const DRWSubdivCache *subdiv_cac
}
static void extract_lines_adjacency_finish_subdiv(const DRWSubdivCache *UNUSED(subdiv_cache),
+ const MeshRenderData *mr,
+ struct MeshBatchCache *cache,
void *buf,
void *_data)
{
- GPUIndexBuf *ibo = static_cast<GPUIndexBuf *>(buf);
- MeshExtract_LineAdjacency_Data *data = static_cast<MeshExtract_LineAdjacency_Data *>(_data);
- GPU_indexbuf_build_in_place(&data->elb, ibo);
- BLI_edgehash_free(data->eh, nullptr);
- MEM_freeN(data->vert_to_loop);
+ extract_lines_adjacency_finish(mr, cache, buf, _data);
}
#undef NO_EDGE