Age | Commit message (Collapse) | Author |
|
More cleanups will come to make this more CPP-like.
|
|
draw_cache_extract_mesh for task scheduling. Will be refactored to draw_cache_extract_mesh_scheduling later on after migrating to CPP.
draw_cache_extract_mesh_render_data extraction of mesh render data from edit mesh/mesh into a more generic structure.
draw_cache_extract_mesh_extractors containing all the extractors. This will be split up further into a single file per extractor.
|
|
These identifiers were accidentally removed in rB44d2479dc36f.
|
|
This patch replaces / redoes the entire MeshExtractors system.
Although they were useful and facilitated the addition of new buffers, they made it difficult to control the threads and added a lot of threading overhead.
Part of the problem was in traversing the same loop type in different threads. The concurrent access of the BMesh Elements slowed the reading.
This patch simplifies the use of threads by merging all the old callbacks from the extracts into a single series of iteration functions.
The type of extraction can be chosen using flags.
This optimized the process by around 34%.
Initial idea and implementation By @mano-wii.
Fine-tuning, cleanup by @atmind.
MASTER:
large_mesh_editing:
- rdata 9ms iter 50ms (frame 155ms)
- Average: 6.462874 FPS
PATCH:
large_mesh_editing:
- rdata 9ms iter 34ms (frame 136ms)
- Average: 7.379491 FPS
Differential Revision: https://developer.blender.org/D11425
|
|
does not change.
Reuse loose geometry during selection (and other operations) from
previous calculation. Loose geometry stays the same, but was
recalculated to determine the size of GPU buffers. This patch would
reuse the previous loose geometry when geometry wasn't changed.
Although not the main bottleneck during selection it is measurable.
Master.
`rdata 46ms iter 55ms (frame 410ms)`
This patch.
`rdata 5ms iter 52ms (frame 342ms)`
Reviewed By: mano-wii
Differential Revision: https://developer.blender.org/D11339
|
|
No real functional changes.
This is useful for benchmark cases when `cache->uv_cage` is passed but
has no buffers are requested.
|
|
|
|
|
|
This uses the same logic as drawing UV's,
where non-bmesh defaults to mesh.
|
|
Approximately 91 spelling corrections, almost all in comments.
Differential Revision: https://developer.blender.org/D10288
Reviewed by Harley Acheson
|
|
This is part two of the fix for T84459.
Issue appears to be caused by AMD graphics driver later than 20.11.1 and
affects older GPUs (Polaris/FIJI cards). Drawing normals in edit mode
uses the same OpenGL data type for storing normals that is known to be
faulty.
This change fixes the face dot normals by using GPU_COMP_I16.
|
|
|
|
Issue appears to be caused by AMD graphics driver later than 20.11.1 and
affects older GPUs (Polaris/FIJI cards). Wireframe drawing uses the same
OpenGL data type for storing normals what is known to be faulty.
This patch enabled storing the normals using GPU_COMP_I16. It also
solves the normals drawing in edit mode for vertex and loop normals.
|
|
This change makes it possible for platforms to only support high quality
normal rendering. This is part of {T82856} where current AMD drivers
running on the polaris architecture does not support the low quality
setting due to a driver bug.
In a next commit the work around will be enabled.
|
|
|
|
Issue was that the `tris_per_mat` are not created when the first batch is drawn
during select operator and then is not created when needed by the workbench pass
since they are not tracked by mesh_buffer_cache_create_requested.
This change will create the `tris_per_mat` just in case they are needed later.
Solution by Clément Foucault
Differential Revision: https://developer.blender.org/D9430
|
|
This line was probable left there after a bad merge.
Reviewed By: campbellbarton
Differential Revision: https://developer.blender.org/D9367
|
|
Corrects incorrect usages of the words 'then' and 'than'.
Differential Revision: https://developer.blender.org/D9246
Reviewed by Campbell Barton
|
|
causes a mess with texture slots
Issue caused by {9582797d4b50} in b2.90. The surface per material used
an index buffer owned by the batch. These index buffers are created at
the same time the surface tris index buffer was created. When a material
per batch buffer was invalidated it used the surface tris index buffer
rendering all materials on all surfaces making the last draw command
render succeed.
This patch stores the surface tris per material in the cache so they can
be reused. There is also no need to use the `saved_elem_ranges` anymore as they are
now part of the cache.
The ugly bit of the implementation is that in `extract_tris_finish` the
MeshBufferCache is retrieved. But as this part was already documented as
a hack and it is something that is only used for final meshes. Other
solutions would impact performance or made the fix not condensed
(passing parameters that shouldn't be used).
Reviewed By: Clément Foucault
Differential Revision: https://developer.blender.org/D9136
|
|
For the self overlap result, each intersection pair does not need to
be tested twice.
|
|
This removes the limitation of the sculpt overlays not being visible
with modifiers active.
Reviewed By: fclem
Maniphest Tasks: T68900
Differential Revision: https://developer.blender.org/D8673
|
|
This makes more sense as this module has more to it than just
GL extensions.
|
|
This is just a cleanup to isolate the internals of the vertbuf.
This adds some getters to avoid refactor of existing code.
|
|
|
|
This prevents UV layer mix up in
MeshBatchCache.cd_used/cd_needed/cd_used_over_time which depends on the
extraction method.
One object's mesh can be accessed with MR_EXTRACT_MESH, another object
that uses the same mesh can use MR_EXTRACT_BMESH based on
(Object.mode & OB_MODE_EDIT), this causes a problem as the edit-mesh
and the mesh aren't always in sync, the custom data layers wont
necessarily match up, causing T77359.
Reviewed by @jbakker, @brecht
Ref D8645
|
|
Was noted as a hack, this can be passed as an argument instead.
|
|
|
|
The problem is caused by a lack of prediction in the `isect_line_segment_tri_v3`
that incorrectly confirms some intersections of coplanar segments to the triangle.
The solution is to use another algorithm to detect intersections.
This also resulted in a slight improvement in the performance:
- 1min 17sec to 1min 6sec in my test file
Differential Revision: https://developer.blender.org/D8500
|
|
|
|
This addresses warnings from Clang-Tidy's `readability-else-after-return`
rule in the `source/blender/draw` module. Not all warnings are addressed
in this commit.
No functional changes.
|
|
leads to crash
|
|
When using link duplicated objects it could happen that one object is
calculating the GPUBuffers and the second object is marking these
buffers invalid. This introduces threading issues.
This patch fixes this by combining the surface and surface per material
batches. Most likely the surface per material batches are used and when
requested you will most likely need the surface batch for the depth
tests and overlays.
During tests it slightly improves performance as batches aren't thrown
away without using it.
After this patch we can add a quick path for meshes with one material
and two materials.
Alternative approaches that have been checked:
- sync extraction per object: reduced performance to much (-15%)
({D8292})
- post checks: reduced the threading issues, but didn't solve it.
- separating preparation and execution of the extraction ({D8312})
Reviewed By: Clément Foucault
Differential Revision: https://developer.blender.org/D8329
|
|
Loop over faces and calculate their centers instead of zeroing the
face center array and accumulating all faces vertex corners.
Move subsurf face center extraction into it's own loop since it works
differently.
|
|
This disables all Sculpt Vertex Colors tools, operators, panels and rendering capabilities and puts them under the "Use Sculpt Vertex Colors" experimental option.
Reviewed By: brecht
Differential Revision: https://developer.blender.org/D8239
|
|
Similar track as for normal mesh. Don't store the tangent normals in CustomData
of the mesh, but in an unassociated CustomData instance.
Reviewed By: Clément Foucault
Differential Revision: https://developer.blender.org/D8161
|
|
Change extraction callbacks to take index ranges instead of calling them
for each mesh element (poly, loop, vert & edge).
This gives a minor overall performance gain in my tests, ~5% on average.
Details:
- Use typed parameter structs and macros for looping over elements.
Without this, changes to these callbacks is time consuming as changes
need to be made in many places.
- Avoid iterating over polygon-loops when iterating over polygons
is sufficient.
- Simplify logic to access adjacent loops for faster line extraction.
- Rename 'loop' iterators to 'poly' (as they take polygon ranges)
the iterator callbacks can operator on either polygon or loop data.
- Use term 'last' for the last index (inclusive),
use 'end' when this value (not inclusive).
|
|
Forgot to free the tangent layer for bmesh in the drawing code.
|
|
|
|
Better readability and allows adding new struct members without
adding empty slots to every 'MeshExtract' struct.
|
|
|
|
Gives around ~5% speedup on high poly meshes.
|
|
Sculpt Vertex Colors is a painting system that runs inside sculpt mode, reusing all its tools and optimizations. This provides much better performance, easier to maintain code and more advanced features (new brush engine, filters, symmetry options, masks and face sets compatibility...). This is also the initial step for future features like vertex painting in Multires and brushes that can sculpt and paint at the same time.
This commit includes:
- SCULPT_UNDO_COLOR for undo support in sculpt mode
- SCULPT_UPDATE_COLOR and PBVH flags and rendering
- Sculpt Color API functions
- Sculpt capability for sculpt tools (only enabled in the Paint Brush for now)
- Rendering support in workbench (default to Sculpt Vertex Colors except in Vertex Paint)
- Conversion operator between MPropCol (Sculpt Vertex Colors) and MLoopCol (Vertex Paint)
- Remesher reprojection in the Voxel Remehser
- Paint Brush and Smear Brush with color smoothing in alt-smooth mode
- Parameters for the new brush engine (density, opacity, flow, wet paint mixing, tip scale) implemented in Sculpt Vertex Colors
- Color Filter
- Color picker (uses S shortcut, replaces smooth)
- Color selector in the top bar
Reviewed By: brecht
Maniphest Tasks: T72866
Differential Revision: https://developer.blender.org/D5975
|
|
Tangent normals were temporarily saved in the original given layers but
the typeinfo wasn't updated. This lead to several issues since we
changed the threading of the mesh extraction.
This patch stores the tangent normals in a temporary custom data on the
stack this way the typemap doesn't need to be updated.
Still need to run the tests for an hour to see if it is fixed
Reviewed By: Clément Foucault, Philipp Oeser
Differential Revision: https://developer.blender.org/D8095
|
|
Regression in deaff945d0b9
|
|
Lines loose extraction cannot happen on the fly as the render data isn't
complete. This patch will do the lines loose subbuffer extraction as a
simple task and not on the fly.
This patch introduces 2 sub-types of tasks that are executed single threaded.
`EXTRACT_MESH_EXTRACT` would do the extraction using Mesh/BMesh geometry.
`EXTRACT_LINES_LOOSE` creates the `lines_loose` subbuffer from already cached
`lines` IBO.
Reviewed By: Clément Foucault
Differential Revision: https://developer.blender.org/D7964
|
|
The underlying issue is that the loose edge extraction cannot be
threaded. This patch will extract the loose edges during initialization
of the render mesh data.
When working on this patch the mesh_render_data_update was split into
multiple functions to identify what part was failing. These functions
would also help us with debugging.
Reviewed By: Clément Foucault
Differential Revision: https://developer.blender.org/D7962
|
|
|
|
|
|
Regression from deaff945d0b9, follow logic from d98ae27f02c794a.
|
|
This patch uses a graph flow scheduler for creating all mesh batches.
On a Ryzen 1700 the framerate of Spring/020_02A.anim.blend went from 10 fps to 11.5 fps.
For each mesh where batches needs to be updated a sub-graph will be added to the task_graph.
This sub-graph starts with an extract_render_data_node. This fills/converts the required data
from Mesh.
Small extractions and extractions that can't be multi-threaded are grouped in a single
`extract_single_threaded_task_node`.
Other extractions will create a node for each loop exceeding 4096 items. these nodes are
linked to the `user_data_init_task_node`. the `user_data_init_task_node` prepares the userdata
needed for the extraction based on the data extracted from the mesh.
Note: If the `lines` and `lines_loose` are requested, the `lines_loose` sub-buffer is created
as part of the lines extraction. When the lines_loose is only requested the sub-buffer is
created from the existing `lines` buffer. It is assumed that the lines buffer is always
requested before or together with the lines_loose what is always the case (see
`DRW_batch_requested(cache->batch.loose_edges, GPU_PRIM_LINES)` in `draw_cache_impl_mesh.c`).
Reviewed By: Clément Foucault
Differential Revision: https://developer.blender.org/D7618
|