Age | Commit message (Collapse) | Author |
|
|
|
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
|
|
|
|
fallthrough in case statement.
|
|
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
|
|
This is a port of the previous implementation but using compute
shaders instead of using the raster pipeline for every steps.
Only the scatter passes is kept as a raster pass for obvious performance
reasons.
Many steps have been rewritten to take advantage of LDS which allows faster
and simpler downsampling and filtering for some passes.
A new stabilize phase has been separated from another setup pass in order
to improve it in the future with better stabilization.
The scatter pass shaders and pipeline also changed. We now use indirect
drawcall to draw quads using triangle strips primitives. This reduces
fragment shader invocation count & overdraw compared to a bounding
triangle. This also reduces the amount of vertex shader invocation
drastically to the bare minimum instead of having always 3 verts per
4 pixels (for each ground).
|
|
This updates image bind tracking to be the same as texture binds.
Adding a new bind flag to avoid conflict when the texture is used in
both slots.
Fixes a gl error in glBindImageTextures about invalid image binds.
|
|
This path is not used by any existing code so it isn't necessary to
backport.
|
|
This allows rendering a batch with parameters computed by the GPU.
Contains GL backend implementation.
|
|
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
|
|
|
|
Tests created GPUTextures with incorrect mipmaps.
|
|
|
|
There were 2 errors.
1. hair code was used to draw curves
2. vertex shader wasn't aware of curves and failed to compile.
|
|
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
|
|
The new implementation leverage compute shaders to reduce the
number of passes and complexity.
The max blur amount is now detected automatically, replacing the property
in the render panel by a simple checkbox.
The dilation algorithm has also been rewritten from scratch into a 1 pass
algorithm that does the dilation more efficiently and more precisely.
Some differences with the old implementation can be observed in areas with
complex motion.
|
|
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
|
|
|
|
|
|
|
|
|
|
Initial implementation.
Authored by Apple: Michael Parkin-White
Ref T96261
Reviewed By: fclem
Differential Revision: https://developer.blender.org/D15357
|
|
When a query begins, the current visibility result buffer needs to be
associated with the currently active Render Pass. The MTLContext and
MTLCommandBuffer are responsible for ensuring new render pass objects are
created if the visibility state changes.
Authored by Apple: Michael Parkin-White
Ref T96261
Reviewed By: fclem
Maniphest Tasks: T96261
Differential Revision: https://developer.blender.org/D15356
|
|
Currently Blender generates mipmaps that override the existing ones.
This patch disables generating new mipmaps for compressed textures.
Reviewed By: fclem
Differential Revision: https://developer.blender.org/D14459
|
|
|
|
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
|
|
|
|
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
|
|
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
|
|
|
|
|
|
Dependency was added as shader builder depended to blenkernel as an
umbrella, in stead of adding the actual dependencies it required.
|
|
Also remove duplicate comments in bmesh_log.h, caused by automated
comment relocation in [0].
[0]: c4e041da23b9c45273fcd4874308c536b6a315d1
|
|
Adds a better name that describes when it is used.
The GPU_SHADER_BUILDER is a buildtime tool for developers
to pre-validate GLSL (and in the overseen future pre-compile to
SpirV). We don't see that this needs to become a required
step in the future so WITH_GPU_BUILDTIME_SHADER_BUILDER
is more descriptive name.
|
|
Fixes workflow when using WITH_GPU_SHADER_BUILDER=On.
|
|
This commit adds visualization to the selection in curves sculpt mode.
Previously it was only possible to see the selection when it was
connected to a material.
In order to obstruct the users vision as little as possible, the
selected areas of the curve are left as is, but a dark overlay
is drawn over unselected areas.
To make it work, the overlay requests the selection attribute and then
ensures that the evaluation is complete for curves. Then it retrieves
the evaluated selection GPU texture and passes that to the shader.
This reuses the existing generic attribute extraction system because
there currently wouldn't be any benefits to dealing with selection
separately, and because it avoids duplication of the logic that
extracts attributes from curves and evaluates them if necessary.
Differential Revision: https://developer.blender.org/D15219
|
|
|
|
|
|
|
|
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 is needed to make the GPU_attribute used as generic input mechanism.
|
|
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.
|
|
|
|
|
|
|
|
|
|
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.
|
|
|
|
|