Commit Graph

5316 Commits

Author SHA1 Message Date
Clément Foucault
acf7eab3b5 Merge branch 'blender-v4.2-release'
# Conflicts:
#	tests/data
2024-07-09 14:52:34 +02:00
Clément Foucault
7fe7b2eed0 Fix: EEVEE: Hardware discrepancy with math wrap function
The math render tests were not passing on the AMD hardware.
This was due to some compiler behavior not returning 1
on the `floor((a - c) / (b - c))` calculation even if
`a` and `b` were equal.
2024-07-09 14:13:32 +02:00
Jeroen Bakker
6471b715b2 Vulkan: Remove performance warning about depth clearing
When clearing depth attachment the write depth state should be enabled.
When this isn't the case a clear texture is being performed. Before
the render graph this used to be a performance issue as the rendering
would be suspended.

The render graph currently reorders these texture clears before of
the rendering context and therefore isn't seen as a performance issue.

Pull Request: https://projects.blender.org/blender/blender/pulls/124340
2024-07-08 14:00:40 +02:00
Jeroen Bakker
180a257eef Cleanup: Vulkan: Use stamp in stead of version
Pull Request: https://projects.blender.org/blender/blender/pulls/124339
2024-07-08 12:56:21 +02:00
Jeroen Bakker
08d365b810 Vulkan: Cleanup barrier state
Try to reduce the barrier state so we can be more flexible when adding
support for sub resource tracking.

Pull Request: https://projects.blender.org/blender/blender/pulls/124237
2024-07-08 12:28:11 +02:00
Campbell Barton
cd1dbab348 Cleanup: spelling in comments 2024-07-07 00:29:39 +10:00
Campbell Barton
48383cf20e Cleanup: avoid shadowing, redundant assignment & minor changes
Quiet cppecheck warnings, use const pointers, ELEM(..) macro,
replace NULL -> nullptr, unsigned int -> uint.
2024-07-07 00:18:00 +10:00
Sebastian Parborg
75959af2ed Merge branch 'blender-v4.2-release' 2024-07-05 17:25:03 +02:00
Sebastian Parborg
f853d097a5 Fix: GLSL error in the sequencer when running mesa
It would error out with "illegal use of reserved word 'active'"
Rename the boolan value to not use the reserved word.
2024-07-05 17:22:52 +02:00
Aras Pranckevicius
eafcd66c0a Merge branch 'blender-v4.2-release' 2024-07-05 12:35:59 +03:00
Aras Pranckevicius
c4534909b2 Fix #123578: VSE active but unselected strip outline visual tweak
Instead of making the dark outline be bright for active but unselected
strips, make it have dark outline just like all other strips,
and a 1px inner bright line inside of that.

Pull Request: https://projects.blender.org/blender/blender/pulls/124210
2024-07-05 11:35:18 +02:00
Jeroen Bakker
89daa19f57 Vulkan: Device statistics
This PR adds device statistics which can be printed to the console.
By default nothing is printed, but developer can choose to enable
it during development.

Pull Request: https://projects.blender.org/blender/blender/pulls/124150
2024-07-04 13:47:54 +02:00
Jeroen Bakker
b6c078a28f Vulkan: Fix image bind space collision
EEVEE Eval light shader could still make a collision between
texture and image bind space making rendering glitch
when not using `--debug-gpu`. The problem was that the bind space
wasn't aware of the offset that the shader interface was using.

Pull Request: https://projects.blender.org/blender/blender/pulls/124140
2024-07-04 10:41:43 +02:00
Miguel Pozo
961dcf29ee Merge branch 'blender-v4.2-release' 2024-07-02 17:01:01 +02:00
Miguel Pozo
b0fbd550e0 Fix #124011: GPU: Broken specialization constants
Don't store pointers to `blender::Map` items since, unlike `std::map`,
they're not guaranteed to stay valid.
This resulted in shader binaries being loaded into the wrong
specialization.

Pull Request: https://projects.blender.org/blender/blender/pulls/124051
2024-07-02 16:59:22 +02:00
Jeroen Bakker
4394b87012 Vulkan: Add support for barycentric coordinates
Barycentric coordinates are used for the wireframe shader. It was
already implemented, but was made broken or when we change the depth
range or when we added support for fallback of shader viewport/layer
rendering. The previous implementation didn't use the correct
EmitVertex leading to incorrect depths. Also the shader layouts where
not Vulkan compliant.

![image](/attachments/39fbfd9e-16fd-42d8-9520-3d8fa839e7de)

Pull Request: https://projects.blender.org/blender/blender/pulls/124048
2024-07-02 15:59:16 +02:00
Jeroen Bakker
88f04e95c3 Vulkan: Fix HiZ synchronization
HiZ update performs a read/write on different buffers, this lead
to write-after-write hazards as the resources where added multiple
times in the same pipeline barrier with different access masks.
This is fixed by merging pipeline barriers based on their resource.

Pull Request: https://projects.blender.org/blender/blender/pulls/124036
2024-07-02 14:06:49 +02:00
Jeroen Bakker
bf3c6a3480 Vulkan: Improve debugging render graph
Adds debug print function to output a node with its inputs and outputs.
Also keep track of the name of the resource (only images) what will
be presented. Tracking of the resource name is only done in debug builds.

Pull Request: https://projects.blender.org/blender/blender/pulls/124033
2024-07-02 13:29:34 +02:00
Jeroen Bakker
7fcc4e5374 Vulkan: Add Render graph support to VKDrawList
Resources of the draw list were overwritten, before used. Fixed by
using resource tracking.

Pull Request: https://projects.blender.org/blender/blender/pulls/124024
2024-07-02 09:20:34 +02:00
Campbell Barton
dffc47e6cf Merge branch 'blender-v4.2-release' 2024-07-02 17:06:35 +10:00
Jeroen Bakker
4d0c14bed3 OpenGL: Fix read from uninitialized memory
When performing framebuffer transition on legacy opengl platforms, some
state was uninitialized. Resulting in incorrect behavior and crashes.

Note that this doens't fix the black cube on legacy platforms. With this PR we
might be able to reproduce the issue on modern HW.

Pull Request: https://projects.blender.org/blender/blender/pulls/123989
2024-07-02 08:37:50 +02:00
Miguel Pozo
ed17e7c0c6 Merge branch 'blender-v4.2-release' 2024-07-01 16:40:29 +02:00
Miguel Pozo
4c314f9a78 GPU: Add --gpu-compilation-subprocesses cmd setting
Allow overriding the `max_parallel_compilations` from the command
line.
Disable compilation subprocesses on RenderDoc sessions.

Pull Request: https://projects.blender.org/blender/blender/pulls/123995
2024-07-01 16:36:01 +02:00
Lukas Stockner
87159b2871 Cycles: Add Diffuse Roughness option to Principled BSDF
Setting this option to a value above zero replaces the lambertian Diffuse term
with the modified energy-preserving Oren-Nayar BSDF, which matches the OpenPBR
behavior.

Pull Request: https://projects.blender.org/blender/blender/pulls/123616
2024-07-01 15:49:09 +02:00
Omar Emara
0e1af55247 Merge branch 'blender-v4.2-release' 2024-07-01 13:30:33 +03:00
Jeroen Bakker
9f53f3b600 OpenGL: Disable Stencil Export when forcing workarounds
When forcing workarounds the stencil export support wasn't disabled.
This PR disables stencil export support when forcing workarounds.

Pull Request: https://projects.blender.org/blender/blender/pulls/123985
2024-07-01 12:19:26 +02:00
Jeroen Bakker
3434260874 Vulkan: Add support for Cycles CPU
Other Cycles backend might also work. Not sure about or Optix/Cuda
as they require GPU synchronization.

Pull Request: https://projects.blender.org/blender/blender/pulls/123895
2024-06-28 13:51:51 +02:00
Jeroen Bakker
da4746fe96 Vulkan: Fix copy depth images with stencil
When copying the depth aspect of a depth+stencil image the incorrect
barriers where created. The barrier needs to have the full aspect, even
when we only copy a single aspect from the image.

Pull Request: https://projects.blender.org/blender/blender/pulls/123890
2024-06-28 13:13:33 +02:00
Jacques Lucke
eb35212f3d Cleanup: make format 2024-06-28 13:09:06 +02:00
Jacques Lucke
3410d0bf3f Nodes: simplify node link drawing shader
* Better separation between drawing backdrop and main line.
* Pass u and v coordinates of line to fragment shader for further processing.
* Remove `colorGradient` which can also be computed from `lineUV`.
* Simplify drawing potentially more than one parallel line as is done in #112677.
2024-06-28 13:08:05 +02:00
Jeroen Bakker
e72e538fdd Vulkan: Fix sequential read hazard
When a buffer resource was read, and after that read from another
shader stage it would not generate the appropriate pipeline barrier.

This is fixed by keeping the last write action around and check
if the shader stage was already included in the previous barriers.

Pull Request: https://projects.blender.org/blender/blender/pulls/123845
2024-06-27 15:53:14 +02:00
Jeroen Bakker
3009c98d5f Vulkan: Fix read-after-write hazard in draw manager visibility
Draw Manager visibility compute shader triggered a read-after-write
hazard. This root cause was that the incorrect access was read from
the shader interface. It was set to none, skipping the needed pipeline
barrier.

Pull Request: https://projects.blender.org/blender/blender/pulls/123839
2024-06-27 14:55:15 +02:00
Miguel Pozo
eb37bace96 Merge branch 'blender-v4.2-release' 2024-06-26 16:45:15 +02:00
Miguel Pozo
2804b000ac Fix: GPU: Fix handling of invalid binary caches 2024-06-26 16:44:46 +02:00
Jeroen Bakker
02a45fb60d Vulkan: Add read dependency for push constants fallback
When a shader uses push constants fallback the push constants are
stored inside a uniform buffer. The uniform buffer needs to be guarded
with a read barrier.

Pull Request: https://projects.blender.org/blender/blender/pulls/123777
2024-06-26 14:38:08 +02:00
Miguel Pozo
840457c45c Merge branch 'blender-v4.2-release' 2024-06-25 19:53:33 +02:00
Miguel Pozo
066619e1a8 Fix: GPU: GLStorageBuf::async_flush_to_host non named path
Fix the read parameter when there's no direct_state_access_support.
2024-06-25 19:52:39 +02:00
Jeroen Bakker
ee0b7b9a95 Vulken: Mix array aspect of image views
The image views type can change depending based on how they are bound
to shaders. When a shader accesses a view without array operations,
the image view should not be an array. This was previously ignored.

Pull Request: https://projects.blender.org/blender/blender/pulls/123726
2024-06-25 15:15:18 +02:00
Jeroen Bakker
78f37fe331 Vulkan: Fix incorrect image aspect
When clearing only the depth of a depth/stencil only the depth
part of the image aspect was stored in the node. This is invalid
when the image needed to be transitioned.

Pull Request: https://projects.blender.org/blender/blender/pulls/123713
2024-06-25 11:05:24 +02:00
Jeroen Bakker
f5b173188e Vulkan: Fix incorrect read image barrier
When having a sequential read image barriers for the same resource
and the second one requires an image layout transition the incorrect
barriers where generated.

This was fixed by aligning the implementation with write image barriers.

Pull Request: https://projects.blender.org/blender/blender/pulls/123712
2024-06-25 11:05:07 +02:00
Miguel Pozo
62293d76bb Merge branch 'blender-v4.2-release' 2024-06-24 18:35:52 +02:00
Miguel Pozo
d88150ce1f Fix: GPU: Skip binaries larger than the shared memory 2024-06-24 18:33:05 +02:00
Jeroen Bakker
55ac7fd6fd Vulkan: Early exit clearing stencils
Adds an early exit when clearing stencils on textures that don't have
a stencil aspect. This is the case when rendering EEVEE planar probes.

Pull Request: https://projects.blender.org/blender/blender/pulls/123668
2024-06-24 14:19:24 +02:00
Jeroen Bakker
34a679d19f Vulkan: Read out of bound when using many resources
Internally the image and texture resources where kept in a vector
where the elements were referenced. When using more than 16 images
this vector is reallocated and previous references become invalid.

This is a quick fix and should be changed with something more
stable.

Pull Request: https://projects.blender.org/blender/blender/pulls/123656
2024-06-24 11:50:38 +02:00
Jeroen Bakker
0c39a75634 Vulkan: Fix binding collision when mixing textures and images
Due to incompatible binding namespaces between Vulkan and OpenGL we
offset the images in the ubo list. In the previous implementation
this could still go wrong as the images and textures bindings where
sequential. When EEVEE binds resources it can also try to bind resources
that aren't valid for the current shader. In this case it was still
possible that the incorrect binding was chosen.

This is fixed by offsetting the images by a large number.

Pull Request: https://projects.blender.org/blender/blender/pulls/123649
2024-06-24 09:27:13 +02:00
Lukas Stockner
26eb5d9899 EEVEE: Adapt Principled BSDF to closure sampling
With the new closure approach, the code can be simplified and cleaned up quite
a bit.

This also removes four parameters, which is helpful for future additions (!123616)
since the parameter limit appears to be reached.

Pull Request: https://projects.blender.org/blender/blender/pulls/123643
2024-06-24 00:20:30 +02:00
Campbell Barton
428c525a41 Merge branch 'blender-v4.2-release' 2024-06-23 13:02:13 +10:00
Campbell Barton
f6b48e18f5 Merge branch 'blender-v4.2-release' 2024-06-23 13:02:10 +10:00
Campbell Barton
f646956149 Cleanup: spelling in comments 2024-06-23 12:25:22 +10:00
Campbell Barton
7632c528de Docs: remove references to "above" in code comments & corrections
Reference identifiers instead of "above" in code comments as these
tends to become outdated. Even when declarations are removed it's at
least clear that the reference no longer exists instead of referring to
whatever is currently above the declaration.
It's also straightforward to search history for a removed identifier.

Corrected 4 cases of references to things that were no longer above
the doc-strings. Noticed other references which look to be incorrect
but need further investigation.
2024-06-23 12:14:19 +10:00