Age | Commit message (Collapse) | Author |
|
|
|
Add blank lines after file references to avoid them being interpreted as
doc-strings the following declarations.
|
|
Add ccl_gpu_kernel_postfix as a statement macro to prevent the following
declarations from being indented.
|
|
Also solves two warnings from the previous similar commit,
f688e3cc3130e70e77f0bb0. The change to the grease pencil
modifier is quite suspicious, but doesn't change the behavior,
which was already broken.
|
|
This was introduced by rBeccb0b222e3465baa71430223c5ee2f0206a7b02.
|
|
This function was not used for anything other than mat4. This
was because of a limitation of the DRW module/
This makes it cleaner for the GLSL and also less tempting to use
it for other unconventional purpose.
|
|
This was caused by the recent changes made to the way we handle matrix
copies. The matrix copy assumed that the uniform iteration was the same
as creation order. But this was far from true. The reality was that
the iterator was reverse for `unichunk` but not for `unichunk->uniforms`
so this was recreating wrong matrix.
I rewrote this part to always use reverse iteration and fix the
copy destination.
Also I simplified the code making the assumption this won't be used for
anything else than mat4.
|
|
Simple error in an earlier commit, the flags should be or-ed.
|
|
|
|
|
|
Also change some remaining cases of "hair object" to "curves object".
|
|
backend.
- Metal uniform array compatibility in DRW module.
- Guard OpenGL-specific workarounds and flushes behind GPU_type_matches_ex API guard. Add further render boundaries for render paths called outside of the main loop.
Authored by Apple: Michael Parkin-White
Ref: T96261
Reviewed By: fclem
Differential Revision: https://developer.blender.org/D14438
|
|
MSL does not have an implicit global scope, this is emulated via macro's adding an indirection for uniforms, attributes, shader stage inputs and outputs such as:
#define roughness shaderinst->roughness.
Variables in GLSL which exist within uniform blocks can be directly referenced via the global scope, unlike standard C++. This means that variable name pollution occurs if subsequent local variables in the code use the same name, resulting in compilation errors.
A number of these conflicting names have been renamed to ensure unique naming and no further scope pollution.
Ref T96261
Reviewed By: fclem
Maniphest Tasks: T96261
Differential Revision: https://developer.blender.org/D14452
|
|
The crash happens because the origindex layers created as part of
the modifier stack evaluation are not set in the `MeshRenderData` when
they should have been.
This is because when selecting in X-ray mode, a subdivision wrapper
is created to ensure that selection happens with a subdivided
geometry, and this replaces the `MDATA` wrapper which is also used to
setup the `MeshRenderData`.
As we do not seemingly have an `MDATA` wrapper, the draw code decides
that we can extract draw buffers directly from the BMesh, instead of
the mapped Mesh with origin indices layers.
To fix this, we should also consider to use mapped extraction if a
subdivision wrapper exists on the mesh.
Differential Revision: https://developer.blender.org/D14485
|
|
Should have no regression.
|
|
This should have no regression.
|
|
# Conflicts:
# source/blender/draw/intern/draw_common_shader_shared.h
# source/blender/draw/intern/shaders/draw_view_info.hh
|
|
The lines paint mask IBO extraction was not implemented for GPU subdivision.
For it to work, we also now need to preserve the subdivision loop to
subdivision edge map, which until now was overwritten to store coarse edges
(the map to coarse edges is still preserved).
Also the paint flag stored in the 4th dimension of the loop normal buffer
was not properly set for flat shaded faces, leading to other kind of
artefacts and render issues.
|
|
|
|
A follow-up to e253f9f66d6f. Follow the policy from T85728
completely (using "num" as a prefix) and rename another function.
|
|
|
|
Each time the user clicks the viewport 2 sets of engine views are
created. Each set is currently composed of 8 view objects, each of size
592 bytes.
Because space is not reserved in the vector that holds them, several
unnecessary re-allocation/copy cycles occur as the vector resizes and
the total allocation load is 8880 bytes. This happens twice.
Reduce to just the allocations necessary and with exactly 4736 bytes
allocated for each set
- Before: 8 allocations and 8 deallocations totaling 17760 bytes
- After: 2 allocations and 2 deallocations totaling 9472 bytes
Reviewed By: fclem, jbakker
Differential Revision: https://developer.blender.org/D13782
|
|
Rename "size" variables and functions to use "num" instead,
based on T85728 (though this doesn't apply to simple C++
containers, it applies here). Rename "range" to "points" in
some functions, so be more specific.
Differential Revision: https://developer.blender.org/D14431
|
|
|
|
Vertices were not drawn properly as the logic for mapped mesh was used
in the BMesh case.
Edge display would ignore subdivided edges which would come from coarse
edges when setting display flags.
|
|
|
|
Metal shading language follows the C++ 14 standard and in some cases requires a greater level of explicitness than GLSL. There are also some small language differences:
- Explicit type-casts (C++ requirements)
- Explicit constant values (C++ requirements, e.g. floating point values using 0.0 instead of 0).
- Metal/OpenGL compatibility paths
- GLSL Function prototypes
- Explicit accessors for vector types when sampling textures.
Authored by Apple: Michael Parkin-White
Ref T96261
Reviewed By: fclem
Maniphest Tasks: T96261
Differential Revision: https://developer.blender.org/D14378
|
|
This is quite a huge cleanup. Making use of the `common_gpencil_lib.glsl`
to share more codes and use more consistent codestyle.
The gpencil engine specifics are now out of the `gpencil_vertex()`
function making it easier to add more features.
There should be no regression as all workarounds are kept as is.
|
|
Mostly quality of life functions and macros.
|
|
# Conflicts:
# source/blender/draw/intern/draw_manager.h
# source/blender/draw/intern/draw_manager_exec.c
# source/blender/draw/intern/draw_shader_shared.h
|
|
This library contains the needed functions to render GPencil object
geometry. Centralizing these will make it possible for other draw
engines (EEVEE, Overlay) to reuse the same vertex shader code and
possibly the same fragment rejection methods.
|
|
This adds a simple and more manageable temp texture behavior.
The texture is garanteed to be available only between the acquire/release pair.
This makes the same engine able to reuse the textures and even overlap the acquire
& release calls.
|
|
- Add name support to storage buffers
- Delete view functions for TextureFromPool
- Add support for different size acquire and assert on mulitple acquire
- Allow multiple release
|
|
|
|
This is useful to read/write to the textures directly using compute
shaders and imageLoad/Store.
|
|
|
|
|
|
This just expose the GPU API through DRW.
|
|
|
|
# Conflicts:
# source/blender/draw/engines/eevee/eevee_light.cc
# source/blender/draw/engines/eevee/eevee_shadow.cc
|
|
|
|
This is supposed to hold the latest improvement from the EEVEE rewrite branch.
Note that a restart is necessary in order for the engine to appear.
The registration code is a bit convoluted as it needs to be after the WM_init.
|
|
Ref T95355
|
|
|
|
Some old platforms and drivers have limited amount of SSBO binding per
compute shader. This disables GPU subdivision if we cannot possibly
bind all required buffers within this limit.
For now the maximum number of buffers used by the GPU code is hardcoded,
but will be programmatically detected when shader creation is automated.
Ref D14337
|
|
The constant M_PI_4 is added to GLSL to ensure it works there too.
Differential Revision: https://developer.blender.org/D14288
|
|
Contributed by luzpaz.
Differential Revision: https://developer.blender.org/D14307
|
|
|
|
|
|
Tangents are computed from UVs on the CPU side when using GPU subdivision
and require that the normals are available there as well (at least for smooth
shading, flat normals can be computed on the fly). This simply adds the missing
normals update call for the `MeshRenderData` setup for the subdivision case.
Differential Revision: https://developer.blender.org/D14278
|