Fix: Viewer node overlay broken after recent draw extraction fix

The viewer node is not edit mode data, it should be extracted from
a final evaluated mesh (that's just the mechanism that geometry
nodes uses to get the data to the engines. The requests were probably
just added to the bottom by mistake.
This commit is contained in:
Hans Goudey
2024-11-23 16:45:55 -05:00
parent 32b9f50319
commit b5f9db919b

View File

@@ -1574,6 +1574,14 @@ void DRW_mesh_batch_cache_create_requested(TaskGraph &task_graph,
}
drw_add_attributes_vbo(cache.batch.surface, mbuflist, &cache.attr_used);
}
assert_deps_valid(
MBC_VIEWER_ATTRIBUTE_OVERLAY,
{BUFFER_INDEX(ibo.tris), BUFFER_INDEX(vbo.pos), BUFFER_INDEX(vbo.attr_viewer)});
if (DRW_batch_requested(cache.batch.surface_viewer_attribute, GPU_PRIM_TRIS)) {
DRW_ibo_request(cache.batch.surface_viewer_attribute, &mbuflist->ibo.tris);
DRW_vbo_request(cache.batch.surface_viewer_attribute, &mbuflist->vbo.pos);
DRW_vbo_request(cache.batch.surface_viewer_attribute, &mbuflist->vbo.attr_viewer);
}
assert_deps_valid(MBC_ALL_VERTS, {BUFFER_INDEX(vbo.pos), BUFFER_INDEX(vbo.nor)});
if (DRW_batch_requested(cache.batch.all_verts, GPU_PRIM_POINTS)) {
DRW_vbo_request(cache.batch.all_verts, &mbuflist->vbo.pos);
@@ -1927,19 +1935,6 @@ void DRW_mesh_batch_cache_create_requested(TaskGraph &task_graph,
init_empty_dummy_batch(*cache.batch.edituv_fdots);
}
}
assert_deps_valid(
MBC_VIEWER_ATTRIBUTE_OVERLAY,
{BUFFER_INDEX(ibo.tris), BUFFER_INDEX(vbo.pos), BUFFER_INDEX(vbo.attr_viewer)});
if (DRW_batch_requested(cache.batch.surface_viewer_attribute, GPU_PRIM_TRIS)) {
if (edit_mapping_valid) {
DRW_ibo_request(cache.batch.surface_viewer_attribute, &mbuflist->ibo.tris);
DRW_vbo_request(cache.batch.surface_viewer_attribute, &mbuflist->vbo.pos);
DRW_vbo_request(cache.batch.surface_viewer_attribute, &mbuflist->vbo.attr_viewer);
}
else {
init_empty_dummy_batch(*cache.batch.surface_viewer_attribute);
}
}
#ifndef NDEBUG
auto assert_final_deps_valid = [&](const int buffer_index) {