Age | Commit message (Collapse) | Author |
|
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
|
|
|
|
|
|
This modules handles renderpasses allocation and filling. Also handles
blitting to viewport framebuffer and render result reading.
Changes against the old implementation:
- the filling of the renderpasses happens all at once requiring
only 1 geometry pass.
- The filtering is optimized with weights precomputed on CPU and
reuse of neighboor pixels.
- Only one accumulation buffer for renderpasses (no ping-pong).
- Accumulation happens in one pass for every passes using a single
dispatch or fullscreen triangle pass.
TAA and history reprojection is not yet implemented.
AOVs support is present but with a 16 AOV limit for now.
Cryptomatte is not yet implemented.
|
|
Removes the following macros for scene/render frame values:
- `CFRA`
- `SUBFRA`
- `SFRA`
- `EFRA`
These macros don't add much, other than saving a few characters when typing.
It's not immediately clear what they refer to, they just hide what they
actually access. Just be explicit and clear about that.
Plus these macros gave read and write access to the variables, so eyesores like
this would be done (eyesore because it looks like assigning to a constant):
```
CFRA = some_frame_nbr;
```
Reviewed By: sergey
Differential Revision: https://developer.blender.org/D15311
|
|
|
|
The resource binding were missing from the shading group
(`shgroup->uniform_attrs`), leading to no custom property UBO creation
(`drw_uniform_attrs_pool_update`) when issuing the drawcall,
resulting in a missing UBO bind.
The fix make sure to no duplicate the bindings by creating a simple
shader bind instead of a `GPUMaterial` bind.
Candidate for 3.2.1 corrective release.
|
|
Use view position to retreive world space direction to retain float
precision.
Candidate for 3.2.1 corrective release.
|
|
The ORCO property was not being properly initialized in this case.
Candidate for 3.2.1 corrective release.
|
|
This was preventing correct attribute rendering with multiple attributes.
Since the `CurveInfos` struct is used for data sharing between C++ and
GLSL and inside a UBO it needs to obey the `std140` alignment rules which
states that arrays of scalars are padded to the size of `vec4` for each
array entry.
|
|
|
|
depending on the visibility of other objects
The material ID was being wrongly passed in the shader.
|
|
|
|
Handling of 16-bits compression was missing, which gave values that were
way off.
|
|
|
|
When using the old particle hair with the hair info length it wasn't
working with AMD GPUs. The reason was that the drw_curves uniform buffer
wasn't initialized what made the shader select the incorrect length.
|
|
Also use Curves as an argument instead of Object,
since it's more specific to this situation.
|
|
When GPU subdivision is used, and the modifier is not set to be applied
on the cage, UV selection is not synced with the face selection in the
viewport.
This happens because the extraction, despite being in edit mode, is set
to `MESH` instead of `BMESH` (or `MAPPED` in some cases) like for CPU
subdivision, and since the mesh is not always synchrnised with the BMesh
the edit mode flags are not always updated.
With GPU subdivision, when creating the `MeshRenderData`, the condition
`has_mdata && do_final && editmesh_eval_final != editmesh_eval_cage` is
true which forces the `MESH` extraction. Following comment in D14485,
this replace the `has_mdata` in the condition with `use_mapped` which
solves the issue.
Differential Revision: https://developer.blender.org/D15248
|
|
This had to be added to the previous commit.
|
|
Regression introduced by {rBca37654b6327}. This commit reversed the
order of loading uniforms. The bloom renderpass used the previous
loading order to overwrite an existing uniform (bloomBaseAdd).
Due to the new ordering this doesn't work anymore where the render
pass outputted an image similar to the final image. This was fixed
by loading the correct value for bloomAddBase and remove the rewrite.
|
|
Pass `use_hide` to the compute shaders so that we can override the
hidden face flags, like CPU extraction is doing.
|
|
Flags in the smooth shading case were not properly set.
|
|
Since the occlusion input is going to be removed in EEVEE-Next, I just
added a temporary workaround. The occlusion is passed as SSS radius
as the Specular BSDF does not use it.
The final result matches 3.1 release
|
|
Addendum to previous fix, which was for point selection, this fixes the
face selection mode. The issue is caused by wrong flags used for paint
mode (the edit mode flag was always used). Also add back flag which was
accidentally removed in 16f5d51109bce849dff5379c60360f271622ac0f.
|
|
Issue is caused by an off by one error which would map some edge loops to
the loops of some the next polygon in the list of polygon, which may not
be a topological neighbor.
|
|
|
|
Previously the attribute name was only stored in the request for curves.
Instead, pass it as part of the "add request" function, so that it is
always used. Since the whole attribute pipeline is name-based,
this can simplify code in a few places.
|
|
The types are retrieved by the attribute matching above anyway,
there is no reason to have another switch based on the type.
|
|
Also remove some unnecessary logic and change a variable name.
|
|
Also remove const for the object argument, since the object data
is logically modified by generating the data.
|
|
On MacOS Eevee cyptomatte shaders fails as it doesn't ignore the `attrib_load`
parameter. I validated that removind the parameter works on Linux/AMD and MacOS
Intel. It could be that there are other platforms that require the dummy parameter.
If this should use a forward declaration and implement an emoty function in the
cryptomatte vertex shader.
|
|
|
|
- Remove unnecessary braces in switch statements
- Move `default` to the end of other switch items
- Use camel case for type names
- Use `BLI_assert_unreachable()`
|
|
Instancing with geometry nodes uses just the evaluated Mesh, and ignores the
Object that it came from. That meant that it would try to look up the subsurf
modifier on the instancer object which does not have the subsurf modifier.
Instead of storing a session UUID and looking up the modifier data, store a
point to the subsurf modifier runtime data. Unlike the modifier data, this
runtime data is preserved across depsgraph CoW. It must be for the subdiv
descriptor contained in it to stay valid along with the draw cache.
As a bonus, this moves various Mesh_Runtime variables into the subsurf runtime
data, reducing memory usage for meshes not using subdivision surfaces.
Also fixes T98693, issues with subdivision level >= 8 due to integer overflow.
Differential Revision: https://developer.blender.org/D15184
|
|
The BMesh case was missing when extracting the loose edges flags used for
display, so the code was crashing on unitialized `MEdge` pointer.
|
|
Found via codespell -q 3 -S ./intern,./extern -L ans,ba,bording,datas,eiter,fiter,hist,inout,lod,ot,parm,parms,pixelx,pres,te
Contributed by luzpaz.
Differential Revision: https://developer.blender.org/D15155
|
|
The normals flags were not setup properly which made normals for all
elements (vertices, faces) to be drawn when using the normals overlay.
Also remove usage of uints for the flag in the APIs.
|
|
|
|
|
|
|
|
|
|
|
|
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
|
|
See {rBb69aad60bda23a53482b2c2ae98715c23a715bc8}
for more details.
|
|
|
|
|
|
# Conflicts:
# source/blender/draw/engines/eevee/shaders/volumetric_vert.glsl
|
|
This bug was unreported. This was triggering a linking error caused by
the vertex shader not having a local version of `attr_load_temperature_post`
and `attr_load_color_post`.
|
|
This was caused by the `copy_m4_m4` trying to copy the `object_to_texture`
from `drw_grid` which was `nullptr`.
Fixing this also exposed that rendering such volumes (without any valid
grid attributes) is not supported and we should follow what Cycles does.
Differential Revision: https://developer.blender.org/D15147
|
|
Viewport drawing does not support a per point radius attribute yet.
Instead, it has a fixed set of radius parameters that are used for all
curves in the same object. Now those radii are retrieved from the
radius attribute of the points on the first curve. This allows users
to control the radius of curves to some degree until proper per-point
radius is supported.
|