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
2020-12-23Fix T84063: crash reading pointer properties in Attribute shader nodeBrecht Van Lommel
Path resolving can find e.g. a datablock rather than a float or integer, treat that as a failure to find a valid property.
2020-12-14Fix missing string escape for RNA path creationCampbell Barton
2020-11-04Fix for previous cleanup commitHans Goudey
2020-11-04Cleanup: Clang tidyHans Goudey
2020-11-03Materials: add custom object properties as uniform attributes.Alexander Gavrilov
This patch allows the user to type a property name into the Attribute node, which will then output the value of the property for each individual object, allowing to e.g. customize shaders by object without duplicating the shader. In order to make supporting this easier for Eevee, it is necessary to explicitly choose whether the attribute is varying or uniform via a dropdown option of the Attribute node. The dropdown also allows choosing whether instancing should be taken into account. The Cycles design treats all attributes as one common namespace, so the Blender interface converts the enum to a name prefix that can't be entered using keyboard. In Eevee, the attributes are provided to the shader via a UBO indexed with resource_id, similar to the existing Object Info data. Unlike it, however, it is necessary to maintain a separate buffer for every requested combination of attributes. This is done using a hash table with the attribute set as the key, as it is expected that technically different but similar materials may use the same set of attributes. In addition, in order to minimize wasted memory, a sparse UBO pool is implemented, so that chunks that don't contain any data don't have to be allocated. The back-end Cycles code is already refactored and committed by Brecht. Differential Revision: https://developer.blender.org/D2057
2020-10-19Spelling: Loose Versus LoseHarley Acheson
Corrects incorrect usages of the word 'loose' when 'lose' was required. Differential Revision: https://developer.blender.org/D9243 Reviewed by Campbell Barton
2020-10-19Spelling: It's Versus ItsHarley Acheson
Corrects incorrect usage of contraction for 'it is', when possessive 'its' was required. Differential Revision: https://developer.blender.org/D9250 Reviewed by Campbell Barton
2020-09-07Cleanup: spellingCampbell Barton
Also correct wrapped lines of example code in threads.cc.
2020-09-06Cleanup: GPUVertBuf: Replace GPU_vertbuf_create by GPU_vertbuf_callocClément Foucault
This is a simple cleanup to make naming consistent with the rest of the module.
2020-09-06GPUVertBuf: Make GPUVertBuf private to the GPU moduleClément Foucault
This is just a cleanup to isolate the internals of the vertbuf. This adds some getters to avoid refactor of existing code.
2020-08-31Cleanup: GPU: Remove unused attr_binding and primitive codeClément Foucault
2020-08-13GPUBatch: Move allocator to backendClément Foucault
2020-08-13GPUBatch: Merge phase and ownership flags and cleanup there usageClément Foucault
Also add new flags to communicate specific behavior to future backend.
2020-08-13DRW: InstanceData: Remove hacks of batch freeing callbackClément Foucault
We instead use a handle reference counter on the GPUVertBufs used by the instancing batches. This make sure that if an update happens on the GPUVertBuf used to contruct the batch, they will never have the same memory address than the previously allocated ones (since they are still pending deletion thanks to the refcounter). This avoid the linear search to update the GPUBatch in the case a batch is deleted (which was even a bad option since they could be only cleared)
2020-08-13GPUBatch: Remove usage of gl_prim_type outside of GPU moduleClément Foucault
2020-08-08GPUBatch: Use custom allocatorClément Foucault
This is needed for the new GPU abstraction.
2020-08-08DRW: Instance Data: Replace GPUBatch bulk allocation by separate allocClément Foucault
This is suboptimal but needed for the new GPU abstraction. Maybe a better solution will be needed if performance is impacted.
2020-03-19Cleanup: `make format` after SortedIncludes changeDalai Felinto
2019-12-02Overlay Engine: Refactor & CleanupClément Foucault
This is the unification of all overlays into one overlay engine as described in T65347. I went over all the code making it more future proof with less hacks and removing old / not relevent parts. Goals / Acheivements: - Remove internal shader usage (only drw shaders) - Remove viewportSize and viewportSizeInv and put them in gloabl ubo - Fixed some drawing issues: Missing probe option and Missing Alt+B clipping of some shader - Remove old (legacy) shaders dependancy (not using view UBO). - Less shader variation (less compilation time at first load and less patching needed for vulkan) - removed some geom shaders when I could - Remove static e_data (except shaders storage where it is OK) - Clear the way to fix some anoying limitations (dithered transparency, background image compositing etc...) - Wireframe drawing now uses the same batching capabilities as workbench & eevee (indirect drawing). - Reduced complexity, removed ~3000 Lines of code in draw (also removed a lot of unused shader in GPU). - Post AA to avoid complexity and cost of MSAA. Remaining issues: - ~~Armature edits, overlay toggles, (... others?) are not refreshing viewport after AA is complete~~ - FXAA is not the best for wires, maybe investigate SMAA - Maybe do something more temporally stable for AA. - ~~Paint overlays are not working with AA.~~ - ~~infront objects are difficult to select.~~ - ~~the infront wires sometimes goes through they solid counterpart (missing clear maybe?) (toggle overlays on-off when using infront+wireframe overlay in solid shading)~~ Note: I made some decision to change slightly the appearance of some objects to simplify their drawing. Namely the empty arrows end (which is now hollow/wire) and distance points of the cameras/spots being done by lines. Reviewed By: jbakker Differential Revision: https://developer.blender.org/D6296
2019-09-17DRW: Refactor to support draw call batchingClément Foucault
Reviewers: brecht Differential Revision: D4997
2019-09-14Revert "DRW: Refactor to support draw call batching"Clément Foucault
This reverts commit ce34a6b0d727bbde6ae373afa8ec6c42bc8980ce.
2019-09-13DRW: Refactor to support draw call batchingClément Foucault
Reviewers: brecht Differential Revision: D4997
2019-09-07Cleanup: use post increment/decrementCampbell Barton
When the result isn't used, prefer post increment/decrement (already used nearly everywhere in Blender).
2019-08-17Cleanup: correct commentsCampbell Barton
2019-07-15Fix T66707 Modifying bone's 'Custom Object' reference shape causes blender ↵Clément Foucault
to crash This was caused by an instancing batch not being initialized correctly.
2019-06-13Fix T65669 Bones in Envelope Display break apart after selecting boneClément Foucault
This was because the VAOs were not updated if an instance batch was reusing a VBO containing instances attributes which was reinitialized. Now we ensure the Batch will reconfigure the VAOs if the VBO is 0.
2019-05-22BLI_memblock: Refactor for faster iteration and allocationClément Foucault
Remove the clear allocation flag as it has little impact since there should be very few allocation per redraw. Make BLI_memblock_alloc and BLI_memblock_iterstep much more cache efficient removing them almost entirely from performance profiles.
2019-05-14DRW: Refactor: Use DRWCall to accumulate per instance attributesClément Foucault
This is a big change that cleanup a lot of confusing code. - The instancing/batching data buffer distribution in draw_instance_data.c. - The selection & drawing code in draw_manager_exec.c - Prety much every non-meshes object drawing (object_mode.c). Most of the changes are just renaming but there still a chance a typo might have sneek through. The Batching/Instancing Shading groups are replace by DRWCallBuffers. This is cleaner and conceptually more in line with what a DRWShadingGroup should be. There is still some little confusion in draw_common.c where some function takes shgroup as input and some don't.
2019-05-01Cleanup: comments (long lines) in drawCampbell Barton
2019-04-17ClangFormat: apply to source, most of internCampbell Barton
Apply clang format as proposed in T53211. For details on usage and instructions for migrating branches without conflicts, see: https://wiki.blender.org/wiki/Tools/ClangFormat
2019-03-19Cleanup: comment blocksCampbell Barton
2019-02-18doxygen: add newline after \fileCampbell Barton
While \file doesn't need an argument, it can't have another doxy command after it.
2019-02-06Cleanup: remove redundant doxygen \file argumentCampbell Barton
Move \ingroup onto same line to be more compact and make it clear the file is in the group.
2019-02-01Cleanup: remove redundant, invalid info from headersCampbell Barton
BF-admins agree to remove header information that isn't useful, to reduce noise. - BEGIN/END license blocks Developers should add non license comments as separate comment blocks. No need for separator text. - Contributors This is often invalid, outdated or misleading especially when splitting files. It's more useful to git-blame to find out who has developed the code. See P901 for script to perform these edits.
2019-01-29Cleanup: replace attrib w/ attrCampbell Barton
Also rename GPUVertexAttribs to GPUVertAttrLayers, avoids confusion with GPUVertAttr which isn't closely related.
2019-01-26Cleanup: blank lines over doxy headersCampbell Barton
2019-01-24Cleanup: add missing braces to draw managerCampbell Barton
2019-01-23Cleanup: add BEGIN/END to GPL headersCampbell Barton
2018-12-18DRW: Instance: Makes it possible to have instances of a non-init batchClément Foucault
2018-09-19Merge branch 'master' into blender2.8Brecht Van Lommel
2018-07-18GWN: Port to GPU module: Replace GWN prefix by GPUClément Foucault
2018-07-08Cleanup: rename 'ct' to 'len' for gawainCampbell Barton
2018-07-08Cleanup: rename 'ct' to 'len' for size varsCampbell Barton
2018-05-30DRW: Instance Data: Replace with static allocation that can be referenced.Clément Foucault
This mean you can store data used for drawing inside the object engine data. Also fixes T55243 Crash in ASAN debug builds due to use-after-free memory in draw code - instances issue?
2018-05-11Cleanup: use 'uint' in draw managerCampbell Barton
2018-04-19Cleanup: styleCampbell Barton
2018-03-17GWN: Vertex Buffer refactor.Clément Foucault
We now alloc a vbo id on creation and let OpenGL manage its memory directly. We use glMapBuffer to get this memory location. This enables us to reuse and modify any vertex buffer directly without destroying it with its associated Batches. This commit does not really improve performance but will let us implement more optimizations in the future. We can also resize the buffer even if this can be slow if we need to keep the existing data. The addition of the usage hint makes dynamic buffers not a special case anymore, simplifying things a bit.
2018-02-22DRW: Fix T54135 : Crash caused by wrongly iterating over ListBase.Clément Foucault
2018-02-21Gawain: Refactor: VAOs caching AND use new VAOs manager.Clément Foucault
A major bottleneck of current implementation is the call to create_bindings() for basically every drawcalls. This is due to the VAO being tagged dirty when assigning a new shader to the Batch, defeating the purpose of the Batch (reuse it for drawing). Since managing hundreds of batches in DrawManager and DrawCache seems not fun enough to me, I prefered rewritting the batches itself. --- Batch changes --- For this to happen I needed to change the Instancing to be part of the Batch rather than being another batch supplied at drawtime. The Gwn_VertBuffers are copied from the batch to be instanciated and a new Gwn_VertBuffer is supplied for instancing attribs. This mean a VAO can be generated and cached for this instancing case. A Batch can be rendered with instancing, without instancing attribs and without the need for a new VAO using the GWN_batch_draw_range_ex with the force_instance parameter set to true. --- Draw manager changes --- The downside with this approach is that we must track the validity of the instanced batch (the original one). For this the only way (I could think of) is to set a callback for when the batch is getting free. This means a bit of refactor in the DrawManager with the separation of batching and instancing Batches. --- VAO cache --- Each VAO is generated for a given ShaderInterface. This means we can keep it alive as long as the shader interface lives. If a ShaderInterface is discarded, it needs to destroy every VAO associated to it. Otherwise, a new ShaderInterface with the same adress could be generated and reuse the same VAO with incorrect bindings. The VAO cache itself is using a mix between a static array of VAO and a dynamic array if the is not enough space in the static. Using this hybrid approach is a bit more performant than the dynamic array alone. The array will not resize down but empty entries will be filled up again. It's unlikely we get a buffer overflow from this. Resizing could be done on next allocation if needed. --- Results --- Using Cached VAOs means that we are not querying each vertex attrib for each vbo for each drawcall, every redraw! In a CPU limited test scene (10000 cubes in Clay engine) I get a reduction of CPU drawing time from ~20ms to 13ms. The only area that is not caching VAOs is the instancing from particles (see comment DRW_shgroup_instance_batch).
2018-02-14DRW: Add instance buffer manager.Clément Foucault
This manager allows to distribute existing batches for instancing attributes. This reduce the number of batches creation. Querying a batch is done with a vertex format. This format should be static so that it's pointer never changes (because we are using this pointer as identifier [we don't want to check the full format that would be too slow]). This might make the original Instance Data manager useless but it's currently used by DRW_object_engine_data_ensure().