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
AgeCommit message (Collapse)Author
2021-07-03Cleanup: consistent use of tags: NOTE/TODO/FIXME/XXXCampbell Barton
Also use doxy style function reference `#` prefix chars when referencing identifiers.
2021-07-02Cleanup: Use const variables for object's evaluated meshHans Goudey
Generally the evaluated mesh should not be changed, since that is the job of the modifier stack. Current code is far from const correct in that regard. This commit uses a const variable for the reult of `BKE_object_get_evaluated_mesh` in some cases. The most common remaining case is retrieving a BVH tree from the mesh.
2021-07-02Cleanup: compiler & clang-tidy warningsCampbell Barton
2021-07-02Cleanup: Clang tidy, remove typedefHans Goudey
2021-07-01Cleanup: Separate each extractor into specific compile unitsGermano Cavalcante
Makes code cleaner and easier to find.
2021-06-28Draw: make 'ibo.lines_loose' extracting saferGermano Cavalcante
No functional changes.
2021-06-28Cleanup: remove unused macro parametersGermano Cavalcante
2021-06-28Cleanup GPU/Draw test cases.Jeroen Bakker
In preparation of supporting vulkan. Draw/GPU tests should use GPU_TEST or DRAW_TEST macros. These macros will run the test on available drawing context backends like OpenGL or Vulkan. As in master there is only an OpenGL backend nothing changed.
2021-06-28Cleanup: repeated terms in code comments & error messagesCampbell Barton
2021-06-26Cleanup: full sentences in comments, improve comment formattingCampbell Barton
2021-06-24Cleanup: move and simplify some draw_cache macrosGermano Cavalcante
2021-06-24Cleanup: comment blocks, trailing space in commentsCampbell Barton
2021-06-22Cleanup: Spelling MistakesLeon Zandman
This patch fixes many minor spelling mistakes, all in comments or console output. Mostly contractions like can't, won't, don't, its/it's, etc. Differential Revision: https://developer.blender.org/D11663 Reviewed by Harley Acheson
2021-06-22Fix T89360: Eevee transforms geometry when using "High Quality Normals"Germano Cavalcante
Offset missed in rB44d2479dc36f
2021-06-22Draw: Added testcases for hair refine shaders.Jeroen Bakker
2021-06-21Cleanup: swap top/bottom args to planes_from_projmatCampbell Barton
X & Z were ordered min/max, where as Y was max/min.
2021-06-20Docs: add additional notes on tessellation, update commentsCampbell Barton
2021-06-20Mesh: optimize object mode face tessellationCampbell Barton
- Multi-thread BKE_mesh_recalc_looptri. - Add BKE_mesh_recalc_looptri_with_normals, this skips having to calculate normals for ngons. Exact performance depends on number of faces, size of ngons and available CPU cores. For high poly meshes the isolated improvement to BKE_mesh_recalc_looptri in my tests was between 6.7x .. 25.0x, with the largest gains seen in meshes containing ngons with many sides. The overall speedup for high poly meshes containing quads and triangles is only ~20% although ngon heavy meshes can be much faster.
2021-06-18Armature: add automatic B-Bone Scale toggles.Alexander Gavrilov
Currently B-Bone scaling can only be controlled via their properties, thus requiring up to 8 drivers per joint between B-Bones to transfer scaling factors from the handle bone. A Scale Easing option is added to multiply the easing value by the Y scale channels to synchronize them - this produces a natural scaling effect where both the shape of the curve and the scale is affected. In addition, four toggles are added for each handle, which multiply each of the X, Y, Z and Ease values by the matching Local Scale channel of the handle bone, thus replacing trivial drivers. The Scale Easing option has no effect on this process since it's easy to just enable both Length and Ease buttons. Differential Revision: https://developer.blender.org/D9870
2021-06-18Armature: add B-Bone Y scale channel and extra flag fields to DNA.Alexander Gavrilov
In addition to the base bone transformation itself, B-Bones have controls that affect transformation of its segments. For rotation the features are quite complete, allowing to both reorient the Bezier handles via properties, and to control them using custom handle bones. However for scaling there are two deficiencies. First, there are only X and Y scale factors (actually X and Z), while lengthwise all segments have the same scaling. The ease option merely affects the shape of the curve, and does not cause actual scaling. Second, scaling can only be controlled via properties, thus requiring up to 6 drivers per joint between B-Bones to transfer scaling factors from the handle bone. This is very inefficient. Finally, the Z channels are confusingly called Y. This commit adds a B-Bone Y Scale channel and extra B-Bone flag fields to DNA with appropriate versioning (including for F-Curves and drivers) in preparation to addressing these limitations. Functionality is not changed, so the new fields are not used until the following commits. Differential Revision: https://developer.blender.org/D9870
2021-06-18DrawManager: Multithreaded counting of material buckets.Jeroen Bakker
When having multiple materials in a mesh the triangles are sorted based on material index. This sorting is done single threaded, but needs two loops over the data. One to count the bucket size and the second one to add the triangles to the right position in the buckets. This patch will do the counting in a multithreaded approach that would speed up the cache creation. It has been measured that this part is the most blocking part of the cache creation. Reviewed By: mano-wii Differential Revision: https://developer.blender.org/D11615
2021-06-18Fix T89240: Crash when moving vertices on a linked duplicateGermano Cavalcante
There is an attempt to free an illegal pointer in `extract_edge_fac_finish`.
2021-06-18Cleanup: clang formatJacques Lucke
2021-06-18Cleanup: clang-tidyCampbell Barton
2021-06-16Cleanup: reduce warnings when compiling release builds.Jeroen Bakker
2021-06-15DRW: sanitize 'DRW_mesh_batch_cache_dirty_tag'Germano Cavalcante
Create maps that specify which batches have vbo or ibo as a reference and use these maps to discard batches along with buffers. Differential Revision: https://developer.blender.org/D11588
2021-06-15Draw Cache: avoid recalculating 'poly_normals'Germano Cavalcante
Call `BKE_mesh_ensure_normals_for_display` to avoid recalculating poly_normals. **Benchmark** ||master:|PATCH: |---|---|---| |looptris_test:|Average: 3.995076 FPS|Average: 4.047470 FPS ||rdata 11ms iter 91ms (frame 235ms)|rdata 11ms iter 86ms (frame 233ms) |subdiv_mesh_cage_and_final:|Average: 1.884492 FPS|Average: 1.900114 FPS ||rdata 7ms iter 42ms (frame 268ms)|rdata 7ms iter 39ms (frame 265ms) ||rdata 7ms iter 44ms (frame 259ms)|rdata 7ms iter 42ms (frame 257ms) |subdiv_mesh_final_only:|Average: 6.245944 FPS|Average: 6.289000 FPS ||rdata 3ms iter 23ms (frame 153ms)|rdata 3ms iter 21ms (frame 154ms) |subdiv_mesh_final_only_ledge:|Average: 6.263482 FPS|Average: 6.187218 FPS ||rdata 3ms iter 23ms (frame 156ms)|rdata 3ms iter 22ms (frame 154ms) Reviewed By: jbakker Differential Revision: https://developer.blender.org/D11527
2021-06-15DrawManager: Cache material offsets.Jeroen Bakker
When using multiple materials in a single mesh the most time is spend in counting the offsets of each material for the sorting. This patch moves the counting of the offsets to render mesh data and caches it as long as the geometry doesn't change. This patch doesn't include multithreading of this code. Reviewed By: mano-wii Differential Revision: https://developer.blender.org/D11612
2021-06-15Cleanup: Added hierarchy in MeshBufferExtractionCache.Jeroen Bakker
2021-06-15Cleanup: Split mesh_render_data_loose_geom into multiple functions.Jeroen Bakker
2021-06-15Cleanup: correct incomplete commentCampbell Barton
2021-06-13Cleanup: redundant initializationCampbell Barton
These were limited to obvious cases. Some less obvious cases were kept as refactoring might make them necessary in future.
2021-06-12Fix missing directory in CMakeLists.txtGermano Cavalcante
2021-06-11Overlays: Make flash on mode transfer an operator propertyPablo Dobarro
This moves the flash on mode transfer effect option from the overlays to an operator property of the mode transfer operator. - This effect is intended to show the target object when no overlays or a minimal set of overlays is enabled. Making it part of the whole set of overlays invalidates this use case. - The effect is not intended to be configurable per viewport, it should be a global option. The effect is still implemented using the overlay engine (instead of a draw modal callback) due to performance and drawing artifacts. Having it implemented as an overlay with runtime timer data in the objects makes also possible to run multiple animations at the same time without any visual glitches. Reviewed By: campbellbarton, JulienKaspar Differential Revision: https://developer.blender.org/D11519
2021-06-11Refactor: use 'BLI_task_parallel_range' in Draw CacheGermano Cavalcante
One drawback to trying to predict the number of threads that will be used in the `task_graph` is that we are only sure of the number when the threads are running. Using `BLI_task_parallel_range` allows the driver to choose the best thread distribution through `parallel_reduce`. The benefit is most evident on hardware with fewer cores. This is the result on an 4-core laptop: ||before:|after: |---|---|---| |large_mesh_editing:|Average: 5.203638 FPS|Average: 5.398925 FPS ||rdata 15ms iter 43ms (frame 193ms)|rdata 14ms iter 36ms (frame 187ms) Differential Revision: https://developer.blender.org/D11558
2021-06-11Refactor: Draw Cache: use 'BLI_task_parallel_range'Germano Cavalcante
This is an adaptation of {D11488}. A disadvantage of manually setting the iter ranges per thread is that we don't know how many threads are running in the background and so we don't know how to best distribute the ranges. To solve this limitation we can use `parallel_reduce` and thus let the driver choose the best distribution of ranges among the threads. This proved to be especially beneficial for computers with few cores. **Benchmarking:** Here's the result on an 4-core laptop: ||master:|PATCH: |---|---|---| |large_mesh_editing:|Average: 5.203638 FPS|Average: 5.398925 FPS ||rdata 15ms iter 43ms (frame 193ms)|rdata 14ms iter 36ms (frame 187ms) Here's the result on an 8-core PC: ||master:|PATCH: |---|---|---| |large_mesh_editing:|Average: 15.267482 FPS|Average: 15.906881 FPS ||rdata 9ms iter 28ms (frame 65ms)|rdata 9ms iter 25ms (frame 63ms) |large_mesh_editing_ledge: |Average: 15.145966 FPS|Average: 15.520474 FPS ||rdata 9ms iter 29ms (frame 65ms)|rdata 9ms iter 25ms (frame 64ms) |looptris_test:|Average: 4.001917 FPS|Average: 4.061105 FPS ||rdata 12ms iter 90ms (frame 236ms)|rdata 12ms iter 87ms (frame 230ms) |subdiv_mesh_cage_and_final:|Average: 1.917769 FPS|Average: 1.971790 FPS ||rdata 7ms iter 37ms (frame 261ms)|rdata 7ms iter 31ms (frame 258ms) ||rdata 7ms iter 38ms (frame 252ms)|rdata 7ms iter 33ms (frame 249ms) |subdiv_mesh_final_only:|Average: 6.387240 FPS|Average: 6.591251 FPS ||rdata 3ms iter 25ms (frame 151ms)|rdata 3ms iter 16ms (frame 145ms) |subdiv_mesh_final_only_ledge:|Average: 6.247393 FPS|Average: 6.596024 FPS ||rdata 3ms iter 26ms (frame 158ms)|rdata 3ms iter 16ms (frame 148ms) **Notes:** - The improvement can only be noticed if all extracts are multithreaded. - This patch touches different areas of the code, so it can be split into another patch if the idea is accepted. These screenshots show how threads behave in a quadcore: Master: {F10164664} Patch: {F10164666} Differential Revision: https://developer.blender.org/D11558
2021-06-09Cleanup: spelling in commentsCampbell Barton
2021-06-09Cleanup: Removed unused definition.Jeroen Bakker
2021-06-09T88352: Use threaded ibo.tris extraction for single material meshes.Jeroen Bakker
This patch adds a specific extraction method when the mesh has only one material. This method is multi-threaded. There is a trade-off in this patch as the ibo isn't compressed (it adds restart indexes for hidden faces). So it depends if threading is faster than the additional GPU buffer upload. # Subdivided cube I used a cube subdivided 7 times, modifiers applied. that gives around 400000 faces. The test is selecting some vertices and move them. During this test the next buffers are updated on each frame: * vbo.pos_nor * vbo.lnor * vbo.edit_data * ibo.tris * ibo.points System info: |platform| Linux-5.11.0-7614-generic-x86_64-with-glibc2.33| | renderer| AMD SIENNA_CICHLID (DRM 3.40.0, 5.11.0-7614-generic, LLVM 11.0.1)| |vendor| AMD| |version| 4.6 (Core Profile) Mesa 21.0.1| |cpu| Intel(R) Core(TM) i7-6700 CPU @ 3.40GHz| |compiler| gcc version 10.3.0| Timing have been measured using DEBUG_TIME in `draw_cache_extract_mesh`. master: `rdata 8ms iter 45ms (frame 153ms)` this patch `rdata 6ms iter 36ms (frame 132ms)` Reviewed By: mano-wii Maniphest Tasks: T88352 Differential Revision: https://developer.blender.org/D11290
2021-06-09Draw Cache: use threading for Mesh extract linesGermano Cavalcante
This is an optimization, but the difference is still not that significant as some extractions are still done in single thread. **Benchmarking** ||before:|after: |---|---|---| |large_mesh_editing:|Average: 14.246502 FPS|Average: 15.438118 FPS ||rdata 9ms iter 31ms (frame 69ms)|rdata 9ms iter 27ms (frame 65ms) |large_mesh_editing_ledge: |Average: 14.913622 FPS|Average: 15.856538 FPS ||rdata 9ms iter 30ms (frame 67ms)|rdata 9ms iter 26ms (frame 63ms) |looptris_test:|Average: 3.970774 FPS|Average: 4.095200 FPS ||rdata 11ms iter 90ms (frame 235ms)|rdata 12ms iter 87ms (frame 229ms) Reviewed By: jbakker Differential Revision: https://developer.blender.org/D11467
2021-06-08GPU: Thread safe index buffer builders.Jeroen Bakker
Current index builder is designed to be used in a single thread. This makes all index buffer extractions single threaded. This patch adds a thread safe solution enabling multithreaded building of index buffers. To reduce locking the solution would provide a task/thread local index buffer builder (called sub builder). When a thread is finished this thread local index buffer builder can be joined with the initial index buffer builder. `GPU_indexbuf_subbuilder_init`: Initialized a sub builder. The index list is shared between the parent and sub buffer, but the counters are localized. Ensuring that updating counters would not need any locking. `GPU_indexbuf_subbuilder_finish`: merge the information of the sub builder back to the parent builder. Needs to be invoked outside the worker thread, or when sure that all worker threads have been finished. Internal the function is not thread safe. For testing purposes the extract_points extractor has been migrated to the new API. Herefore changes to the mesh extractor were needed. * When creating tasks, the task number of current task is stored in ExtractTaskData including the total number of tasks. * Adding two functions in `MeshExtract`. ** `task_init` will initialize the task specific userdata. ** `task_finish` should merge back the task specific userdata back. * adding task_id parameter to the iteration functions so they can access the correct task data without any need for locking. There is no noticeable change in end user performance. Reviewed By: mano-wii Differential Revision: https://developer.blender.org/D11499
2021-06-08Revert "Cleanup: use cpp new/delete."Jeroen Bakker
This reverts commit 43464c94f4def8689dd99a9e459f5ff77420d27b.
2021-06-08Cleanup: replace NULL with nullptr.Jeroen Bakker
2021-06-08Cleanup: use cpp new/delete.Jeroen Bakker
2021-06-08Cleanup: replace typedef structs with structs.Jeroen Bakker
2021-06-08Cleanup: Separate compile unit edituv.Jeroen Bakker
2021-06-08Cleanup: Separate compile unit lines_adjacency.Jeroen Bakker
2021-06-08Cleanup: Separate compile unit lines_paint_mask.Jeroen Bakker
2021-06-08Cleanup: Separate fdots extraction in own compile unit.Jeroen Bakker
2021-06-07Cleanup: Move extract lines to compile unit.Jeroen Bakker