Commit Graph

6202 Commits

Author SHA1 Message Date
Miguel Pozo
05dcc0377b Fix: GPU: Missing error logs
Regression from d5f84d0016.
2025-07-14 18:53:35 +02:00
Campbell Barton
ec8751f826 Cleanup: white-space around C-style comment blocks
Also use C++ style comments for disabling code.
2025-07-13 21:58:53 +10:00
Brecht Van Lommel
b0d7e6d15f Fix: EEVEE glass BSDF broken after recent thin film addition
Caused by cf92af3ac4.
2025-07-10 16:55:06 +02:00
Brecht Van Lommel
d7cc940825 Logging: Log GHOST backend, GPU backend and GPU device
Important information that could not be found directly in the logs yet.

Pull Request: https://projects.blender.org/blender/blender/pulls/140244
2025-07-09 20:59:27 +02:00
Brecht Van Lommel
4653b65f7c Logging: Add DEBUG, TRACE severity, replace numeric levels
The numeric levels have no obvious meaning. This removes the distinction
between severity and levels, instead there is a single list of named levels
with defined meaning.

Debug means information that's mainly useful for developers, and trace is for
very verbose code execution tracing.

Pull Request: https://projects.blender.org/blender/blender/pulls/140244
2025-07-09 20:59:26 +02:00
Miguel Pozo
f46aa9a1ea Core: Add BLI_thread_queue priority and cancel support
Add functionality required for using BLI_thread_queue for shader compilation, as
discussed in #140214.

Pull Request: https://projects.blender.org/blender/blender/pulls/140992
2025-07-09 18:04:51 +02:00
Jeroen Bakker
4d9c5ebd97 Vulkan: Move Wayland/HDR support out of experimental
This PR moves Wayland/HDR support out of experimental.
This allows more people to test and provide feedback. We
can always decide later to disable it for the release, but so
far we only got positive feedback.

Pull Request: https://projects.blender.org/blender/blender/pulls/141666
2025-07-09 13:24:31 +02:00
Jeroen Bakker
807931166a Merge branch 'blender-v4.5-release' 2025-07-09 08:59:36 +02:00
Jeroen Bakker
2170739ba3 Fix #141628: Vulkan: Crash when index buffer could not be allocated
Added an early exit when the index buffer could not be allocated. Most
likely when there is an out of memory issue.

Pull Request: https://projects.blender.org/blender/blender/pulls/141653
2025-07-09 08:57:57 +02:00
Campbell Barton
1eb9933e5e Merge branch 'blender-v4.5-release' 2025-07-08 22:20:25 +10:00
Jeroen Bakker
402cf10760 Fix #141476: Vulkan: Disable descriptor buffer on Windows/Intel
Windows/Intel GPU crashes when descriptor buffer cannot be allocated
anymore. This PR enables a workaround by not using descriptor buffers.

In future we should investigate how to improve the GC of descriptor
buffers and review the limits.

Pull Request: https://projects.blender.org/blender/blender/pulls/141600
2025-07-08 14:02:51 +02:00
Omar Emara
3fcf4b4763 Merge branch 'blender-v4.5-release' 2025-07-08 08:59:03 +03:00
Omar Emara
1c98f29ed3 Fix: Wrong GL data format for RG integer textures
The GPU_RG16I format was assigned a wrong GL data format, which is
probably a typo.

Pull Request: https://projects.blender.org/blender/blender/pulls/141409
2025-07-08 07:57:33 +02:00
Campbell Barton
09260bf6c0 Merge branch 'blender-v4.5-release' 2025-07-08 15:38:58 +10:00
Campbell Barton
20ee5c2283 Fix buffer overflow reading the selection buffer
Reading from the top-right of the selection buffer could read
past the buffer bounds. Resolve by ensuring the clamped buffer
isn't empty. Relates to #141591.
2025-07-08 15:38:18 +10:00
Germano Cavalcante
289adf8616 Merge branch 'blender-v4.5-release' 2025-07-07 11:56:35 -03:00
Jeroen Bakker
b4e8ee02cc Fix #141238: Vulkan: Crash during upload huge geometry
In case Blender was able to allocate a vertex buffer for huge geometry,
but isn't able to allocate its staging buffer it would crash. In this
case errors will be reported in the console.

This PR fixes this by clearing the data in stead of uploading.

Pull Request: https://projects.blender.org/blender/blender/pulls/141553
2025-07-07 15:33:42 +02:00
Campbell Barton
0ceedc2a7d Cleanup: various non-functional changes in C++ 2025-07-05 09:03:09 +10:00
Clément Foucault
644fb2b679 Fix #98654: GPUOffScreen example has wrong color management
This was because the display shader never did the correct
color transformation.

This is a risky fix as it expects all input texture to be in
the correct colorspace (srgb). If they aren't this will
produce darker result.

If this is a huge issue we can introduce a global setting
(like line width) to set if the attached texture is
in srgb space or linear. This would avoid to change the
drawing code all over the place.

Pull Request: https://projects.blender.org/blender/blender/pulls/141237
2025-07-03 14:07:58 +02:00
Jeroen Bakker
4cd31eb5db Merge branch 'blender-v4.5-release' 2025-06-30 13:57:34 +02:00
Jeroen Bakker
9ff4328246 Fix #141078: Vulkan: Assert when uploading to large vertex buffers
When vertex buffers cannot be uploaded (buffer is to large) the buffer
will get a null handle. However it can still try to upload data to the
null handle.

Pull Request: https://projects.blender.org/blender/blender/pulls/141218
2025-06-30 13:57:06 +02:00
Jeroen Bakker
8b1b9ecae4 Merge branch 'blender-v4.5-release' 2025-06-30 13:55:57 +02:00
Jeroen Bakker
e3f2d8804f Fix #139189: Fix incorrect base and vertex offset in index buffers
When drawing batches the base and vertex offset were incorrectly
interpreted leading to artifacts.

Pull Request: https://projects.blender.org/blender/blender/pulls/141214
2025-06-30 13:55:13 +02:00
Jeroen Bakker
00d746059e Fix #140927, #140912: OpenGL: Annotate draw on surface broken
Recently we switched from Depth24S8 to Depth32FS8. On OpenGL the read
back of depth was not working as it asked the driver to download both
the depth and stencil part of the texture. This isn't supported when using floats
and would not return any data.

This PR forces OpenGL to read back depth component when a depth/stencil
texture is used.

Pull Request: https://projects.blender.org/blender/blender/pulls/141009
2025-06-26 10:05:27 +02:00
Jeroen Bakker
28add6cfea Merge branch 'blender-v4.5-release' 2025-06-26 08:50:36 +02:00
Jeroen Bakker
40eaaf089f Vulkan: Switch Qualcomm to switch to OpenGL
Due to driver issues qualcomm devices that try to start Blender with
a driver below 31.0.112.0 will automatically switch to OpenGL.

Pull Request: https://projects.blender.org/blender/blender/pulls/140902
2025-06-26 08:49:37 +02:00
Clément Foucault
872c8fb189 Fix #77909: Viewport Render Image clamps output
The issue was that this operator is using the same
path as the viewport display. So the colors are
clamped if the display is not HDR.
This fix is easy now that we have an HDR path for
the viewport display. We just enforce using it
when doing the viewport render preview.
2025-06-25 11:28:50 +02:00
Jeroen Bakker
e63a20fee1 Vulkan: HDR support for Wayland
This change enables HDR support for wayland as an experimental feature.
It supports both non-linear extended sRGB and un-clamped sRGB.

Windows isn't supported as the HDR settings are not accessible via an
API and would require similar settings that games use to configure the
monitor. Adding those sliders isn't what we would like to add.

Vulkan (working group) is working on new extensions that might change
the shortcomings. It isn't clear yet what the extension will do and what
the impact is for applications that want to use it. When the extension
is out we should review at the situation again.

Pull Request: https://projects.blender.org/blender/blender/pulls/133159
2025-06-24 11:51:14 +02:00
Jeroen Bakker
03caffe540 GPU: Deprecate GPU_DATA_UINT_24_8
GPU_DATA_UINT_24_8 isn't used anymore. We cannot phase out the data type
as it can still be used by add-ons. This PR will deprecate
`GPU_DATA_UINT_24_8`. When used in an add-on a deprecation message will
be shown.

Pull Request: https://projects.blender.org/blender/blender/pulls/140715
2025-06-20 12:17:20 +02:00
Jeroen Bakker
cdf538e1a7 Merge branch 'blender-v4.5-release' 2025-06-20 09:51:44 +02:00
Jeroen Bakker
d2e88494e1 Cleanup: Vulkan: Remove unused code
Removes `VKTexture::current_layout_` and `VKTexture::init`. The code
was unused since the introduction of the render graph.

Pull Request: https://projects.blender.org/blender/blender/pulls/140708
2025-06-20 09:51:19 +02:00
Jeroen Bakker
09af302457 GPU: Remove depth24 texture format
Metal and AMD/Intel/Vulkan don't support depth24 texture formats
natively. The backends implemented fallback to use depth32f in
stead.

Recently we removed all usages of depth24 to use depth32 and the
next step is to remove the depth24 format and the workarounds in
the backend.

Note: The removal of `GPU_DATA_UINT_24_8` isn't part of this PR.

Pull Request: https://projects.blender.org/blender/blender/pulls/140659
2025-06-19 16:24:06 +02:00
Jeroen Bakker
6f8bc55cef Merge branch 'blender-v4.5-release' 2025-06-19 14:13:47 +02:00
Jeroen Bakker
fefbdefbca Fix: Vulkan: Crash on exit
We detected that the gpu/draw tests could lead to
crashes after the tests where finished. It was
identified that the crash happened as the submission
runner wasn't exited, uses a mutex, that is being
destroyed by the main thread.

Solution is to wait until the submission runner has
finished, before destroying resources.

Pull Request: https://projects.blender.org/blender/blender/pulls/140650
2025-06-19 14:13:00 +02:00
Jeroen Bakker
a5e30aaa9e Refactor: GPU: Use Depth32F
Blender uses depth24 for legacy reasons. All backends that we support
have support for depth32f.

This PR updates all usages of depth24 with depth32f.

- depth24 are not supported on AMD/Intel/Vulkan and Metal. There depth32f
  was already used to work around this limitation.
- This allows us to implement reverse depth in workbench, overlay and
grease pencil in the future.

Pull Request: https://projects.blender.org/blender/blender/pulls/140531
2025-06-19 13:30:50 +02:00
Campbell Barton
954b492914 Cleanup: remove unused "use_bgl" from the GPU StateManager 2025-06-19 11:57:56 +10:00
Campbell Barton
05631085f8 Cleanup: spelling in comments (make check_spelling_*) 2025-06-19 11:40:00 +10:00
Alaska
b561c78f93 Nodes: Remove legacy combine/separate nodes
In Blender 3.3 (1) the individual combine and separate color nodes were
combined together into a single combine/separate color node.

To ensure legacy addons still worked, the old nodes were left in
Blender, but hidden from the Add menus.

It has been nearly 3 years since that change was made, most if not all
addons should have been updated by now. So this commit removes these
hidden legacy nodes.

(1) blender/blender@82df48227b

Pull Request: https://projects.blender.org/blender/blender/pulls/135376
2025-06-17 15:36:33 +02:00
Jeroen Bakker
e7a8ed0eab GPU: Fix testcase due to recent cleanups
Issue was introduced by !140340. This test has 2 different array sizes
and used the parameter for its range.
2025-06-17 12:28:04 +02:00
Jeroen Bakker
8b9bdf8236 Merge branch 'blender-v4.5-release' 2025-06-17 11:17:40 +02:00
Jeroen Bakker
ea1652dca3 Fix #140229: Vulkan: Crash during depth aware-navigation
Depth navigation sends many small render graphs to the device. It can be
that a subsequent render graph uses the same shader as the previous one
with the same descriptor set tracker. The descriptor set tracker didn't
cleared its full state and a subsequent render graph was generating
commands assuming that the device was in a certain state.

However it wasn't and a command to bind a descriptor set was skipped
resulting in a device out of bound write. Depending on the platform this
could overwrite any data on the GPU, including shader programs as the
select shader writes to a storage buffer. This clarifies why the issue
resulted in very odd and none consistent behavior.

This PR fixes this by clearing the VKPipelineData and
VKDescriptorTracker.

Pull Request: https://projects.blender.org/blender/blender/pulls/140526
2025-06-17 11:17:03 +02:00
Jeroen Bakker
8e6c208c5b Merge branch 'blender-v4.5-release' 2025-06-17 08:58:18 +02:00
Jeroen Bakker
701eb56f5e Fix #140129: Vulkan: Race condition render graph submission
When queueing render graphs for submission the adding of the queue was
not guarded. This could  still introduce a race condition, although
very unlikely.

Co-authored-by: Jorn Visser <git@jornvisser.com>

Pull Request: https://projects.blender.org/blender/blender/pulls/140517
2025-06-17 08:57:36 +02:00
Jacques Lucke
27b5e02eaf Fix: compiler error due to missing template parameter 2025-06-17 06:34:10 +02:00
Mattias Fredriksson
407dcb39d4 Tests: EXPECT_EQ_SPAN utility macro
Replaces pointer based EXPECT_EQ_ARRAY with EXPECT_EQ_SPAN in most cases
as they already used spans (or span compatible datastructures).
Currently EXPECT_EQ_ARRAY only takes in one size variable and doesn't
compare the  number of elements between arguments (requiring an
additional line to do so).

This should make the code cleaner and safer. Goal is also to promote
the use Spans in new test code.

Pull Request: https://projects.blender.org/blender/blender/pulls/140340
2025-06-16 20:31:00 +02:00
marcopavanello
ab21755aaf Shaders: Remove old Preetham and Hosek sky texture models
Remove old Preetham and Hosek-Wilkie sky models, which are less accurate.
The Nishita improved model has been available for long enough.

Pull Request: https://projects.blender.org/blender/blender/pulls/139923
2025-06-16 14:36:18 +02:00
Clément Foucault
decd88f67e Python: Remove deprecated BGL API
The API was in a deprecation state for many years now.
This API was not compatible with Metal nor Vulkan.

This also remove `Image.bindcode`.

Pull Request: https://projects.blender.org/blender/blender/pulls/140370
2025-06-16 12:50:50 +02:00
Clément Foucault
9ddc67166f Fix: GPU: Hang on Mesa with --debug-gpu on opengl
Just workaround the issue.
2025-06-16 12:44:16 +02:00
Clément Foucault
d6f9414c27 Fix #140367: EEVEE: Materials with special characters fail to compile
These `CREATE_INFO_` guards are not yet used.
Still have special case for materials.
2025-06-16 11:28:04 +02:00
Clément Foucault
0b5b1932a0 Merge branch 'blender-v4.5-release' 2025-06-16 11:02:55 +02:00