Compare commits

..

55 Commits

Author SHA1 Message Date
d17551c10f Assert that texture is valid before binding it. 2022-01-11 23:27:56 +01:00
ecd40a4bc2 Improve getters for draw::Texture 2022-01-11 23:20:45 +01:00
d263ae4cde Add better comments and correct the namespace 2022-01-11 23:05:29 +01:00
91f4550473 Merge branch 'tmp-vector-template' into drw-gpu-wrapper 2022-01-11 22:50:14 +01:00
a564817cb8 Make mixed vec4 type constructor works with different vector types 2022-01-11 21:08:49 +01:00
4192ef4471 Add constructor tests 2022-01-11 21:06:11 +01:00
4795315b53 Add clamp() to templated functions 2022-01-11 21:02:09 +01:00
dff5c48000 Fix type conversion error on MSVC (thanks @JacquesLucke for that) 2022-01-11 19:20:11 +01:00
679d9bef5b Remove BLI_double2|3.hh files 2022-01-11 17:11:04 +01:00
eeb0a5c654 Merge branch 'master' into tmp-vector-template
# Conflicts:
#	source/blender/nodes/geometry/nodes/node_geo_input_normal.cc
2022-01-11 16:43:03 +01:00
c5dbff8786 Change comment to be more meaningful. 2022-01-11 16:32:03 +01:00
c3f2b64c6f Group vector types declaration into BLI_math_vec_types.hh and BLI_math_vec_mpq_types.hh 2022-01-11 16:26:29 +01:00
fe4c2970a0 Remove file scope using namespace blender; 2022-01-11 14:33:51 +01:00
f72f4d96bf Deduplicate cross_poly implementation 2022-01-11 14:19:35 +01:00
c3b3821cce Simplify template macros 2022-01-11 13:55:59 +01:00
fcf3ddfb48 Add asserts that modulo second argument is not zero. 2022-01-11 13:54:31 +01:00
6bfa578d0c Move is_zero and is_any_zero to blender::math namespace. 2022-01-11 13:49:57 +01:00
d43ca533e3 Use early return instead of result variable. 2022-01-11 13:44:26 +01:00
892a4927f9 Merge branch 'master' into tmp-vector-template 2022-01-10 23:23:23 +01:00
8fe642e97a Set uint_type as void if type is larger than 64bits 2022-01-10 22:53:38 +01:00
988dc73a14 Use using instead of typedef inside of vec_base 2022-01-10 22:53:38 +01:00
06dc56c176 Fix template specialization error 2022-01-10 22:53:37 +01:00
3b6733c504 BLI_math_vec_types: Add bit shift operators 2022-01-10 20:11:54 +01:00
243296db6a Rework macro name and add manhattan distance & Length functions 2022-01-10 20:11:44 +01:00
4c95619a78 BLI_math_vector: Split vector template and vector functions into 2 files
Also rework the macros to be less context dependent.
2022-01-10 18:21:05 +01:00
88498ab9b5 BLI_math_vector: Remove old implementation 2022-01-10 18:21:05 +01:00
fd2653323b BLI_math_vector: Templated version of vector type that supports size
This removes many code duplication and allow for arbitrary size of
vector.
2022-01-10 18:21:05 +01:00
50840bd3d7 BLI_utildefines: Move BLI_ENABLE_IF to utildefines
This is a more suitable place for it to be use throughout the codebase.
2022-01-10 15:35:55 +01:00
a6fcfe5174 Merge branch 'master' into tmp-vector-template
# Conflicts:
#	source/blender/blenlib/BLI_float2.hh
#	source/blender/blenlib/BLI_float3.hh
#	source/blender/blenlib/BLI_float4.hh
2022-01-10 13:59:53 +01:00
faeab8367c BLI_floatX: Add most missing constructors and operator
This should have no side effect.

This reverse the dependency, with `float2` being needed for `float3` and
so on.

This is needed for extensive usage of these types in the draw engines.

Differential Revision: https://developer.blender.org/D13756
2022-01-10 13:52:08 +01:00
1aa962825b Use same order of arguments for Texture.ensure*() 2022-01-10 11:36:20 +01:00
7c98c97933 Use int vector types for extent and use ADL for constructor. 2022-01-10 02:09:48 +01:00
54c2d6a06d DRW_gpu_wrappers: Fix some inheritance issue and use vector types as parameter 2022-01-10 01:36:41 +01:00
009bfa4e34 Merge branch 'tmp-vector-template' into drw-gpu-wrapper 2022-01-10 01:12:36 +01:00
d55eaefa8f Cleanup: Use type_length in vec4_base 2022-01-10 00:58:49 +01:00
6ffa70a427 Move isect_seg_seg to math namespace
This way it is easier to add more variations later with
different component count.
2022-01-10 00:28:30 +01:00
438bff315d BLI_math_vector: Refactor mpq2 & mpq3 to use template version
Note that this removes the copy & move constructor and assignment
from mpq2.
2022-01-10 00:05:48 +01:00
abdf952f81 BLI_math_vector: Refactor double3 to use template version 2022-01-09 22:34:45 +01:00
e3d9c72074 BLI_math_vector: Fix operator type for vec2_base 2022-01-09 22:14:40 +01:00
56522c9e15 BLI_math_vector: Move float2 and double2 to use template 2022-01-09 22:14:28 +01:00
3218970b83 delaunay_2d.cc: Use math:: namespace vector operations 2022-01-09 22:10:44 +01:00
87d0d2b0ca float2::isect_seg_seg: Remove mu as part of the return struct
This is to be able to template the function.
2022-01-09 22:08:51 +01:00
f29f9468f5 BLI_int2/3/4: Add support for integral vector types 2022-01-09 19:01:39 +01:00
445a594c29 DRW: Add DRW_gpu_wrapper.hh
This file contains templates and classes that makes using the
GPU objects easier in C++ and with the draw manager.
2022-01-09 18:51:51 +01:00
950f2d7f52 BLI_float4: Replace float4 with templated version 2022-01-08 22:17:18 +01:00
acdca99771 BLI_vector_template: Add back all explicit constructors
This is because there are ambiguities with the c-style pointer
constructors.
2022-01-08 22:15:59 +01:00
9d06293482 BLI_float3: Replace float3 with templated version
Change also the namespace of all the function `float3` becomes `math`.
2022-01-08 22:04:14 +01:00
57c0a538da Rename last vector methods to use the static function version 2022-01-08 22:04:13 +01:00
c2b1ee5c0f Rename normalize to use the static function version 2022-01-08 22:04:13 +01:00
a515079149 BLI_float3: add normalize to double and float2 2022-01-08 22:04:13 +01:00
17c21e5cfa BLI_float: Rename length & length_squared to use static version 2022-01-08 22:04:13 +01:00
314cb58334 BLI_float: Rename normalize to use static version 2022-01-08 22:04:13 +01:00
a4b2b30cce BLI_float3: Add static functions equivalent of public methods
This is to ease the port towards the new templated functions.
2022-01-08 22:04:13 +01:00
34e22b6308 Add vector templates 2022-01-08 22:04:13 +01:00
883497755e BLI_floatX: Add most missing constructors and operator
This should have no side effect.

This reverse the dependency, with `float2` being needed for `float3` and
so on.

This is needed for extensive usage of these types in the draw engines.

Differential Revision: https://developer.blender.org/D13756
2022-01-06 19:46:57 +01:00
168 changed files with 17483 additions and 1290 deletions

View File

@@ -559,14 +559,12 @@ if(WIN32)
set(CPACK_INSTALL_PREFIX ${CMAKE_GENERIC_PROGRAM_FILES}/${})
endif()
# Compiler tool-chain.
if(UNIX AND NOT APPLE)
if(CMAKE_COMPILER_IS_GNUCC)
option(WITH_LINKER_GOLD "Use ld.gold linker which is usually faster than ld.bfd" ON)
mark_as_advanced(WITH_LINKER_GOLD)
option(WITH_LINKER_LLD "Use ld.lld linker which is usually faster than ld.gold" OFF)
mark_as_advanced(WITH_LINKER_LLD)
endif()
# Compiler toolchain
if(CMAKE_COMPILER_IS_GNUCC)
option(WITH_LINKER_GOLD "Use ld.gold linker which is usually faster than ld.bfd" ON)
mark_as_advanced(WITH_LINKER_GOLD)
option(WITH_LINKER_LLD "Use ld.lld linker which is usually faster than ld.gold" OFF)
mark_as_advanced(WITH_LINKER_LLD)
endif()
option(WITH_COMPILER_ASAN "Build and link against address sanitizer (only for Debug & RelWithDebInfo targets)." OFF)

View File

@@ -38,6 +38,13 @@ elseif(UNIX AND NOT APPLE)
)
endif()
if(BLENDER_PLATFORM_ARM)
set(GMP_OPTIONS
${GMP_OPTIONS}
--disable-assembly
)
endif()
ExternalProject_Add(external_gmp
URL file://${PACKAGE_DIR}/${GMP_FILE}
DOWNLOAD_DIR ${DOWNLOAD_DIR}

View File

@@ -474,9 +474,9 @@ set(ISPC_HASH 2e3abedbc0ea9aaec17d6562c632454d)
set(ISPC_HASH_TYPE MD5)
set(ISPC_FILE ispc-${ISPC_VERSION}.tar.gz)
set(GMP_VERSION 6.2.1)
set(GMP_VERSION 6.2.0)
set(GMP_URI https://gmplib.org/download/gmp/gmp-${GMP_VERSION}.tar.xz)
set(GMP_HASH 0b82665c4a92fd2ade7440c13fcaa42b)
set(GMP_HASH a325e3f09e6d91e62101e59f9bda3ec1)
set(GMP_HASH_TYPE MD5)
set(GMP_FILE gmp-${GMP_VERSION}.tar.xz)

View File

@@ -3620,8 +3620,8 @@ compile_FFmpeg() {
fi
./configure --cc="gcc -Wl,--as-needed" \
--extra-ldflags="-pthread" \
--prefix=$_inst --enable-shared \
--extra-ldflags="-pthread -static-libgcc" \
--prefix=$_inst --enable-static \
--disable-ffplay --disable-doc \
--enable-gray \
--enable-avfilter --disable-vdpau \
@@ -5721,6 +5721,76 @@ install_OTHER() {
# ----------------------------------------------------------------------------
# Printing User Info
print_info_ffmpeglink_DEB() {
dpkg -L $_packages | grep -e ".*\/lib[^\/]\+\.so" | gawk '{ printf(nlines ? "'"$_ffmpeg_list_sep"'%s" : "%s", gensub(/.*lib([^\/]+)\.so/, "\\1", "g", $0)); nlines++ }'
}
print_info_ffmpeglink_RPM() {
rpm -ql $_packages | grep -e ".*\/lib[^\/]\+\.so" | gawk '{ printf(nlines ? "'"$_ffmpeg_list_sep"'%s" : "%s", gensub(/.*lib([^\/]+)\.so/, "\\1", "g", $0)); nlines++ }'
}
print_info_ffmpeglink_ARCH() {
pacman -Ql $_packages | grep -e ".*\/lib[^\/]\+\.so$" | gawk '{ printf(nlines ? "'"$_ffmpeg_list_sep"'%s" : "%s", gensub(/.*lib([^\/]+)\.so/, "\\1", "g", $0)); nlines++ }'
}
print_info_ffmpeglink() {
# This func must only print a ';'-separated list of libs...
if [ -z "$DISTRO" ]; then
ERROR "Failed to detect distribution type"
exit 1
fi
# Create list of packages from which to get libs names...
_packages=""
if [ "$THEORA_USE" = true ]; then
_packages="$_packages $THEORA_DEV"
fi
if [ "$VORBIS_USE" = true ]; then
_packages="$_packages $VORBIS_DEV"
fi
if [ "$OGG_USE" = true ]; then
_packages="$_packages $OGG_DEV"
fi
if [ "$XVID_USE" = true ]; then
_packages="$_packages $XVID_DEV"
fi
if [ "$VPX_USE" = true ]; then
_packages="$_packages $VPX_DEV"
fi
if [ "$OPUS_USE" = true ]; then
_packages="$_packages $OPUS_DEV"
fi
if [ "$MP3LAME_USE" = true ]; then
_packages="$_packages $MP3LAME_DEV"
fi
if [ "$X264_USE" = true ]; then
_packages="$_packages $X264_DEV"
fi
if [ "$OPENJPEG_USE" = true ]; then
_packages="$_packages $OPENJPEG_DEV"
fi
if [ "$DISTRO" = "DEB" ]; then
print_info_ffmpeglink_DEB
elif [ "$DISTRO" = "RPM" ]; then
print_info_ffmpeglink_RPM
elif [ "$DISTRO" = "ARCH" ]; then
print_info_ffmpeglink_ARCH
# XXX TODO!
else
PRINT "<Could not determine additional link libraries needed for ffmpeg, replace this by valid list of libs...>"
fi
}
print_info() {
PRINT ""
PRINT ""
@@ -5932,10 +6002,12 @@ print_info() {
if [ "$FFMPEG_SKIP" = false ]; then
_1="-D WITH_CODEC_FFMPEG=ON"
_2="-D FFMPEG_LIBRARIES='avformat;avcodec;avutil;avdevice;swscale;swresample;lzma;rt;`print_info_ffmpeglink`'"
PRINT " $_1"
_buildargs="$_buildargs $_1"
PRINT " $_2"
_buildargs="$_buildargs $_1 $_2"
if [ -d $INST/ffmpeg ]; then
_1="-D FFMPEG_ROOT_DIR=$INST/ffmpeg"
_1="-D FFMPEG=$INST/ffmpeg"
PRINT " $_1"
_buildargs="$_buildargs $_1"
fi

View File

@@ -33,8 +33,6 @@ if(NOT FFMPEG_FIND_COMPONENTS)
avfilter
avformat
avutil
swscale
swresample
)
endif()
@@ -52,9 +50,9 @@ foreach(_component ${FFMPEG_FIND_COMPONENTS})
string(TOUPPER ${_component} _upper_COMPONENT)
find_library(FFMPEG_${_upper_COMPONENT}_LIBRARY
NAMES
${_component}
${_upper_COMPONENT}
HINTS
${_ffmpeg_SEARCH_DIRS}
${LIBDIR}/ffmpeg
PATH_SUFFIXES
lib64 lib
)

View File

@@ -488,6 +488,7 @@ function(blender_add_test_executable
include_directories(${includes})
include_directories(${includes_sys})
setup_libdirs()
BLENDER_SRC_GTEST_EX(
NAME ${name}
@@ -524,6 +525,83 @@ function(setup_heavy_lib_pool)
endif()
endfunction()
function(SETUP_LIBDIRS)
# NOTE: For all new libraries, use absolute library paths.
# This should eventually be phased out.
# APPLE platform uses full paths for linking libraries, and avoids link_directories.
if(NOT MSVC AND NOT APPLE)
link_directories(${JPEG_LIBPATH} ${PNG_LIBPATH} ${ZLIB_LIBPATH} ${FREETYPE_LIBPATH})
if(WITH_PYTHON) # AND NOT WITH_PYTHON_MODULE # WIN32 needs
link_directories(${PYTHON_LIBPATH})
endif()
if(WITH_SDL AND NOT WITH_SDL_DYNLOAD)
link_directories(${SDL_LIBPATH})
endif()
if(WITH_CODEC_FFMPEG)
link_directories(${FFMPEG_LIBPATH})
endif()
if(WITH_IMAGE_OPENEXR)
link_directories(${OPENEXR_LIBPATH})
endif()
if(WITH_IMAGE_TIFF)
link_directories(${TIFF_LIBPATH})
endif()
if(WITH_BOOST)
link_directories(${BOOST_LIBPATH})
endif()
if(WITH_OPENIMAGEIO)
link_directories(${OPENIMAGEIO_LIBPATH})
endif()
if(WITH_OPENIMAGEDENOISE)
link_directories(${OPENIMAGEDENOISE_LIBPATH})
endif()
if(WITH_OPENCOLORIO)
link_directories(${OPENCOLORIO_LIBPATH})
endif()
if(WITH_OPENVDB)
link_directories(${OPENVDB_LIBPATH})
endif()
if(WITH_OPENAL)
link_directories(${OPENAL_LIBPATH})
endif()
if(WITH_JACK AND NOT WITH_JACK_DYNLOAD)
link_directories(${JACK_LIBPATH})
endif()
if(WITH_PULSEAUDIO AND NOT WITH_PULSEAUDIO_DYNLOAD)
link_directories(${LIBPULSE_LIBPATH})
endif()
if(WITH_CODEC_SNDFILE)
link_directories(${LIBSNDFILE_LIBPATH})
endif()
if(WITH_FFTW3)
link_directories(${FFTW3_LIBPATH})
endif()
if(WITH_OPENCOLLADA)
link_directories(${OPENCOLLADA_LIBPATH})
# # Never set
# link_directories(${PCRE_LIBPATH})
# link_directories(${EXPAT_LIBPATH})
endif()
if(WITH_LLVM)
link_directories(${LLVM_LIBPATH})
endif()
if(WITH_ALEMBIC)
link_directories(${ALEMBIC_LIBPATH})
endif()
if(WITH_GMP)
link_directories(${GMP_LIBPATH})
endif()
if(WIN32 AND NOT UNIX)
link_directories(${PTHREADS_LIBPATH})
endif()
endif()
endfunction()
# Platform specific linker flags for targets.
function(setup_platform_linker_flags
target)
@@ -1214,6 +1292,29 @@ macro(openmp_delayload
endif()
endmacro()
macro(blender_precompile_headers target cpp header)
if(MSVC)
# get the name for the pch output file
get_filename_component(pchbase ${cpp} NAME_WE)
set(pchfinal "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/${pchbase}.pch")
# mark the cpp as the one outputting the pch
set_property(SOURCE ${cpp} APPEND PROPERTY OBJECT_OUTPUTS "${pchfinal}")
# get all sources for the target
get_target_property(sources ${target} SOURCES)
# make all sources depend on the pch to enforce the build order
foreach(src ${sources})
set_property(SOURCE ${src} APPEND PROPERTY OBJECT_DEPENDS "${pchfinal}")
endforeach()
target_sources(${target} PRIVATE ${cpp} ${header})
set_target_properties(${target} PROPERTIES COMPILE_FLAGS "/Yu${header} /Fp${pchfinal} /FI${header}")
set_source_files_properties(${cpp} PROPERTIES COMPILE_FLAGS "/Yc${header} /Fp${pchfinal}")
endif()
endmacro()
macro(set_and_warn_dependency
_dependency _setting _val)
# when $_dependency is disabled, forces $_setting = $_val

View File

@@ -173,7 +173,6 @@ if(WITH_IMAGE_OPENEXR)
endif()
if(WITH_CODEC_FFMPEG)
set(FFMPEG_ROOT_DIR ${LIBDIR}/ffmpeg)
set(FFMPEG_FIND_COMPONENTS
avcodec avdevice avformat avutil
mp3lame ogg opus swresample swscale

View File

@@ -18,7 +18,7 @@
# All rights reserved.
# ***** END GPL LICENSE BLOCK *****
# Libraries configuration for any *nix system including Linux and Unix (excluding APPLE).
# Libraries configuration for any *nix system including Linux and Unix.
# Detect precompiled library directory
if(NOT DEFINED LIBDIR)
@@ -178,30 +178,26 @@ endif()
if(WITH_CODEC_FFMPEG)
if(EXISTS ${LIBDIR})
set(FFMPEG_ROOT_DIR ${LIBDIR}/ffmpeg)
# Override FFMPEG components to also include static library dependencies
# included with precompiled libraries, and to ensure correct link order.
set(FFMPEG_FIND_COMPONENTS
avformat avcodec avdevice avutil swresample swscale
sndfile
FLAC
mp3lame
opus
theora theoradec theoraenc
vorbis vorbisenc vorbisfile ogg
vpx
x264
xvidcore)
elseif(FFMPEG)
# Old cache variable used for root dir, convert to new standard.
set(FFMPEG_ROOT_DIR ${FFMPEG})
# For precompiled lib directory, all ffmpeg dependencies are in the same folder
file(GLOB ffmpeg_libs ${LIBDIR}/ffmpeg/lib/*.a ${LIBDIR}/sndfile/lib/*.a)
set(FFMPEG ${LIBDIR}/ffmpeg CACHE PATH "FFMPEG Directory")
set(FFMPEG_LIBRARIES ${ffmpeg_libs} ${ffmpeg_libs} CACHE STRING "FFMPEG Libraries")
else()
set(FFMPEG /usr CACHE PATH "FFMPEG Directory")
set(FFMPEG_LIBRARIES avformat avcodec avutil avdevice swscale CACHE STRING "FFMPEG Libraries")
endif()
find_package(FFmpeg)
if(NOT FFMPEG_FOUND)
set(WITH_CODEC_FFMPEG OFF)
message(STATUS "FFmpeg not found, disabling it")
mark_as_advanced(FFMPEG)
# lame, but until we have proper find module for ffmpeg
set(FFMPEG_INCLUDE_DIRS ${FFMPEG}/include)
if(EXISTS "${FFMPEG}/include/ffmpeg/")
list(APPEND FFMPEG_INCLUDE_DIRS "${FFMPEG}/include/ffmpeg")
endif()
# end lameness
mark_as_advanced(FFMPEG_LIBRARIES)
set(FFMPEG_LIBPATH ${FFMPEG}/lib)
endif()
if(WITH_FFTW3)

View File

@@ -257,7 +257,7 @@ static int hipewHipInit(void) {
#endif
static int initialized = 0;
static int result = 0;
int error;
int error, driver_version;
if (initialized) {
return result;
@@ -565,6 +565,8 @@ int hipewCompilerVersion(void) {
const char *path = hipewCompilerPath();
const char *marker = "Hip compilation tools, release ";
FILE *pipe;
int major, minor;
char *versionstr;
char buf[128];
char output[65536] = "\0";
char command[65536] = "\0";

View File

@@ -51,6 +51,8 @@ list(APPEND LIBRARIES ${CYCLES_GL_LIBRARIES})
# Common configuration.
cycles_link_directories()
add_definitions(${GL_DEFINITIONS})
include_directories(${INC})

View File

@@ -84,6 +84,39 @@ macro(cycles_add_library target library_deps)
cycles_set_solution_folder(${target})
endmacro()
# Cycles library dependencies common to all executables
function(cycles_link_directories)
if(APPLE)
# APPLE platform uses full paths for linking libraries, and avoids link_directories.
return()
endif()
if(WITH_OPENCOLORIO)
link_directories(${OPENCOLORIO_LIBPATH})
endif()
if(WITH_OPENVDB)
link_directories(${OPENVDB_LIBPATH} ${BLOSC_LIBPATH})
endif()
if(WITH_OPENSUBDIV)
link_directories(${OPENSUBDIV_LIBPATH})
endif()
if(WITH_OPENIMAGEDENOISE)
link_directories(${OPENIMAGEDENOISE_LIBPATH})
endif()
link_directories(
${OPENIMAGEIO_LIBPATH}
${BOOST_LIBPATH}
${PNG_LIBPATH}
${JPEG_LIBPATH}
${ZLIB_LIBPATH}
${TIFF_LIBPATH}
${OPENEXR_LIBPATH}
${OPENJPEG_LIBPATH}
)
endfunction()
macro(cycles_target_link_libraries target)
if(WITH_CYCLES_LOGGING)
target_link_libraries(${target} ${GLOG_LIBRARIES} ${GFLAGS_LIBRARIES})

View File

@@ -72,7 +72,7 @@ CPUDevice::CPUDevice(const DeviceInfo &info_, Stats &stats_, Profiler &profiler_
<< " CPU kernels.";
if (info.cpu_threads == 0) {
info.cpu_threads = TaskScheduler::max_concurrency();
info.cpu_threads = TaskScheduler::num_threads();
}
#ifdef WITH_OSL

View File

@@ -334,7 +334,7 @@ DeviceInfo Device::get_multi_device(const vector<DeviceInfo> &subdevices,
/* Ensure CPU device does not slow down GPU. */
if (device.type == DEVICE_CPU && subdevices.size() > 1) {
if (background) {
int orig_cpu_threads = (threads) ? threads : TaskScheduler::max_concurrency();
int orig_cpu_threads = (threads) ? threads : TaskScheduler::num_threads();
int cpu_threads = max(orig_cpu_threads - (subdevices.size() - 1), 0);
VLOG(1) << "CPU render threads reduced from " << orig_cpu_threads << " to " << cpu_threads

View File

@@ -243,10 +243,6 @@ ccl_gpu_kernel(GPU_KERNEL_BLOCK_NUM_THREADS, GPU_KERNEL_MAX_REGISTERS)
}
}
#ifdef __KERNEL_METAL__
constant int __dummy_constant [[function_constant(0)]];
#endif
ccl_gpu_kernel(GPU_KERNEL_BLOCK_NUM_THREADS, GPU_KERNEL_MAX_REGISTERS)
ccl_gpu_kernel_signature(integrator_shade_surface_raytrace,
ccl_global const int *path_index_array,
@@ -257,16 +253,7 @@ ccl_gpu_kernel(GPU_KERNEL_BLOCK_NUM_THREADS, GPU_KERNEL_MAX_REGISTERS)
if (global_index < work_size) {
const int state = (path_index_array) ? path_index_array[global_index] : global_index;
#ifdef __KERNEL_METAL__
KernelGlobals kg = NULL;
/* Workaround Ambient Occlusion and Bevel nodes not working with Metal.
* Dummy offset should not affect result, but somehow fixes bug! */
kg += __dummy_constant;
ccl_gpu_kernel_call(integrator_shade_surface_raytrace(kg, state, render_buffer));
#else
ccl_gpu_kernel_call(integrator_shade_surface_raytrace(NULL, state, render_buffer));
#endif
}
}

View File

@@ -92,14 +92,6 @@ ccl_device_forceinline void kernel_write_denoising_features_surface(
else if (sc->type == CLOSURE_BSDF_HAIR_PRINCIPLED_ID) {
closure_albedo *= bsdf_principled_hair_albedo(sc);
}
else if (sc->type == CLOSURE_BSDF_PRINCIPLED_DIFFUSE_ID) {
/* BSSRDF already accounts for weight, retro-reflection would double up. */
ccl_private const PrincipledDiffuseBsdf *bsdf = (ccl_private const PrincipledDiffuseBsdf *)
sc;
if (bsdf->components == PRINCIPLED_DIFFUSE_RETRO_REFLECTION) {
continue;
}
}
if (bsdf_get_specular_roughness_squared(sc) > sqr(0.075f)) {
diffuse_albedo += closure_albedo;

View File

@@ -85,4 +85,6 @@ shader node_normal_map(normal NormalIn = N,
if (Strength != 1.0)
Normal = normalize(NormalIn + (Normal - NormalIn) * max(Strength, 0.0));
Normal = ensure_valid_reflection(Ng, I, Normal);
}

View File

@@ -38,6 +38,8 @@ set(ALL_CYCLES_LIBRARIES
)
include_directories(${INC})
cycles_link_directories()
set(SRC
integrator_adaptive_sampling_test.cpp
integrator_render_scheduler_test.cpp

View File

@@ -109,10 +109,9 @@ void TaskScheduler::free_memory()
assert(users == 0);
}
int TaskScheduler::max_concurrency()
int TaskScheduler::num_threads()
{
thread_scoped_lock lock(mutex);
return (users > 0) ? active_num_threads : tbb::this_task_arena::max_concurrency();
return active_num_threads;
}
/* Dedicated Task Pool */

View File

@@ -86,9 +86,10 @@ class TaskScheduler {
static void exit();
static void free_memory();
/* Maximum number of threads that will work on task. Use as little as
* possible and leave scheduling and splitting up tasks to the scheduler. */
static int max_concurrency();
/* Approximate number of threads that will work on task, which may be lower
* or higher than the actual number of threads. Use as little as possible and
* leave splitting up tasks to the scheduler. */
static int num_threads();
protected:
static thread_mutex mutex;

View File

@@ -496,6 +496,8 @@ typedef struct {
int target_start;
/** Represents the position of the end of the selection */
int target_end;
/** custom temporal data */
GHOST_TUserDataPtr tmp;
} GHOST_TEventImeData;
typedef struct {

View File

@@ -38,6 +38,8 @@ set(LIB
)
if(WITH_LIBMV)
setup_libdirs()
if(WIN32)
add_definitions(-D_USE_MATH_DEFINES)
endif()

View File

@@ -118,6 +118,8 @@ set(LIB
)
if(WITH_LIBMV)
setup_libdirs()
if(WIN32)
add_definitions(-D_USE_MATH_DEFINES)
endif()

File diff suppressed because it is too large Load Diff

Before

Width:  |  Height:  |  Size: 2.5 MiB

After

Width:  |  Height:  |  Size: 2.5 MiB

File diff suppressed because it is too large Load Diff

Before

Width:  |  Height:  |  Size: 69 KiB

After

Width:  |  Height:  |  Size: 556 KiB

View File

@@ -6267,8 +6267,7 @@ def km_image_editor_tool_uv_select(params, *, fallback):
_fallback_id("Image Editor Tool: Uv, Tweak", fallback),
{"space_type": 'IMAGE_EDITOR', "region_type": 'WINDOW'},
{"items": [
*([] if (fallback and (params.select_mouse == 'RIGHTMOUSE')) else _template_items_tool_select(
params, "uv.select", "uv.cursor_set", extend="extend")),
*([] if fallback else _template_items_tool_select(params, "uv.select", "uv.cursor_set", extend="extend")),
*([] if (not params.use_fallback_tool_rmb) else _template_uv_select(
type=params.select_mouse, value=params.select_mouse_value, legacy=params.legacy)),
]},
@@ -6386,7 +6385,7 @@ def km_node_editor_tool_select(params, *, fallback):
_fallback_id("Node Tool: Tweak", fallback),
{"space_type": 'NODE_EDITOR', "region_type": 'WINDOW'},
{"items": [
*([] if (fallback and (params.select_mouse == 'RIGHTMOUSE')) else [
*([] if fallback else [
("node.select", {"type": params.select_mouse, "value": 'PRESS'},
{"properties": [("deselect_all", not params.legacy)]}),
]),
@@ -6468,7 +6467,7 @@ def km_3d_view_tool_select(params, *, fallback):
_fallback_id("3D View Tool: Tweak", fallback),
{"space_type": 'VIEW_3D', "region_type": 'WINDOW'},
{"items": [
*([] if (fallback and (params.select_mouse == 'RIGHTMOUSE')) else _template_items_tool_select(
*([] if fallback else _template_items_tool_select(
params, "view3d.select", "view3d.cursor3d", extend="toggle")),
*([] if (not params.use_fallback_tool_rmb) else _template_view3d_select(
type=params.select_mouse, value=params.select_mouse_value, legacy=params.legacy)),
@@ -7378,7 +7377,7 @@ def km_3d_view_tool_edit_gpencil_select(params, *, fallback):
_fallback_id("3D View Tool: Edit Gpencil, Tweak", fallback),
{"space_type": 'VIEW_3D', "region_type": 'WINDOW'},
{"items": [
*([] if (fallback and (params.select_mouse == 'RIGHTMOUSE')) else _template_items_tool_select(
*([] if fallback else _template_items_tool_select(
params, "gpencil.select", "view3d.cursor3d", extend="toggle")),
*([] if (not params.use_fallback_tool_rmb) else _template_view3d_gpencil_select(
type=params.select_mouse, value=params.select_mouse_value, legacy=params.legacy)),
@@ -7554,7 +7553,7 @@ def km_sequencer_editor_tool_generic_select(params, *, fallback):
_fallback_id("Sequencer Tool: Tweak", fallback),
{"space_type": 'SEQUENCE_EDITOR', "region_type": 'WINDOW'},
{"items": [
*([] if (fallback and (params.select_mouse == 'RIGHTMOUSE')) else _template_items_tool_select(
*([] if fallback else _template_items_tool_select(
params, "sequencer.select", "sequencer.cursor_set", extend="toggle")),
*([] if (not params.use_fallback_tool_rmb) else _template_sequencer_preview_select(

View File

@@ -949,7 +949,7 @@ class CLIP_OT_setup_tracking_scene(Operator):
"""Make all the newly created and the old objects of a collection """ \
"""to be properly setup for shadow catch"""
for ob in collection.objects:
ob.is_shadow_catcher = True
ob.cycles.is_shadow_catcher = True
for child in collection.children:
setup_shadow_catcher_objects(child)

View File

@@ -501,7 +501,6 @@ compositor_node_categories = [
NodeItem("CompositorNodeTexture"),
NodeItem("CompositorNodeBokehImage"),
NodeItem("CompositorNodeTime"),
NodeItem("CompositorNodeSceneTime"),
NodeItem("CompositorNodeTrackPos"),
]),
CompositorNodeCategory("CMP_OUTPUT", "Output", items=[

View File

@@ -122,7 +122,7 @@ void BLF_draw(int fontid, const char *str, size_t str_len) ATTR_NONNULL(2);
int BLF_draw_mono(int fontid, const char *str, size_t str_len, int cwidth) ATTR_NONNULL(2);
typedef bool (*BLF_GlyphBoundsFn)(const char *str,
size_t str_step_ofs,
const size_t str_step_ofs,
const struct rcti *glyph_step_bounds,
int glyph_advance_x,
const struct rctf *glyph_bounds,

View File

@@ -121,7 +121,7 @@ void blf_font_boundbox_foreach_glyph(struct FontBLF *font,
const char *str,
size_t str_len,
bool (*user_fn)(const char *str,
size_t str_step_ofs,
const size_t str_step_ofs,
const struct rcti *glyph_step_bounds,
int glyph_advance_x,
const struct rctf *glyph_bounds,
@@ -132,7 +132,7 @@ void blf_font_boundbox_foreach_glyph(struct FontBLF *font,
int blf_font_count_missing_chars(struct FontBLF *font,
const char *str,
size_t str_len,
const size_t str_len,
int *r_tot_chars);
void blf_font_free(struct FontBLF *font);

View File

@@ -140,7 +140,7 @@ bool BKE_appdir_font_folder_default(char *dir);
* Find Python executable.
*/
bool BKE_appdir_program_python_search(char *fullpath,
size_t fullpath_len,
const size_t fullpath_len,
int version_major,
int version_minor);

View File

@@ -73,7 +73,7 @@ bool BKE_id_attribute_rename(struct ID *id,
const char *new_name,
struct ReportList *reports);
int BKE_id_attributes_length(struct ID *id, CustomDataMask mask);
int BKE_id_attributes_length(struct ID *id, const CustomDataMask mask);
struct CustomDataLayer *BKE_id_attributes_active_get(struct ID *id);
void BKE_id_attributes_active_set(struct ID *id, struct CustomDataLayer *layer);

View File

@@ -128,7 +128,7 @@ BVHTree *bvhtree_from_editmesh_verts_ex(BVHTreeFromEditMesh *data,
float epsilon,
int tree_type,
int axis,
BVHCacheType bvh_cache_type,
const BVHCacheType bvh_cache_type,
struct BVHCache **bvh_cache_p,
ThreadMutex *mesh_eval_mutex);
@@ -148,7 +148,7 @@ BVHTree *bvhtree_from_mesh_verts_ex(struct BVHTreeFromMesh *data,
float epsilon,
int tree_type,
int axis,
BVHCacheType bvh_cache_type,
const BVHCacheType bvh_cache_type,
struct BVHCache **bvh_cache_p,
ThreadMutex *mesh_eval_mutex);
@@ -165,7 +165,7 @@ BVHTree *bvhtree_from_editmesh_edges_ex(BVHTreeFromEditMesh *data,
float epsilon,
int tree_type,
int axis,
BVHCacheType bvh_cache_type,
const BVHCacheType bvh_cache_type,
struct BVHCache **bvh_cache_p,
ThreadMutex *mesh_eval_mutex);
@@ -188,7 +188,7 @@ BVHTree *bvhtree_from_mesh_edges_ex(struct BVHTreeFromMesh *data,
float epsilon,
int tree_type,
int axis,
BVHCacheType bvh_cache_type,
const BVHCacheType bvh_cache_type,
struct BVHCache **bvh_cache_p,
ThreadMutex *mesh_eval_mutex);
@@ -212,7 +212,7 @@ BVHTree *bvhtree_from_mesh_faces_ex(struct BVHTreeFromMesh *data,
float epsilon,
int tree_type,
int axis,
BVHCacheType bvh_cache_type,
const BVHCacheType bvh_cache_type,
struct BVHCache **bvh_cache_p,
ThreadMutex *mesh_eval_mutex);
@@ -229,7 +229,7 @@ BVHTree *bvhtree_from_editmesh_looptri_ex(BVHTreeFromEditMesh *data,
float epsilon,
int tree_type,
int axis,
BVHCacheType bvh_cache_type,
const BVHCacheType bvh_cache_type,
struct BVHCache **bvh_cache_p,
ThreadMutex *mesh_eval_mutex);
@@ -251,7 +251,7 @@ BVHTree *bvhtree_from_mesh_looptri_ex(struct BVHTreeFromMesh *data,
float epsilon,
int tree_type,
int axis,
BVHCacheType bvh_cache_type,
const BVHCacheType bvh_cache_type,
struct BVHCache **bvh_cache_p,
ThreadMutex *mesh_eval_mutex);
@@ -263,7 +263,7 @@ BVHTree *bvhtree_from_mesh_looptri_ex(struct BVHTreeFromMesh *data,
*/
BVHTree *BKE_bvhtree_from_mesh_get(struct BVHTreeFromMesh *data,
const struct Mesh *mesh,
BVHCacheType bvh_cache_type,
const BVHCacheType bvh_cache_type,
int tree_type);
/**
@@ -272,7 +272,7 @@ BVHTree *BKE_bvhtree_from_mesh_get(struct BVHTreeFromMesh *data,
BVHTree *BKE_bvhtree_from_editmesh_get(BVHTreeFromEditMesh *data,
struct BMEditMesh *em,
int tree_type,
BVHCacheType bvh_cache_type,
const BVHCacheType bvh_cache_type,
struct BVHCache **bvh_cache_p,
ThreadMutex *mesh_eval_mutex);

View File

@@ -323,7 +323,7 @@ void CustomData_bmesh_copy_data_exclude_by_type(const struct CustomData *source,
struct CustomData *dest,
void *src_block,
void **dest_block,
CustomDataMask mask_exclude);
const CustomDataMask mask_exclude);
/**
* Copies data of a single layer of a given type.
@@ -496,7 +496,7 @@ void CustomData_bmesh_free_block_data(struct CustomData *data, void *block);
*/
void CustomData_bmesh_free_block_data_exclude_by_type(struct CustomData *data,
void *block,
CustomDataMask mask_exclude);
const CustomDataMask mask_exclude);
/**
* Copy custom data to/from layers as in mesh/derived-mesh, to edit-mesh

View File

@@ -367,7 +367,7 @@ void BKE_image_packfiles(struct ReportList *reports, struct Image *ima, const ch
void BKE_image_packfiles_from_mem(struct ReportList *reports,
struct Image *ima,
char *data,
size_t data_len);
const size_t data_len);
/**
* Prints memory statistics for images.

View File

@@ -1313,7 +1313,6 @@ void ntreeGPUMaterialNodes(struct bNodeTree *localtree,
#define CMP_NODE_CRYPTOMATTE 326
#define CMP_NODE_POSTERIZE 327
#define CMP_NODE_CONVERT_COLOR_SPACE 328
#define CMP_NODE_SCENE_TIME 329
/* channel toggles */
#define CMP_CHAN_RGB 1
@@ -1374,12 +1373,18 @@ void ntreeCompositTagRender(struct Scene *scene);
* - Each render layer node calls the update function of the
* render engine that's used for its scene.
* - The render engine calls RE_engine_register_pass for each pass.
* - #RE_engine_register_pass calls #node_cmp_rlayers_register_pass.
* - #RE_engine_register_pass calls #ntreeCompositRegisterPass,
* which calls #node_cmp_rlayers_register_pass for every render layer node.
*
* TODO: This is *not* part of `blenkernel`, it's defined under "source/blender/nodes/".
* This declaration should be moved out of BKE.
*/
void ntreeCompositUpdateRLayers(struct bNodeTree *ntree);
void ntreeCompositRegisterPass(struct bNodeTree *ntree,
struct Scene *scene,
struct ViewLayer *view_layer,
const char *name,
eNodeSocketDatatype type);
void ntreeCompositClearTags(struct bNodeTree *ntree);
struct bNodeSocket *ntreeCompositOutputFileAddSocket(struct bNodeTree *ntree,

View File

@@ -317,8 +317,11 @@ void BKE_scene_multiview_view_prefix_get(struct Scene *scene,
const char *name,
char *r_prefix,
const char **r_ext);
void BKE_scene_multiview_videos_dimensions_get(
const struct RenderData *rd, size_t width, size_t height, size_t *r_width, size_t *r_height);
void BKE_scene_multiview_videos_dimensions_get(const struct RenderData *rd,
const size_t width,
const size_t height,
size_t *r_width,
size_t *r_height);
int BKE_scene_multiview_num_videos_get(const struct RenderData *rd);
/* depsgraph */

View File

@@ -104,7 +104,7 @@ void BKE_vfont_select_clamp(struct Object *ob);
void BKE_vfont_clipboard_free(void);
void BKE_vfont_clipboard_set(const char32_t *text_buf,
const struct CharInfo *info_buf,
size_t len);
const size_t len);
void BKE_vfont_clipboard_get(char32_t **r_text_buf,
struct CharInfo **r_info_buf,
size_t *r_len_utf8,

View File

@@ -44,9 +44,9 @@ void data_transfer_layersmapping_add_item(struct ListBase *r_map,
void *data_dst,
int data_src_n,
int data_dst_n,
size_t elem_size,
size_t data_size,
size_t data_offset,
const size_t elem_size,
const size_t data_size,
const size_t data_offset,
uint64_t data_flag,
cd_datatransfer_interp interp,
void *interp_data);

View File

@@ -2446,7 +2446,7 @@ void BKE_image_stamp_buf(Scene *scene,
/* and draw the text. */
BLF_position(mono, x, y + y_ofs, 0.0);
BLF_draw_buffer(mono, stamp_data.file, sizeof(stamp_data.file));
BLF_draw_buffer(mono, stamp_data.file, BLF_DRAW_STR_DUMMY_MAX);
/* the extra pixel for background. */
y -= BUFF_MARGIN_Y * 2;
@@ -2469,7 +2469,7 @@ void BKE_image_stamp_buf(Scene *scene,
y + h + BUFF_MARGIN_Y);
BLF_position(mono, x, y + y_ofs, 0.0);
BLF_draw_buffer(mono, stamp_data.date, sizeof(stamp_data.date));
BLF_draw_buffer(mono, stamp_data.date, BLF_DRAW_STR_DUMMY_MAX);
/* the extra pixel for background. */
y -= BUFF_MARGIN_Y * 2;
@@ -2492,7 +2492,7 @@ void BKE_image_stamp_buf(Scene *scene,
y + h + BUFF_MARGIN_Y);
BLF_position(mono, x, y + y_ofs, 0.0);
BLF_draw_buffer(mono, stamp_data.rendertime, sizeof(stamp_data.rendertime));
BLF_draw_buffer(mono, stamp_data.rendertime, BLF_DRAW_STR_DUMMY_MAX);
/* the extra pixel for background. */
y -= BUFF_MARGIN_Y * 2;
@@ -2515,7 +2515,7 @@ void BKE_image_stamp_buf(Scene *scene,
y + h + BUFF_MARGIN_Y);
BLF_position(mono, x, y + y_ofs, 0.0);
BLF_draw_buffer(mono, stamp_data.memory, sizeof(stamp_data.memory));
BLF_draw_buffer(mono, stamp_data.memory, BLF_DRAW_STR_DUMMY_MAX);
/* the extra pixel for background. */
y -= BUFF_MARGIN_Y * 2;
@@ -2538,7 +2538,7 @@ void BKE_image_stamp_buf(Scene *scene,
y + h + BUFF_MARGIN_Y);
BLF_position(mono, x, y + y_ofs, 0.0);
BLF_draw_buffer(mono, stamp_data.hostname, sizeof(stamp_data.hostname));
BLF_draw_buffer(mono, stamp_data.hostname, BLF_DRAW_STR_DUMMY_MAX);
/* the extra pixel for background. */
y -= BUFF_MARGIN_Y * 2;
@@ -2562,7 +2562,7 @@ void BKE_image_stamp_buf(Scene *scene,
y + h + BUFF_MARGIN_Y);
BLF_position(mono, x, y + y_ofs + (h - h_fixed), 0.0);
BLF_draw_buffer(mono, stamp_data.note, sizeof(stamp_data.note));
BLF_draw_buffer(mono, stamp_data.note, BLF_DRAW_STR_DUMMY_MAX);
}
BLF_disable(mono, BLF_WORD_WRAP);
@@ -2586,7 +2586,7 @@ void BKE_image_stamp_buf(Scene *scene,
/* and pad the text. */
BLF_position(mono, x, y + y_ofs, 0.0);
BLF_draw_buffer(mono, stamp_data.marker, sizeof(stamp_data.marker));
BLF_draw_buffer(mono, stamp_data.marker, BLF_DRAW_STR_DUMMY_MAX);
/* space width. */
x += w + pad;
@@ -2609,7 +2609,7 @@ void BKE_image_stamp_buf(Scene *scene,
/* and pad the text. */
BLF_position(mono, x, y + y_ofs, 0.0);
BLF_draw_buffer(mono, stamp_data.time, sizeof(stamp_data.time));
BLF_draw_buffer(mono, stamp_data.time, BLF_DRAW_STR_DUMMY_MAX);
/* space width. */
x += w + pad;
@@ -2631,7 +2631,7 @@ void BKE_image_stamp_buf(Scene *scene,
/* and pad the text. */
BLF_position(mono, x, y + y_ofs, 0.0);
BLF_draw_buffer(mono, stamp_data.frame, sizeof(stamp_data.frame));
BLF_draw_buffer(mono, stamp_data.frame, BLF_DRAW_STR_DUMMY_MAX);
/* space width. */
x += w + pad;
@@ -2651,7 +2651,7 @@ void BKE_image_stamp_buf(Scene *scene,
x + w + BUFF_MARGIN_X,
y + h + BUFF_MARGIN_Y);
BLF_position(mono, x, y + y_ofs, 0.0);
BLF_draw_buffer(mono, stamp_data.camera, sizeof(stamp_data.camera));
BLF_draw_buffer(mono, stamp_data.camera, BLF_DRAW_STR_DUMMY_MAX);
/* space width. */
x += w + pad;
@@ -2671,7 +2671,7 @@ void BKE_image_stamp_buf(Scene *scene,
x + w + BUFF_MARGIN_X,
y + h + BUFF_MARGIN_Y);
BLF_position(mono, x, y + y_ofs, 0.0);
BLF_draw_buffer(mono, stamp_data.cameralens, sizeof(stamp_data.cameralens));
BLF_draw_buffer(mono, stamp_data.cameralens, BLF_DRAW_STR_DUMMY_MAX);
}
if (TEXT_SIZE_CHECK(stamp_data.scene, w, h)) {
@@ -2693,7 +2693,7 @@ void BKE_image_stamp_buf(Scene *scene,
/* and pad the text. */
BLF_position(mono, x, y + y_ofs, 0.0);
BLF_draw_buffer(mono, stamp_data.scene, sizeof(stamp_data.scene));
BLF_draw_buffer(mono, stamp_data.scene, BLF_DRAW_STR_DUMMY_MAX);
}
if (TEXT_SIZE_CHECK(stamp_data.strip, w, h)) {
@@ -2715,7 +2715,7 @@ void BKE_image_stamp_buf(Scene *scene,
y + h + BUFF_MARGIN_Y);
BLF_position(mono, x, y + y_ofs, 0.0);
BLF_draw_buffer(mono, stamp_data.strip, sizeof(stamp_data.strip));
BLF_draw_buffer(mono, stamp_data.strip, BLF_DRAW_STR_DUMMY_MAX);
}
/* cleanup the buffer. */

View File

@@ -38,7 +38,6 @@
#include "BLT_translation.h"
#include "DNA_defaults.h"
#include "DNA_mask_types.h"
#include "BKE_animsys.h"
@@ -1309,7 +1308,7 @@ void BKE_mask_point_parent_matrix_get(MaskSplinePoint *point,
MovieTrackingObject *ob = BKE_tracking_object_get_named(tracking, parent->parent);
if (ob) {
MovieClipUser user = *DNA_struct_default_get(MovieClipUser);
MovieClipUser user = {0};
float clip_framenr = BKE_movieclip_remap_scene_to_clip_frame(clip, ctime);
BKE_movieclip_user_set_frame(&user, ctime);

View File

@@ -953,7 +953,7 @@ static MovieClip *movieclip_alloc(Main *bmain, const char *name)
static void movieclip_load_get_size(MovieClip *clip)
{
int width, height;
MovieClipUser user = *DNA_struct_default_get(MovieClipUser);
MovieClipUser user = {0};
user.framenr = BKE_movieclip_remap_clip_to_scene_frame(clip, 1);
BKE_movieclip_get_size(clip, &user, &width, &height);

View File

@@ -4447,7 +4447,6 @@ static void registerCompositNodes()
register_node_type_cmp_value();
register_node_type_cmp_rgb();
register_node_type_cmp_curve_time();
register_node_type_cmp_scene_time();
register_node_type_cmp_movieclip();
register_node_type_cmp_composite();

View File

@@ -1650,14 +1650,6 @@ static const DupliGenerator *get_dupli_generator(const DupliContext *ctx)
return nullptr;
}
/* Give "Object as Font" instances higher priority than geometry set instances, to retain
* the behavior from before curve object meshes were processed as instances internally. */
if (transflag & OB_DUPLIVERTS) {
if (ctx->object->type == OB_FONT) {
return &gen_dupli_verts_font;
}
}
if (ctx->object->runtime.geometry_set_eval != nullptr) {
if (BKE_object_has_geometry_set_instances(ctx->object)) {
return &gen_dupli_geometry_set;
@@ -1671,6 +1663,9 @@ static const DupliGenerator *get_dupli_generator(const DupliContext *ctx)
if (ctx->object->type == OB_MESH) {
return &gen_dupli_verts;
}
if (ctx->object->type == OB_FONT) {
return &gen_dupli_verts_font;
}
if (ctx->object->type == OB_POINTCLOUD) {
return &gen_dupli_verts_pointcloud;
}

View File

@@ -26,7 +26,6 @@
#include "MEM_guardedalloc.h"
#include "DNA_defaults.h"
#include "DNA_movieclip_types.h"
#include "BLI_threads.h"
@@ -323,7 +322,7 @@ void BKE_tracking_refine_marker(MovieClip *clip,
int search_area_height, search_area_width;
int clip_flag = clip->flag & MCLIP_TIMECODE_FLAGS;
int reference_framenr;
MovieClipUser user = *DNA_struct_default_get(MovieClipUser);
MovieClipUser user = {0};
double dst_pixel_x[5], dst_pixel_y[5];
bool tracked;

View File

@@ -84,7 +84,7 @@ size_t BLI_array_store_calc_size_compacted_get(const BArrayStore *bs);
*/
BArrayState *BLI_array_store_state_add(BArrayStore *bs,
const void *data,
size_t data_len,
const size_t data_len,
const BArrayState *state_reference);
/**
* Remove a state and free any unused #BChunk data.

View File

@@ -52,7 +52,7 @@ void _bli_array_wrap(void *arr, uint arr_len, size_t arr_stride, int dir);
* Access via #BLI_array_wrap
*/
void _bli_array_permute(
void *arr, uint arr_len, size_t arr_stride, const uint *order, void *arr_temp);
void *arr, uint arr_len, const size_t arr_stride, const uint *order, void *arr_temp);
#define BLI_array_permute(arr, arr_len, order) \
_bli_array_permute(arr, arr_len, sizeof(*(arr)), order, NULL)
#define BLI_array_permute_ex(arr, arr_len, order, arr_temp) \
@@ -152,7 +152,7 @@ bool _bli_array_is_zeroed(const void *arr, uint arr_len, size_t arr_stride);
*/
bool _bli_array_iter_spiral_square(const void *arr_v,
const int arr_shape[2],
size_t elem_size,
const size_t elem_size,
const int center[2],
bool (*test_fn)(const void *arr_item, void *user_data),
void *user_data);

View File

@@ -74,7 +74,7 @@ enum {
/**
* \note Never decreases the amount of memory allocated.
*/
void BLI_buffer_resize(BLI_Buffer *buffer, size_t new_count);
void BLI_buffer_resize(BLI_Buffer *buffer, const size_t new_count);
/**
* Ensure size, throwing away old data, respecting #BLI_BUFFER_USE_CALLOC.
@@ -83,7 +83,7 @@ void BLI_buffer_resize(BLI_Buffer *buffer, size_t new_count);
* - Ignored (malloc'd).
* - Cleared (when #BLI_BUFFER_USE_CALLOC is set).
*/
void BLI_buffer_reinit(BLI_Buffer *buffer, size_t new_count);
void BLI_buffer_reinit(BLI_Buffer *buffer, const size_t new_count);
/**
* Append an array of elements.

View File

@@ -155,7 +155,8 @@ double BLI_dir_free_space(const char *dir) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(
*
* \note can return NULL when the size is not big enough
*/
char *BLI_current_working_dir(char *dir, size_t maxncpy) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL();
char *BLI_current_working_dir(char *dir, const size_t maxncpy) ATTR_WARN_UNUSED_RESULT
ATTR_NONNULL();
eFileAttributes BLI_file_attributes(const char *path);
/** \} */

View File

@@ -31,7 +31,7 @@ extern "C" {
typedef struct _GSQueue GSQueue;
GSQueue *BLI_gsqueue_new(size_t elem_size);
GSQueue *BLI_gsqueue_new(const size_t elem_size);
/**
* Returns true if the queue is empty, false otherwise.
*/

View File

@@ -85,7 +85,7 @@ void *BLI_findptr(const struct ListBase *listbase,
*/
void *BLI_listbase_bytes_find(const ListBase *listbase,
const void *bytes,
size_t bytes_size,
const size_t bytes_size,
int offset) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1, 2);
/**
* Find the first item in the list that matches the given string, or the given index as fallback.
@@ -96,7 +96,7 @@ void *BLI_listbase_bytes_find(const ListBase *listbase,
*/
void *BLI_listbase_string_or_index_find(const struct ListBase *listbase,
const char *string,
size_t string_offset,
const size_t string_offset,
int index) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1);
/* Find backwards. */
@@ -133,7 +133,7 @@ void *BLI_rfindptr(const struct ListBase *listbase,
*/
void *BLI_listbase_bytes_rfind(const ListBase *listbase,
const void *bytes,
size_t bytes_size,
const size_t bytes_size,
int offset) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1, 2);
/**

View File

@@ -20,11 +20,10 @@
* \ingroup bli
*/
#include "BLI_math_vec_types.hh"
#ifdef WITH_GMP
# include "BLI_math_mpq.hh"
# include "BLI_math_vec_types.hh"
namespace blender {

View File

@@ -38,13 +38,13 @@ extern "C" {
struct MemArena;
typedef struct MemArena MemArena;
struct MemArena *BLI_memarena_new(size_t bufsize,
struct MemArena *BLI_memarena_new(const size_t bufsize,
const char *name) ATTR_WARN_UNUSED_RESULT ATTR_RETURNS_NONNULL
ATTR_NONNULL(2) ATTR_MALLOC;
void BLI_memarena_free(struct MemArena *ma) ATTR_NONNULL(1);
void BLI_memarena_use_malloc(struct MemArena *ma) ATTR_NONNULL(1);
void BLI_memarena_use_calloc(struct MemArena *ma) ATTR_NONNULL(1);
void BLI_memarena_use_align(struct MemArena *ma, size_t align) ATTR_NONNULL(1);
void BLI_memarena_use_align(struct MemArena *ma, const size_t align) ATTR_NONNULL(1);
void *BLI_memarena_alloc(struct MemArena *ma, size_t size) ATTR_WARN_UNUSED_RESULT
ATTR_NONNULL(1) ATTR_MALLOC ATTR_ALLOC_SIZE(2);
void *BLI_memarena_calloc(struct MemArena *ma, size_t size) ATTR_WARN_UNUSED_RESULT

View File

@@ -29,7 +29,7 @@ extern "C" {
/* it may be defined already */
#ifndef __BLI_UTILDEFINES_H__
bool BLI_memory_is_zero(const void *arr, size_t size);
bool BLI_memory_is_zero(const void *arr, const size_t size);
#endif
#ifdef __cplusplus

View File

@@ -75,15 +75,16 @@ bool BLI_make_existing_file(const char *name);
* - Doesn't use CWD, or deal with relative paths.
* - Only fill's in \a dir and \a file when they are non NULL.
*/
void BLI_split_dirfile(const char *string, char *dir, char *file, size_t dirlen, size_t filelen);
void BLI_split_dirfile(
const char *string, char *dir, char *file, const size_t dirlen, const size_t filelen);
/**
* Copies the parent directory part of string into `dir`, max length `dirlen`.
*/
void BLI_split_dir_part(const char *string, char *dir, size_t dirlen);
void BLI_split_dir_part(const char *string, char *dir, const size_t dirlen);
/**
* Copies the leaf filename part of string into `file`, max length `filelen`.
*/
void BLI_split_file_part(const char *string, char *file, size_t filelen);
void BLI_split_file_part(const char *string, char *file, const size_t filelen);
/**
* Returns a pointer to the last extension (e.g. the position of the last period).
* Returns NULL if there is no extension.
@@ -93,7 +94,7 @@ const char *BLI_path_extension(const char *filepath) ATTR_NONNULL();
/**
* Append a filename to a dir, ensuring slash separates.
*/
void BLI_path_append(char *__restrict dst, size_t maxlen, const char *__restrict file)
void BLI_path_append(char *__restrict dst, const size_t maxlen, const char *__restrict file)
ATTR_NONNULL();
/**
* Simple appending of filename to dir, does not check for valid path!
@@ -103,7 +104,7 @@ void BLI_path_append(char *__restrict dst, size_t maxlen, const char *__restrict
* that de-duplicates separators and can handle an arbitrary number of paths.
*/
void BLI_join_dirfile(char *__restrict dst,
size_t maxlen,
const size_t maxlen,
const char *__restrict dir,
const char *__restrict file) ATTR_NONNULL();
/**
@@ -113,7 +114,7 @@ void BLI_join_dirfile(char *__restrict dst,
* \note If you want a trailing slash, add `SEP_STR` as the last path argument,
* duplicate slashes will be cleaned up.
*/
size_t BLI_path_join(char *__restrict dst, size_t dst_len, const char *path_first, ...)
size_t BLI_path_join(char *__restrict dst, const size_t dst_len, const char *path_first, ...)
ATTR_NONNULL(1, 3) ATTR_SENTINEL(0);
/**
* Like Python's `os.path.basename()`
@@ -163,12 +164,12 @@ void BLI_path_slash_rstrip(char *string) ATTR_NONNULL();
void BLI_path_slash_native(char *path) ATTR_NONNULL();
#ifdef _WIN32
bool BLI_path_program_extensions_add_win32(char *name, size_t maxlen);
bool BLI_path_program_extensions_add_win32(char *name, const size_t maxlen);
#endif
/**
* Search for a binary (executable)
*/
bool BLI_path_program_search(char *fullname, size_t maxlen, const char *name);
bool BLI_path_program_search(char *fullname, const size_t maxlen, const char *name);
/**
* \return true when `str` end with `ext` (case insensitive).
@@ -352,7 +353,7 @@ bool BLI_path_is_abs_from_cwd(const char *path) ATTR_NONNULL();
* This is _not_ something Blender's internal paths support, instead they use the "//" prefix.
* In most cases #BLI_path_abs should be used instead.
*/
bool BLI_path_abs_from_cwd(char *path, size_t maxlen) ATTR_NONNULL();
bool BLI_path_abs_from_cwd(char *path, const size_t maxlen) ATTR_NONNULL();
/**
* Replaces `file` with a relative version (prefixed by "//") such that #BLI_path_abs, given
* the same `relfile`, will convert it back to its original value.

View File

@@ -28,13 +28,13 @@ extern "C" {
typedef struct BLI_Stack BLI_Stack;
BLI_Stack *BLI_stack_new_ex(size_t elem_size,
BLI_Stack *BLI_stack_new_ex(const size_t elem_size,
const char *description,
size_t chunk_size) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL();
const size_t chunk_size) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL();
/**
* Create a new homogeneous stack with elements of 'elem_size' bytes.
*/
BLI_Stack *BLI_stack_new(size_t elem_size, const char *description) ATTR_WARN_UNUSED_RESULT
BLI_Stack *BLI_stack_new(const size_t elem_size, const char *description) ATTR_WARN_UNUSED_RESULT
ATTR_NONNULL();
/**

View File

@@ -42,7 +42,8 @@ extern "C" {
* \param len: The number of bytes to duplicate
* \retval Returns the duplicated string
*/
char *BLI_strdupn(const char *str, size_t len) ATTR_MALLOC ATTR_WARN_UNUSED_RESULT ATTR_NONNULL();
char *BLI_strdupn(const char *str, const size_t len) ATTR_MALLOC ATTR_WARN_UNUSED_RESULT
ATTR_NONNULL();
/**
* Duplicates the cstring \a str into a newly mallocN'd
@@ -73,7 +74,8 @@ char *BLI_strdupcat(const char *__restrict str1,
* the size of dst)
* \retval Returns dst
*/
char *BLI_strncpy(char *__restrict dst, const char *__restrict src, size_t maxncpy) ATTR_NONNULL();
char *BLI_strncpy(char *__restrict dst, const char *__restrict src, const size_t maxncpy)
ATTR_NONNULL();
/**
* Like BLI_strncpy but ensures dst is always padded by given char,
@@ -105,7 +107,7 @@ char *BLI_strncpy_ensure_pad(char *__restrict dst,
*/
size_t BLI_strncpy_rlen(char *__restrict dst,
const char *__restrict src,
size_t maxncpy) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL();
const size_t maxncpy) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL();
size_t BLI_strcpy_rlen(char *__restrict dst, const char *__restrict src) ATTR_WARN_UNUSED_RESULT
ATTR_NONNULL();
@@ -184,7 +186,7 @@ void BLI_str_replace_char(char *str, char src, char dst) ATTR_NONNULL();
* \note Larger tables should use a hash table.
*/
bool BLI_str_replace_table_exact(char *string,
size_t string_len,
const size_t string_len,
const char *replace_table[][2],
int replace_table_len);
@@ -233,7 +235,7 @@ char *BLI_sprintfN(const char *__restrict format, ...) ATTR_WARN_UNUSED_RESULT
*
* \note This is used for creating animation paths in blend files.
*/
size_t BLI_str_escape(char *__restrict dst, const char *__restrict src, size_t dst_maxncpy)
size_t BLI_str_escape(char *__restrict dst, const char *__restrict src, const size_t dst_maxncpy)
ATTR_NONNULL();
/**
* This roughly matches C and Python's string escaping with double quotes - `"`.
@@ -249,9 +251,9 @@ size_t BLI_str_escape(char *__restrict dst, const char *__restrict src, size_t d
*/
size_t BLI_str_unescape_ex(char *__restrict dst,
const char *__restrict src,
size_t src_maxncpy,
const size_t src_maxncpy,
/* Additional arguments. */
size_t dst_maxncpy,
const size_t dst_maxncpy,
bool *r_is_complete) ATTR_NONNULL();
/**
* See #BLI_str_unescape_ex doc-string.
@@ -263,7 +265,7 @@ size_t BLI_str_unescape_ex(char *__restrict dst,
*
* \note This is used for parsing animation paths in blend files (runs often).
*/
size_t BLI_str_unescape(char *__restrict dst, const char *__restrict src, size_t src_maxncpy)
size_t BLI_str_unescape(char *__restrict dst, const char *__restrict src, const size_t src_maxncpy)
ATTR_NONNULL();
/**
@@ -357,10 +359,10 @@ int BLI_strcmp_ignore_pad(const char *str1, const char *str2, char pad) ATTR_WAR
/**
* Determine the length of a fixed-size string.
*/
size_t BLI_strnlen(const char *str, size_t maxlen) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL();
size_t BLI_strnlen(const char *str, const size_t maxlen) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL();
void BLI_str_tolower_ascii(char *str, size_t len) ATTR_NONNULL();
void BLI_str_toupper_ascii(char *str, size_t len) ATTR_NONNULL();
void BLI_str_tolower_ascii(char *str, const size_t len) ATTR_NONNULL();
void BLI_str_toupper_ascii(char *str, const size_t len) ATTR_NONNULL();
/**
* Strip white-space from end of the string.
*/
@@ -477,7 +479,7 @@ bool BLI_string_all_words_matched(const char *name,
* \return The number of words found in \a str
*/
int BLI_string_find_split_words(const char *str,
size_t len,
const size_t len,
char delim,
int r_words[][2],
int words_max) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL();

View File

@@ -110,12 +110,14 @@ size_t BLI_str_utf8_from_unicode_len(unsigned int c) ATTR_WARN_UNUSED_RESULT;
*
* \return number of bytes written.
*/
size_t BLI_str_utf8_from_unicode(unsigned int c, char *outbuf, size_t outbuf_len) ATTR_NONNULL(2);
size_t BLI_str_utf8_from_unicode(unsigned int c, char *outbuf, const size_t outbuf_len)
ATTR_NONNULL(2);
size_t BLI_str_utf8_as_utf32(char32_t *__restrict dst_w,
const char *__restrict src_c,
size_t maxncpy) ATTR_NONNULL(1, 2);
size_t BLI_str_utf32_as_utf8(char *__restrict dst, const char32_t *__restrict src, size_t maxncpy)
ATTR_NONNULL(1, 2);
const size_t maxncpy) ATTR_NONNULL(1, 2);
size_t BLI_str_utf32_as_utf8(char *__restrict dst,
const char32_t *__restrict src,
const size_t maxncpy) ATTR_NONNULL(1, 2);
/**
* \return The UTF-32 len in UTF-8.
*/
@@ -160,20 +162,21 @@ size_t BLI_wstrlen_utf8(const wchar_t *src) ATTR_NONNULL(1) ATTR_WARN_UNUSED_RES
size_t BLI_strlen_utf8_ex(const char *strc, size_t *r_len_bytes)
ATTR_NONNULL(1, 2) ATTR_WARN_UNUSED_RESULT;
size_t BLI_strlen_utf8(const char *strc) ATTR_NONNULL(1) ATTR_WARN_UNUSED_RESULT;
size_t BLI_strnlen_utf8_ex(const char *strc, size_t maxlen, size_t *r_len_bytes)
size_t BLI_strnlen_utf8_ex(const char *strc, const size_t maxlen, size_t *r_len_bytes)
ATTR_NONNULL(1, 3);
/**
* \param strc: the string to measure the length.
* \param maxlen: the string length (in bytes)
* \return the unicode length (not in bytes!)
*/
size_t BLI_strnlen_utf8(const char *strc, size_t maxlen) ATTR_NONNULL(1) ATTR_WARN_UNUSED_RESULT;
size_t BLI_strnlen_utf8(const char *strc, const size_t maxlen)
ATTR_NONNULL(1) ATTR_WARN_UNUSED_RESULT;
size_t BLI_strncpy_wchar_as_utf8(char *__restrict dst,
const wchar_t *__restrict src,
size_t maxncpy) ATTR_NONNULL(1, 2);
const size_t maxncpy) ATTR_NONNULL(1, 2);
size_t BLI_strncpy_wchar_from_utf8(wchar_t *__restrict dst,
const char *__restrict src,
size_t maxncpy) ATTR_NONNULL(1, 2);
const size_t maxncpy) ATTR_NONNULL(1, 2);
/**
* Count columns that character/string occupies (based on `wcwidth.co`).

View File

@@ -57,11 +57,11 @@ bool BLI_string_is_decimal(const char *string) ATTR_NONNULL();
* Based on `BLI_split_dirfile()` / `os.path.splitext()`,
* `"a.b.c"` -> (`"a.b"`, `".c"`).
*/
void BLI_string_split_suffix(const char *string, char *r_body, char *r_suf, size_t str_len);
void BLI_string_split_suffix(const char *string, char *r_body, char *r_suf, const size_t str_len);
/**
* `"a.b.c"` -> (`"a."`, `"b.c"`).
*/
void BLI_string_split_prefix(const char *string, char *r_pre, char *r_body, size_t str_len);
void BLI_string_split_prefix(const char *string, char *r_pre, char *r_body, const size_t str_len);
/**
* Join strings, return newly allocated string.
@@ -127,7 +127,7 @@ char *BLI_string_join_array_by_sep_char_with_tableN(char sep,
size_t BLI_string_flip_side_name(char *r_name,
const char *from_name,
bool strip_number,
size_t name_len);
const size_t name_len);
/**
* Ensures name is unique (according to criteria specified by caller in unique_check callback),

View File

@@ -42,7 +42,7 @@ extern "C" {
* \return length of \a str
*/
size_t BLI_timecode_string_from_time(char *str,
size_t maxncpy,
const size_t maxncpy,
int brevity_level,
float time_seconds,
double fps,
@@ -56,7 +56,7 @@ size_t BLI_timecode_string_from_time(char *str,
* \param time_seconds: time total time in seconds
* \return length of \a str
*/
size_t BLI_timecode_string_from_time_simple(char *str, size_t maxncpy, double time_seconds)
size_t BLI_timecode_string_from_time_simple(char *str, const size_t maxncpy, double time_seconds)
ATTR_NONNULL();
/**
@@ -72,7 +72,7 @@ size_t BLI_timecode_string_from_time_simple(char *str, size_t maxncpy, double ti
* \note in some cases this is used to print non-seconds values.
*/
size_t BLI_timecode_string_from_time_seconds(char *str,
size_t maxncpy,
const size_t maxncpy,
int brevity_level,
float time_seconds) ATTR_NONNULL();

View File

@@ -638,7 +638,7 @@ extern "C" {
/**
* Check if memory is zeroed, as with `memset(arr, 0, arr_size)`.
*/
extern bool BLI_memory_is_zero(const void *arr, size_t arr_size);
extern bool BLI_memory_is_zero(const void *arr, const size_t arr_size);
#endif
#define MEMCMP_STRUCT_AFTER_IS_ZERO(struct_var, member) \

View File

@@ -54,9 +54,8 @@ typedef struct ParallelMempoolTaskData {
*
* See #BLI_task_parallel_mempool implementation for detailed usage example.
*/
ParallelMempoolTaskData *mempool_iter_threadsafe_create(BLI_mempool *pool,
size_t num_iter) ATTR_WARN_UNUSED_RESULT
ATTR_NONNULL();
ParallelMempoolTaskData *mempool_iter_threadsafe_create(BLI_mempool *pool, const size_t num_iter)
ATTR_WARN_UNUSED_RESULT ATTR_NONNULL();
void mempool_iter_threadsafe_destroy(ParallelMempoolTaskData *iter_arr) ATTR_NONNULL();
/**

View File

@@ -146,4 +146,4 @@ TEST(math_vec_types, VectorTypeConversion)
EXPECT_EQ(d[1], -1.0);
}
} // namespace blender::tests
} // namespace blender::tests

View File

@@ -23,6 +23,7 @@ set(INC
..
)
setup_libdirs()
include_directories(${INC})
BLENDER_TEST_PERFORMANCE(BLI_ghash_performance "bf_blenlib")

View File

@@ -30,6 +30,7 @@ set(SRC
msgfmt.c
)
setup_libdirs()
add_cc_flags_custom_test(msgfmt)
if(WIN32)

View File

@@ -1186,7 +1186,6 @@ static BMO_FlagSet bmo_enum_triangulate_quad_method[] = {
{MOD_TRIANGULATE_QUAD_FIXED, "FIXED"},
{MOD_TRIANGULATE_QUAD_ALTERNATE, "ALTERNATE"},
{MOD_TRIANGULATE_QUAD_SHORTEDGE, "SHORT_EDGE"},
{MOD_TRIANGULATE_QUAD_LONGEDGE, "LONG_EDGE"},
{0, NULL},
};

View File

@@ -1007,7 +1007,6 @@ void BM_face_triangulate(BMesh *bm,
break;
}
case MOD_TRIANGULATE_QUAD_SHORTEDGE:
case MOD_TRIANGULATE_QUAD_LONGEDGE:
case MOD_TRIANGULATE_QUAD_BEAUTY:
default: {
BMLoop *l_v3, *l_v4;
@@ -1024,12 +1023,6 @@ void BM_face_triangulate(BMesh *bm,
d2 = len_squared_v3v3(l_v1->v->co, l_v3->v->co);
split_24 = ((d2 - d1) > 0.0f);
}
else if (quad_method == MOD_TRIANGULATE_QUAD_LONGEDGE) {
float d1, d2;
d1 = len_squared_v3v3(l_v4->v->co, l_v2->v->co);
d2 = len_squared_v3v3(l_v1->v->co, l_v3->v->co);
split_24 = ((d2 - d1) < 0.0f);
}
else {
/* first check if the quad is concave on either diagonal */
const int flip_flag = is_quad_flip_v3(

View File

@@ -40,9 +40,6 @@ set(INC
../../../intern/atomic
../../../intern/guardedalloc
../../../intern/clog
# dna_type_offsets.h
${CMAKE_CURRENT_BINARY_DIR}/../makesdna/intern
)
set(INC_SYS
@@ -150,8 +147,6 @@ set(SRC
nodes/COM_TimeNode.h
nodes/COM_ValueNode.cc
nodes/COM_ValueNode.h
nodes/COM_SceneTimeNode.cc
nodes/COM_SceneTimeNode.h
# output nodes
nodes/COM_CompositorNode.cc
@@ -650,15 +645,6 @@ endif()
blender_add_lib(bf_compositor "${SRC}" "${INC}" "${INC_SYS}" "${LIB}")
if(WITH_UNITY_BUILD)
set_target_properties(bf_compositor PROPERTIES UNITY_BUILD ON)
set_target_properties(bf_compositor PROPERTIES UNITY_BUILD_BATCH_SIZE 10)
endif()
if(COMMAND target_precompile_headers)
target_precompile_headers(bf_compositor PRIVATE COM_precomp.h)
endif()
if(CXX_WARN_NO_SUGGEST_OVERRIDE)
target_compile_options(bf_compositor PRIVATE "-Wsuggest-override")
endif()

View File

@@ -1,33 +0,0 @@
/* Pre-compiled headers, see: D13797. */
#include <cfloat>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <functional>
#include <iostream>
#include <iterator>
#include <list>
#include <map>
#include <ostream>
#include <set>
#include <string>
#include "COM_ConstantOperation.h"
#include "COM_ConvertOperation.h"
#include "COM_Debug.h"
#include "COM_Enums.h"
#include "COM_ExecutionGroup.h"
#include "COM_ExecutionSystem.h"
#include "COM_MultiThreadedOperation.h"
#include "COM_Node.h"
#include "COM_NodeOperation.h"
#include "COM_OpenCLDevice.h"
#include "COM_SetAlphaMultiplyOperation.h"
#include "COM_SetColorOperation.h"
#include "COM_SetSamplerOperation.h"
#include "COM_SetValueOperation.h"
#include "COM_SetVectorOperation.h"
#include "COM_defines.h"

View File

@@ -94,7 +94,6 @@
#include "COM_RotateNode.h"
#include "COM_ScaleNode.h"
#include "COM_ScaleOperation.h"
#include "COM_SceneTimeNode.h"
#include "COM_SeparateColorNode.h"
#include "COM_SetAlphaNode.h"
#include "COM_SetValueOperation.h"
@@ -361,9 +360,6 @@ Node *COM_convert_bnode(bNode *b_node)
case CMP_NODE_TRANSFORM:
node = new TransformNode(b_node);
break;
case CMP_NODE_SCENE_TIME:
node = new SceneTimeNode(b_node);
break;
case CMP_NODE_STABILIZE2D:
node = new Stabilize2dNode(b_node);
break;

View File

@@ -1,50 +0,0 @@
/*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* Copyright 2022, Blender Foundation.
*/
#include "COM_SceneTimeNode.h"
#include "COM_SetValueOperation.h"
namespace blender::compositor {
SceneTimeNode::SceneTimeNode(bNode *editor_node) : Node(editor_node)
{
/* pass */
}
void SceneTimeNode::convert_to_operations(NodeConverter &converter,
const CompositorContext &context) const
{
SetValueOperation *SecondOperation = new SetValueOperation();
SetValueOperation *frameOperation = new SetValueOperation();
const int frameNumber = context.get_framenumber();
const Scene* scene = context.get_scene();
const double frameRate = (((double)scene->r.frs_sec) / (double)scene->r.frs_sec_base);
SecondOperation->set_value(float(frameNumber / frameRate));
converter.add_operation(SecondOperation);
frameOperation->set_value(frameNumber);
converter.add_operation(frameOperation);
converter.map_output_socket(get_output_socket(0), SecondOperation->get_output_socket());
converter.map_output_socket(get_output_socket(1), frameOperation->get_output_socket());
}
} // namespace blender::compositor

View File

@@ -1,36 +0,0 @@
/*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* Copyright 2022, Blender Foundation.
*/
#pragma once
#include "COM_Node.h"
namespace blender::compositor {
/**
* \brief SceneTimeNode
* \ingroup Node
*/
class SceneTimeNode : public Node {
public:
SceneTimeNode(bNode *editor_node);
void convert_to_operations(NodeConverter &converter,
const CompositorContext &context) const override;
};
} // namespace blender::compositor

View File

@@ -18,8 +18,6 @@
#include "COM_KeyingScreenOperation.h"
#include "DNA_defaults.h"
#include "BKE_movieclip.h"
#include "BKE_tracking.h"
@@ -77,7 +75,7 @@ void KeyingScreenOperation::deinit_execution()
KeyingScreenOperation::TriangulationData *KeyingScreenOperation::build_voronoi_triangulation()
{
MovieClipUser user = *DNA_struct_default_get(MovieClipUser);
MovieClipUser user = {0};
TriangulationData *triangulation;
MovieTracking *tracking = &movie_clip_->tracking;
MovieTrackingTrack *track;
@@ -303,7 +301,7 @@ void KeyingScreenOperation::determine_canvas(const rcti &preferred_area, rcti &r
r_area = COM_AREA_NONE;
if (movie_clip_) {
MovieClipUser user = *DNA_struct_default_get(MovieClipUser);
MovieClipUser user = {0};
int width, height;
int clip_frame = BKE_movieclip_remap_scene_to_clip_frame(movie_clip_, framenumber_);

View File

@@ -18,8 +18,6 @@
#include "COM_MovieDistortionOperation.h"
#include "DNA_defaults.h"
#include "BKE_movieclip.h"
namespace blender::compositor {
@@ -38,7 +36,7 @@ void MovieDistortionOperation::init_data()
{
if (movie_clip_) {
MovieTracking *tracking = &movie_clip_->tracking;
MovieClipUser clip_user = *DNA_struct_default_get(MovieClipUser);
MovieClipUser clip_user = {0};
int calibration_width, calibration_height;
BKE_movieclip_user_set_frame(&clip_user, framenumber_);

View File

@@ -136,7 +136,7 @@ void add_exr_channels(void *exrhandle,
const char *layer_name,
const DataType datatype,
const char *view_name,
size_t width,
const size_t width,
bool use_half_float,
float *buf);
void free_exr_channels(void *exrhandle,

View File

@@ -18,8 +18,6 @@
#include "COM_PlaneTrackOperation.h"
#include "DNA_defaults.h"
#include "BKE_movieclip.h"
#include "BKE_tracking.h"
@@ -82,7 +80,7 @@ void PlaneTrackCommon::determine_canvas(const rcti &preferred_area, rcti &r_area
r_area = COM_AREA_NONE;
if (movie_clip_) {
int width, height;
MovieClipUser user = *DNA_struct_default_get(MovieClipUser);
MovieClipUser user = {0};
BKE_movieclip_user_set_frame(&user, framenumber_);
BKE_movieclip_get_size(movie_clip_, &user, &width, &height);
r_area = preferred_area;

View File

@@ -18,8 +18,6 @@
#include "COM_TrackPositionOperation.h"
#include "DNA_defaults.h"
#include "BKE_movieclip.h"
#include "BKE_node.h"
#include "BKE_tracking.h"
@@ -52,7 +50,7 @@ void TrackPositionOperation::calc_track_position()
{
is_track_position_calculated_ = true;
MovieTracking *tracking = nullptr;
MovieClipUser user = *DNA_struct_default_get(MovieClipUser);
MovieClipUser user = {0};
MovieTrackingObject *object;
track_position_ = 0;

View File

@@ -52,6 +52,10 @@ if(NOT WITH_HEADLESS)
endif()
include_directories(${PNG_INCLUDE_DIRS})
if(NOT APPLE)
# APPLE platform uses full paths for linking libraries.
link_directories(${PNG_LIBPATH} ${ZLIB_LIBPATH})
endif()
add_executable(datatoc_icon ${SRC})
setup_platform_linker_flags(datatoc_icon)

View File

@@ -1475,17 +1475,6 @@ void DepsgraphRelationBuilder::build_animation_images(ID *id)
id, NodeType::IMAGE_ANIMATION, OperationCode::IMAGE_ANIMATION);
TimeSourceKey time_src_key;
add_relation(time_src_key, image_animation_key, "TimeSrc -> Image Animation");
/* The image users of these ids may change during evaluation. Make sure that the image
* animation update happens after evaluation. */
if (GS(id->name) == ID_MA) {
OperationKey material_update_key(id, NodeType::SHADING, OperationCode::MATERIAL_UPDATE);
add_relation(material_update_key, image_animation_key, "Material Update -> Image Animation");
}
else if (GS(id->name) == ID_WO) {
OperationKey world_update_key(id, NodeType::SHADING, OperationCode::WORLD_UPDATE);
add_relation(world_update_key, image_animation_key, "World Update -> Image Animation");
}
}
}

View File

@@ -55,7 +55,7 @@ template<class ModeObjectType> struct DepsNodeFactoryImpl : public DepsNodeFacto
void register_node_typeinfo(DepsNodeFactory *factory);
/* Get typeinfo for specified type */
DepsNodeFactory *type_get_factory(NodeType type);
DepsNodeFactory *type_get_factory(const NodeType type);
} // namespace deg
} // namespace blender

View File

@@ -26,12 +26,12 @@ static void build_fcurve(FCurve &fcurve)
fcurve.totvert = 3;
fcurve.bezt = static_cast<BezTriple *>(
MEM_callocN(sizeof(BezTriple) * fcurve.totvert, "BezTriples"));
fcurve.bezt[0].vec[1][0] = 10.0f;
fcurve.bezt[0].vec[1][1] = 1.0f;
fcurve.bezt[1].vec[1][0] = 20.0f;
fcurve.bezt[1].vec[1][1] = 2.0f;
fcurve.bezt[2].vec[1][0] = 30.0f;
fcurve.bezt[2].vec[1][1] = 1.0f;
fcurve.bezt[0].vec[1][0] = 10.f;
fcurve.bezt[0].vec[1][1] = 1.f;
fcurve.bezt[1].vec[1][0] = 20.f;
fcurve.bezt[1].vec[1][1] = 2.f;
fcurve.bezt[2].vec[1][0] = 30.f;
fcurve.bezt[2].vec[1][1] = 1.f;
}
static AnimKeylist *create_test_keylist()

View File

@@ -29,10 +29,10 @@ set(INC_SYS
)
set(SRC
geometry_attributes.cc
geometry_ops.cc
geometry_attributes.c
geometry_ops.c
geometry_intern.hh
geometry_intern.h
)
set(LIB

View File

@@ -35,14 +35,14 @@
#include "ED_object.h"
#include "geometry_intern.hh"
#include "geometry_intern.h"
/*********************** Attribute Operators ************************/
static bool geometry_attributes_poll(bContext *C)
{
Object *ob = ED_object_context(C);
ID *data = (ob) ? static_cast<ID *>(ob->data) : nullptr;
ID *data = (ob) ? ob->data : NULL;
return (ob && !ID_IS_LINKED(ob) && data && !ID_IS_LINKED(data)) &&
BKE_id_attributes_supported(data);
}
@@ -54,8 +54,8 @@ static bool geometry_attributes_remove_poll(bContext *C)
}
Object *ob = ED_object_context(C);
ID *data = (ob) ? static_cast<ID *>(ob->data) : nullptr;
if (BKE_id_attributes_active_get(data) != nullptr) {
ID *data = (ob) ? ob->data : NULL;
if (BKE_id_attributes_active_get(data) != NULL) {
return true;
}
@@ -67,22 +67,22 @@ static const EnumPropertyItem *geometry_attribute_domain_itemf(bContext *C,
PropertyRNA *UNUSED(prop),
bool *r_free)
{
if (C == nullptr) {
if (C == NULL) {
return DummyRNA_NULL_items;
}
Object *ob = ED_object_context(C);
if (ob == nullptr) {
if (ob == NULL) {
return DummyRNA_NULL_items;
}
return rna_enum_attribute_domain_itemf(static_cast<ID *>(ob->data), r_free);
return rna_enum_attribute_domain_itemf(ob->data, r_free);
}
static int geometry_attribute_add_exec(bContext *C, wmOperator *op)
{
Object *ob = ED_object_context(C);
ID *id = static_cast<ID *>(ob->data);
ID *id = ob->data;
char name[MAX_NAME];
RNA_string_get(op->ptr, "name", name);
@@ -90,7 +90,7 @@ static int geometry_attribute_add_exec(bContext *C, wmOperator *op)
AttributeDomain domain = (AttributeDomain)RNA_enum_get(op->ptr, "domain");
CustomDataLayer *layer = BKE_id_attribute_new(id, name, type, domain, op->reports);
if (layer == nullptr) {
if (layer == NULL) {
return OPERATOR_CANCELLED;
}
@@ -144,10 +144,10 @@ void GEOMETRY_OT_attribute_add(wmOperatorType *ot)
static int geometry_attribute_remove_exec(bContext *C, wmOperator *op)
{
Object *ob = ED_object_context(C);
ID *id = static_cast<ID *>(ob->data);
ID *id = ob->data;
CustomDataLayer *layer = BKE_id_attributes_active_get(id);
if (layer == nullptr) {
if (layer == NULL) {
return OPERATOR_CANCELLED;
}

View File

@@ -25,6 +25,6 @@
struct wmOperatorType;
/* *** geometry_attributes.cc *** */
/* *** geometry_attributes.c *** */
void GEOMETRY_OT_attribute_add(struct wmOperatorType *ot);
void GEOMETRY_OT_attribute_remove(struct wmOperatorType *ot);

View File

@@ -25,7 +25,7 @@
#include "ED_geometry.h"
#include "geometry_intern.hh"
#include "geometry_intern.h"
/**************************** registration **********************************/

View File

@@ -54,7 +54,6 @@
#include "BKE_deform.h"
#include "BKE_global.h"
#include "BKE_gpencil.h"
#include "BKE_gpencil_curve.h"
#include "BKE_gpencil_geom.h"
#include "BKE_layer.h"
#include "BKE_main.h"
@@ -835,7 +834,7 @@ static short gpencil_stroke_addpoint(tGPsdata *p,
/* color strength */
if (brush_settings->flag & GP_BRUSH_USE_STRENGTH_PRESSURE) {
pt->strength *= BKE_curvemapping_evaluateF(brush_settings->curve_strength, 0, pressure);
CLAMP(pt->strength, MIN2(GPENCIL_STRENGTH_MIN, brush_settings->draw_strength), 1.0f);
CLAMP(pt->strength, GPENCIL_STRENGTH_MIN, 1.0f);
}
/* Set vertex colors for buffer. */
@@ -919,19 +918,6 @@ static short gpencil_stroke_addpoint(tGPsdata *p,
return GP_STROKEADD_INVALID;
}
static void gpencil_stroke_unselect(bGPdata *gpd, bGPDstroke *gps)
{
gps->flag &= ~GP_STROKE_SELECT;
BKE_gpencil_stroke_select_index_reset(gps);
for (int i = 0; i < gps->totpoints; i++) {
gps->points[i].flag &= ~GP_SPOINT_SELECT;
}
/* Update the selection from the stroke to the curve. */
if (gps->editcurve) {
BKE_gpencil_editcurve_stroke_sync_selection(gpd, gps, gps->editcurve);
}
}
/* make a new stroke from the buffer data */
static void gpencil_stroke_newfrombuffer(tGPsdata *p)
{
@@ -942,7 +928,6 @@ static void gpencil_stroke_newfrombuffer(tGPsdata *p)
tGPspoint *ptc;
MDeformVert *dvert = NULL;
Brush *brush = p->brush;
BrushGpencilSettings *brush_settings = brush->gpencil_settings;
ToolSettings *ts = p->scene->toolsettings;
Depsgraph *depsgraph = p->depsgraph;
Object *obact = (Object *)p->ownerPtr.data;
@@ -1031,7 +1016,7 @@ static void gpencil_stroke_newfrombuffer(tGPsdata *p)
/* copy pressure and time */
pt->pressure = ptc->pressure;
pt->strength = ptc->strength;
CLAMP(pt->strength, MIN2(GPENCIL_STRENGTH_MIN, brush_settings->draw_strength), 1.0f);
CLAMP(pt->strength, GPENCIL_STRENGTH_MIN, 1.0f);
copy_v4_v4(pt->vert_color, ptc->vert_color);
pt->time = ptc->time;
/* Apply the vertex color to point. */
@@ -1065,7 +1050,7 @@ static void gpencil_stroke_newfrombuffer(tGPsdata *p)
/* copy pressure and time */
pt->pressure = ptc->pressure;
pt->strength = ptc->strength;
CLAMP(pt->strength, MIN2(GPENCIL_STRENGTH_MIN, brush_settings->draw_strength), 1.0f);
CLAMP(pt->strength, GPENCIL_STRENGTH_MIN, 1.0f);
pt->time = ptc->time;
/* Apply the vertex color to point. */
ED_gpencil_point_vertex_color_set(ts, brush, pt, ptc);
@@ -1190,7 +1175,7 @@ static void gpencil_stroke_newfrombuffer(tGPsdata *p)
/* copy pressure and time */
pt->pressure = ptc->pressure;
pt->strength = ptc->strength;
CLAMP(pt->strength, MIN2(GPENCIL_STRENGTH_MIN, brush_settings->draw_strength), 1.0f);
CLAMP(pt->strength, GPENCIL_STRENGTH_MIN, 1.0f);
copy_v4_v4(pt->vert_color, ptc->vert_color);
pt->time = ptc->time;
pt->uv_fac = ptc->uv_fac;
@@ -1315,12 +1300,7 @@ static void gpencil_stroke_newfrombuffer(tGPsdata *p)
ctrl2,
GPENCIL_MINIMUM_JOIN_DIST,
&pt_index);
if (gps_target != NULL) {
/* Unselect all points of source and destination strokes. This is required to avoid
* a change in the resolution of the original strokes during the join. */
gpencil_stroke_unselect(gpd, gps);
gpencil_stroke_unselect(gpd, gps_target);
gps = ED_gpencil_stroke_join_and_trim(p->gpd, p->gpf, gps, gps_target, pt_index);
}
else {

View File

@@ -102,7 +102,7 @@ void ED_slider_destroy(struct bContext *C, struct tSlider *slider);
*/
void ED_slider_status_string_get(const struct tSlider *slider,
char *status_string,
size_t size_of_status_string);
const size_t size_of_status_string);
float ED_slider_factor_get(struct tSlider *slider);
void ED_slider_factor_set(struct tSlider *slider, float factor);

View File

@@ -495,7 +495,7 @@ float UI_text_clip_middle_ex(const struct uiFontStyle *fstyle,
char *str,
float okwidth,
float minwidth,
size_t max_len,
const size_t max_len,
char rpart_sep);
/**
@@ -2957,17 +2957,15 @@ void UI_fontstyle_set(const struct uiFontStyle *fs);
void UI_fontstyle_draw_ex(const struct uiFontStyle *fs,
const struct rcti *rect,
const char *str,
size_t str_len,
const uchar col[4],
const struct uiFontStyleDraw_Params *fs_params,
size_t len,
int *r_xofs,
int *r_yofs,
struct ResultBLF *r_info);
void UI_fontstyle_draw(const struct uiFontStyle *fs,
const struct rcti *rect,
const char *str,
size_t str_len,
const uchar col[4],
const struct uiFontStyleDraw_Params *fs_params);
/**

View File

@@ -688,11 +688,11 @@ extern void ui_hsvcube_pos_from_vals(
*/
extern void ui_but_string_get_ex(uiBut *but,
char *str,
size_t maxlen,
const size_t maxlen,
int float_precision,
bool use_exp_float,
bool *r_use_exp_float) ATTR_NONNULL(1, 2);
extern void ui_but_string_get(uiBut *but, char *str, size_t maxlen) ATTR_NONNULL();
extern void ui_but_string_get(uiBut *but, char *str, const size_t maxlen) ATTR_NONNULL();
/**
* A version of #ui_but_string_get_ex for dynamic buffer sizes
* (where #ui_but_string_get_max_length returns 0).

View File

@@ -1146,7 +1146,6 @@ static void panel_draw_aligned_widgets(const uiStyle *style,
UI_fontstyle_draw(fontstyle,
&title_rect,
panel->drawname,
sizeof(panel->drawname),
title_color,
&(struct uiFontStyleDraw_Params){
.align = UI_STYLE_TEXT_LEFT,

View File

@@ -74,8 +74,6 @@
#define UI_TIP_PADDING (int)(UI_TIP_PAD_FAC * UI_UNIT_Y)
#define UI_TIP_MAXWIDTH 600
#define UI_TIP_STR_MAX 1024
typedef struct uiTooltipFormat {
enum {
UI_TIP_STYLE_NORMAL = 0,
@@ -216,7 +214,7 @@ static void ui_tooltip_region_draw_cb(const bContext *UNUSED(C), ARegion *region
/* draw header and active data (is done here to be able to change color) */
rgb_float_to_uchar(drawcol, tip_colors[UI_TIP_LC_MAIN]);
UI_fontstyle_set(&data->fstyle);
UI_fontstyle_draw(&data->fstyle, &bbox, field->text, UI_TIP_STR_MAX, drawcol, &fs_params);
UI_fontstyle_draw(&data->fstyle, &bbox, field->text, drawcol, &fs_params);
/* offset to the end of the last line */
if (field->text_suffix) {
@@ -226,8 +224,7 @@ static void ui_tooltip_region_draw_cb(const bContext *UNUSED(C), ARegion *region
bbox.ymax -= yofs;
rgb_float_to_uchar(drawcol, tip_colors[UI_TIP_LC_ACTIVE]);
UI_fontstyle_draw(
&data->fstyle, &bbox, field->text_suffix, UI_TIP_STR_MAX, drawcol, &fs_params);
UI_fontstyle_draw(&data->fstyle, &bbox, field->text_suffix, drawcol, &fs_params);
/* undo offset */
bbox.xmin -= xofs;
@@ -246,7 +243,7 @@ static void ui_tooltip_region_draw_cb(const bContext *UNUSED(C), ARegion *region
/* XXX, needed because we don't have mono in 'U.uifonts' */
BLF_size(fstyle_mono.uifont_id, fstyle_mono.points * U.pixelsize, U.dpi);
rgb_float_to_uchar(drawcol, tip_colors[field->format.color_id]);
UI_fontstyle_draw(&fstyle_mono, &bbox, field->text, UI_TIP_STR_MAX, drawcol, &fs_params);
UI_fontstyle_draw(&fstyle_mono, &bbox, field->text, drawcol, &fs_params);
}
else {
BLI_assert(field->format.style == UI_TIP_STYLE_NORMAL);
@@ -258,7 +255,7 @@ static void ui_tooltip_region_draw_cb(const bContext *UNUSED(C), ARegion *region
/* draw remaining data */
rgb_float_to_uchar(drawcol, tip_colors[field->format.color_id]);
UI_fontstyle_set(&data->fstyle);
UI_fontstyle_draw(&data->fstyle, &bbox, field->text, UI_TIP_STR_MAX, drawcol, &fs_params);
UI_fontstyle_draw(&data->fstyle, &bbox, field->text, drawcol, &fs_params);
}
bbox.ymax -= data->lineh * field->geom.lines;
@@ -1218,12 +1215,12 @@ static ARegion *ui_tooltip_create_with_data(bContext *C,
BLI_assert(ELEM(field->format.style, UI_TIP_STYLE_NORMAL, UI_TIP_STYLE_HEADER));
font_id = data->fstyle.uifont_id;
}
w = BLF_width_ex(font_id, field->text, UI_TIP_STR_MAX, &info);
w = BLF_width_ex(font_id, field->text, BLF_DRAW_STR_DUMMY_MAX, &info);
/* check for suffix (enum label) */
if (field->text_suffix && field->text_suffix[0]) {
x_pos = info.width;
w = max_ii(w, x_pos + BLF_width(font_id, field->text_suffix, UI_TIP_STR_MAX));
w = max_ii(w, x_pos + BLF_width(font_id, field->text_suffix, BLF_DRAW_STR_DUMMY_MAX));
}
fontw = max_ii(fontw, w);

View File

@@ -140,9 +140,9 @@ static uiFont *uifont_to_blfont(int id)
void UI_fontstyle_draw_ex(const uiFontStyle *fs,
const rcti *rect,
const char *str,
const size_t str_len,
const uchar col[4],
const struct uiFontStyleDraw_Params *fs_params,
size_t len,
int *r_xofs,
int *r_yofs,
struct ResultBLF *r_info)
@@ -183,10 +183,10 @@ void UI_fontstyle_draw_ex(const uiFontStyle *fs,
}
if (fs_params->align == UI_STYLE_TEXT_CENTER) {
xofs = floor(0.5f * (BLI_rcti_size_x(rect) - BLF_width(fs->uifont_id, str, str_len)));
xofs = floor(0.5f * (BLI_rcti_size_x(rect) - BLF_width(fs->uifont_id, str, len)));
}
else if (fs_params->align == UI_STYLE_TEXT_RIGHT) {
xofs = BLI_rcti_size_x(rect) - BLF_width(fs->uifont_id, str, str_len);
xofs = BLI_rcti_size_x(rect) - BLF_width(fs->uifont_id, str, len);
}
yofs = MAX2(0, yofs);
@@ -196,7 +196,7 @@ void UI_fontstyle_draw_ex(const uiFontStyle *fs,
BLF_position(fs->uifont_id, rect->xmin + xofs, rect->ymin + yofs, 0.0f);
BLF_color4ubv(fs->uifont_id, col);
BLF_draw_ex(fs->uifont_id, str, str_len, r_info);
BLF_draw_ex(fs->uifont_id, str, len, r_info);
BLF_disable(fs->uifont_id, font_flag);
@@ -211,11 +211,12 @@ void UI_fontstyle_draw_ex(const uiFontStyle *fs,
void UI_fontstyle_draw(const uiFontStyle *fs,
const rcti *rect,
const char *str,
const size_t str_len,
const uchar col[4],
const struct uiFontStyleDraw_Params *fs_params)
{
UI_fontstyle_draw_ex(fs, rect, str, str_len, col, fs_params, NULL, NULL, NULL);
int xofs, yofs;
UI_fontstyle_draw_ex(fs, rect, str, col, fs_params, BLF_DRAW_STR_DUMMY_MAX, &xofs, &yofs, NULL);
}
void UI_fontstyle_draw_rotated(const uiFontStyle *fs,

View File

@@ -2130,11 +2130,11 @@ static void widget_draw_text(const uiFontStyle *fstyle,
UI_fontstyle_draw_ex(fstyle,
rect,
drawstr + but->ofs,
drawlen,
wcol->text,
&(struct uiFontStyleDraw_Params){
.align = align,
},
drawlen,
&font_xofs,
&font_yofs,
NULL);
@@ -2194,7 +2194,6 @@ static void widget_draw_text(const uiFontStyle *fstyle,
UI_fontstyle_draw(fstyle,
rect,
drawstr_right,
UI_MAX_DRAW_STR,
col,
&(struct uiFontStyleDraw_Params){
.align = UI_STYLE_TEXT_RIGHT,
@@ -5418,11 +5417,11 @@ void ui_draw_menu_item(const uiFontStyle *fstyle,
UI_fontstyle_draw_ex(fstyle,
rect,
drawstr,
sizeof(drawstr),
wt->wcol.text,
&(struct uiFontStyleDraw_Params){
.align = UI_STYLE_TEXT_LEFT,
},
BLF_DRAW_STR_DUMMY_MAX,
&xofs,
&yofs,
&info);
@@ -5469,7 +5468,6 @@ void ui_draw_menu_item(const uiFontStyle *fstyle,
UI_fontstyle_draw(fstyle,
rect,
hint_drawstr,
sizeof(hint_drawstr),
wt->wcol.text,
&(struct uiFontStyleDraw_Params){
.align = UI_STYLE_TEXT_RIGHT,
@@ -5525,7 +5523,6 @@ void ui_draw_preview_item_stateless(const uiFontStyle *fstyle,
UI_fontstyle_draw(fstyle,
&trect,
drawstr,
sizeof(drawstr),
text_col,
&(struct uiFontStyleDraw_Params){
.align = text_align,

View File

@@ -3527,8 +3527,6 @@ static int object_add_named_exec(bContext *C, wmOperator *op)
}
basen->object->visibility_flag &= ~OB_HIDE_VIEWPORT;
/* Do immediately, as #copy_object_set_idnew() below operates on visible objects. */
BKE_base_eval_flags(basen);
/* object_add_duplicate_internal() doesn't deselect other objects, unlike object_add_common() or
* BKE_view_layer_base_deselect_all(). */

View File

@@ -722,7 +722,7 @@ void ED_preview_draw(const bContext *C, void *idp, void *parentp, void *slotp, r
SpaceProperties *sbuts = CTX_wm_space_properties(C);
ShaderPreview *sp = static_cast<ShaderPreview *>(WM_jobs_customdata(wm, area));
rcti newrect;
bool ok;
int ok;
int newx = BLI_rcti_size_x(rect);
int newy = BLI_rcti_size_y(rect);

View File

@@ -2083,31 +2083,15 @@ typedef struct sAreaSplitData {
} sAreaSplitData;
static bool area_split_allowed(const ScrArea *area, const eScreenAxis dir_axis)
{
if (!area || area->global) {
/* Must be a non-global area. */
return false;
}
if ((dir_axis == SCREEN_AXIS_V && area->winx <= 2 * AREAMINX) ||
(dir_axis == SCREEN_AXIS_H && area->winy <= 2 * ED_area_headersize())) {
/* Must be at least double minimum sizes to split into two. */
return false;
}
return true;
}
static void area_split_draw_cb(const struct wmWindow *UNUSED(win), void *userdata)
{
const wmOperator *op = userdata;
sAreaSplitData *sd = op->customdata;
const eScreenAxis dir_axis = RNA_enum_get(op->ptr, "direction");
if (area_split_allowed(sd->sarea, dir_axis)) {
if (sd->sarea) {
const eScreenAxis dir_axis = RNA_enum_get(op->ptr, "direction");
float fac = RNA_float_get(op->ptr, "factor");
screen_draw_split_preview(sd->sarea, dir_axis, fac);
}
}
@@ -2137,6 +2121,18 @@ static bool area_split_init(bContext *C, wmOperator *op)
/* required properties */
const eScreenAxis dir_axis = RNA_enum_get(op->ptr, "direction");
/* minimal size */
if (dir_axis == SCREEN_AXIS_V) {
if (area->winx < 2 * AREAMINX) {
return false;
}
}
else {
if (area->winy < 2 * ED_area_headersize()) {
return false;
}
}
/* custom data */
sAreaSplitData *sd = (sAreaSplitData *)MEM_callocN(sizeof(sAreaSplitData), "op_area_split");
op->customdata = sd;
@@ -2193,10 +2189,6 @@ static bool area_split_apply(bContext *C, wmOperator *op)
float fac = RNA_float_get(op->ptr, "factor");
const eScreenAxis dir_axis = RNA_enum_get(op->ptr, "direction");
if (!area_split_allowed(sd->sarea, dir_axis)) {
return false;
}
sd->narea = area_split(win, screen, sd->sarea, dir_axis, fac, false); /* false = no merge */
if (sd->narea == NULL) {
@@ -2262,15 +2254,9 @@ static void area_split_exit(bContext *C, wmOperator *op)
static void area_split_preview_update_cursor(bContext *C, wmOperator *op)
{
sAreaSplitData *sd = (sAreaSplitData *)op->customdata;
wmWindow *win = CTX_wm_window(C);
const eScreenAxis dir_axis = RNA_enum_get(op->ptr, "direction");
if (area_split_allowed(sd->sarea, dir_axis)) {
WM_cursor_set(CTX_wm_window(C),
(dir_axis == SCREEN_AXIS_H) ? WM_CURSOR_H_SPLIT : WM_CURSOR_V_SPLIT);
}
else {
WM_cursor_set(CTX_wm_window(C), WM_CURSOR_STOP);
}
WM_cursor_set(win, (dir_axis == SCREEN_AXIS_H) ? WM_CURSOR_H_SPLIT : WM_CURSOR_V_SPLIT);
}
/* UI callback, adds new handler */
@@ -2523,9 +2509,6 @@ static int area_split_modal(bContext *C, wmOperator *op, const wmEvent *event)
if (sd->sarea) {
ED_area_tag_redraw(sd->sarea);
}
area_split_preview_update_cursor(C, op);
/* area context not set */
sd->sarea = BKE_screen_find_area_xy(CTX_wm_screen(C), SPACE_TYPE_ANY, event->xy);

View File

@@ -31,9 +31,6 @@ set(INC
../../windowmanager
../../../../intern/glew-mx
../../../../intern/guardedalloc
# dna_type_offsets.h
${CMAKE_CURRENT_BINARY_DIR}/../../makesdna/intern
)
set(SRC

View File

@@ -34,7 +34,6 @@
#include "MEM_guardedalloc.h"
#include "DNA_defaults.h"
#include "DNA_mask_types.h"
#include "BLI_fileops.h"
@@ -687,7 +686,7 @@ static bool check_prefetch_break(void)
static uchar *prefetch_read_file_to_memory(
MovieClip *clip, int current_frame, short render_size, short render_flag, size_t *r_size)
{
MovieClipUser user = *DNA_struct_default_get(MovieClipUser);
MovieClipUser user = {0};
user.framenr = current_frame;
user.render_size = render_size;
user.render_flag = render_flag;
@@ -734,7 +733,7 @@ static int prefetch_find_uncached_frame(MovieClip *clip,
short direction)
{
int current_frame;
MovieClipUser user = *DNA_struct_default_get(MovieClipUser);
MovieClipUser user = {0};
user.render_size = render_size;
user.render_flag = render_flag;
@@ -834,7 +833,7 @@ static void prefetch_task_func(TaskPool *__restrict pool, void *task_data)
while ((mem = prefetch_thread_next_frame(queue, clip, &size, &current_frame))) {
ImBuf *ibuf;
MovieClipUser user = *DNA_struct_default_get(MovieClipUser);
MovieClipUser user = {0};
int flag = IB_rect | IB_multilayer | IB_alphamode_detect | IB_metadata;
int result;
char *colorspace_name = NULL;
@@ -916,7 +915,7 @@ static bool prefetch_movie_frame(MovieClip *clip,
short render_flag,
short *stop)
{
MovieClipUser user = *DNA_struct_default_get(MovieClipUser);
MovieClipUser user = {0};
if (check_prefetch_break() || *stop) {
return false;

View File

@@ -33,7 +33,6 @@
#include "MEM_guardedalloc.h"
#include "DNA_defaults.h"
#include "DNA_scene_types.h" /* min/max frames */
#include "DNA_userdef_types.h"
@@ -1322,7 +1321,7 @@ static uchar *proxy_thread_next_frame(ProxyQueue *queue,
BLI_spin_lock(&queue->spin);
if (!*queue->stop && queue->cfra <= queue->efra) {
MovieClipUser user = *DNA_struct_default_get(MovieClipUser);
MovieClipUser user = {0};
char name[FILE_MAX];
size_t size;
int file;

View File

@@ -24,8 +24,6 @@
#include <stdio.h>
#include <string.h>
#include "DNA_defaults.h"
#include "DNA_mask_types.h"
#include "DNA_movieclip_types.h"
#include "DNA_scene_types.h"
@@ -241,7 +239,14 @@ static SpaceLink *clip_create(const ScrArea *area, const Scene *scene)
ARegion *region;
SpaceClip *sc;
sc = DNA_struct_default_alloc(SpaceClip);
sc = MEM_callocN(sizeof(SpaceClip), "initclip");
sc->spacetype = SPACE_CLIP;
sc->flag = SC_SHOW_MARKER_PATTERN | SC_SHOW_TRACK_PATH | SC_SHOW_GRAPH_TRACKS_MOTION |
SC_SHOW_GRAPH_FRAMES | SC_SHOW_ANNOTATION;
sc->zoom = 1.0f;
sc->path_length = 20;
sc->scopes.track_preview_height = 120;
sc->around = V3D_AROUND_CENTER_MEDIAN;
/* header */
region = MEM_callocN(sizeof(ARegion), "header for clip");

View File

@@ -240,7 +240,6 @@ static void file_draw_string(int sx,
UI_fontstyle_draw(&fs,
&rect,
fname,
sizeof(fname),
col,
&(struct uiFontStyleDraw_Params){
.align = align,
@@ -290,12 +289,12 @@ static void file_draw_string_multiline(int sx,
UI_fontstyle_draw_ex(&style->widget,
&rect,
string,
len,
text_col,
&(struct uiFontStyleDraw_Params){
.align = UI_STYLE_TEXT_LEFT,
.word_wrap = true,
},
len,
NULL,
NULL,
&result);

Some files were not shown because too many files have changed in this diff Show More