The only annoying part is that for the external MDISPS the mesh
needs to be cast to non-const.
Arguably it is semantically correct behavior as the details of
how external data is read is kind of implementation details.
- Return evaluated points as function return value.
Used in cases when only limit or final point is requested, without
partial derivatives.
- Re-order function argument list and use default argument values to
simplify usage in the simple/typical cases.
No functional changes expected.
This PR adds recycling of descriptor pools. Currently descriptor pools
are discarded when full or context is flushed. This PR allows
descriptor pools to be discarded for reuse.
It is also more conservative and only discard
Descriptor pools when they are full or fragmented.
When using the Vulkan backend a small amount of descriptor memory can leak. Even
when we clean up all resources, drivers can still keep data around on the
GPU. Eventually this can lead to out of memory issues depending on how
the GPU driver actually manages descriptor sets.
When the descriptor sets of the descriptor pool aren't used anymore
the VKDiscardPool will recycle the pools back to its original VKDescriptorPools.
It needs to be the same instance as descriptor pools/sets are owned by
a single thread.
Pull Request: https://projects.blender.org/blender/blender/pulls/144992
get_texture_colorspace_name accessed byte_buffer instead of
float_buffer; introduced in 18110744a2. In practice VSE seems to
always fill colorspaces, so does not cause a very visible bug.
Instead of matching regions, free all popups using
UI_popup_handlers_remove_all which also calls the remove callback
that frees the uiPopupBlockHandle.
Deleting or changing the screen with a popup (error report in this case)
wasn't removing the popup, it would attempt to display using it's
region which had been freed when changing the screen.
Regression in [0] an unsaved file would be an empty string which could
be equal to "libname" causing them to be considered equal, resulting
in an error thatthe file was linking in itself.
Resolve by only performing this check on saved files.
fa29d28d73
This PR adds HDR support for Windows for `VK_COLOR_SPACE_EXTENDED_SRGB_LINEAR_EXT`
on `VK_FORMAT_R16G16B16A16_SFLOAT` swapchains .
For nonlinear surface formats (sRGB and extended sRGB) the back buffer is blit into the swapchain,
When VK_COLOR_SPACE_EXTENDED_SRGB_LINEAR_EXT is used as surface format a compute shader
is used to flip and invert the gamma.
SDR white level is updated from a few window event changes, but actually
none of them immediately respond to SDR white level changes in the system.
That requires using the WinRT API, which we don't do so far.
Current limitations:
- Intel GPU support
- Dual GPU support
In the future we may add controls inside Blender for absolute HDR nits,
across different platforms. But this makes behavior closer to macOS.
See !144565 for details
Co-authored-by: Brecht Van Lommel <brecht@blender.org>
Pull Request: https://projects.blender.org/blender/blender/pulls/144717
Pool of VolumeInfo was never reset. Detected when stress testing
the vulkan backend using tree_creature.blend where the world
volume was converted to a volume object.
Pull Request: https://projects.blender.org/blender/blender/pulls/144967
When disabling cursor constraint NumInput::idx_max was set to -1.
This looks to be the behavior since 2.4x, however more recently
the modulo of `idx_max + 1` was used to cycle the axis when pressing
tab (crashing when `idx_max` is -1).
Resolve by setting `NumInput::idx_max` to the number of axes since
this is the state when transform is initialized.
Only create an outliner tree element for all Action slots in specific
modes of the outliner. The "object-hierarchical" modes (Scene, View
Layer) show the Action underneath each user of that Action; in these
cases, only the assigned slot is shown now.
Previously all slots would be shown, in all modes of the Outliner. This
meant quadratic complexity, as each Action is included in the tree for
each of its users, and then each of those tree items would show all
slots. This means the number of tree items for the slots was multiplied
by the number of users.
Pull Request: https://projects.blender.org/blender/blender/pulls/144864
In the Node Editor itself, you cannot edit a linked Nodetree (add nodes,
drag from a socket etc., so basically no actions allowed).
In the Properties Editor (Material tab) however, where we display the
Nodetree differently (via `uiTemplateNodeView`) and while editing
properties themselves was already disabled, you could still edit node
**links** (thus **adding** nodes to the tree).
This would all be lost on file reload though, so better prevent this.
To resolve, just disable the socket / NodeLink button when looking at a
linked Nodetree.
NOTE: the "not in a linked nodetree" disabled hint is not showing yet,
something I intend to fix in an upcoming PR (it is also not showing this
for properties generally in the node editor).
Pull Request: https://projects.blender.org/blender/blender/pulls/144930
* Bundled ICC profiles for display spaces supported by Blender, and
embed them in the image file when saving.
* Verified to work for PNG, TIFF, JPEG and WebP, but not all file
formats support this.
* No ICC profile is written for sRGB currently. It would be a matter
of adding an icc file, however this may be a breaking change for
some use cases.
* Fix save as render of EXR files not properly changing the image
colorspace to match.
Uses CC0 licensed ICC files from the Compact ICC Profiles project.
This does not include support for saving HDR images. While there exist
ICC profiles for PQ, they are not well supported and the preferred method
for HDR is to write CICP tags. However OpenImageIO support for this is
still under development.
Ref #144911
Pull Request: https://projects.blender.org/blender/blender/pulls/144565
These should at least show the correct colors and gamut now, following the
color picking space in the OpenColorIO config.
However the ACES config use sRGB as the color_picking role, which means
that the color picker only shows a limited a gamut. There is apparently is
not agreement on the interpretation of this role, so we might have to stop
using it.
Additionally, if you set the color_picking role to something like ACEScg +
sRGB transfer function, the widgets do show all the colors in the gamut,
however the gamut is probably too large to be practical for most uses. So
we need some UI solution for this regardless.
Ref #144911
Pull Request: https://projects.blender.org/blender/blender/pulls/144565
This was a temporary solution until we had proper HDR displays.
* Auto detect from the display + view transform if they are HDR, and
enable it automatically. This is based on encoding hdr-video in the config.
* If a HDR transform is selected and there is no HDR display support, an
info message will be shown in the color management panel.
* It is now possible to view HDR images in the image editor, without
needing to use "View as Render".
* There is no versioning to switch to a HDR display, because that also
affects image saving. So users will have to manually select the
"Rec.2100 PQ" display to see HDR colors again.
Ref #144911
Pull Request: https://projects.blender.org/blender/blender/pulls/144565
* Change meaning of display device to be the device that we are trying
to emulate, not the monitor configuration.
* The display transform is now:
* User specified view and display transform
* Clamp to 0 to limit colors to gamut
* Inverse untonemapped display transform
* Convert to extended sRGB
* When using the display space in the color management API, it now needs to
be specified if it's for drawing (with emulation) or file output or color
inspection (without).
Like HDR, this only works on macOS and Linux + Wayland + Vulkan currently.
Support for Windows/Vulkan is under development in #144717.
Ref #144911
Pull Request: https://projects.blender.org/blender/blender/pulls/144565
For display and image saving, we need to know certain properties of displays
and view transforms that OpenColorIO does not explicitly provide. In the
upcoming OpenColorIO 2.5 there will be an interop ID for color spaces that
adds more information. This moves towards that design, with heuristics for
configs that don't have the interop IDs.
* Try to use the first colorspace alias as the interop ID. This is used in
some existing configs, and now the Blender config as well.
* Improve ACES 2.0 config compatibility by interpreting some aliases like
srgb_display as interop IDs.
* Detect is_srgb and is_wide_gamut through display colorspace interop ID.
These are now per view rather than per display.
* Detect is_extended where we can't clamp to 0..1 through interop ID.
* Detect untonemapped view as config wide default view transform for converting
between reference and display space, if "Standard" or "Un-tone-mapped" can
not be found.
* Detect which display and view transform combination is HDR by checking for
"hdr-video" encoding on the display colorspace in the OpenColorIO config.
Ref #144911
Pull Request: https://projects.blender.org/blender/blender/pulls/144565
* PROP_COLOR_GAMMA is sRGB, not display space
* Hex colors are always sRGB
* Image byte buffers are in byte_buffer.colorspace
Fixes for sequencer text, image painting, render stamp and tooltips.
The default display space is sRGB, so this change will not be noticed
in most files.
Ref #144911
Pull Request: https://projects.blender.org/blender/blender/pulls/144565
DEG_add_collision_relations was only adding relationships for objects in
the brush collection, however dynamic paint also updates parent objects
and armature poses which weren't accounted for. Failing to include these
relations meant the evaluating the depsgraph could evaluate a pose
object from multiple threads at once - causing a crash.
Resolve by sharing logic between DEG_add_collision_relations &
BKE_object_modifier_update_subframe so depsgraph relationships match
objects the dynamic-paint modifier updates as part of its evaluation.
Ref !144844
Improve the documentation for the Bone coordinate spaces and these struct fields:
- `head` & `tail`
- `bone_mat`
- `arm_head` / `arm_tail`
- `dist`
No functional changes.
Pull Request: https://projects.blender.org/blender/blender/pulls/143729
When unlinking object from unused data display mode, crash occurred due
to dangling pointer (`id->lib->runtime`) of parent tree element. Here
parent is "Objects" tree element which is not an actual ID. Similar to
other unlink callback, add an extra check to ensure we're unlinking from
valid ID/tree element.
Pull Request: https://projects.blender.org/blender/blender/pulls/144853
This is a workaround for an issue in SPIRV-Optimizer. When optimizing
large shaders the optimizer can crash. This can be fixed by altering the
maximum object ids and performing a compact ids in the end. However this
part of the API is not accessible via ShaderC.
To work around the issue shader optimizations are being disabled for
large shaders. The issue has been reported upstream.
Pull Request: https://projects.blender.org/blender/blender/pulls/144774