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
2022-02-15Cleanup: unused argument warningsCampbell Barton
2022-02-14Merge remote-tracking branch 'origin/blender-v3.1-release'Kévin Dietrich
2022-02-14Fix T95177: GPU subdiv crashes mirror modifier in edit-modeKévin Dietrich
The issue has two causes: on one hand origin indices were not handled properly, on the other hand the extraction type (Mesh, BMesh, or mapped) was not detected correctly. For the second case reuse the MeshRenderData creation from the coarse code path so that we make the same decisions. Loose geometry extraction had to be updated to properly handle the BMesh cases. For the origin indices, in some cases (for edges and faces), the arrays used by the subdivision code already have the origin indices baked into them, so mapping them a second time through the origin index layer is wrong, and could cause out of bounds accesses. For vertices especially, we would use two arrays: one for mapping subdivision vertices to coarse vertices, and another one to map coarse vertices to subdivision loops used for the selection index buffer. The second one is now removed (which saves a bit of memory) as it is did not have the proper data setup for use with the origin indices and we can easily compute it using the first array anyway.
2022-02-11Merge branch 'blender-v3.1-release'Peter Kim
2022-02-11Fix excessive re-creation of VR viewport texturesPeter Kim
Due to the freeing and re-creation of textures performed when binding offscreen viewports, VR viewport textures would be needlessly re-created every drawing iteration, leading to a negative impact on VR frame rate. This was brought to light by 6738ecb64e8b, which introduced an additional texture clear operation on initialization and was prohibitively costly on some systems when performed every frame. Now, the textures for VR viewports will not be always re-created during offscreen binding, but only when necessary using a pre-drawing step (`wm_xr_session_surface_offscreen_ensure()`). Reviewed By: jbakker, fclem Differential Revision: https://developer.blender.org/D14059
2022-02-11File headers: manually convert files to use SPDX headersCampbell Barton
Also add BSD-2-Clause to SPDX license list.
2022-02-11File headers: add missing copyright, add MIT to SPDX licensesCampbell Barton
2022-02-11File headers: SPDX License migrationCampbell Barton
Use a shorter/simpler license convention, stops the header taking so much space. Follow the SPDX license specification: https://spdx.org/licenses - C/C++/objc/objc++ - Python - Shell Scripts - CMake, GNUmakefile While most of the source tree has been included - `./extern/` was left out. - `./intern/cycles` & `./intern/atomic` are also excluded because they use different header conventions. doc/license/SPDX-license-identifiers.txt has been added to list SPDX all used identifiers. See P2788 for the script that automated these edits. Reviewed By: brecht, mont29, sergey Ref D14069
2022-02-10Merge branch 'blender-v3.1-release'Sergey Sharybin
2022-02-10Fix T95666: Crash when attempting multires linear subdivideSergey Sharybin
The crash was happening when the mesh had loose edges. Loose edges are not part of OpenSubdiv topology and hence should not be communicated to the refiner. Pass ta boolean flag indicating whether an edge is loose or not in the mesh foreach routines, which seems to be the easiest way.
2022-02-07Curves: Rename "Hair" types, variables, and functions to "Curves"Hans Goudey
Based on discussions from T95355 and T94193, the plan is to use the name "Curves" to describe the data-block container for multiple curves. Eventually this will replace the existing "Curve" data-block. However, it will be a while before the curve data-block can be replaced so in order to distinguish the two curve types in the UI, "Hair Curves" will be used, but eventually changed back to "Curves". This patch renames "hair-related" files, functions, types, and variable names to this convention. A deep rename is preferred to keep code consistent and to avoid any "hair" terminology from leaking, since the new data-block is meant for all curve types, not just hair use cases. The downside of this naming is that the difference between "Curve" and "Curves" has become important. That was considered during design discussons and deemed acceptable, especially given the non-permanent nature of the somewhat common conflict. Some points of interest: - All DNA compatibility is lost, just like rBf59767ff9729. - I renamed `ID_HA` to `ID_CV` so there is no complete mismatch. - `hair_curves` is used where necessary to distinguish from the existing "curves" plural. - I didn't rename any of the cycles/rendering code function names, since that is also used by the old hair particle system. Differential Revision: https://developer.blender.org/D14007
2022-02-06DRW: Add preprocessor error if including common_view_lib.glsl without draw_viewClément Foucault
This avoid making include mistake and potentially detect areas that do not really need common_view_lib.glsl.
2022-02-06GPU: move gpu_shader_shared_utils.h to the public section of the moduleClément Foucault
This is then easier to include in other modules.
2022-02-05DRW: Fix memory leak in UniformArrayBufferClément Foucault
2022-02-04DRW: Fix a commentClément Foucault
2022-02-04DRW: Add DRW_UNUSED_RESOURCE_TRACKING for ubo and ssboClément Foucault
When uncommented, this option will make any call binding a resource that is not present in the shader produce a warning message with its origin.
2022-02-04DRW: Add compute_ref calls, barriers calls, and vertex_buffer_refClément Foucault
- Compute ref let the size of dispatch be modified just before drawing. - Barrier call makes it possible to chain multiple compute passes in one pass. - DRW_shgroup_vertex_buffer_ref is the analog of DRW_shgroup_uniform_block_ref.
2022-02-04DRW: Fix bug in cubemap creation in draw::TextureClément Foucault
The order of if clause made impossible to create a cubemap.
2022-02-04Attributes: Infrastructure for generic 8-bit integer data typeHans Goudey
This commit adds infrastructure for 8 bit signed integer attributes. This can be useful given the discussion in T94193, where we want to store spline type, Bezier handle type, and other small enums as attributes. This is only exposed in the interface in the attribute lists, so it shouldn't be an option in geometry nodes, at least for now. I expect that this type won't be used directly very often, it should mostly be cast to an enum type. However, with support for 8 bit integers, it also makes sense to add things like mixing implementations for consistency. Differential Revision: https://developer.blender.org/D13721
2022-02-03Curves: Changes to the new curves data-blockHans Goudey
This patch refactors the "Hair" data-block, which will soon be renamed to "Curves". The larger change is switching from an array of `HairCurve` to find indices in the points array to simply storing an array of offsets. Using a single integer instead of two halves the amount of memory for that particular array. Besides that, there are some other changes in this patch: - Split the data-structure to a separate `CurveGeometry` DNA struct so it is usable for grease pencil too. - Update naming to be more aligned with newer code and the style guide. - Add direct access to some arrays in RNA -- Radius is now retrieved as a regular attribute in Cycles. -- `HairPoint` has been renamed to `CurvePoint` -- `HairCurve` has been renamed to `CurveSlice` - Add comments to the struct in DNA. The next steps are renaming `Hair` -> `Curves`, and adding support for other curve types: Bezier, Poly, and NURBS. Ref T95355 Differential Revision: https://developer.blender.org/D13987
2022-02-02Cleanup: spelling in commentsCampbell Barton
2022-02-01GPUShader: Rename createInfo storage QualifiersClément Foucault
Using opt-in instead of opt-out to make code easier to read. Add combined flag enum. Making restrict an inverse flag option because it is so rare to use it.
2022-02-01Merge branch 'blender-v3.1-release'Jacques Lucke
2022-02-01Silence draw manager warning.Jeroen Bakker
This message isn't useful for users so silenced it.
2022-02-01Cleanup: Remove unused datatoc definitions.Jeroen Bakker
2022-02-01Merge branch 'blender-v3.1-release'Sergey Sharybin
2022-02-01Fix T95376: Fix crash when switching to UV workspace.Jeroen Bakker
Can also happen in other places when the overlay engine is active. Some parts of the overlay engine uses builtin shaders, but disable the color space conversion to the target texture. Currently there the overlay engine has its own set of libraries it could include and defined a macro to pass-throught the color space conversion. The library include mechanism currently fails when it couldn't find the builtin library in the libraries of the overlay engine. This only happened in debug mode. This change will not fail, but warns the developer if a library could not be included. In the future this should be replaced by a different mechanism that can disable the builtin library. See {T95382}.
2022-01-31Cleanup: use our own conventions for tags in commentsCampbell Barton
2022-01-28Cleanup: spelling in commentsCampbell Barton
Also minor wording improvements.
2022-01-27DRW: Fix some issues with DRW_gpu_wrapper.hhClément Foucault
- Fix assert on size. - Fix void * casting. - Pass extent by values. - Add swap function to avoid letting the types copyable. - Add back the GPUTexture * operator on TextureFromPool.
2022-01-27DRW: Fix DRW_gpu_wrapper.hhClément Foucault
The UBYTE datatype is not supported by the clear fallback. Also fix vector types headers.
2022-01-27Cleanup: Fix const correctness warningClément Foucault
2022-01-27Cleanup: Add more const correctness to some functionsClément Foucault
These are functions that are used by eevee-rewrite which has more strict const correctness.
2022-01-27GPUShaderCreateInfo: Remove push_constant indexingClément Foucault
This is too much impractical and offers no real benefit.
2022-01-26DRW: Fix builtin uniform name mismatchClément Foucault
This lead to severe unreported regression, like volume rendering broken in workbench.
2022-01-26D13910: Workbench: Port shaders to use GPUShaderCreateInfoClément Foucault
Also adds a few things to GPUShader for easily create shaders. Heavy usage of macros to compose the createInfo and avoid duplications and copy paste bugs. This makes the link between the shader request functions (in workbench_shader.cc) and the actual createInfo a bit obscure since the names are composed and not searchable. Reviewed By: jbakker Differential Revision: https://developer.blender.org/D13910
2022-01-25Cycles: add Point Info nodeBrecht Van Lommel
With (center) position, radius and random value outputs. Eevee does not yet support rendering point clouds, but an untested implementation of this node was added for when it does. Ref T92573
2022-01-25Draw: Migrate hair refine compute shader to use create info.Jeroen Bakker
This patch migrates the draw manager hair refine compute shader to use GPUShaderCreateInfo. Reviewed By: fclem Differential Revision: https://developer.blender.org/D13915
2022-01-25Fix depsgraphs sharing IDs via evaluated edit meshSergey Sharybin
The evaluated mesh is a result of evaluated modifiers, and referencing other evaluated IDs such as materials. It can not be stored in the EditMesh structure which is intended to be re-used by many areas. Such sharing was causing ownership errors causing bugs like T93855: Cycles crash with edit mode and simultaneous viewport and final render The proposed solution is to store the evaluated edit mesh and its cage in the object's runtime field. The motivation goes as following: - It allows to avoid ownership problems like the ones in the linked report. - Object level is chosen over mesh level is because the evaluated mesh is affected by modifiers, which are on the object level. This patch allows to have modifier stack of an object which shares mesh with an object which is in edit mode to be properly taken into account (before the change the modifier stack from the active object will be used for all objects which share the mesh). There is a change in the way how copy-on-write is handled in the edit mode to allow proper state update when changing active scene (or having two windows with different scenes). Previously, the copt-on-write would have been ignored by skipping tagging CoW component. Now it is ignored from within the CoW operation callback. This allows to update edit pointers for objects which are not from the current depsgraph and where the edit_mesh was never assigned in the case when the depsgraph was evaluated prior the active depsgraph. There is no user level changes changes expected with the CoW handling changes: should not affect on neither performance, nor memory consumption. Tested scenarios: - Various modifiers configurations of objects sharing mesh and be part of the same scene. - Steps from the reports: T93855, T82952, T77359 This also fixes T76609, T72733 and perhaps other reports. Differential Revision: https://developer.blender.org/D13824
2022-01-24Add workaround for broken interface query functions on Intel HD Graphics ↵Clment Foucault
4400 and 4600 Fixes T93680 For current drivers of Intel HD Graphics 4400 and 4600, various Program Introspection functions appear broken and return incorrect values, causing crashes in the current handling of SSBOs. Disable use of this feature on those devices. Add checks to features that use SSBOs (Hair and Subdivision Modifier). Reviewed By: fclem, jbakker Maniphest Tasks: T93680 Differential Revision: https://developer.blender.org/D13806
2022-01-24GPU subdiv: reduce memory usage for point IBOKévin Dietrich
The point IBO should only have data for coarse vertices (or in general, the vertices in the original mesh). As it used for displaying the vertices for selection in edit mode, and as it indexes into the VBOs for the positions and edit data, it is itself only indexed by coarse/ original vertex index. For the subdivision case, this would allocate space for the final subdivision vertex and reallocate to make room for loose geometry, although only the first coarse vertex count amount of data would be. Now just allocate for the required memory. Also reuse index buffer APIs instead of doing manual work.
2022-01-24GPU subdiv: fix unitialized dataKévin Dietrich
2022-01-24Cleanup: sort struct forward declarationsCampbell Barton
2022-01-24Cleanup: spelling in commentsCampbell Barton
2022-01-20Subdivision: add support for vertex creasingKévin Dietrich
This adds vertex creasing support for OpenSubDiv for modeling, rendering, Alembic and USD I/O. For modeling, vertex creasing follows the edge creasing implementation with an operator accessible through the Vertex menu in Edit Mode, and some parameter in the properties panel. The option in the Subsurf and Multires to use edge creasing also affects vertex creasing. The vertex crease data is stored as a CustomData layer, unlike edge creases which for now are stored in `MEdge`, but will in the future also be moved to a `CustomData` layer. See comments for details on the difference in behavior for the `CD_CREASE` layer between egdes and vertices. For Cycles this adds sockets on the Mesh node to hold data about which vertices are creased (one socket for the indices, one for the weigths). Viewport rendering of vertex creasing reuses the same color scheme as for edges and creased vertices are drawn bigger than uncreased vertices. For Alembic and USD, vertex crease support follows the edge crease implementation, they are always read, but only exported if a `Subsurf` modifier is present on the Mesh. Reviewed By: brecht, fclem, sergey, sybren, campbellbarton Differential Revision: https://developer.blender.org/D10145
2022-01-17Revert "Revert "GPUShaderCreateInfo for interface abstraction""Jeroen Bakker
This reverts commit edee5a947b7ea3e1324aa334a22c7c9bbf47f5f7. Fixes compilation error (Missing file BLI_float2.hh)
2022-01-17Revert "GPUShaderCreateInfo for interface abstraction"Jeroen Bakker
This reverts commit 8fb2ff458ba579dba08bfdf57d043ad158b5db07. Missing some files.
2022-01-17GPUShaderCreateInfo for interface abstractionJeroen Bakker
This is a first part of the Shader Create Info system could be. A shader create info provides a way to define shader structure, resources and interfaces. This makes for a quick way to provide backend agnostic binding informations while also making shader variations easy to declare. - Clear source input (only one file). Cleans up the GPU api since we can create a shader from one descriptor - Resources and interfaces are generated by the backend (much simpler than parsing). - Bindings are explicit from position in the array. - GPUShaderInterface becomes a trivial translation of enums and string copy. - No external dependency to third party lib. - Cleaner code, less fragmentation of resources in several libs. - Easy to modify / extend at runtime. - no parser involve, very easy to code. - Does not hold any data, can be static and kept on disc. - Could hold precompiled bytecode for static shaders. This also includes a new global dependency system. GLSL shaders can include other sources by using #pragma BLENDER_REQUIRE(...). This patch already migrated several builtin shaders. Other shaders should be migrated one at a time, and could be done inside master. There is a new compile directive `WITH_GPU_SHADER_BUILDER` this is an optional directive for linting shaders to increase turn around time. What is remaining: - pyGPU API {T94975} - Migration of other shaders. This could be a community effort. Reviewed By: jbakker Maniphest Tasks: T94975 Differential Revision: https://developer.blender.org/D13360
2022-01-16Fix T94865: GPU subdiv crash switching to texpaint areaKévin Dietrich
The crash is due to the fact that GPU subdivision extraction routines for edit data (including UVs) only worked for BMesh. However, a Mesh based version is still needed for texture painting. This adds the missing components. This also ensures all data are properly initialized (at least the ones revealed by the bug).
2022-01-16Cleanup: deduplicate GPU subdiv data extraction loopsKévin Dietrich
This puts the loop over the final subdivision quads outside of the mesh iteration callback. This can also allow for easier parallel execution in the future if need be.