Devices reported by failing drivers were still part of the device
selection list. When selected they would never be picked.
This change hides these devices from the UI
Pull Request: https://projects.blender.org/blender/blender/pulls/131431
In OpenGL the last vertex is the provoking vertex. In Vulkan the first
vertex is the provoking vertex. This PR uses `VK_EXT_provoking_vertex`
to use the last vertex as the provoking vertex.
Pull Request: https://projects.blender.org/blender/blender/pulls/131412
Continuation of #131332.
Including built-in headers in VS2019 ends up including `corecrt_math.h`
as a side effect, which has many functions that overlap in name with
our stubs.
This puts the conflicting functions inside its own namespace (`glsl`)
and declares macros for them.
(Note this has the side effect of not allowing us to use those as
variable names)
This also removes the `<cassert>` and `<cstdio>` includes.
Pull Request: https://projects.blender.org/blender/blender/pulls/131386
There seems to be an issue inside Intel OpenGL driver of legacy
platforms that fails to link `gpu_shader_sequencer_strips`.
Uniform locations are used to fix an specialization constants issue.
This PR only adds the uniform location when the shader can be
specialized. It is unclear what is actually failing inside the driver
but there are other issues with the driver.
Pull Request: https://projects.blender.org/blender/blender/pulls/131293
When copying from/to depth stencil images the aspect of the image was
set incorrectly. It pointed to only one aspect of the full image when
building resource links, which could lead to incorrect decisions in the
driver.
Found when researching #131269
Pull Request: https://projects.blender.org/blender/blender/pulls/131298
The new buffer size could have been non aligned when using the
fractional growing heuristic. This non aligned allocation
would then trigger an assert at the SSBO constructor.
Aligning the alocation size fixes the issue.
GPU and GHOST require to have identical checks to remove faulty drivers.
When not done GHOST can still select a device that isn't supported and
lead to freezing interfaces.
Pull Request: https://projects.blender.org/blender/blender/pulls/131241
This was caused by querying on the selection state
before it is setup. It is only setup just before
the draw function.
To fix this, we sync the `info_buf` just before
drawing the overlays.
Also add some safety to avoid uninitialized memory.
Its not standard how `Present Engines` return images for presentation, and
currently is expected that they cycle between swap-chain images with each
`vkAcquireNextImageKHR` call.
However present engines could return any available image, that can mean
to reuse the last presented one if available. (This seem to be the behavior
using `Layered on DXGI Swapchain` the default `Present Method` used
with latest NVIDIA drivers on Windows).
Since resource pools expects to images to cycle in a sequential order, if any
present engine always return the same image for presentation only a single
resource pool would be used for each rendered frame, and since resources
are only released by cycling between resource pools, this resource pool would
overflow since it never releases any resource.
This changes makes resource pools to cycle each time a image is presented.
Pull Request: https://projects.blender.org/blender/blender/pulls/131129
This avoid stack overflow on GCC because types were getting too
large (70 bytes for a float4) and created a lot of static
memory for UBOs declarations.
When a main window contains a child window and the main window is closed
it can crash as the context isn't available when destructing the
VKFramebuffer of the child window.
Pull Request: https://projects.blender.org/blender/blender/pulls/131137
This happened because NVidia GPUs require higher alignment
for SSBO binds than for vertex inputs.
This is related to #131103 which fixed it for vulkan.
Add a common capability option for that.
Since recently we bind immediate sub buffers as storage buffers to
extend the geometry for line drawing. We didn't add alignment checks and
that raised warnings. This change will fix those warnings.
Pull Request: https://projects.blender.org/blender/blender/pulls/131103
When lighting baking is used in a background render the resources are
freed to early. The cause is that light baking does some initialization
within a context, that isn't send to the GPU. The first iteration of
light baking is expecting that it can free resources, what leads to GPU
resources to be deleted that are still used by commands that are
scheduled to be send to the GPU.
This PR fixes this by using multiple resource pools when background
rendering and ensure that contexts are send to the GPU when rendering
ends.
Pull Request: https://projects.blender.org/blender/blender/pulls/131094
Add support for Logic op XOR. This is used in image editors and tracking
editor. Logic ops is required on Linux and Windows, however for macOS it
will be disabled when using MoltenVK. MoltenVK has can be compiled with
support for logic ops, but that isn't the default as it relies on
private APIs.
When the workaround is enabled it will create artifacts when used.
Ref: #130347
Pull Request: https://projects.blender.org/blender/blender/pulls/131089
When debugging render graph the debug group name can narrow down the
place where a node originates from. This PR adds a function to retrieve
the full debug group name of a specific node.
Pull Request: https://projects.blender.org/blender/blender/pulls/131081
This port is not so straightforward.
This shader is used in different configurations and is
available to python bindings. So we need to keep
compatibility with different attributes configurations.
This is why attributes are loaded per component and a
uniform sets the length of the component.
Since this shader can be used from both the imm and batch
API, we need to inject some workarounds to bind the buffers
correctly.
The end result is still less versatile than the previous
metal workaround (i.e.: more attribute fetch mode supported),
but it is also way less code.
### Limitations:
The new shader has some limitation:
- Both `color` and `pos` attributes need to be `F32`.
- Each attribute needs to be 4byte aligned.
- Fetch type needs to be `GPU_FETCH_FLOAT`.
- Primitive type needs to be `GPU_PRIM_LINES`, `GPU_PRIM_LINE_STRIP` or `GPU_PRIM_LINE_LOOP`.
- If drawing using an index buffer, it must contain no primitive restart.
Rel #127493
Co-authored-by: Jeroen Bakker <jeroen@blender.org>
Pull Request: https://projects.blender.org/blender/blender/pulls/129315
When using texture painting Blender could freeze, crash or not showing
any results depending on the platform being used.
There were several issues:
- texture painting could send a layer offset of -1, which would select
an incorrect layer
- source data wasn't copied correctly in the staging buffer as it
ignored `texture_unpack_row_length`
Pull Request: https://projects.blender.org/blender/blender/pulls/130973