Age | Commit message (Collapse) | Author |
|
|
|
|
|
The new Xcode 14.1 brings the new Apple Clang compiler which
considers sprintf unsafe and geenrates deprecation warnings
suggesting to sue snprintf instead. This only happens for C++
code by default, and C code can still use sprintf without any
warning.
This changes does the following:
- Whenever is trivial replace sprintf() with BLI_snprintf.
- For all other cases use the newly introduced BLI_sprintf
which is a wrapper around sprintf() but without warning.
There is a discouragement note in the BLI_sprintf comment to
suggest use of BLI_snprintf when the size is known.
Differential Revision: https://developer.blender.org/D16410
|
|
|
|
|
|
Function casts hid casting between potentially incompatible type
signatures (using int instead of Py_ssize_t). As it happens this seems
not to have caused any bugs on supported platforms so this change is
mainly for correctness and to avoid problems in the future.
|
|
Some BPy_StructRNA methods used BPy_PropertyRNA in their function
signatures, while this didn't case any bugs, it could lead to issues
in the future.
|
|
Missed these changes in [0].
Also replace designated initializers in some C code, as it's not used
often and would need to be removed when converting to C++.
[0] e555ede626dade2c9b6449ec7dcdda22b2585fd4
|
|
Use struct identifiers in comments before the value.
This has some advantages:
- The struct identifiers didn't mix well with other code-comments,
where other comments were wrapped onto the next line.
- Minor changes could re-align all other comments in the struct.
- PyVarObject_HEAD_INIT & tp_name are no longer placed on the same line.
Remove overly verbose comments copied from PyTypeObject (Python v2.x),
these aren't especially helpful and get outdated.
Also corrected some outdated names:
- PyTypeObject.tp_print -> tp_vectorcall_offset
- PyTypeObject.tp_reserved -> tp_as_async
|
|
|
|
|
|
|
|
This patch adds a placeholder for the vulkan backend.
When activated (`WITH_VULKAN_BACKEND=On` and `--gpu-backend vulkan`)
it might open a blender screen, but nothing should be visible as
none of the functions are implemented or otherwise crash on a nullptr.
This is expected as this is just a placeholder. The goal is to add shader compilation
+validation to this backend as one of the next steps so we can validate
changes to existing shaders on OpenGL, Metal and Vulkan at the same time.
Reviewed By: fclem
Differential Revision: https://developer.blender.org/D16338
|
|
Function returns the active GPU backend type.
|
|
|
|
Show the windowing environment on non MS-Windows/Apple systems,
since X11/WAYLAND are selected startup there was no convenient way
for users to know which back-end was being used.
Include the windowing environment in the About splash & system-info.txt
since it will be useful for handling bug reports.
This commit adds a private API call not intended for general use
as I would like to be able to remove this later and it's only needed
in the specific case of testing if Blender is using WAYLAND or X11
(which maybe be used via XWayland).
Python scripts can already inspect the system to check which windowing
environment used, the API call is mainly useful for troubleshooting.
|
|
|
|
|
|
|
|
Uninitialized stack memory was used when intersecting 2D vectors.
|
|
|
|
Missed flipping arguments for caller.
|
|
Rename BKE_appdir_folder_id_version to
BKE_appdir_resource_path_id_with_version because BKE_appdir_folder_id
and BKE_appdir_folder_id_version didn't accept compatible arguments.
Also add notes to GHOST_getSystemDir & GHOST_getUserDir that
BKE_appdir_resource_path_id(..) should be used instead (in most cases).
|
|
This is the conventional way of dealing with unused arguments in C++,
since it works on all compilers.
Regex find and replace: `UNUSED\((\w+)\)` -> `/*$1*/`
|
|
Contributed by luzpaz.
Differential Revision: https://developer.blender.org/D16071
|
|
|
|
Mathutils types were always GC tracked even when it wasn't intended.
Not having to track objects speeds up Python execution.
In an isolated benchmark created to stress test the GC
creating 4-million vectors (re-assigning them 100 times), this gives
an overall ~2.5x speedup, see: P3221.
Details:
Since [0] (which added support for sub-classed mathutils types)
tp_alloc was called which defaults to PyType_GenericAlloc which always
GC tracked the resulting object when Py_TPFLAGS_HAVE_GC was set.
Avoid using PyType_GenericAlloc unless the type is sub-classed,
in that case the object is un-tracked.
Add asserts that the tracked state is as expected before tracking &
un-tracking, to ensure changes to object creation don't cause objects
to be tracked unintentionally.
Also assign the PyTypeObject.tp_is_gc callback so types optionally GC
track objects only do so when an object is referenced.
[0]: fbd936494495d0de54eef24a97957e000306785f
|
|
|
|
Improve correctness, API, comments, memory usage and performance
of the 2D convex hull calculation.
Pre-requisite for UV packing improvements.
Differential Revision: https://developer.blender.org/D16055
|
|
Depending on the actual platform, Blender will disable features that are
known to have a faulty implementation. Add-on developers or users don't
have the ability to check what is actually enabled.
This patch will add the ability to check for
* Compute shader support `gpu.capabilities.compute_shader_support_get()`.
* SSBO support `gpu.capabilities.shader_storage_buffer_objects_support_get()`.
* Image load/store `gpu.capabilities.shader_image_load_store_support_get()`.
|
|
|
|
Some changes missed from f68cfd6bb078482c4a779a6e26a56e2734edb5b8.
|
|
|
|
|
|
Correction of U.dpi to hold actual monitor DPI. Simplify font sizing by
omitting DPI as API argument, always using 72 internally.
See D15961 for more details.
Differential Revision: https://developer.blender.org/D15961
Reviewed by Campbell Barton
|
|
refactor-mesh-position-generic
|
|
|
|
As with the other uniform methods, a single value is expected.
|
|
refactor-mesh-position-generic
|
|
Allow building a standalone mathutils without including imbuf.
|
|
refactor-mesh-position-generic
|
|
|
|
refactor-mesh-position-generic
|
|
This simplifies python code.
When we call a method like shader.uniform_float("color", (1,1,1,1)),
we expect the shader's uniform to be updated regardless of whether the
shader is bound or not.
And `batch.draw()` already calls `GPU_shader_bind` inside.
Differential Revision: https://developer.blender.org/D15929
|
|
|
|
While both are supported, 'arg' is in more common use so prefer it.
|
|
And remove Python flags from nodes, no longer needed.
|
|
|
|
|
|
refactor-mesh-position-generic
|