Merge branch 'blender-v4.4-release'
This commit is contained in:
@@ -82,6 +82,7 @@ set(DPCPP_EXTRA_ARGS
|
||||
-DPYTHON_EXECUTABLE=${PYTHON_BINARY}
|
||||
-DLLDB_ENABLE_CURSES=OFF
|
||||
-DLLVM_ENABLE_TERMINFO=OFF
|
||||
-DLLVM_ENABLE_ZLIB=OFF
|
||||
-DLLVM_ENABLE_ZSTD=FORCE_ON
|
||||
-DLLVM_USE_STATIC_ZSTD=ON
|
||||
-Dzstd_INCLUDE_DIR=${LIBDIR}/zstd/include
|
||||
|
||||
@@ -64,6 +64,9 @@ endif()
|
||||
|
||||
find_library(SYCL_LIBRARY
|
||||
NAMES
|
||||
sycl10
|
||||
sycl9
|
||||
sycl8
|
||||
sycl7
|
||||
sycl6
|
||||
sycl
|
||||
@@ -76,6 +79,9 @@ find_library(SYCL_LIBRARY
|
||||
if(WIN32)
|
||||
find_library(SYCL_LIBRARY_DEBUG
|
||||
NAMES
|
||||
sycl10d
|
||||
sycl9d
|
||||
sycl8d
|
||||
sycl7d
|
||||
sycl6d
|
||||
sycld
|
||||
|
||||
@@ -43,68 +43,6 @@ function(unset_cached_varables_containting contents msg)
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
# Detect update from 3.1 to 3.2 libs.
|
||||
if(UNIX AND
|
||||
DEFINED OPENEXR_VERSION AND
|
||||
OPENEXR_VERSION VERSION_LESS "3.0.0" AND
|
||||
EXISTS ${LIBDIR}/imath)
|
||||
message(STATUS "Auto updating CMake configuration for Blender 3.2 libraries")
|
||||
|
||||
unset_cache_variables("^OPENIMAGEIO")
|
||||
unset_cache_variables("^OPENEXR")
|
||||
unset_cache_variables("^IMATH")
|
||||
unset_cache_variables("^PNG")
|
||||
unset_cache_variables("^USD")
|
||||
unset_cache_variables("^WEBP")
|
||||
unset_cache_variables("^NANOVDB")
|
||||
endif()
|
||||
|
||||
# Automatically set WebP on/off depending if libraries are available.
|
||||
if(EXISTS ${LIBDIR}/webp)
|
||||
if(WITH_OPENIMAGEIO)
|
||||
set(WITH_IMAGE_WEBP ON CACHE BOOL "" FORCE)
|
||||
endif()
|
||||
else()
|
||||
set(WITH_IMAGE_WEBP OFF)
|
||||
endif()
|
||||
|
||||
# NanoVDB moved into openvdb.
|
||||
if(UNIX AND DEFINED NANOVDB_INCLUDE_DIR)
|
||||
if(NOT EXISTS ${NANOVDB_INCLUDE_DIR} AND
|
||||
EXISTS ${LIBDIR}/openvdb/include/nanovdb)
|
||||
unset_cache_variables("^NANOVDB")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# Detect update to 3.5 libs with shared libraries.
|
||||
if(UNIX AND
|
||||
DEFINED TBB_LIBRARY AND
|
||||
TBB_LIBRARY MATCHES "libtbb.a$" AND
|
||||
EXISTS ${LIBDIR}/usd/include/pxr/base/tf/pyModule.h)
|
||||
message(STATUS "Auto updating CMake configuration for Blender 3.5 libraries")
|
||||
unset_cache_variables("^BLOSC")
|
||||
unset_cache_variables("^BOOST")
|
||||
unset_cache_variables("^Boost")
|
||||
unset_cache_variables("^IMATH")
|
||||
unset_cache_variables("^OPENCOLORIO")
|
||||
unset_cache_variables("^OPENEXR")
|
||||
unset_cache_variables("^OPENIMAGEIO")
|
||||
unset_cache_variables("^OPENSUBDIV")
|
||||
unset_cache_variables("^OPENVDB")
|
||||
unset_cache_variables("^TBB")
|
||||
unset_cache_variables("^USD")
|
||||
endif()
|
||||
|
||||
if(UNIX AND (NOT APPLE) AND LIBDIR AND (EXISTS ${LIBDIR}))
|
||||
# Only search for the path if it's found on the system.
|
||||
set(_libdir_stale "/lib/linux_centos7_x86_64/")
|
||||
unset_cached_varables_containting(
|
||||
"${_libdir_stale}"
|
||||
"Auto clearing old ${_libdir_stale} paths from CMake configuration"
|
||||
)
|
||||
unset(_libdir_stale)
|
||||
endif()
|
||||
|
||||
# Detect update in 4.1 to shared library OpenImageDenoise and OSL.
|
||||
if(UNIX AND
|
||||
DEFINED OPENIMAGEDENOISE_LIBRARY AND
|
||||
@@ -135,3 +73,26 @@ if(UNIX AND
|
||||
message(STATUS "Auto updating CMake configuration for Python 3.11")
|
||||
unset_cache_variables("^PYTHON_")
|
||||
endif()
|
||||
|
||||
# Detect update to 4.4 libs.
|
||||
if(LIBDIR AND
|
||||
EXISTS ${LIBDIR}/tbb/include/oneapi AND
|
||||
((DEFINED Boost_INCLUDE_DIR) OR (SYCL_LIBRARY MATCHES "sycl7")))
|
||||
message(STATUS "Auto updating CMake configuration for Blender 4.4 libraries")
|
||||
unset_cache_variables("^BOOST")
|
||||
unset_cache_variables("^Boost")
|
||||
unset_cache_variables("^EMBREE")
|
||||
unset_cache_variables("^IMATH")
|
||||
unset_cache_variables("^MATERIALX")
|
||||
unset_cache_variables("^NANOVDB")
|
||||
unset_cache_variables("^OPENCOLORIO")
|
||||
unset_cache_variables("^OPENEXR")
|
||||
unset_cache_variables("^OPENIMAGEDENOISE")
|
||||
unset_cache_variables("^OPENIMAGEIO")
|
||||
unset_cache_variables("^OPENVDB")
|
||||
unset_cache_variables("^OSL_")
|
||||
unset_cache_variables("^PYTHON")
|
||||
unset_cache_variables("^SYCL")
|
||||
unset_cache_variables("^TBB")
|
||||
unset_cache_variables("^USD")
|
||||
endif()
|
||||
|
||||
@@ -49,6 +49,7 @@
|
||||
#include "DNA_brush_types.h"
|
||||
#include "DNA_camera_types.h"
|
||||
#include "DNA_defaults.h"
|
||||
#include "DNA_image_types.h"
|
||||
#include "DNA_light_types.h"
|
||||
#include "DNA_material_types.h"
|
||||
#include "DNA_object_types.h"
|
||||
@@ -157,6 +158,16 @@ static void image_runtime_free_data(Image *image)
|
||||
BKE_image_partial_update_register_free(image);
|
||||
}
|
||||
|
||||
static void image_gpu_runtime_reset(Image *ima)
|
||||
{
|
||||
ima->lastused = 0;
|
||||
ima->gpuflag = 0;
|
||||
ima->gpuframenr = IMAGE_GPU_FRAME_NONE;
|
||||
ima->gpu_pass = IMAGE_GPU_PASS_NONE;
|
||||
ima->gpu_layer = IMAGE_GPU_LAYER_NONE;
|
||||
ima->gpu_view = IMAGE_GPU_VIEW_NONE;
|
||||
}
|
||||
|
||||
static void image_init_data(ID *id)
|
||||
{
|
||||
Image *image = (Image *)id;
|
||||
@@ -349,9 +360,8 @@ static void image_blend_write(BlendWriter *writer, ID *id, const void *id_addres
|
||||
|
||||
/* Clear all data that isn't read to reduce false detection of changed image during memfile undo.
|
||||
*/
|
||||
ima->lastused = 0;
|
||||
ima->cache = nullptr;
|
||||
ima->gpuflag = 0;
|
||||
image_gpu_runtime_reset(ima);
|
||||
BLI_listbase_clear(&ima->anims);
|
||||
ima->runtime.partial_update_register = nullptr;
|
||||
ima->runtime.partial_update_user = nullptr;
|
||||
@@ -434,9 +444,7 @@ static void image_blend_read_data(BlendDataReader *reader, ID *id)
|
||||
BKE_previewimg_blend_read(reader, ima->preview);
|
||||
BLO_read_struct(reader, Stereo3dFormat, &ima->stereo3d_format);
|
||||
|
||||
ima->lastused = 0;
|
||||
ima->gpuflag = 0;
|
||||
|
||||
image_gpu_runtime_reset(ima);
|
||||
image_runtime_reset(ima);
|
||||
}
|
||||
|
||||
@@ -5225,7 +5233,9 @@ void BKE_image_user_frame_calc(Image *ima, ImageUser *iuser, int cfra)
|
||||
/* NOTE: a single texture and refresh doesn't really work when
|
||||
* multiple image users may use different frames, this is to
|
||||
* be improved with perhaps a GPU texture cache. */
|
||||
BKE_image_partial_update_mark_full_update(ima);
|
||||
if (ima->gpuframenr != IMAGE_GPU_FRAME_NONE) {
|
||||
BKE_image_partial_update_mark_full_update(ima);
|
||||
}
|
||||
ima->gpuframenr = iuser->framenr;
|
||||
}
|
||||
|
||||
|
||||
@@ -335,7 +335,7 @@ static void image_gpu_texture_try_partial_update(Image *image, ImageUser *iuser)
|
||||
}
|
||||
}
|
||||
|
||||
void BKE_image_ensure_gpu_texture(Image *image, ImageUser *image_user)
|
||||
void BKE_image_ensure_gpu_texture(Image *image, ImageUser *iuser)
|
||||
{
|
||||
if (!image) {
|
||||
return;
|
||||
@@ -343,8 +343,9 @@ void BKE_image_ensure_gpu_texture(Image *image, ImageUser *image_user)
|
||||
|
||||
/* Note that the image can cache both stereo views, so we only invalidate the cache if the view
|
||||
* index is more than 2. */
|
||||
if (image->gpu_pass != image_user->pass || image->gpu_layer != image_user->layer ||
|
||||
(image->gpu_view != image_user->multi_index && image_user->multi_index >= 2))
|
||||
if (!ELEM(image->gpu_pass, IMAGE_GPU_PASS_NONE, iuser->pass) ||
|
||||
!ELEM(image->gpu_layer, IMAGE_GPU_LAYER_NONE, iuser->layer) ||
|
||||
(!ELEM(image->gpu_view, IMAGE_GPU_VIEW_NONE, iuser->multi_index) && iuser->multi_index >= 2))
|
||||
{
|
||||
BKE_image_partial_update_mark_full_update(image);
|
||||
}
|
||||
|
||||
@@ -22,9 +22,10 @@
|
||||
.gen_y = 1024, \
|
||||
.gen_type = IMA_GENTYPE_GRID, \
|
||||
\
|
||||
.gpuframenr = INT_MAX, \
|
||||
.gpu_pass = SHRT_MAX, \
|
||||
.gpu_layer = SHRT_MAX, \
|
||||
.gpuframenr = IMAGE_GPU_FRAME_NONE, \
|
||||
.gpu_pass = IMAGE_GPU_PASS_NONE, \
|
||||
.gpu_layer = IMAGE_GPU_LAYER_NONE, \
|
||||
.gpu_view = IMAGE_GPU_VIEW_NONE, \
|
||||
.seam_margin = 8, \
|
||||
}
|
||||
|
||||
|
||||
@@ -293,3 +293,9 @@ enum {
|
||||
IMA_ALPHA_CHANNEL_PACKED = 2,
|
||||
IMA_ALPHA_IGNORE = 3,
|
||||
};
|
||||
|
||||
/* Image gpu runtime defaults */
|
||||
#define IMAGE_GPU_FRAME_NONE INT_MAX
|
||||
#define IMAGE_GPU_PASS_NONE SHRT_MAX
|
||||
#define IMAGE_GPU_LAYER_NONE SHRT_MAX
|
||||
#define IMAGE_GPU_VIEW_NONE SHRT_MAX
|
||||
|
||||
Reference in New Issue
Block a user