Adding checks for platform capabilities involved adding functions
to multiple classes and was too involved.
Replace this with a single GHOST_System::getCapabilities() function.
Workaround gnome-shell including uninitialized memory when pasting
from the clipboard. Where `read` would not write data into the range
return by the length.
Reading from the pipe into a power-of-two buffer
works around the problem.
It's not clear why this only impacts gnome-shell - as there is no
significant down-side to changing the buffer size, apply a workaround.
Ref !106091.
Workaround gnome-shell including uninitialized memory when pasting
from the clipboard. Where `read` woud
Reading from the pipe into a power-of-two buffer
works around the problem.
It's not clear why this only impacts gnome-shell - as there is no
significant down-side to changing the buffer size, apply a workaround.
Only the text editor supported the primary clipboard & only for modal
selection. Now selecting text in the console & 3D text editing also
sets the primary clipboard under X11 & Wayland.
Notes:
- Pasting from the primary clipboard isn't yet exposed in the key-map
so in practice it's only useful for pasting text outside of Blender.
- Use skip-save option when pasting from the primary selection
so this is never used by the regular paste shortcut.
- This commit adds a primary-clipboard flag to WM_capabilities_flag() so
creating the the copy-buffer is only performed when necessary.
This PR uses renderdoc for frame capturing when enabled.
It enabled an easier workflow for frame capturing.
- Capture GPU API calls from test cases
- Capture GPU API calls from background threads
- Capture GPU API calls from background rendering.
Renderdoc is an important GPU debugger used by the Eevee/
Viewport module. Previously we needed to change code in
order to record background rendering, that could on its own
lead to other side-effects.
The integration with renderdoc can be enabled using
`WITH_RENDERDOC=On` compiler option. `GPU_debug_capture_begin`
and `GPU_debug_capture_end` can be added to the section
of the code you want to debug. When running Blender inside
renderdoc this part will automatically be captured.
All GPU test cases are now guarded by these calls. In order
to capture the test cases you need to start the test cases
from renderdoc and the captured GPU API calls will appear
where each capture is a single test case.
Pull Request: https://projects.blender.org/blender/blender/pulls/105921
was assuming such cases are already handled before this function is
called, but seems to be broken on windows and linux. Do
`safe_normalize()` so the tests pass, will check the problem afterwards.
Use XCURSOR_THEME & XCURSOR_SIZE environment variables for Wayland.
While this isn't an official part of the spec, many Wayland compositors
& applications use these variables.
* Group bounding box, bounding cone and energy to a struct called `LightTreePrimitivesMeasure`
* Add utility functions to add primitives to nodes or buckets
* Precompute the split bucket cost to improve efficiency (about 1.4x expected)
Pull Request: https://projects.blender.org/blender/blender/pulls/105931
Push a task to `TaskPool` when more than `MIN_PRIMS_PER_THREAD` primitives are to be processed. The nodes are rearranged in a depth-first order when copied to the device.
Tested with the scene in #105550 on an Apple M1 Ultra (20 cores), about 11x speedup.
Pull Request: https://projects.blender.org/blender/blender/pulls/105862
Implements #102359.
Split the `MLoop` struct into two separate integer arrays called
`corner_verts` and `corner_edges`, referring to the vertex each corner
is attached to and the next edge around the face at each corner. These
arrays can be sliced to give access to the edges or vertices in a face.
Then they are often referred to as "poly_verts" or "poly_edges".
The main benefits are halving the necessary memory bandwidth when only
one array is used and simplifications from using regular integer indices
instead of a special-purpose struct.
The commit also starts a renaming from "loop" to "corner" in mesh code.
Like the other mesh struct of array refactors, forward compatibility is
kept by writing files with the older format. This will be done until 4.0
to ease the transition process.
Looking at a small portion of the patch should give a good impression
for the rest of the changes. I tried to make the changes as small as
possible so it's easy to tell the correctness from the diff. Though I
found Blender developers have been very inventive over the last decade
when finding different ways to loop over the corners in a face.
For performance, nearly every piece of code that deals with `Mesh` is
slightly impacted. Any algorithm that is memory bottle-necked should
see an improvement. For example, here is a comparison of interpolating
a vertex float attribute to face corners (Ryzen 3700x):
**Before** (Average: 3.7 ms, Min: 3.4 ms)
```
threading::parallel_for(loops.index_range(), 4096, [&](IndexRange range) {
for (const int64_t i : range) {
dst[i] = src[loops[i].v];
}
});
```
**After** (Average: 2.9 ms, Min: 2.6 ms)
```
array_utils::gather(src, corner_verts, dst);
```
That's an improvement of 28% to the average timings, and it's also a
simplification, since an index-based routine can be used instead.
For more examples using the new arrays, see the design task.
Pull Request: https://projects.blender.org/blender/blender/pulls/104424
The name #ensure_valid_reflection seems to indicate that the resulted
reflection must be valid, whereas in the reality it only ensure validity
for specular reflections. The new name matches the behavior better.
This function checks if the shading normal would result in an invalid reflection into the lower hemisphere; if it is the case, the function raises the shading normal just enough so that the specular reflection lies above the surface. This is a trick to prevent dark regions at grazing angles caused by normal/bump maps. However, the specular direction is not a good representation for a diffuse material, applying this function sometimes brightens the result too much and causes unexpected results. This patch applies the function to only glossy materials instead.
Pull Request: #105776
Actually both potential roots lie in the interval [0, 1], so the
function ended up checking both roots all the time.
The new implementation explains why only one of the roots is valid; it
saves two square roots and a bunch of other computations.
This changes the maximum viewport resolution divider for Cycles to
help users get a more responsive viewport.
This is done by changing the maximum viewport resolution divider
to a divider that aims to have the largest axis of the viewport
roughly equal to 128 pixels.
Depending on the circumstances, this change can result in a few
noticeable differences:
- Users with slow hardware and a large pixel_size, or slow hardware
and a low resolution screen, may observe a higher resolution viewport
during navigation, making the scene more readable. However this comes
at the cost of reduced responsiveness.
- Users with slow hardware and a low pixel_size and high
resolution screen may observe a lower resolution viewport during
navigation, providing a more responsive viewport during navigation.
Along with that, how Cycles iterates through resolution dividers
is changed to promote quick transitions between resolution dividers.
Meaning users don't need to wait through as many iterations to get
from a low navigation resolution to a 1:1 viewport resolution.
Pull Request: https://projects.blender.org/blender/blender/pulls/105581
When linking a texture directly to the material output, it's likely being
done for the purpose of previewing. In that case, bias the heuristic towards
not building a light tree, as it's likely not needed and slow on dense meshes.