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-08-11Mesh: Move hide flags to generic attributesHans Goudey
This commit moves the hide status of mesh vertices, edges, and faces from the `ME_FLAG` to optional generic boolean attributes. Storing this data as generic attributes can significantly simplify and improve code, as described in T95965. The attributes are called `.hide_vert`, `.hide_edge`, and `.hide_poly`, using the attribute name semantics discussed in T97452. The `.` prefix means they are "UI attributes", so they still contain original data edited by users, but they aren't meant to be accessed procedurally by the user in arbitrary situations. They are also be hidden in the spreadsheet and the attribute list by default, Until 4.0, the attributes are still written to and read from the mesh in the old way, so neither forward nor backward compatibility are affected. This means memory requirements will be increased by one byte per element when the hide status is used. When the flags are removed completely, requirements will decrease when hiding is unused. Further notes: * Some code can be further simplified to skip some processing when the hide attributes don't exist. * The data is still stored in flags for `BMesh`, necessitating some complexity in the conversion to and from `Mesh`. * Access to the "hide" property of mesh elements in RNA is slower. The separate boolean arrays should be used where possible. Ref T95965 Differential Revision: https://developer.blender.org/D14685
2022-08-10Cleanup: spellingCampbell Barton
2022-08-09DRW: DebugDraw: Port module to C++ and add GPU capabilitiesClément Foucault
This is a complete rewrite of the draw debug drawing module in C++. It uses `GPUStorageBuf` to store the data to be drawn and use indirect drawing. This makes it easier to do a mirror API for GPU shaders. The C++ API class is exposed through `draw_debug.hh` and should be used when possible in new code. However, the debug drawing will not work for platform not yet supporting `GPUStorageBuf`. Also keep in mind that this module must only be used in debug build for performance and compatibility reasons.
2022-08-08Fix T100285: Shader value node always outputs zeroOmar Emara
The shader value node always outputs zero in some cases even when its value is not zero. This is caused by b639e6086445f20d428df1f471c73922bbd54b67. In that commit, the behavior of GPU node linking changed such that unlinked sockets get their value from their associated GPU node stack instead of the socket itself. But execution node stacks do not always have their output values initialized, and since the value node stores its value in its output, it follows that its uniform value will be wrong. This patch fixes that by getting the value directly from the socket. This is also done fro the RGBA node, since it is implemented similarly. Finally, the GPU_uniformbuf_link_out function was removed since it is no longer used and does not make sense anymore. Differential Revision: https://developer.blender.org/D15641 Reviewed By: Clement
2022-08-04Cleanup: spelling, code-blocksCampbell Barton
2022-08-03Fix compile issue in recent commit.Jeroen Bakker
fallthrough in case statement.
2022-08-03Image: Display GPU layout in `uiTemplateImageInfo`Angus Stanton
Add IMB_gpu_get_texture_format and GPU_texture_format_description to retrieve and 'stringify' an eGPUTextureFormat. These are then used in the image info panel used in several areas across blender. New Information: {F13330937} Reviewed By: jbakker Maniphest Tasks: T99998 Differential Revision: https://developer.blender.org/D15575
2022-08-02GPUBatch: Add GPU_batch_draw_indirectClément Foucault
This allows rendering a batch with parameters computed by the GPU. Contains GL backend implementation.
2022-08-02Cleanup: Simplify arguments to sculpt draw functionsHans Goudey
Instead of passing pointers to specific mesh data, rely on retrieving that data from the mesh internally. This makes it easier to support retrieving additional data from Mesh (like active attribute names in D15101 or D15169). It also makes the functions simpler conceptually, because they're drawing a mesh with an acceleration strcture on top. The BKE_id_attribute_copy_domains_temp call was unnecessary because the GPU_pbvh_mesh_buffers_update function was only called when Mesh/PBVH_FACES is used in the first place. Differential Revision: https://developer.blender.org/D15197
2022-08-01Merge branch 'blender-v3.3-release'Jeroen Bakker
2022-08-01Eevee: Add support of rendering curves with cryptomatte.Jeroen Bakker
There were 2 errors. 1. hair code was used to draw curves 2. vertex shader wasn't aware of curves and failed to compile.
2022-07-29Realtime Compositor: Add needed GPU module changesOmar Emara
This patch implements the necessary changes to the GPU module that are needed by the realtime compositor. A new function GPU_material_from_callbacks was added to construct a GPU material from a number of callbacks. A callback to construct the material graph by adding and linking the necessary GPU material nodes. And the existing code generator callback. This essentially allows the construction of GPU materials independent of node trees and without the need to do any node tree localization. A new composite source output to the code generator was added. This output contains the serialization of nodes that are tagged with GPU_NODE_TAG_COMPOSITOR, which are the nodes linked to the newly added composite output links. Two new GPU uniform setters were added for int2 and matrix3 types. Shader create info now supports generated compute sources. Shaders starting with gpu_shader_compositor are now considered part of the shader library. Additionally, two fixes were implemented. First, GPU setter node de-duplication now appropriately increments the reference count of the references resources. Second, unlinked sockets now get their value from their associated GPU node stack instead of the socket itself. Differential Revision: https://developer.blender.org/D14690 Reviewed By: Clement
2022-07-26Refactor: Extract color attributes as generic attributesHans Goudey
Previously there was a special extraction process for "vertex colors" that copied the color data to the GPU with a special format. Instead, this patch replaces this with use of the generic attribute extraction. This reduces the number of code paths, allowing easier optimization in the future. To make it possible to use the generic extraction system for attributes but also assign aliases for use by shaders, some changes are necessary. First, the GPU material attribute can now store whether it actually refers to the default color attribute, rather than a specific name. This replaces the hack to use `CD_MCOL` in the color attribute shader node. Second, the extraction code checks the names against the default and active names and assigns aliases if the request corresponds to a special active attribute. Finally, support for byte color attributes was added to the generic attribute extraction. Differential Revision: https://developer.blender.org/D15205
2022-07-21GPU: Fix compilation with WITH_GPU_BUILDTIME_SHADER_BUILDER optionClément Foucault
2022-07-16Fix error in assertion after 92a99c14965905e73f049bc1f92b597a903977fcCampbell Barton
2022-07-15Fix Eevee backround render crash after recent changes from D15463Brecht Van Lommel
Backend initialization needs to be delayed until after the OpenGL context is created. This worked fine in foreground mode because the OpenGL context already exists for the window at the point GPU_backend_init_once was called, but not for background mode. Create the backend just in time in GPU_context_create as before, and automatically free it when the last context id discarded. But check if any GPU backend is supported before creating the OpenGL context. Ref D15463, D15465
2022-07-15Fix compiler error in debug builds after 1cf465bbc331Julian Eisel
2022-07-15Fix GPU backend deleting resources without an active contextBrecht Van Lommel
This causes an assert with libepoxy, but was wrong already regardless. Refactor logic to work as follows: * GPU_exit() deletes backend resources * Destroy UI GPU resources with the context active * Call GPU_backend_exit() after deleting the context Ref D15291 Differential Revision: https://developer.blender.org/D15465
2022-07-15Fix T99706: Crash rendering with headless buildsCampbell Barton
When rendering with headless builds, show an error instead of crashing. Previously GPU_backend_init was called indirectly from DRW_opengl_context_create, a new function is now called from the window manager (GPU_backend_init_once), so it's possible to check if the GPU has a back-end. This also disables the `bgl` Python module when building WITH_HEADLESS. Reviewed By: fclem Ref D15463
2022-07-15GPU: Fix shader builder on hardware that does not have all featuresClément Foucault
2022-07-15Cleanup: GPU: Replace NULL by nullptr from C++ filesClément Foucault
2022-07-11GPU: Update shader builder stubs.Jeroen Bakker
Fixes workflow when using WITH_GPU_SHADER_BUILDER=On.
2022-07-01Metal: MTLMemoryManager implementation includes functions which manage ↵Jason Fielder
allocation of MTLBuffer resources. The memory manager includes both a GPUContext-local manager which allocates per-context resources such as Circular Scratch Buffers for temporary data such as uniform updates and resource staging, and a GPUContext-global memory manager which features a pooled memory allocator for efficient re-use of resources, to reduce CPU-overhead of frequent memory allocations. These Memory Managers act as a simple interface for use by other Metal backend modules and to coordinate the lifetime of buffers, to ensure that GPU-resident resources are correctly tracked and freed when no longer in use. Note: This also contains dependent DIFF changes from D15027, though these will be removed once D15027 lands. Authored by Apple: Michael Parkin-White Ref T96261 Reviewed By: fclem Maniphest Tasks: T96261 Differential Revision: https://developer.blender.org/D15277
2022-07-01Cleanup: GPUCodegen: Remove unused variablesClément Foucault
2022-07-01GPUMaterial: Remove the max attribute checkClément Foucault
This is needed to make the GPU_attribute used as generic input mechanism.
2022-06-30Cleanup: colon after params, move text into public doc-strings, spellingCampbell Barton
2022-06-30Fix T98886: PBVH_GRIDS ignores face smooth flag on first gpu buildJoseph Eagar
2022-06-29Cleanup: Clang tidy, unused variable warningHans Goudey
2022-06-29Fix T98825: EEVEE: Regression: Buffer overflow in sample name bufferClément Foucault
This happened because of the false assumption that `std::array<char, 32>` would be treated as a container and not relocate their content if the `Vector` would grow. Replacing with actual object allocation fixes the issue. Candidate for 3.2.1 corrective release.
2022-06-29Cleanup: spelling in commentsCampbell Barton
2022-06-28Cleanup: GPUShader: Fix missing space in debug messageClément Foucault
2022-06-27MTLCommandBufferState for coordinating GPU workload submission and render ↵Jason Fielder
pass coordination. MTLFrameBuffer has been implemented to support creation of RenderCommandEncoders, along with supporting functionality in the Metal Context. Optimisation stubs for GPU_framebuffer_bind_ext has been added, which enables specific assignment of attachment load-store ops at the bind level, rather than on a framebuffer object as a whole. Begin and end frame markers are used to encapsulate frame boundaries for explicit workload submission. This is required for explicit APIs where implicit flushing of work does not occur. Ref T96261 Reviewed By: fclem Maniphest Tasks: T96261 Differential Revision: https://developer.blender.org/D15027
2022-06-22Cleanup: remove redundant GPU headersCampbell Barton
2022-06-21Fix crash editing anisotropic filter preference from background modeBrecht Van Lommel
2022-06-17Cleanup: remove redundant string formattingCampbell Barton
2022-06-12Cleanup (GPU): Improve efficiency of circle drawing.Chris Blackbourn
2022-06-10Cleanup: Clang tidyHans Goudey
2022-06-09Cleanup: warningsCampbell Barton
2022-06-09Cleanup: quiet warningsCampbell Barton
2022-06-08Sculpt: PBVH Draw Support for EEVEEJoseph Eagar
This patch adds support for PBVH drawing in EEVEE. Notes: # PBVH_FACES only. For Multires we'll need an API to get/cache attributes. DynTopo support will be merged in later with sculpt-dev's DynTopo implementation. # Supports vertex color and UV attributes only; other types can be added fairly easily though. # Workbench only sends the active vertex color and UV layers to the GPU. # Added a new draw engine API method, DRW_cdlayer_attr_aliases_add. Please review. # The vertex format object is now stored in the pbvh. Reviewed By: Clément Foucault & Brecht Van Lommel & Jeroen Bakker Differential Revision: https://developer.blender.org/D13897 Ref D13897
2022-06-07Merge branch 'blender-v3.2-release'Clément Foucault
2022-06-07GPUMaterial: Make compilation fail when reusing failed `GPUPass`Clément Foucault
This avoid leaving a `GPUMaterial` in a `GPU_MAT_QUEUED` state which would block rendering. Fix T98603: Hang when saving project in material preview mode Maniphest Tasks: T98603 Differential Revision: https://developer.blender.org/D15135
2022-06-05Cleanup: Move remaining mesh draw code to C++Hans Goudey
After this commit, all mesh data extraction and drawing code is in C++, including headers, making it possible to use improved types for future performance improvements and simplifications. The only non-trivial changes are in `draw_cache_impl_mesh.cc`, where use of certain features and macros in C necessitated larger changes. Differential Revision: https://developer.blender.org/D15088
2022-06-01Cleanup: use 'e' prefix for enum typesCampbell Barton
- CustomDataType -> eCustomDataType - CustomDataMask -> eCustomDataMask - AttributeDomain -> eAttrDomain - NamedAttributeUsage -> eNamedAttrUsage
2022-05-30Cleanup: fix various typosBrecht Van Lommel
Contributed by luzpaz Differential Revision: https://developer.blender.org/D15057
2022-05-27GPU: Remove cached full/scaled image texture.Jeroen Bakker
full scaled image isn't used anymore. It was added to use a different scale when displaying an image in the image editor. This was replaced by the image engine redesign. This change will reduce complexity of {T98375}.
2022-05-19GPUStorageBuf: Add `GPU_storagebuf_copy_sub_from_vertbuf()`Clément Foucault
This allows using the Graphic API to copy buffer data. The GPU module do not expose untyped buffers even if that's what most API do, so the copy function need to be strongly typed. Contains GL backend implementation.
2022-05-19GPUSource: Add error message on source not foundClément Foucault
Without this, we could have crashes during static compilation of shaders without knowing where it would come from.
2022-05-18Cleanup: formatCampbell Barton
2022-05-15GPUVertBuf: Add support for binding as buffer textureClément Foucault
This is often needed and somehow cumbersome to set up. This will allow some code simplifications.