Fix merge inaccuracies with blender-v4.3-release
Some of the files are not accurate to blender-v4.3-release and not due to any goo engine additions Likely due to merges from beyond 4.3 that made it into 4.2 since it is an LTS and gets more support So merging these changes to keep it in line with the release version of 4.3
This commit is contained in:
@@ -108,10 +108,7 @@ ExternalProject_Add(external_dpcpp
|
||||
|
||||
PATCH_COMMAND ${PATCH_CMD} -p 1 -d
|
||||
${BUILD_DIR}/dpcpp/src/external_dpcpp <
|
||||
${PATCH_DIR}/dpcpp.diff &&
|
||||
${PATCH_CMD} -p 1 -d
|
||||
${BUILD_DIR}/dpcpp/src/external_dpcpp <
|
||||
${PATCH_DIR}/dpcpp_13328.diff
|
||||
${PATCH_DIR}/dpcpp.diff
|
||||
|
||||
INSTALL_DIR ${LIBDIR}/dpcpp
|
||||
)
|
||||
|
||||
@@ -96,7 +96,7 @@ set(BOOST_VERSION 1.82.0)
|
||||
set(BOOST_VERSION_SHORT 1.82)
|
||||
set(BOOST_VERSION_NODOTS 1_82_0)
|
||||
set(BOOST_VERSION_NODOTS_SHORT 1_82)
|
||||
set(BOOST_URI https://archives.boost.io/release/${BOOST_VERSION}/source/boost_${BOOST_VERSION_NODOTS}.tar.gz)
|
||||
set(BOOST_URI https://boostorg.jfrog.io/artifactory/main/release/${BOOST_VERSION}/source/boost_${BOOST_VERSION_NODOTS}.tar.gz)
|
||||
set(BOOST_HASH f7050f554a65f6a42ece221eaeec1660)
|
||||
set(BOOST_HASH_TYPE MD5)
|
||||
set(BOOST_FILE boost_${BOOST_VERSION_NODOTS}.tar.gz)
|
||||
|
||||
@@ -15,4 +15,4 @@ set(WITH_DOC_MANPAGE OFF CACHE BOOL "" FORCE)
|
||||
set(WITH_CYCLES_TEST_OSL ON CACHE BOOL "" FORCE)
|
||||
|
||||
set(HIPRT_COMPILER_PARALLEL_JOBS 6 CACHE STRING "" FORCE)
|
||||
set(SYCL_OFFLINE_COMPILER_PARALLEL_JOBS 6 CACHE STRING "" FORCE)
|
||||
set(SYCL_OFFLINE_COMPILER_PARALLEL_JOBS 6 CACHE STRING "" FORCE)
|
||||
@@ -7,4 +7,4 @@ include("${CMAKE_CURRENT_LIST_DIR}/../../cmake/config/blender_release.cmake")
|
||||
set(WITH_CYCLES_TEST_OSL ON CACHE BOOL "" FORCE)
|
||||
|
||||
set(HIPRT_COMPILER_PARALLEL_JOBS 6 CACHE STRING "" FORCE)
|
||||
set(SYCL_OFFLINE_COMPILER_PARALLEL_JOBS 6 CACHE STRING "" FORCE)
|
||||
set(SYCL_OFFLINE_COMPILER_PARALLEL_JOBS 6 CACHE STRING "" FORCE)
|
||||
@@ -569,13 +569,7 @@ macro(TEST_SSE_SUPPORT
|
||||
check_c_source_runs("
|
||||
#include <nmmintrin.h>
|
||||
#include <emmintrin.h>
|
||||
#include <smmintrin.h>
|
||||
int main(void) {
|
||||
__m128i v = _mm_setzero_si128();
|
||||
v = _mm_cmpgt_epi64(v,v);
|
||||
if (_mm_test_all_zeros(v, v)) return 0;
|
||||
return 1;
|
||||
}"
|
||||
int main(void) { __m128i v = _mm_setzero_si128(); v = _mm_cmpgt_epi64(v,v); return 0; }"
|
||||
SUPPORT_SSE42_BUILD)
|
||||
endif()
|
||||
|
||||
|
||||
@@ -360,24 +360,15 @@ endif()
|
||||
# CMake FindOpenMP doesn't know about AppleClang before 3.12, so provide custom flags.
|
||||
if(WITH_OPENMP)
|
||||
if(CMAKE_C_COMPILER_ID MATCHES "Clang")
|
||||
if(${CMAKE_C_COMPILER_VERSION} VERSION_GREATER_EQUAL 17.0)
|
||||
if(WITH_STRICT_BUILD_OPTIONS)
|
||||
message(SEND_ERROR "OpenMP library is not compatible with the current Clang version")
|
||||
else()
|
||||
message(WARNING "OpenMP library is not compatible with the current Clang version, disabling")
|
||||
endif()
|
||||
set(WITH_OPENMP OFF)
|
||||
else()
|
||||
# Use OpenMP from our precompiled libraries.
|
||||
message(STATUS "Using ${LIBDIR}/openmp for OpenMP")
|
||||
set(OPENMP_CUSTOM ON)
|
||||
set(OPENMP_FOUND ON)
|
||||
set(OpenMP_C_FLAGS "-Xclang -fopenmp -I'${LIBDIR}/openmp/include'")
|
||||
set(OpenMP_CXX_FLAGS "-Xclang -fopenmp -I'${LIBDIR}/openmp/include'")
|
||||
set(OpenMP_LIBRARY_DIR "${LIBDIR}/openmp/lib/")
|
||||
set(OpenMP_LINKER_FLAGS "-L'${OpenMP_LIBRARY_DIR}' -lomp")
|
||||
set(OpenMP_LIBRARY "${OpenMP_LIBRARY_DIR}/libomp.dylib")
|
||||
endif()
|
||||
# Use OpenMP from our precompiled libraries.
|
||||
message(STATUS "Using ${LIBDIR}/openmp for OpenMP")
|
||||
set(OPENMP_CUSTOM ON)
|
||||
set(OPENMP_FOUND ON)
|
||||
set(OpenMP_C_FLAGS "-Xclang -fopenmp -I'${LIBDIR}/openmp/include'")
|
||||
set(OpenMP_CXX_FLAGS "-Xclang -fopenmp -I'${LIBDIR}/openmp/include'")
|
||||
set(OpenMP_LIBRARY_DIR "${LIBDIR}/openmp/lib/")
|
||||
set(OpenMP_LINKER_FLAGS "-L'${OpenMP_LIBRARY_DIR}' -lomp")
|
||||
set(OpenMP_LIBRARY "${OpenMP_LIBRARY_DIR}/libomp.dylib")
|
||||
endif()
|
||||
endif()
|
||||
add_bundled_libraries(openmp/lib)
|
||||
|
||||
@@ -170,14 +170,14 @@ function(blender_add_ctests)
|
||||
TEST_PREFIX ${ARGS_SUITE_NAME}
|
||||
WORKING_DIRECTORY "${TEST_INSTALL_DIR}"
|
||||
EXTRA_ARGS
|
||||
--test-assets-dir "${CMAKE_SOURCE_DIR}/tests/files"
|
||||
--test-assets-dir "${CMAKE_SOURCE_DIR}/tests/data"
|
||||
--test-release-dir "${_test_release_dir}"
|
||||
)
|
||||
else()
|
||||
add_test(
|
||||
NAME ${ARGS_SUITE_NAME}
|
||||
COMMAND ${ARGS_TARGET}
|
||||
--test-assets-dir "${CMAKE_SOURCE_DIR}/tests/files"
|
||||
--test-assets-dir "${CMAKE_SOURCE_DIR}/tests/data"
|
||||
--test-release-dir "${_test_release_dir}"
|
||||
WORKING_DIRECTORY ${TEST_INSTALL_DIR}
|
||||
)
|
||||
|
||||
@@ -46,16 +46,6 @@ long_description = """# Blender
|
||||
|
||||
This package provides Blender as a Python module for use in studio pipelines, web services, scientific research, and more.
|
||||
|
||||
### Archived Versions
|
||||
|
||||
Blender versions outside the current LTS window are removed from PyPI but are available at [https://download.blender.org/pypi/bpy/](https://download.blender.org/pypi/bpy/).
|
||||
|
||||
These versions can still be installed manually. For example, to install version 3.6.0:
|
||||
|
||||
```bash
|
||||
pip install bpy==3.6.0 --extra-index-url https://download.blender.org/pypi/
|
||||
```
|
||||
|
||||
## Documentation
|
||||
|
||||
* [Blender Python API](https://docs.blender.org/api/current/)
|
||||
|
||||
@@ -3,26 +3,13 @@
|
||||
#
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
__all__ = (
|
||||
"main",
|
||||
)
|
||||
|
||||
import argparse
|
||||
import make_utils
|
||||
import os
|
||||
import subprocess
|
||||
import sys
|
||||
from pathlib import Path
|
||||
|
||||
from typing import (
|
||||
TextIO,
|
||||
Any,
|
||||
Tuple,
|
||||
Union,
|
||||
# Proxies for `collections.abc`
|
||||
Iterable,
|
||||
List,
|
||||
)
|
||||
from typing import Iterable, TextIO, Optional, Any, Union
|
||||
|
||||
# This script can run from any location,
|
||||
# output is created in the $CWD
|
||||
@@ -30,24 +17,15 @@ from typing import (
|
||||
# NOTE: while the Python part of this script is portable,
|
||||
# it relies on external commands typically found on GNU/Linux.
|
||||
# Support for other platforms could be added by moving GNU `tar` & `md5sum` use to Python.
|
||||
# This also relies on having a Unix shell (sh) to run some git commands.
|
||||
|
||||
SKIP_NAMES: Tuple[str, ...] = (
|
||||
SKIP_NAMES = {
|
||||
".gitignore",
|
||||
".gitmodules",
|
||||
".gitattributes",
|
||||
".git-blame-ignore-revs",
|
||||
".arcconfig",
|
||||
".svn",
|
||||
)
|
||||
|
||||
# Tuple with folder names relative to the main repository root that are to be excluded.
|
||||
SKIP_FOLDERS: Tuple[str, ...] = (
|
||||
)
|
||||
|
||||
# Generated list of Paths to be ignored based on the SKIP_FOLDERS and some rum-time rules like
|
||||
# the type of package that is being created.
|
||||
SKIP_PATHS: List[Path] = []
|
||||
}
|
||||
|
||||
|
||||
def main() -> None:
|
||||
@@ -57,8 +35,7 @@ def main() -> None:
|
||||
description="Create a tarball of the Blender sources, optionally including sources of dependencies.",
|
||||
epilog="This script is intended to be run by `make source_archive_complete`.",
|
||||
)
|
||||
group = cli_parser.add_mutually_exclusive_group()
|
||||
group.add_argument(
|
||||
cli_parser.add_argument(
|
||||
"-p",
|
||||
"--include-packages",
|
||||
type=Path,
|
||||
@@ -66,12 +43,6 @@ def main() -> None:
|
||||
metavar="PACKAGE_PATH",
|
||||
help="Include all source files from the given package directory as well.",
|
||||
)
|
||||
group.add_argument(
|
||||
"-t",
|
||||
"--package-test-data",
|
||||
action='store_true',
|
||||
help="Package all test data into its own archive",
|
||||
)
|
||||
|
||||
cli_args = cli_parser.parse_args()
|
||||
|
||||
@@ -81,10 +52,6 @@ def main() -> None:
|
||||
os.chdir(curdir)
|
||||
blender_srcdir = blender_srcdir.relative_to(curdir)
|
||||
|
||||
# Update our SKIP_FOLDERS blacklist with the source directory name
|
||||
global SKIP_PATHS
|
||||
SKIP_PATHS = [blender_srcdir / entry for entry in SKIP_FOLDERS]
|
||||
|
||||
print(f"Output dir: {curdir}")
|
||||
|
||||
version = make_utils.parse_blender_version()
|
||||
@@ -92,13 +59,7 @@ def main() -> None:
|
||||
manifest = manifest_path(tarball)
|
||||
packages_dir = packages_path(curdir, cli_args)
|
||||
|
||||
if cli_args.package_test_data:
|
||||
print("Creating an archive of all test data.")
|
||||
create_manifest(version, manifest, blender_srcdir / "tests/files", packages_dir)
|
||||
else:
|
||||
SKIP_PATHS.append(blender_srcdir / "tests/files")
|
||||
create_manifest(version, manifest, blender_srcdir, packages_dir)
|
||||
|
||||
create_manifest(version, manifest, blender_srcdir, packages_dir)
|
||||
create_tarball(version, tarball, manifest, blender_srcdir, packages_dir)
|
||||
create_checksum_file(tarball)
|
||||
cleanup(manifest)
|
||||
@@ -109,8 +70,6 @@ def tarball_path(output_dir: Path, version: make_utils.BlenderVersion, cli_args:
|
||||
extra = ""
|
||||
if cli_args.include_packages:
|
||||
extra = "-with-libraries"
|
||||
elif cli_args.package_test_data:
|
||||
extra = "-test-data"
|
||||
|
||||
return output_dir / f"blender{extra}-{version}.tar.xz"
|
||||
|
||||
@@ -119,24 +78,24 @@ def manifest_path(tarball: Path) -> Path:
|
||||
"""Return the manifest path for the given tarball path.
|
||||
|
||||
>>> from pathlib import Path
|
||||
>>> tarball = Path("/home/user/workspace/blender-git/blender-test.tar.gz")
|
||||
>>> tarball = Path("/home/sybren/workspace/blender-git/blender-test.tar.gz")
|
||||
>>> manifest_path(tarball).as_posix()
|
||||
'/home/user/workspace/blender-git/blender-test-manifest.txt'
|
||||
'/home/sybren/workspace/blender-git/blender-test-manifest.txt'
|
||||
"""
|
||||
# Note that `.tar.gz` is seen as two suffixes.
|
||||
# ".tar.gz" is seen as two suffixes.
|
||||
without_suffix = tarball.with_suffix("").with_suffix("")
|
||||
name = without_suffix.name
|
||||
return without_suffix.with_name(f"{name}-manifest.txt")
|
||||
|
||||
|
||||
def packages_path(current_directory: Path, cli_args: Any) -> Union[Path, None]:
|
||||
def packages_path(current_directory: Path, cli_args: Any) -> Optional[Path]:
|
||||
if not cli_args.include_packages:
|
||||
return None
|
||||
|
||||
abspath = cli_args.include_packages.absolute()
|
||||
|
||||
# `os.path.relpath()` can return paths like "../../packages", where
|
||||
# `Path.relative_to()` will not go up directories (so its return value never
|
||||
# os.path.relpath() can return paths like "../../packages", where
|
||||
# Path.relative_to() will not go up directories (so its return value never
|
||||
# has "../" in there).
|
||||
relpath = os.path.relpath(abspath, current_directory)
|
||||
|
||||
@@ -150,12 +109,12 @@ def create_manifest(
|
||||
version: make_utils.BlenderVersion,
|
||||
outpath: Path,
|
||||
blender_srcdir: Path,
|
||||
packages_dir: Union[Path, None],
|
||||
exclude: List[Path] = []
|
||||
packages_dir: Optional[Path],
|
||||
) -> None:
|
||||
print(f'Building manifest of files: "{outpath}"...', end="", flush=True)
|
||||
with outpath.open("w", encoding="utf-8") as outfile:
|
||||
main_files_to_manifest(blender_srcdir, outfile)
|
||||
assets_to_manifest(blender_srcdir, outfile)
|
||||
|
||||
if packages_dir:
|
||||
packages_to_manifest(outfile, packages_dir)
|
||||
@@ -164,9 +123,20 @@ def create_manifest(
|
||||
|
||||
def main_files_to_manifest(blender_srcdir: Path, outfile: TextIO) -> None:
|
||||
assert not blender_srcdir.is_absolute()
|
||||
for git_repo in git_gather_all_folders_to_package(blender_srcdir):
|
||||
for path in git_ls_files(git_repo):
|
||||
print(path, file=outfile)
|
||||
for path in git_ls_files(blender_srcdir):
|
||||
print(path, file=outfile)
|
||||
|
||||
|
||||
def assets_to_manifest(blender_srcdir: Path, outfile: TextIO) -> None:
|
||||
assert not blender_srcdir.is_absolute()
|
||||
|
||||
assets_dir = blender_srcdir.parent / "lib" / "assets"
|
||||
for path in assets_dir.glob("*"):
|
||||
if path.name == "working":
|
||||
continue
|
||||
if path.name in SKIP_NAMES:
|
||||
continue
|
||||
print(path, file=outfile)
|
||||
|
||||
|
||||
def packages_to_manifest(outfile: TextIO, packages_dir: Path) -> None:
|
||||
@@ -187,7 +157,7 @@ def create_tarball(
|
||||
tarball: Path,
|
||||
manifest: Path,
|
||||
blender_srcdir: Path,
|
||||
packages_dir: Union[Path, None],
|
||||
packages_dir: Optional[Path],
|
||||
) -> None:
|
||||
print(f'Creating archive: "{tarball}" ...', end="", flush=True)
|
||||
|
||||
@@ -204,6 +174,8 @@ def create_tarball(
|
||||
command += [
|
||||
"--transform",
|
||||
f"s,^{blender_srcdir.name}/,blender-{version}/,g",
|
||||
"--transform",
|
||||
f"s,^lib/assets/,blender-{version}/release/datafiles/assets/,g",
|
||||
"--use-compress-program=xz -1",
|
||||
"--create",
|
||||
f"--file={tarball}",
|
||||
@@ -246,63 +218,28 @@ def cleanup(manifest: Path) -> None:
|
||||
# Low-level commands
|
||||
|
||||
|
||||
def git_gather_all_folders_to_package(directory: Path = Path(".")) -> Iterable[Path]:
|
||||
"""Generator, yields lines which represents each directory to gather git files from.
|
||||
|
||||
Each directory represents either the top level git repository or a submodule.
|
||||
All submodules that have the 'update = none' setting will be excluded from this list.
|
||||
|
||||
The directory path given to this function will be included in the yielded paths
|
||||
"""
|
||||
|
||||
# For each submodule (recurse into submodules within submodules if they exist)
|
||||
git_main_command = "submodule --quiet foreach --recursive"
|
||||
# Return the path to the submodule and what the value is of their "update" setting
|
||||
# If the "update" setting doesn't exist, only the path to the submodule is returned
|
||||
git_command_args = "'echo $displaypath $(git config --file \"$toplevel/.gitmodules\" --get submodule.$name.update)'"
|
||||
|
||||
# Yield the root directory as this is our top level git repo
|
||||
yield directory
|
||||
|
||||
for line in git_command(f"-C '{directory}' {git_main_command} {git_command_args}"):
|
||||
# Check if we shouldn't include the directory on this line
|
||||
split_line = line.rsplit(maxsplit=1)
|
||||
if len(split_line) > 1 and split_line[-1] == "none":
|
||||
continue
|
||||
path = directory / split_line[0]
|
||||
yield path
|
||||
|
||||
|
||||
def is_path_ignored(file: Path) -> bool:
|
||||
for skip_folder in SKIP_PATHS:
|
||||
if file.is_relative_to(skip_folder):
|
||||
return True
|
||||
return False
|
||||
|
||||
|
||||
def git_ls_files(directory: Path = Path(".")) -> Iterable[Path]:
|
||||
"""Generator, yields lines of output from 'git ls-files'.
|
||||
|
||||
Only lines that are actually files (so no directories, sockets, etc.) are
|
||||
returned, and never one from SKIP_NAMES.
|
||||
"""
|
||||
for line in git_command(f"-C '{directory}' ls-files"):
|
||||
for line in git_command("-C", str(directory), "ls-files"):
|
||||
path = directory / line
|
||||
if not path.is_file() or path.name in SKIP_NAMES:
|
||||
continue
|
||||
if not is_path_ignored(path):
|
||||
yield path
|
||||
yield path
|
||||
|
||||
|
||||
def git_command(cli_args: str) -> Iterable[str]:
|
||||
def git_command(*cli_args: Union[bytes, str, Path]) -> Iterable[str]:
|
||||
"""Generator, yields lines of output from a Git command."""
|
||||
command = "git " + cli_args
|
||||
command = ("git", *cli_args)
|
||||
|
||||
# import shlex
|
||||
# print(">", " ".join(shlex.quote(arg) for arg in command))
|
||||
|
||||
git = subprocess.run(
|
||||
command, stdout=subprocess.PIPE, shell=True, check=True, text=True, timeout=30
|
||||
command, stdout=subprocess.PIPE, check=True, text=True, timeout=30
|
||||
)
|
||||
for line in git.stdout.split("\n"):
|
||||
if line:
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
"""
|
||||
"make update" for all platforms, updating Git LFS submodules for libraries and
|
||||
Blender git repository.
|
||||
tests, and Blender git repository.
|
||||
|
||||
For release branches, this will check out the appropriate branches of
|
||||
submodules and libraries.
|
||||
@@ -48,7 +48,7 @@ def parse_arguments() -> argparse.Namespace:
|
||||
parser.add_argument("--no-libraries", action="store_true")
|
||||
parser.add_argument("--no-blender", action="store_true")
|
||||
parser.add_argument("--no-submodules", action="store_true")
|
||||
parser.add_argument("--no-lfs-fallback", action="store_true")
|
||||
parser.add_argument("--use-tests", action="store_true")
|
||||
parser.add_argument("--git-command", default="git")
|
||||
parser.add_argument("--use-linux-libraries", action="store_true")
|
||||
parser.add_argument("--architecture", type=str,
|
||||
@@ -203,6 +203,21 @@ def initialize_precompiled_libraries(args: argparse.Namespace) -> str:
|
||||
return ""
|
||||
|
||||
|
||||
def initialize_tests_data_files(args: argparse.Namespace) -> str:
|
||||
"""
|
||||
Configure submodule with files used by regression tests
|
||||
"""
|
||||
|
||||
print_stage("Configuring Tests Data Files")
|
||||
|
||||
submodule_dir = "tests/data"
|
||||
|
||||
print(f"* Enabling tests data at {submodule_dir}")
|
||||
make_utils.git_enable_submodule(args.git_command, Path(submodule_dir))
|
||||
|
||||
return ""
|
||||
|
||||
|
||||
def git_update_skip(args: argparse.Namespace, check_remote_exists: bool = True) -> str:
|
||||
"""Test if git repo can be updated."""
|
||||
|
||||
@@ -502,6 +517,21 @@ def floating_checkout_update(
|
||||
return skip_msg
|
||||
|
||||
|
||||
def external_scripts_update(
|
||||
args: argparse.Namespace,
|
||||
repo_name: str,
|
||||
directory_name: str,
|
||||
branch: Optional[str],
|
||||
) -> str:
|
||||
return floating_checkout_update(
|
||||
args,
|
||||
repo_name,
|
||||
Path("scripts") / directory_name,
|
||||
branch,
|
||||
old_submodules_dir=Path("release") / "scripts" / directory_name,
|
||||
)
|
||||
|
||||
|
||||
def floating_libraries_update(args: argparse.Namespace, branch: Optional[str]) -> str:
|
||||
"""Update libraries checkouts which are floating (not attached as Git submodules)"""
|
||||
msg = ""
|
||||
@@ -577,34 +607,8 @@ def submodules_lib_update(args: argparse.Namespace, branch: Optional[str]) -> st
|
||||
return msg
|
||||
|
||||
|
||||
def lfs_fallback_setup(args: argparse.Namespace) -> None:
|
||||
"""
|
||||
Set up an additional projects.blender.org remote, for LFS fetching fallback
|
||||
in case the fork does not include LFS files.
|
||||
"""
|
||||
remotes = make_utils.git_get_remotes(args.git_command)
|
||||
add_fallback_remote = True
|
||||
fallback_remote = "lfs-fallback"
|
||||
|
||||
for remote in remotes:
|
||||
url = make_utils.git_get_remote_url(args.git_command, remote)
|
||||
if "projects.blender.org" not in url:
|
||||
make_utils.git_set_config(args.git_command, f"lfs.{remote}.searchall", "true")
|
||||
else:
|
||||
add_fallback_remote = False
|
||||
|
||||
if add_fallback_remote and not make_utils.git_remote_exist(args.git_command, fallback_remote):
|
||||
print_stage("Adding Git LFS fallback remote")
|
||||
print("Used to fetch files from projects.blender.org if missing.")
|
||||
|
||||
url = "https://projects.blender.org/blender/blender.git"
|
||||
push_url = "no_push"
|
||||
make_utils.git_add_remote(args.git_command, fallback_remote, url, push_url)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
args = parse_arguments()
|
||||
|
||||
blender_skip_msg = ""
|
||||
libraries_skip_msg = ""
|
||||
submodules_skip_msg = ""
|
||||
@@ -632,6 +636,8 @@ if __name__ == "__main__":
|
||||
|
||||
if not args.no_libraries:
|
||||
libraries_skip_msg += initialize_precompiled_libraries(args)
|
||||
if args.use_tests:
|
||||
libraries_skip_msg += initialize_tests_data_files(args)
|
||||
libraries_skip_msg += submodules_lib_update(args, branch)
|
||||
|
||||
# Report any skipped repositories at the end, so it's not as easy to miss.
|
||||
@@ -640,10 +646,6 @@ if __name__ == "__main__":
|
||||
print_stage("Update finished with the following messages")
|
||||
print(skip_msg.strip())
|
||||
|
||||
if args.use_tests:
|
||||
print()
|
||||
print('NOTE: --use-tests is a deprecated command line argument, kept for compatibility purposes.')
|
||||
|
||||
# For failed submodule update we throw an error, since not having correct
|
||||
# submodules can make Blender throw errors.
|
||||
# For Blender itself we don't and consider "make update" to be a command
|
||||
|
||||
@@ -116,20 +116,6 @@ def git_is_remote_repository(git_command: str, repo: str) -> bool:
|
||||
return exit_code == 0
|
||||
|
||||
|
||||
def git_get_remotes(git_command: str) -> Sequence[str]:
|
||||
"""Get a list of git remotes"""
|
||||
# Additional check if the remote exists, for safety in case the output of this command
|
||||
# changes in the future.
|
||||
remotes = check_output([git_command, "remote"]).split()
|
||||
return [remote for remote in remotes if git_remote_exist(git_command, remote)]
|
||||
|
||||
|
||||
def git_add_remote(git_command: str, name: str, url: str, push_url: str) -> None:
|
||||
"""Add a git remote"""
|
||||
call((git_command, "remote", "add", name, url), silent=True)
|
||||
call((git_command, "remote", "set-url", "--push", name, push_url), silent=True)
|
||||
|
||||
|
||||
def git_branch(git_command: str) -> str:
|
||||
"""Get current branch name."""
|
||||
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 5.6 KiB After Width: | Height: | Size: 129 B |
Vendored
+1
-1
@@ -14,7 +14,7 @@
|
||||
# limitations under the License.
|
||||
################################################################################
|
||||
|
||||
cmake_minimum_required(VERSION 3.10)
|
||||
cmake_minimum_required(VERSION 3.5)
|
||||
include(CMakeDependentOption)
|
||||
|
||||
if(POLICY CMP0054)
|
||||
|
||||
Vendored
-8
@@ -14,8 +14,6 @@ set(INC_SYS
|
||||
set(SRC
|
||||
src/hipew.c
|
||||
include/hipew.h
|
||||
include/hipew5.h
|
||||
include/hipew6.h
|
||||
)
|
||||
|
||||
set(LIB
|
||||
@@ -35,9 +33,3 @@ if(HIPRT_INCLUDE_DIR)
|
||||
endif()
|
||||
|
||||
blender_add_lib(extern_hipew "${SRC}" "${INC}" "${INC_SYS}" "${LIB}")
|
||||
|
||||
find_package(HIP 5.5.0)
|
||||
|
||||
if(HIP_VERSION_MAJOR EQUAL 5)
|
||||
target_compile_definitions(extern_hipew PUBLIC WITH_HIP_SDK_5)
|
||||
endif()
|
||||
|
||||
Vendored
+331
-66
@@ -116,6 +116,13 @@ typedef struct HIPuuid_st {
|
||||
char bytes[16];
|
||||
} HIPuuid;
|
||||
|
||||
typedef enum hipMemcpyKind {
|
||||
hipMemcpyHostToHost = 0,
|
||||
hipMemcpyHostToDevice = 1,
|
||||
hipMemcpyDeviceToHost = 2,
|
||||
hipMemcpyDeviceToDevice = 3,
|
||||
hipMemcpyDefault = 4
|
||||
} hipMemcpyKind;
|
||||
|
||||
typedef enum hipChannelFormatKind {
|
||||
hipChannelFormatKindSigned = 0,
|
||||
@@ -198,6 +205,18 @@ typedef enum hipMemoryType {
|
||||
|
||||
hipMemoryType get_hip_memory_type(hipMemoryType mem_type, int runtime_version);
|
||||
|
||||
/**
|
||||
* Pointer attributes
|
||||
*/
|
||||
typedef struct hipPointerAttribute_t {
|
||||
enum hipMemoryType memoryType;
|
||||
int device;
|
||||
void* devicePointer;
|
||||
void* hostPointer;
|
||||
int isManaged;
|
||||
unsigned allocationFlags; /* flags specified when memory was allocated*/
|
||||
/* peers? */
|
||||
} hipPointerAttribute_t;
|
||||
|
||||
typedef struct ihipIpcEventHandle_t {
|
||||
char reserved[HIP_IPC_HANDLE_SIZE];
|
||||
@@ -295,6 +314,128 @@ typedef enum HIPoccupancy_flags_enum {
|
||||
HIP_OCCUPANCY_DISABLE_CACHING_OVERRIDE = 0x1,
|
||||
} HIPoccupancy_flags;
|
||||
|
||||
typedef enum hipDeviceAttribute_t {
|
||||
hipDeviceAttributeCudaCompatibleBegin = 0,
|
||||
hipDeviceAttributeEccEnabled = hipDeviceAttributeCudaCompatibleBegin, ///< Whether ECC support is enabled.
|
||||
hipDeviceAttributeAccessPolicyMaxWindowSize, ///< Cuda only. The maximum size of the window policy in bytes.
|
||||
hipDeviceAttributeAsyncEngineCount, ///< Cuda only. Asynchronous engines number.
|
||||
hipDeviceAttributeCanMapHostMemory, ///< Whether host memory can be mapped into device address space
|
||||
hipDeviceAttributeCanUseHostPointerForRegisteredMem,///< Cuda only. Device can access host registered memory
|
||||
///< at the same virtual address as the CPU
|
||||
hipDeviceAttributeClockRate, ///< Peak clock frequency in kilohertz.
|
||||
hipDeviceAttributeComputeMode, ///< Compute mode that device is currently in.
|
||||
hipDeviceAttributeComputePreemptionSupported, ///< Cuda only. Device supports Compute Preemption.
|
||||
hipDeviceAttributeConcurrentKernels, ///< Device can possibly execute multiple kernels concurrently.
|
||||
hipDeviceAttributeConcurrentManagedAccess, ///< Device can coherently access managed memory concurrently with the CPU
|
||||
hipDeviceAttributeCooperativeLaunch, ///< Support cooperative launch
|
||||
hipDeviceAttributeCooperativeMultiDeviceLaunch, ///< Support cooperative launch on multiple devices
|
||||
hipDeviceAttributeDeviceOverlap, ///< Cuda only. Device can concurrently copy memory and execute a kernel.
|
||||
///< Deprecated. Use instead asyncEngineCount.
|
||||
hipDeviceAttributeDirectManagedMemAccessFromHost, ///< Host can directly access managed memory on
|
||||
///< the device without migration
|
||||
hipDeviceAttributeGlobalL1CacheSupported, ///< Cuda only. Device supports caching globals in L1
|
||||
hipDeviceAttributeHostNativeAtomicSupported, ///< Cuda only. Link between the device and the host supports native atomic operations
|
||||
hipDeviceAttributeIntegrated, ///< Device is integrated GPU
|
||||
hipDeviceAttributeIsMultiGpuBoard, ///< Multiple GPU devices.
|
||||
hipDeviceAttributeKernelExecTimeout, ///< Run time limit for kernels executed on the device
|
||||
hipDeviceAttributeL2CacheSize, ///< Size of L2 cache in bytes. 0 if the device doesn't have L2 cache.
|
||||
hipDeviceAttributeLocalL1CacheSupported, ///< caching locals in L1 is supported
|
||||
hipDeviceAttributeLuid, ///< Cuda only. 8-byte locally unique identifier in 8 bytes. Undefined on TCC and non-Windows platforms
|
||||
hipDeviceAttributeLuidDeviceNodeMask, ///< Cuda only. Luid device node mask. Undefined on TCC and non-Windows platforms
|
||||
hipDeviceAttributeComputeCapabilityMajor, ///< Major compute capability version number.
|
||||
hipDeviceAttributeManagedMemory, ///< Device supports allocating managed memory on this system
|
||||
hipDeviceAttributeMaxBlocksPerMultiProcessor, ///< Cuda only. Max block size per multiprocessor
|
||||
hipDeviceAttributeMaxBlockDimX, ///< Max block size in width.
|
||||
hipDeviceAttributeMaxBlockDimY, ///< Max block size in height.
|
||||
hipDeviceAttributeMaxBlockDimZ, ///< Max block size in depth.
|
||||
hipDeviceAttributeMaxGridDimX, ///< Max grid size in width.
|
||||
hipDeviceAttributeMaxGridDimY, ///< Max grid size in height.
|
||||
hipDeviceAttributeMaxGridDimZ, ///< Max grid size in depth.
|
||||
hipDeviceAttributeMaxSurface1D, ///< Maximum size of 1D surface.
|
||||
hipDeviceAttributeMaxSurface1DLayered, ///< Cuda only. Maximum dimensions of 1D layered surface.
|
||||
hipDeviceAttributeMaxSurface2D, ///< Maximum dimension (width, height) of 2D surface.
|
||||
hipDeviceAttributeMaxSurface2DLayered, ///< Cuda only. Maximum dimensions of 2D layered surface.
|
||||
hipDeviceAttributeMaxSurface3D, ///< Maximum dimension (width, height, depth) of 3D surface.
|
||||
hipDeviceAttributeMaxSurfaceCubemap, ///< Cuda only. Maximum dimensions of Cubemap surface.
|
||||
hipDeviceAttributeMaxSurfaceCubemapLayered, ///< Cuda only. Maximum dimension of Cubemap layered surface.
|
||||
hipDeviceAttributeMaxTexture1DWidth, ///< Maximum size of 1D texture.
|
||||
hipDeviceAttributeMaxTexture1DLayered, ///< Cuda only. Maximum dimensions of 1D layered texture.
|
||||
hipDeviceAttributeMaxTexture1DLinear, ///< Maximum number of elements allocatable in a 1D linear texture.
|
||||
///< Use cudaDeviceGetTexture1DLinearMaxWidth() instead on Cuda.
|
||||
hipDeviceAttributeMaxTexture1DMipmap, ///< Cuda only. Maximum size of 1D mipmapped texture.
|
||||
hipDeviceAttributeMaxTexture2DWidth, ///< Maximum dimension width of 2D texture.
|
||||
hipDeviceAttributeMaxTexture2DHeight, ///< Maximum dimension hight of 2D texture.
|
||||
hipDeviceAttributeMaxTexture2DGather, ///< Cuda only. Maximum dimensions of 2D texture if gather operations performed.
|
||||
hipDeviceAttributeMaxTexture2DLayered, ///< Cuda only. Maximum dimensions of 2D layered texture.
|
||||
hipDeviceAttributeMaxTexture2DLinear, ///< Cuda only. Maximum dimensions (width, height, pitch) of 2D textures bound to pitched memory.
|
||||
hipDeviceAttributeMaxTexture2DMipmap, ///< Cuda only. Maximum dimensions of 2D mipmapped texture.
|
||||
hipDeviceAttributeMaxTexture3DWidth, ///< Maximum dimension width of 3D texture.
|
||||
hipDeviceAttributeMaxTexture3DHeight, ///< Maximum dimension height of 3D texture.
|
||||
hipDeviceAttributeMaxTexture3DDepth, ///< Maximum dimension depth of 3D texture.
|
||||
hipDeviceAttributeMaxTexture3DAlt, ///< Cuda only. Maximum dimensions of alternate 3D texture.
|
||||
hipDeviceAttributeMaxTextureCubemap, ///< Cuda only. Maximum dimensions of Cubemap texture
|
||||
hipDeviceAttributeMaxTextureCubemapLayered, ///< Cuda only. Maximum dimensions of Cubemap layered texture.
|
||||
hipDeviceAttributeMaxThreadsDim, ///< Maximum dimension of a block
|
||||
hipDeviceAttributeMaxThreadsPerBlock, ///< Maximum number of threads per block.
|
||||
hipDeviceAttributeMaxThreadsPerMultiProcessor, ///< Maximum resident threads per multiprocessor.
|
||||
hipDeviceAttributeMaxPitch, ///< Maximum pitch in bytes allowed by memory copies
|
||||
hipDeviceAttributeMemoryBusWidth, ///< Global memory bus width in bits.
|
||||
hipDeviceAttributeMemoryClockRate, ///< Peak memory clock frequency in kilohertz.
|
||||
hipDeviceAttributeComputeCapabilityMinor, ///< Minor compute capability version number.
|
||||
hipDeviceAttributeMultiGpuBoardGroupID, ///< Cuda only. Unique ID of device group on the same multi-GPU board
|
||||
hipDeviceAttributeMultiprocessorCount, ///< Number of multiprocessors on the device.
|
||||
hipDeviceAttributeName, ///< Device name.
|
||||
hipDeviceAttributePageableMemoryAccess, ///< Device supports coherently accessing pageable memory
|
||||
///< without calling hipHostRegister on it
|
||||
hipDeviceAttributePageableMemoryAccessUsesHostPageTables, ///< Device accesses pageable memory via the host's page tables
|
||||
hipDeviceAttributePciBusId, ///< PCI Bus ID.
|
||||
hipDeviceAttributePciDeviceId, ///< PCI Device ID.
|
||||
hipDeviceAttributePciDomainID, ///< PCI Domain ID.
|
||||
hipDeviceAttributePersistingL2CacheMaxSize, ///< Cuda11 only. Maximum l2 persisting lines capacity in bytes
|
||||
hipDeviceAttributeMaxRegistersPerBlock, ///< 32-bit registers available to a thread block. This number is shared
|
||||
///< by all thread blocks simultaneously resident on a multiprocessor.
|
||||
hipDeviceAttributeMaxRegistersPerMultiprocessor, ///< 32-bit registers available per block.
|
||||
hipDeviceAttributeReservedSharedMemPerBlock, ///< Cuda11 only. Shared memory reserved by CUDA driver per block.
|
||||
hipDeviceAttributeMaxSharedMemoryPerBlock, ///< Maximum shared memory available per block in bytes.
|
||||
hipDeviceAttributeSharedMemPerBlockOptin, ///< Cuda only. Maximum shared memory per block usable by special opt in.
|
||||
hipDeviceAttributeSharedMemPerMultiprocessor, ///< Cuda only. Shared memory available per multiprocessor.
|
||||
hipDeviceAttributeSingleToDoublePrecisionPerfRatio, ///< Cuda only. Performance ratio of single precision to double precision.
|
||||
hipDeviceAttributeStreamPrioritiesSupported, ///< Cuda only. Whether to support stream priorities.
|
||||
hipDeviceAttributeSurfaceAlignment, ///< Cuda only. Alignment requirement for surfaces
|
||||
hipDeviceAttributeTccDriver, ///< Cuda only. Whether device is a Tesla device using TCC driver
|
||||
hipDeviceAttributeTextureAlignment, ///< Alignment requirement for textures
|
||||
hipDeviceAttributeTexturePitchAlignment, ///< Pitch alignment requirement for 2D texture references bound to pitched memory;
|
||||
hipDeviceAttributeTotalConstantMemory, ///< Constant memory size in bytes.
|
||||
hipDeviceAttributeTotalGlobalMem, ///< Global memory available on devicice.
|
||||
hipDeviceAttributeUnifiedAddressing, ///< Cuda only. An unified address space shared with the host.
|
||||
hipDeviceAttributeUuid, ///< Cuda only. Unique ID in 16 byte.
|
||||
hipDeviceAttributeWarpSize, ///< Warp size in threads.
|
||||
hipDeviceAttributeCudaCompatibleEnd = 9999,
|
||||
hipDeviceAttributeAmdSpecificBegin = 10000,
|
||||
hipDeviceAttributeClockInstructionRate = hipDeviceAttributeAmdSpecificBegin, ///< Frequency in khz of the timer used by the device-side "clock*"
|
||||
hipDeviceAttributeArch, ///< Device architecture
|
||||
hipDeviceAttributeMaxSharedMemoryPerMultiprocessor, ///< Maximum Shared Memory PerMultiprocessor.
|
||||
hipDeviceAttributeGcnArch, ///< Device gcn architecture
|
||||
hipDeviceAttributeGcnArchName, ///< Device gcnArch name in 256 bytes
|
||||
hipDeviceAttributeHdpMemFlushCntl, ///< Address of the HDP_MEM_COHERENCY_FLUSH_CNTL register
|
||||
hipDeviceAttributeHdpRegFlushCntl, ///< Address of the HDP_REG_COHERENCY_FLUSH_CNTL register
|
||||
hipDeviceAttributeCooperativeMultiDeviceUnmatchedFunc, ///< Supports cooperative launch on multiple
|
||||
///< devices with unmatched functions
|
||||
hipDeviceAttributeCooperativeMultiDeviceUnmatchedGridDim, ///< Supports cooperative launch on multiple
|
||||
///< devices with unmatched grid dimensions
|
||||
hipDeviceAttributeCooperativeMultiDeviceUnmatchedBlockDim, ///< Supports cooperative launch on multiple
|
||||
///< devices with unmatched block dimensions
|
||||
hipDeviceAttributeCooperativeMultiDeviceUnmatchedSharedMem, ///< Supports cooperative launch on multiple
|
||||
///< devices with unmatched shared memories
|
||||
hipDeviceAttributeIsLargeBar, ///< Whether it is LargeBar
|
||||
hipDeviceAttributeAsicRevision, ///< Revision of the GPU in this device
|
||||
hipDeviceAttributeCanUseStreamWaitValue, ///< '1' if Device supports hipStreamWaitValue32() and
|
||||
///< hipStreamWaitValue64() , '0' otherwise.
|
||||
hipDeviceAttributeAmdSpecificEnd = 19999,
|
||||
hipDeviceAttributeVendorSpecificBegin = 20000,
|
||||
hipDeviceAttribute
|
||||
// Extended attributes for vendors
|
||||
} hipDeviceAttribute_t;
|
||||
|
||||
typedef struct HIPdevprop_st {
|
||||
int maxThreadsPerBlock;
|
||||
@@ -340,6 +481,84 @@ typedef struct {
|
||||
unsigned hasDynamicParallelism : 1; ///< Dynamic parallelism.
|
||||
} hipDeviceArch_t;
|
||||
|
||||
typedef struct hipDeviceProp_t {
|
||||
char name[256]; ///< Device name.
|
||||
size_t totalGlobalMem; ///< Size of global memory region (in bytes).
|
||||
size_t sharedMemPerBlock; ///< Size of shared memory region (in bytes).
|
||||
int regsPerBlock; ///< Registers per block.
|
||||
int warpSize; ///< Warp size.
|
||||
int maxThreadsPerBlock; ///< Max work items per work group or workgroup max size.
|
||||
int maxThreadsDim[3]; ///< Max number of threads in each dimension (XYZ) of a block.
|
||||
int maxGridSize[3]; ///< Max grid dimensions (XYZ).
|
||||
int clockRate; ///< Max clock frequency of the multiProcessors in khz.
|
||||
int memoryClockRate; ///< Max global memory clock frequency in khz.
|
||||
int memoryBusWidth; ///< Global memory bus width in bits.
|
||||
size_t totalConstMem; ///< Size of shared memory region (in bytes).
|
||||
int major; ///< Major compute capability. On HCC, this is an approximation and features may
|
||||
///< differ from CUDA CC. See the arch feature flags for portable ways to query
|
||||
///< feature caps.
|
||||
int minor; ///< Minor compute capability. On HCC, this is an approximation and features may
|
||||
///< differ from CUDA CC. See the arch feature flags for portable ways to query
|
||||
///< feature caps.
|
||||
int multiProcessorCount; ///< Number of multi-processors (compute units).
|
||||
int l2CacheSize; ///< L2 cache size.
|
||||
int maxThreadsPerMultiProcessor; ///< Maximum resident threads per multi-processor.
|
||||
int computeMode; ///< Compute mode.
|
||||
int clockInstructionRate; ///< Frequency in khz of the timer used by the device-side "clock*"
|
||||
///< instructions. New for HIP.
|
||||
hipDeviceArch_t arch; ///< Architectural feature flags. New for HIP.
|
||||
int concurrentKernels; ///< Device can possibly execute multiple kernels concurrently.
|
||||
int pciDomainID; ///< PCI Domain ID
|
||||
int pciBusID; ///< PCI Bus ID.
|
||||
int pciDeviceID; ///< PCI Device ID.
|
||||
size_t maxSharedMemoryPerMultiProcessor; ///< Maximum Shared Memory Per Multiprocessor.
|
||||
int isMultiGpuBoard; ///< 1 if device is on a multi-GPU board, 0 if not.
|
||||
int canMapHostMemory; ///< Check whether HIP can map host memory
|
||||
int gcnArch; ///< DEPRECATED: use gcnArchName instead
|
||||
char gcnArchName[256]; ///< AMD GCN Arch Name.
|
||||
int integrated; ///< APU vs dGPU
|
||||
int cooperativeLaunch; ///< HIP device supports cooperative launch
|
||||
int cooperativeMultiDeviceLaunch; ///< HIP device supports cooperative launch on multiple devices
|
||||
int maxTexture1DLinear; ///< Maximum size for 1D textures bound to linear memory
|
||||
int maxTexture1D; ///< Maximum number of elements in 1D images
|
||||
int maxTexture2D[2]; ///< Maximum dimensions (width, height) of 2D images, in image elements
|
||||
int maxTexture3D[3]; ///< Maximum dimensions (width, height, depth) of 3D images, in image elements
|
||||
unsigned int* hdpMemFlushCntl; ///< Addres of HDP_MEM_COHERENCY_FLUSH_CNTL register
|
||||
unsigned int* hdpRegFlushCntl; ///< Addres of HDP_REG_COHERENCY_FLUSH_CNTL register
|
||||
size_t memPitch; ///<Maximum pitch in bytes allowed by memory copies
|
||||
size_t textureAlignment; ///<Alignment requirement for textures
|
||||
size_t texturePitchAlignment; ///<Pitch alignment requirement for texture references bound to pitched memory
|
||||
int kernelExecTimeoutEnabled; ///<Run time limit for kernels executed on the device
|
||||
int ECCEnabled; ///<Device has ECC support enabled
|
||||
int tccDriver; ///< 1:If device is Tesla device using TCC driver, else 0
|
||||
int cooperativeMultiDeviceUnmatchedFunc; ///< HIP device supports cooperative launch on multiple
|
||||
///devices with unmatched functions
|
||||
int cooperativeMultiDeviceUnmatchedGridDim; ///< HIP device supports cooperative launch on multiple
|
||||
///devices with unmatched grid dimensions
|
||||
int cooperativeMultiDeviceUnmatchedBlockDim; ///< HIP device supports cooperative launch on multiple
|
||||
///devices with unmatched block dimensions
|
||||
int cooperativeMultiDeviceUnmatchedSharedMem; ///< HIP device supports cooperative launch on multiple
|
||||
///devices with unmatched shared memories
|
||||
int isLargeBar; ///< 1: if it is a large PCI bar device, else 0
|
||||
int asicRevision; ///< Revision of the GPU in this device
|
||||
int managedMemory; ///< Device supports allocating managed memory on this system
|
||||
int directManagedMemAccessFromHost; ///< Host can directly access managed memory on the device without migration
|
||||
int concurrentManagedAccess; ///< Device can coherently access managed memory concurrently with the CPU
|
||||
int pageableMemoryAccess; ///< Device supports coherently accessing pageable memory
|
||||
///< without calling hipHostRegister on it
|
||||
int pageableMemoryAccessUsesHostPageTables; ///< Device accesses pageable memory via the host's page tables
|
||||
} hipDeviceProp_t;
|
||||
|
||||
typedef enum HIPpointer_attribute_enum {
|
||||
HIP_POINTER_ATTRIBUTE_CONTEXT = 1,
|
||||
HIP_POINTER_ATTRIBUTE_MEMORY_TYPE = 2,
|
||||
HIP_POINTER_ATTRIBUTE_DEVICE_POINTER = 3,
|
||||
HIP_POINTER_ATTRIBUTE_HOST_POINTER = 4,
|
||||
HIP_POINTER_ATTRIBUTE_SYNC_MEMOPS = 6,
|
||||
HIP_POINTER_ATTRIBUTE_BUFFER_ID = 7,
|
||||
HIP_POINTER_ATTRIBUTE_IS_MANAGED = 8,
|
||||
HIP_POINTER_ATTRIBUTE_DEVICE_ORDINAL = 9,
|
||||
} HIPpointer_attribute;
|
||||
|
||||
typedef enum hipFunction_attribute {
|
||||
HIP_FUNC_ATTRIBUTE_MAX_THREADS_PER_BLOCK = 0,
|
||||
@@ -376,6 +595,12 @@ typedef enum HIPshared_carveout_enum {
|
||||
|
||||
|
||||
|
||||
typedef enum hipComputeMode {
|
||||
hipComputeModeDefault = 0,
|
||||
hipComputeModeProhibited = 2,
|
||||
hipComputeModeExclusiveProcess = 3,
|
||||
} hipComputeMode;
|
||||
|
||||
typedef enum HIPmem_advise_enum {
|
||||
HIP_MEM_ADVISE_SET_READ_MOSTLY = 1,
|
||||
HIP_MEM_ADVISE_UNSET_READ_MOSTLY = 2,
|
||||
@@ -577,6 +802,24 @@ typedef enum HIPdevice_P2PAttribute_enum {
|
||||
|
||||
typedef struct hipGraphicsResource_st* hipGraphicsResource;
|
||||
|
||||
typedef struct hip_Memcpy2D {
|
||||
size_t srcXInBytes;
|
||||
size_t srcY;
|
||||
hipMemoryType srcMemoryType;
|
||||
const void* srcHost;
|
||||
hipDeviceptr_t srcDevice;
|
||||
hArray * srcArray;
|
||||
size_t srcPitch;
|
||||
size_t dstXInBytes;
|
||||
size_t dstY;
|
||||
hipMemoryType dstMemoryType;
|
||||
void* dstHost;
|
||||
hipDeviceptr_t dstDevice;
|
||||
hArray * dstArray;
|
||||
size_t dstPitch;
|
||||
size_t WidthInBytes;
|
||||
size_t Height;
|
||||
} hip_Memcpy2D;
|
||||
|
||||
typedef enum hipDeviceP2PAttr {
|
||||
hipDevP2PAttrPerformanceRank = 0,
|
||||
@@ -585,6 +828,60 @@ typedef enum hipDeviceP2PAttr {
|
||||
hipDevP2PAttrHipArrayAccessSupported
|
||||
} hipDeviceP2PAttr;
|
||||
|
||||
typedef struct HIP_MEMCPY3D {
|
||||
unsigned int srcXInBytes;
|
||||
unsigned int srcY;
|
||||
unsigned int srcZ;
|
||||
unsigned int srcLOD;
|
||||
hipMemoryType srcMemoryType;
|
||||
const void* srcHost;
|
||||
hipDeviceptr_t srcDevice;
|
||||
hArray srcArray;
|
||||
unsigned int srcPitch;
|
||||
unsigned int srcHeight;
|
||||
unsigned int dstXInBytes;
|
||||
unsigned int dstY;
|
||||
unsigned int dstZ;
|
||||
unsigned int dstLOD;
|
||||
hipMemoryType dstMemoryType;
|
||||
void* dstHost;
|
||||
hipDeviceptr_t dstDevice;
|
||||
hArray dstArray;
|
||||
unsigned int dstPitch;
|
||||
unsigned int dstHeight;
|
||||
unsigned int WidthInBytes;
|
||||
unsigned int Height;
|
||||
unsigned int Depth;
|
||||
} HIP_MEMCPY3D;
|
||||
|
||||
typedef struct HIP_MEMCPY3D_PEER_st {
|
||||
size_t srcXInBytes;
|
||||
size_t srcY;
|
||||
size_t srcZ;
|
||||
size_t srcLOD;
|
||||
hipMemoryType srcMemoryType;
|
||||
const void* srcHost;
|
||||
hipDeviceptr_t srcDevice;
|
||||
hArray * srcArray;
|
||||
hipCtx_t srcContext;
|
||||
size_t srcPitch;
|
||||
size_t srcHeight;
|
||||
size_t dstXInBytes;
|
||||
size_t dstY;
|
||||
size_t dstZ;
|
||||
size_t dstLOD;
|
||||
hipMemoryType dstMemoryType;
|
||||
void* dstHost;
|
||||
hipDeviceptr_t dstDevice;
|
||||
hArray * dstArray;
|
||||
hipCtx_t dstContext;
|
||||
size_t dstPitch;
|
||||
size_t dstHeight;
|
||||
size_t WidthInBytes;
|
||||
size_t Height;
|
||||
size_t Depth;
|
||||
} HIP_MEMCPY3D_PEER;
|
||||
|
||||
typedef struct HIP_ARRAY_DESCRIPTOR {
|
||||
size_t Width;
|
||||
size_t Height;
|
||||
@@ -754,6 +1051,11 @@ typedef struct HIP_RESOURCE_VIEW_DESC_st {
|
||||
unsigned int reserved[16];
|
||||
} HIP_RESOURCE_VIEW_DESC;
|
||||
|
||||
typedef struct HIP_POINTER_ATTRIBUTE_P2P_TOKENS_st {
|
||||
unsigned long long p2pToken;
|
||||
unsigned int vaSpaceToken;
|
||||
} HIP_POINTER_ATTRIBUTE_P2P_TOKENS;
|
||||
|
||||
|
||||
typedef unsigned int GLenum;
|
||||
typedef unsigned int GLuint;
|
||||
@@ -771,7 +1073,34 @@ typedef enum HIPGLmap_flags_enum {
|
||||
HIP_GL_MAP_RESOURCE_FLAGS_WRITE_DISCARD = 0x02,
|
||||
} HIPGLmap_flags;
|
||||
|
||||
typedef enum hipExternalMemoryHandleType_enum {
|
||||
hipExternalMemoryHandleTypeOpaqueFd = 1,
|
||||
hipExternalMemoryHandleTypeOpaqueWin32 = 2,
|
||||
hipExternalMemoryHandleTypeOpaqueWin32Kmt = 3,
|
||||
hipExternalMemoryHandleTypeD3D12Heap = 4,
|
||||
hipExternalMemoryHandleTypeD3D12Resource = 5,
|
||||
hipExternalMemoryHandleTypeD3D11Resource = 6,
|
||||
hipExternalMemoryHandleTypeD3D11ResourceKmt = 7,
|
||||
} hipExternalMemoryHandleType;
|
||||
|
||||
typedef struct hipExternalMemoryHandleDesc_st {
|
||||
hipExternalMemoryHandleType type;
|
||||
union {
|
||||
int fd;
|
||||
struct {
|
||||
void *handle;
|
||||
const void *name;
|
||||
} win32;
|
||||
} handle;
|
||||
unsigned long long size;
|
||||
unsigned int flags;
|
||||
} hipExternalMemoryHandleDesc;
|
||||
|
||||
typedef struct hipExternalMemoryBufferDesc_st {
|
||||
unsigned long long offset;
|
||||
unsigned long long size;
|
||||
unsigned int flags;
|
||||
} hipExternalMemoryBufferDesc;
|
||||
|
||||
/**
|
||||
* hipRTC related
|
||||
@@ -837,72 +1166,6 @@ typedef enum hiprtcJITInputType {
|
||||
HIPRTC_JIT_NUM_INPUT_TYPES = ( HIPRTC_JIT_NUM_LEGACY_INPUT_TYPES + 3 )
|
||||
} hiprtcJITInputType;
|
||||
|
||||
#ifdef WITH_HIP_SDK_5
|
||||
#include "hipew5.h"
|
||||
#else
|
||||
#include "hipew6.h"
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Pointer attributes
|
||||
*/
|
||||
typedef struct hipPointerAttribute_t {
|
||||
enum hipMemoryType memoryType;
|
||||
int device;
|
||||
void* devicePointer;
|
||||
void* hostPointer;
|
||||
int isManaged;
|
||||
unsigned allocationFlags; /* flags specified when memory was allocated*/
|
||||
/* peers? */
|
||||
} hipPointerAttribute_t;
|
||||
|
||||
typedef struct hip_Memcpy2D {
|
||||
size_t srcXInBytes;
|
||||
size_t srcY;
|
||||
hipMemoryType srcMemoryType;
|
||||
const void* srcHost;
|
||||
hipDeviceptr_t srcDevice;
|
||||
hArray* srcArray;
|
||||
size_t srcPitch;
|
||||
size_t dstXInBytes;
|
||||
size_t dstY;
|
||||
hipMemoryType dstMemoryType;
|
||||
void* dstHost;
|
||||
hipDeviceptr_t dstDevice;
|
||||
hArray* dstArray;
|
||||
size_t dstPitch;
|
||||
size_t WidthInBytes;
|
||||
size_t Height;
|
||||
} hip_Memcpy2D;
|
||||
|
||||
typedef struct HIP_MEMCPY3D_PEER_st {
|
||||
size_t srcXInBytes;
|
||||
size_t srcY;
|
||||
size_t srcZ;
|
||||
size_t srcLOD;
|
||||
hipMemoryType srcMemoryType;
|
||||
const void* srcHost;
|
||||
hipDeviceptr_t srcDevice;
|
||||
hArray* srcArray;
|
||||
hipCtx_t srcContext;
|
||||
size_t srcPitch;
|
||||
size_t srcHeight;
|
||||
size_t dstXInBytes;
|
||||
size_t dstY;
|
||||
size_t dstZ;
|
||||
size_t dstLOD;
|
||||
hipMemoryType dstMemoryType;
|
||||
void* dstHost;
|
||||
hipDeviceptr_t dstDevice;
|
||||
hArray* dstArray;
|
||||
hipCtx_t dstContext;
|
||||
size_t dstPitch;
|
||||
size_t dstHeight;
|
||||
size_t WidthInBytes;
|
||||
size_t Height;
|
||||
size_t Depth;
|
||||
} HIP_MEMCPY3D_PEER;
|
||||
|
||||
typedef struct ihiprtcLinkState* hiprtcLinkState;
|
||||
|
||||
/* Function types. */
|
||||
@@ -914,6 +1177,7 @@ typedef hipError_t HIPAPI thipDriverGetVersion(int* driverVersion);
|
||||
typedef hipError_t HIPAPI thipRuntimeGetVersion(int* runtimeVersion);
|
||||
typedef hipError_t HIPAPI thipGetDevice(int* device);
|
||||
typedef hipError_t HIPAPI thipGetDeviceCount(int* count);
|
||||
typedef hipError_t HIPAPI thipGetDeviceProperties(hipDeviceProp_t* props, int deviceId);
|
||||
typedef hipError_t HIPAPI thipDeviceGet(hipDevice_t* device, int ordinal);
|
||||
typedef hipError_t HIPAPI thipDeviceGetName(char* name, int len, hipDevice_t dev);
|
||||
typedef hipError_t HIPAPI thipDeviceGetAttribute(int* pi, hipDeviceAttribute_t attrib, hipDevice_t dev);
|
||||
@@ -1064,6 +1328,7 @@ extern thipDriverGetVersion *hipDriverGetVersion;
|
||||
extern thipRuntimeGetVersion *hipRuntimeGetVersion;
|
||||
extern thipGetDevice *hipGetDevice;
|
||||
extern thipGetDeviceCount *hipGetDeviceCount;
|
||||
extern thipGetDeviceProperties *hipGetDeviceProperties;
|
||||
extern thipDeviceGet *hipDeviceGet;
|
||||
extern thipDeviceGetName *hipDeviceGetName;
|
||||
extern thipDeviceGetAttribute *hipDeviceGetAttribute;
|
||||
|
||||
Vendored
+8
-23
@@ -38,11 +38,7 @@ thipDriverGetVersion *hipDriverGetVersion;
|
||||
thipRuntimeGetVersion *hipRuntimeGetVersion;
|
||||
thipGetDevice *hipGetDevice;
|
||||
thipGetDeviceCount *hipGetDeviceCount;
|
||||
#ifdef WITH_HIP_SDK_5
|
||||
thipGetDeviceProperties *hipGetDeviceProperties;
|
||||
#else
|
||||
thipGetDevicePropertiesR0600 *hipGetDevicePropertiesR0600;
|
||||
#endif
|
||||
thipGetDeviceProperties *hipGetDeviceProperties;
|
||||
thipDeviceGet* hipDeviceGet;
|
||||
thipDeviceGetName *hipDeviceGetName;
|
||||
thipDeviceGetAttribute *hipDeviceGetAttribute;
|
||||
@@ -237,7 +233,6 @@ static int hipewHipInit(void) {
|
||||
/* Library paths. */
|
||||
#ifdef _WIN32
|
||||
/* Expected in C:/Windows/System32 or similar, no path needed. */
|
||||
#ifdef WITH_HIP_SDK_5
|
||||
const char *hip_paths[] = {"amdhip64.dll", "amdhip64_6.dll", NULL};
|
||||
#elif defined(__APPLE__)
|
||||
/* Default installation path. */
|
||||
@@ -245,18 +240,12 @@ static int hipewHipInit(void) {
|
||||
#else
|
||||
/* ROCm 6 changes paths from /opt/rocm/hip/lib to /opt/rocm/lib, so
|
||||
* search for libraries there. It still includes .so.5. */
|
||||
#ifdef WITH_HIP_SDK_5
|
||||
const char* hip_paths[] = { "libamdhip64.so.5",
|
||||
"/opt/rocm/lib/libamdhip64.so.5",
|
||||
"/opt/rocm/hip/lib/libamdhip64.so.5",
|
||||
NULL };
|
||||
#else
|
||||
const char* hip_paths[] = { "libamdhip64.so.6",
|
||||
"/opt/rocm/lib/libamdhip64.so.6",
|
||||
"/opt/rocm/hip/lib/libamdhip64.so.6",
|
||||
NULL };
|
||||
|
||||
#endif
|
||||
const char *hip_paths[] = {"libamdhip64.so.5",
|
||||
"/opt/rocm/lib/libamdhip64.so.5",
|
||||
"/opt/rocm/hip/lib/libamdhip64.so.5",
|
||||
"libamdhip64.so",
|
||||
"/opt/rocm/lib/libamdhip64.so",
|
||||
"/opt/rocm/hip/lib/libamdhip64.so", NULL};
|
||||
#endif
|
||||
static int initialized = 0;
|
||||
static int result = 0;
|
||||
@@ -291,11 +280,6 @@ static int hipewHipInit(void) {
|
||||
}
|
||||
|
||||
/* Fetch all function pointers. */
|
||||
#ifdef WITH_HIP_SDK_5
|
||||
HIP_LIBRARY_FIND_CHECKED(hipGetDeviceProperties);
|
||||
#else
|
||||
HIP_LIBRARY_FIND_CHECKED(hipGetDevicePropertiesR0600);
|
||||
#endif
|
||||
HIP_LIBRARY_FIND_CHECKED(hipGetErrorName);
|
||||
HIP_LIBRARY_FIND_CHECKED(hipGetErrorString);
|
||||
HIP_LIBRARY_FIND_CHECKED(hipGetLastError);
|
||||
@@ -304,6 +288,7 @@ static int hipewHipInit(void) {
|
||||
HIP_LIBRARY_FIND_CHECKED(hipRuntimeGetVersion);
|
||||
HIP_LIBRARY_FIND_CHECKED(hipGetDevice);
|
||||
HIP_LIBRARY_FIND_CHECKED(hipGetDeviceCount);
|
||||
HIP_LIBRARY_FIND_CHECKED(hipGetDeviceProperties);
|
||||
HIP_LIBRARY_FIND_CHECKED(hipDeviceGet);
|
||||
HIP_LIBRARY_FIND_CHECKED(hipDeviceGetName);
|
||||
HIP_LIBRARY_FIND_CHECKED(hipDeviceGetAttribute);
|
||||
|
||||
Vendored
-1
@@ -5,4 +5,3 @@ Copyright: Copyright 2011 Tobias Pfaff, Nils Thuerey
|
||||
Upstream version: 0.13
|
||||
Local modifications:
|
||||
* ./patches/local_namespace.diff to support loading MANTA variables into an isolated __main__ name-space.
|
||||
* ./patches/import-openvdb-empty-cubes-fix.patch to fix OpenVDB import visual glitches, by copying full 8x8x8 nodes.
|
||||
|
||||
+5
-14
@@ -112,7 +112,7 @@ class WrapperRegistry {
|
||||
const std::string &name,
|
||||
Manta::PbArgs &args,
|
||||
Manta::PbClass *parent);
|
||||
void construct(bool python_lifecycle, const std::string &scriptname, const vector<string> &args);
|
||||
void construct(const std::string &scriptname, const vector<string> &args);
|
||||
void cleanup();
|
||||
void renameObjects();
|
||||
void runPreInit(PyObject *name_space);
|
||||
@@ -566,9 +566,7 @@ PyObject *WrapperRegistry::createPyObject(const string &classname,
|
||||
}
|
||||
|
||||
// prepare typeinfo and register python module
|
||||
void WrapperRegistry::construct(const bool python_lifecycle,
|
||||
const string &scriptname,
|
||||
const vector<string> &args)
|
||||
void WrapperRegistry::construct(const string &scriptname, const vector<string> &args)
|
||||
{
|
||||
mScriptName = scriptname;
|
||||
this->args = args;
|
||||
@@ -577,15 +575,8 @@ void WrapperRegistry::construct(const bool python_lifecycle,
|
||||
registerMeta();
|
||||
registerDummyTypes();
|
||||
|
||||
// Don't extend the init-tab when Python is already initialized.
|
||||
// Since Python 3.12 this isn't supported and will crash.
|
||||
//
|
||||
// When `python_lifecycle` is false (when manta-flow is embedded), it's the responsibility
|
||||
// of the application embedding this code to include #PyInit_manta_main in the init-tab.
|
||||
if (python_lifecycle) {
|
||||
// work around for certain gcc versions, cast to char*
|
||||
PyImport_AppendInittab((char *)gDefaultModuleName.c_str(), PyInit_manta_main);
|
||||
}
|
||||
// work around for certain gcc versions, cast to char*
|
||||
PyImport_AppendInittab((char *)gDefaultModuleName.c_str(), PyInit_manta_main);
|
||||
}
|
||||
|
||||
inline PyObject *castPy(PyTypeObject *p)
|
||||
@@ -720,7 +711,7 @@ void setup(const bool python_lifecycle,
|
||||
const std::vector<std::string> &args,
|
||||
PyObject *name_space)
|
||||
{
|
||||
WrapperRegistry::instance().construct(python_lifecycle, filename, args);
|
||||
WrapperRegistry::instance().construct(filename, args);
|
||||
if (python_lifecycle) {
|
||||
Py_Initialize();
|
||||
}
|
||||
|
||||
+2
-16
@@ -54,28 +54,14 @@ template<class GridType, class T> void importVDB(typename GridType::Ptr from, Gr
|
||||
using ValueT = typename GridType::ValueType;
|
||||
|
||||
// Check if current grid is to be read as a sparse grid, active voxels (only) will be copied
|
||||
|
||||
if (to->saveSparse()) {
|
||||
to->clear(); // Ensure that destination grid is empty before writing
|
||||
for (typename GridType::ValueOnCIter iter = from->cbeginValueOn(); iter.test(); ++iter) {
|
||||
ValueT vdbValue = *iter;
|
||||
openvdb::Coord coord = iter.getCoord();
|
||||
T toMantaValue;
|
||||
convertFrom(vdbValue, &toMantaValue);
|
||||
// #91174 #124064 - Check if iteration is Voxel or Tile
|
||||
if (iter.isVoxelValue()) {
|
||||
openvdb::Coord coord = iter.getCoord();
|
||||
to->set(coord.x(), coord.y(), coord.z(), toMantaValue);
|
||||
}
|
||||
else {
|
||||
openvdb::CoordBBox bbox;
|
||||
iter.getBoundingBox(bbox);
|
||||
// If grid has 8x8x8 block with the same value, it is stored as Tile with single value.
|
||||
// We need to iterate over the bounding box and copy such value to all voxels in 8x8x8 node.
|
||||
for (openvdb::CoordBBox::Iterator<true> ijk(bbox); ijk; ++ijk) {
|
||||
openvdb::Coord coord = *ijk;
|
||||
to->set(coord.x(), coord.y(), coord.z(), toMantaValue);
|
||||
}
|
||||
}
|
||||
to->set(coord.x(), coord.y(), coord.z(), toMantaValue);
|
||||
}
|
||||
}
|
||||
// When importing all grid cells, using a grid accessor is usually faster than a value iterator
|
||||
|
||||
Vendored
+1
-3
@@ -1296,9 +1296,7 @@ void Optimizer::optimize_integer_constraints(Hierarchy& mRes, std::map<int, int>
|
||||
solver = std::make_unique<GurobiFlowHelper>();
|
||||
}
|
||||
#endif
|
||||
/* This used to be arc_ids.size() which is wrong, the loop below adds
|
||||
* exactly arcs.size() edges. */
|
||||
solver->resize(initial.size() + 2, arcs.size());
|
||||
solver->resize(initial.size() + 2, arc_ids.size());
|
||||
|
||||
std::set<int> ids;
|
||||
for (int i = 0; i < arcs.size(); ++i) {
|
||||
|
||||
@@ -1111,12 +1111,10 @@ void BlenderSync::sync_mesh(BL::Depsgraph b_depsgraph, BObjectInfo &b_ob_info, M
|
||||
if (view_layer.use_surfaces) {
|
||||
/* Adaptive subdivision setup. Not for baking since that requires
|
||||
* exact mapping to the Blender mesh. */
|
||||
Mesh::SubdivisionType subdivision_type = (b_ob_info.real_object != b_bake_target) ?
|
||||
object_subdivision_type(b_ob_info.real_object,
|
||||
preview,
|
||||
experimental) :
|
||||
Mesh::SUBDIVISION_NONE;
|
||||
new_mesh.set_subdivision_type(subdivision_type);
|
||||
if (!scene->bake_manager->get_baking()) {
|
||||
new_mesh.set_subdivision_type(
|
||||
object_subdivision_type(b_ob_info.real_object, preview, experimental));
|
||||
}
|
||||
|
||||
/* For some reason, meshes do not need this... */
|
||||
bool need_undeformed = new_mesh.need_attribute(scene, ATTR_STD_GENERATED);
|
||||
|
||||
@@ -175,7 +175,7 @@ Object *BlenderSync::sync_object(BL::Depsgraph &b_depsgraph,
|
||||
if (is_instance) {
|
||||
persistent_id_array = b_instance.persistent_id();
|
||||
persistent_id = persistent_id_array.data;
|
||||
if (!motion && !b_ob_info.is_real_object_data()) {
|
||||
if (!b_ob_info.is_real_object_data()) {
|
||||
/* Remember which object data the geometry is coming from, so that we can sync it when the
|
||||
* object has changed. */
|
||||
instance_geometries_by_object[b_ob_info.real_object.ptr.data].insert(b_ob_info.object_data);
|
||||
@@ -316,8 +316,6 @@ Object *BlenderSync::sync_object(BL::Depsgraph &b_depsgraph,
|
||||
bool is_caustics_receiver = get_boolean(cobject, "is_caustics_receiver");
|
||||
object->set_is_caustics_receiver(is_caustics_receiver);
|
||||
|
||||
object->set_is_bake_target(b_ob_info.real_object == b_bake_target);
|
||||
|
||||
/* sync the asset name for Cryptomatte */
|
||||
BL::Object parent = b_ob.parent();
|
||||
ustring parent_name;
|
||||
@@ -563,12 +561,7 @@ void BlenderSync::sync_objects(BL::Depsgraph &b_depsgraph,
|
||||
else {
|
||||
geometry_motion_synced.clear();
|
||||
}
|
||||
|
||||
if (!motion) {
|
||||
/* Object to geometry instance mapping is built for the reference time, as other
|
||||
* times just look up the corresponding geometry. */
|
||||
instance_geometries_by_object.clear();
|
||||
}
|
||||
instance_geometries_by_object.clear();
|
||||
|
||||
/* initialize culling */
|
||||
BlenderObjectCulling culling(scene, b_scene);
|
||||
|
||||
@@ -209,8 +209,6 @@ void BlenderSync::sync_pointcloud(PointCloud *pointcloud, BObjectInfo &b_ob_info
|
||||
need_motion,
|
||||
motion_scale);
|
||||
|
||||
pointcloud->clear_non_sockets();
|
||||
|
||||
/* Update original sockets. */
|
||||
for (const SocketType &socket : new_pointcloud.type->inputs) {
|
||||
/* Those sockets are updated in sync_object, so do not modify them. */
|
||||
|
||||
@@ -686,7 +686,7 @@ void BlenderSession::bake(BL::Depsgraph &b_depsgraph_,
|
||||
b_engine, b_userpref, b_scene, background);
|
||||
|
||||
/* Initialize bake manager, before we load the baking kernels. */
|
||||
scene->bake_manager->set_baking(scene, true);
|
||||
scene->bake_manager->set(scene, b_object.name());
|
||||
|
||||
session->set_display_driver(nullptr);
|
||||
session->set_output_driver(make_unique<BlenderOutputDriver>(b_engine));
|
||||
@@ -694,7 +694,6 @@ void BlenderSession::bake(BL::Depsgraph &b_depsgraph_,
|
||||
|
||||
/* Sync scene. */
|
||||
BL::Object b_camera_override(b_engine.camera_override());
|
||||
sync->set_bake_target(b_object);
|
||||
sync->sync_camera(b_render, b_camera_override, width, height, "");
|
||||
sync->sync_data(b_render,
|
||||
b_depsgraph,
|
||||
@@ -728,8 +727,8 @@ void BlenderSession::bake(BL::Depsgraph &b_depsgraph_,
|
||||
* other way, in that case Blender will report a warning afterwards. */
|
||||
Object *bake_object = nullptr;
|
||||
if (!session->progress.get_cancel()) {
|
||||
for (Object *ob : scene->objects) {
|
||||
if (ob->get_is_bake_target()) {
|
||||
foreach (Object *ob, scene->objects) {
|
||||
if (ob->name == b_object.name()) {
|
||||
bake_object = ob;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -842,13 +842,11 @@ static ShaderNode *add_node(Scene *scene,
|
||||
image->set_animated(is_image_animated(b_image_source, b_image_user));
|
||||
image->set_alpha_type(get_image_alpha_type(b_image));
|
||||
|
||||
if (b_image_source == BL::Image::source_TILED) {
|
||||
array<int> tiles;
|
||||
for (BL::UDIMTile &b_tile : b_image.tiles) {
|
||||
tiles.push_back_slow(b_tile.number());
|
||||
}
|
||||
image->set_tiles(tiles);
|
||||
array<int> tiles;
|
||||
for (BL::UDIMTile &b_tile : b_image.tiles) {
|
||||
tiles.push_back_slow(b_tile.number());
|
||||
}
|
||||
image->set_tiles(tiles);
|
||||
|
||||
/* builtin images will use callback-based reading because
|
||||
* they could only be loaded correct from blender side
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0 */
|
||||
|
||||
#include "RNA_types.hh"
|
||||
#include "scene/background.h"
|
||||
#include "scene/camera.h"
|
||||
#include "scene/curves.h"
|
||||
@@ -48,7 +47,6 @@ BlenderSync::BlenderSync(BL::RenderEngine &b_engine,
|
||||
: b_engine(b_engine),
|
||||
b_data(b_data),
|
||||
b_scene(b_scene),
|
||||
b_bake_target(PointerRNA_NULL),
|
||||
shader_map(scene),
|
||||
object_map(scene),
|
||||
procedural_map(scene),
|
||||
@@ -89,11 +87,6 @@ void BlenderSync::tag_update()
|
||||
has_updates_ = true;
|
||||
}
|
||||
|
||||
void BlenderSync::set_bake_target(BL::Object &b_object)
|
||||
{
|
||||
b_bake_target = b_object;
|
||||
}
|
||||
|
||||
/* Sync */
|
||||
|
||||
void BlenderSync::sync_recalc(BL::Depsgraph &b_depsgraph, BL::SpaceView3D &b_v3d)
|
||||
@@ -585,7 +578,7 @@ void BlenderSync::sync_view_layer(BL::ViewLayer &b_view_layer)
|
||||
/* Filter. */
|
||||
view_layer.use_background_shader = b_view_layer.use_sky();
|
||||
/* Always enable surfaces for baking, otherwise there is nothing to bake to. */
|
||||
view_layer.use_surfaces = b_view_layer.use_solid() || b_bake_target;
|
||||
view_layer.use_surfaces = b_view_layer.use_solid() || scene->bake_manager->get_baking();
|
||||
view_layer.use_hair = b_view_layer.use_strand();
|
||||
view_layer.use_volumes = b_view_layer.use_volumes();
|
||||
view_layer.use_motion_blur = b_view_layer.use_motion_blur() &&
|
||||
@@ -814,7 +807,7 @@ void BlenderSync::free_data_after_sync(BL::Depsgraph &b_depsgraph)
|
||||
/* Baking re-uses the depsgraph multiple times, clearing crashes
|
||||
* reading un-evaluated mesh data which isn't aligned with the
|
||||
* geometry we're baking, see #71012. */
|
||||
!b_bake_target &&
|
||||
!scene->bake_manager->get_baking() &&
|
||||
/* Persistent data must main caches for performance and correctness. */
|
||||
!is_persistent_data;
|
||||
|
||||
|
||||
@@ -57,8 +57,6 @@ class BlenderSync {
|
||||
|
||||
void tag_update();
|
||||
|
||||
void set_bake_target(BL::Object &b_object);
|
||||
|
||||
/* sync */
|
||||
void sync_recalc(BL::Depsgraph &b_depsgraph, BL::SpaceView3D &b_v3d);
|
||||
void sync_data(BL::RenderSettings &b_render,
|
||||
@@ -225,7 +223,6 @@ class BlenderSync {
|
||||
BL::RenderEngine b_engine;
|
||||
BL::BlendData b_data;
|
||||
BL::Scene b_scene;
|
||||
BL::Object b_bake_target;
|
||||
|
||||
enum ShaderFlags { SHADER_WITH_LAYER_ATTRS };
|
||||
|
||||
|
||||
@@ -198,8 +198,6 @@ static void sync_smoke_volume(
|
||||
ATTR_STD_VOLUME_VELOCITY,
|
||||
ATTR_STD_NONE};
|
||||
|
||||
int frame_interval[2] = {b_domain.cache_frame_start(), b_domain.cache_frame_end()};
|
||||
|
||||
for (int i = 0; attributes[i] != ATTR_STD_NONE; i++) {
|
||||
AttributeStandard std = attributes[i];
|
||||
if (!volume->need_attribute(scene, std)) {
|
||||
@@ -210,11 +208,6 @@ static void sync_smoke_volume(
|
||||
|
||||
Attribute *attr = volume->attributes.add(std);
|
||||
|
||||
if (frame < frame_interval[0] || frame > frame_interval[1]) {
|
||||
attr->data_voxel().clear();
|
||||
continue;
|
||||
}
|
||||
|
||||
ImageLoader *loader = new BlenderSmokeLoader(b_ob_info.real_object, std);
|
||||
ImageParams params;
|
||||
params.frame = frame;
|
||||
|
||||
@@ -41,6 +41,8 @@ BVHObjectSplit::BVHObjectSplit(BVHBuild *builder,
|
||||
const BVHReference *ref_ptr = &references_->at(range.start());
|
||||
float min_sah = FLT_MAX;
|
||||
|
||||
storage_->right_bounds.resize(range.size());
|
||||
|
||||
for (int dim = 0; dim < 3; dim++) {
|
||||
/* Sort references. */
|
||||
bvh_reference_sort(range.start(),
|
||||
@@ -50,11 +52,6 @@ BVHObjectSplit::BVHObjectSplit(BVHBuild *builder,
|
||||
unaligned_heuristic_,
|
||||
aligned_space_);
|
||||
|
||||
// Resize must be called after every bvh_reference_sort, as sorting may use a task pool for
|
||||
// large ranges. This may cause another BVHObjectSplit to use and resize the storage on the
|
||||
// same thread.
|
||||
storage_->right_bounds.resize(range.size());
|
||||
|
||||
/* sweep right to left and determine bounds. */
|
||||
BoundBox right_bounds = BoundBox::empty;
|
||||
for (int i = range.size() - 1; i > 0; i--) {
|
||||
@@ -444,11 +441,11 @@ void BVHSpatialSplit::split_point_primitive(const PointCloud *pointcloud,
|
||||
}
|
||||
point = get_unaligned_point(point);
|
||||
|
||||
if (point[dim] - radius <= pos) {
|
||||
if (point[dim] <= pos) {
|
||||
left_bounds.grow(point, radius);
|
||||
}
|
||||
|
||||
if (point[dim] + radius >= pos) {
|
||||
if (point[dim] >= pos) {
|
||||
right_bounds.grow(point, radius);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -804,17 +804,4 @@ void GPUDevice::generic_copy_to(device_memory &mem)
|
||||
|
||||
/* DeviceInfo */
|
||||
|
||||
bool DeviceInfo::contains_device_type(const DeviceType type) const
|
||||
{
|
||||
if (this->type == type) {
|
||||
return true;
|
||||
}
|
||||
for (const DeviceInfo &info : multi_devices) {
|
||||
if (info.contains_device_type(type)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
CCL_NAMESPACE_END
|
||||
|
||||
@@ -114,7 +114,6 @@ class DeviceInfo {
|
||||
has_gpu_queue = false;
|
||||
use_hardware_raytracing = false;
|
||||
use_metalrt_by_default = false;
|
||||
kernel_optimization_level = KERNEL_OPTIMIZATION_LEVEL_FULL;
|
||||
denoisers = DENOISER_NONE;
|
||||
}
|
||||
|
||||
@@ -130,8 +129,6 @@ class DeviceInfo {
|
||||
{
|
||||
return !(*this == info);
|
||||
}
|
||||
|
||||
bool contains_device_type(const DeviceType type) const;
|
||||
};
|
||||
|
||||
/* Device */
|
||||
|
||||
@@ -109,22 +109,6 @@ struct BVHMetalBuildThrottler {
|
||||
}
|
||||
} g_bvh_build_throttler;
|
||||
|
||||
/* macOS 15.2 and 15.3 has a bug in the dynamic BVH refitting which leads to missing geometry
|
||||
* during render. The issue is fixed in the macOS 15.4, until then disable refitting even for
|
||||
* the viewport.
|
||||
* Note that dynamic BVH is still used on the scene level to speed up updates of instances and
|
||||
* such. #132782. */
|
||||
static bool support_refit_blas()
|
||||
{
|
||||
if (@available(macos 15.4, *)) {
|
||||
return true;
|
||||
}
|
||||
if (@available(macos 15.2, *)) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
BVHMetal::BVHMetal(const BVHParams ¶ms_,
|
||||
const vector<Geometry *> &geometry_,
|
||||
const vector<Object *> &objects_,
|
||||
@@ -178,7 +162,7 @@ bool BVHMetal::build_BLAS_mesh(Progress &progress,
|
||||
"Building mesh BLAS | %7d tris | %s", (int)mesh->num_triangles(), geom->name.c_str());
|
||||
/*------------------------------------------------*/
|
||||
|
||||
const bool use_fast_trace_bvh = (params.bvh_type == BVH_TYPE_STATIC) || !support_refit_blas();
|
||||
const bool use_fast_trace_bvh = (params.bvh_type == BVH_TYPE_STATIC);
|
||||
|
||||
const array<float3> &verts = mesh->get_verts();
|
||||
const array<int> &tris = mesh->get_triangles();
|
||||
@@ -399,7 +383,7 @@ bool BVHMetal::build_BLAS_hair(Progress &progress,
|
||||
"Building hair BLAS | %7d curves | %s", (int)hair->num_curves(), geom->name.c_str());
|
||||
/*------------------------------------------------*/
|
||||
|
||||
const bool use_fast_trace_bvh = (params.bvh_type == BVH_TYPE_STATIC) || !support_refit_blas();
|
||||
const bool use_fast_trace_bvh = (params.bvh_type == BVH_TYPE_STATIC);
|
||||
|
||||
size_t num_motion_steps = 1;
|
||||
Attribute *motion_keys = hair->attributes.find(ATTR_STD_MOTION_VERTEX_POSITION);
|
||||
@@ -743,7 +727,7 @@ bool BVHMetal::build_BLAS_pointcloud(Progress &progress,
|
||||
const float3 *points = pointcloud->get_points().data();
|
||||
const float *radius = pointcloud->get_radius().data();
|
||||
|
||||
const bool use_fast_trace_bvh = (params.bvh_type == BVH_TYPE_STATIC) || !support_refit_blas();
|
||||
const bool use_fast_trace_bvh = (params.bvh_type == BVH_TYPE_STATIC);
|
||||
|
||||
size_t num_motion_steps = 1;
|
||||
Attribute *motion_keys = pointcloud->attributes.find(ATTR_STD_MOTION_VERTEX_POSITION);
|
||||
@@ -1063,7 +1047,7 @@ bool BVHMetal::build_TLAS(Progress &progress,
|
||||
BVH_status("Building TLAS | %7d instances", (int)num_instances);
|
||||
/*------------------------------------------------*/
|
||||
|
||||
const bool use_fast_trace_bvh = (params.bvh_type == BVH_TYPE_STATIC) || !support_refit_blas();
|
||||
const bool use_fast_trace_bvh = (params.bvh_type == BVH_TYPE_STATIC);
|
||||
|
||||
NSMutableArray *all_blas = [NSMutableArray array];
|
||||
unordered_map<BVHMetal const *, int> instance_mapping;
|
||||
@@ -1340,10 +1324,6 @@ bool BVHMetal::build(Progress &progress,
|
||||
}
|
||||
}
|
||||
|
||||
if (!support_refit_blas()) {
|
||||
refit = false;
|
||||
}
|
||||
|
||||
@autoreleasepool {
|
||||
if (!params.top_level) {
|
||||
return build_BLAS(progress, mtl_device, queue, refit);
|
||||
|
||||
@@ -392,7 +392,7 @@ MetalKernelPipeline *ShaderCache::get_best_pipeline(DeviceKernel kernel, const M
|
||||
bool MetalKernelPipeline::should_use_binary_archive() const
|
||||
{
|
||||
/* Issues with binary archives in older macOS versions. */
|
||||
if (@available(macOS 15.4, *)) {
|
||||
if (@available(macOS 13.0, *)) {
|
||||
if (auto str = getenv("CYCLES_METAL_DISABLE_BINARY_ARCHIVES")) {
|
||||
if (atoi(str) != 0) {
|
||||
/* Don't archive if we have opted out by env var. */
|
||||
|
||||
@@ -530,21 +530,18 @@ void OneapiDevice::const_copy_to(const char *name, void *host, size_t size)
|
||||
<< string_human_readable_number(size) << " bytes. ("
|
||||
<< string_human_readable_size(size) << ")";
|
||||
|
||||
if (strcmp(name, "data") == 0) {
|
||||
assert(size <= sizeof(KernelData));
|
||||
KernelData *const data = static_cast<KernelData *>(host);
|
||||
|
||||
/* We need this value when allocating local memory for integrator_sort_bucket_pass
|
||||
* and integrator_sort_write_pass kernels. */
|
||||
scene_max_shaders_ = data->max_shaders;
|
||||
|
||||
# ifdef WITH_EMBREE_GPU
|
||||
if (embree_scene != nullptr) {
|
||||
/* Update scene handle(since it is different for each device on multi devices) */
|
||||
data->device_bvh = embree_scene;
|
||||
}
|
||||
# endif
|
||||
if (embree_scene != nullptr && strcmp(name, "data") == 0) {
|
||||
assert(size <= sizeof(KernelData));
|
||||
|
||||
/* Update scene handle(since it is different for each device on multi devices) */
|
||||
KernelData *const data = (KernelData *)host;
|
||||
data->device_bvh = embree_scene;
|
||||
|
||||
/* We need this number later for proper local memory allocation. */
|
||||
scene_max_shaders_ = data->max_shaders;
|
||||
}
|
||||
# endif
|
||||
|
||||
ConstMemMap::iterator i = const_mem_map_.find(name);
|
||||
device_vector<uchar> *data;
|
||||
|
||||
@@ -869,14 +869,6 @@ ccl_device Spectrum bsdf_hair_huang_eval(KernelGlobals kg,
|
||||
bsdf->extra->gamma_m_min = gamma_m_min;
|
||||
bsdf->extra->gamma_m_max = gamma_m_max;
|
||||
|
||||
/* FIXME(weizhen): There is a problem of `fast_sinf(-1.57085085f)` returning 0 instead of
|
||||
* expected -1, causing the range to be incorrect. As that seems an uncommon case, it feels safer
|
||||
* to cover this case first, and look into solving the problem in `fast_sinf()` later. */
|
||||
kernel_assert(bsdf->extra->gamma_m_min < bsdf->extra->gamma_m_max);
|
||||
if (!(bsdf->extra->gamma_m_min < bsdf->extra->gamma_m_max)) {
|
||||
return zero_spectrum();
|
||||
}
|
||||
|
||||
const float projected_area = cos_theta(local_I) * dh;
|
||||
|
||||
return (bsdf_hair_huang_eval_r(kg, sc, local_I, local_O) +
|
||||
|
||||
@@ -48,7 +48,7 @@ ccl_device_inline void motion_curve_keys_linear(
|
||||
KernelGlobals kg, int object, float time, int k0, int k1, float4 keys[2])
|
||||
{
|
||||
/* get motion info */
|
||||
const int numsteps = kernel_data_fetch(objects, object).num_geom_steps;
|
||||
const int numsteps = kernel_data_fetch(objects, object).numsteps;
|
||||
const int numverts = kernel_data_fetch(objects, object).numverts;
|
||||
|
||||
/* figure out which steps we need to fetch and their interpolation factor */
|
||||
@@ -108,7 +108,7 @@ ccl_device_inline void motion_curve_keys(
|
||||
KernelGlobals kg, int object, float time, int k0, int k1, int k2, int k3, float4 keys[4])
|
||||
{
|
||||
/* get motion info */
|
||||
const int numsteps = kernel_data_fetch(objects, object).num_geom_steps;
|
||||
const int numsteps = kernel_data_fetch(objects, object).numsteps;
|
||||
const int numverts = kernel_data_fetch(objects, object).numverts;
|
||||
|
||||
/* figure out which steps we need to fetch and their interpolation factor */
|
||||
|
||||
@@ -37,7 +37,7 @@ motion_point_for_step(KernelGlobals kg, int offset, int numverts, int numsteps,
|
||||
ccl_device_inline float4 motion_point(KernelGlobals kg, int object, int prim, float time)
|
||||
{
|
||||
/* get motion info */
|
||||
const int numsteps = kernel_data_fetch(objects, object).num_geom_steps;
|
||||
const int numsteps = kernel_data_fetch(objects, object).numsteps;
|
||||
const int numverts = kernel_data_fetch(objects, object).numverts;
|
||||
|
||||
/* figure out which steps we need to fetch and their interpolation factor */
|
||||
|
||||
@@ -87,7 +87,7 @@ ccl_device_inline void motion_triangle_compute_info(KernelGlobals kg,
|
||||
ccl_private float *t)
|
||||
{
|
||||
/* Get object motion info. */
|
||||
*numsteps = kernel_data_fetch(objects, object).num_geom_steps;
|
||||
*numsteps = kernel_data_fetch(objects, object).numsteps;
|
||||
|
||||
/* Figure out which steps we need to fetch and their interpolation factor. */
|
||||
int maxstep = *numsteps * 2;
|
||||
|
||||
@@ -67,8 +67,8 @@ ccl_device_inline Transform object_fetch_motion_pass_transform(KernelGlobals kg,
|
||||
ccl_device_inline Transform object_fetch_transform_motion(KernelGlobals kg, int object, float time)
|
||||
{
|
||||
const uint motion_offset = kernel_data_fetch(objects, object).motion_offset;
|
||||
const ccl_global DecomposedTransform *motion = &kernel_data_fetch(object_motion, motion_offset);
|
||||
const uint num_steps = kernel_data_fetch(objects, object).num_tfm_steps;
|
||||
ccl_global const DecomposedTransform *motion = &kernel_data_fetch(object_motion, motion_offset);
|
||||
const uint num_steps = kernel_data_fetch(objects, object).numsteps * 2 + 1;
|
||||
|
||||
Transform tfm;
|
||||
transform_motion_array_interpolate(&tfm, motion, num_steps, time);
|
||||
|
||||
@@ -447,15 +447,10 @@ ccl_device_forceinline bool background_light_tree_parameters(const float3 centro
|
||||
{
|
||||
if (in_volume_segment) {
|
||||
if (t == FLT_MAX) {
|
||||
/* In world volumes, distant lights can contribute to the lighting of the volume with
|
||||
* specific configurations of procedurally generated volumes. Use a ray length of 1.0 in this
|
||||
* case to give the distant light some weight, but one that isn't too high for a typical
|
||||
* world volume use case. */
|
||||
theta_d = 1.0f;
|
||||
}
|
||||
else {
|
||||
theta_d = t;
|
||||
/* In world volume, distant light has no contribution. */
|
||||
return false;
|
||||
}
|
||||
theta_d = t;
|
||||
}
|
||||
|
||||
/* Cover the whole sphere */
|
||||
|
||||
@@ -140,15 +140,10 @@ ccl_device_forceinline bool distant_light_tree_parameters(const float3 centroid,
|
||||
{
|
||||
if (in_volume_segment) {
|
||||
if (t == FLT_MAX) {
|
||||
/* In world volumes, distant lights can contribute to the lighting of the volume with
|
||||
* specific configurations of procedurally generated volumes. Use a ray length of 1.0 in this
|
||||
* case to give the distant light some weight, but one that isn't too high for a typical
|
||||
* world volume use case. */
|
||||
theta_d = 1.0f;
|
||||
}
|
||||
else {
|
||||
theta_d = t;
|
||||
/* In world volume, distant light has no contribution. */
|
||||
return false;
|
||||
}
|
||||
theta_d = t;
|
||||
}
|
||||
|
||||
/* Treating it as a disk light 1 unit away */
|
||||
|
||||
@@ -218,7 +218,7 @@ ccl_device void light_tree_importance(const float3 N_or_D,
|
||||
float cos_max_outgoing_angle;
|
||||
const float cos_theta_plus_theta_u = cos_theta * cos_theta_u - sin_theta * sin_theta_u;
|
||||
if (bcone.theta_e - bcone.theta_o < 0 || cos_theta < 0 || cos_theta_u < 0 ||
|
||||
cos_theta_plus_theta_u < fast_cosf(bcone.theta_e - bcone.theta_o))
|
||||
cos_theta_plus_theta_u < cosf(bcone.theta_e - bcone.theta_o))
|
||||
{
|
||||
min_importance = 0.0f;
|
||||
}
|
||||
@@ -313,15 +313,10 @@ ccl_device void light_tree_node_importance(KernelGlobals kg,
|
||||
cos_theta_u = fast_cosf(bcone.theta_o + bcone.theta_e);
|
||||
distance = 1.0f;
|
||||
/* For distant lights, the integral in Eq. (4) gives the ray length. */
|
||||
theta_d = t;
|
||||
if (t == FLT_MAX) {
|
||||
/* In world volumes, distant lights can contribute to the lighting of the volume with
|
||||
* specific configurations of procedurally generated volumes. Use a ray length of 1.0 in this
|
||||
* case to give the distant light some weight, but one that isn't too high for a typical
|
||||
* world volume use case. */
|
||||
theta_d = 1.0f;
|
||||
}
|
||||
else {
|
||||
theta_d = t;
|
||||
/* In world volume, distant light has no contribution. */
|
||||
return;
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
||||
@@ -58,7 +58,7 @@ color image_texture_lookup(string filename,
|
||||
/* Flip the y coordinate, but preserve UDIM tiles. */
|
||||
float flip_v;
|
||||
if (is_tiled) {
|
||||
float v_i = floor(v);
|
||||
float v_i = (int)v;
|
||||
flip_v = v_i + (1.0 - (v - v_i));
|
||||
}
|
||||
else {
|
||||
|
||||
@@ -1526,8 +1526,7 @@ typedef struct KernelObject {
|
||||
float dupli_uv[2];
|
||||
|
||||
int numkeys;
|
||||
int num_geom_steps;
|
||||
int num_tfm_steps;
|
||||
int numsteps;
|
||||
int numverts;
|
||||
|
||||
uint patch_map_offset;
|
||||
@@ -1550,8 +1549,6 @@ typedef struct KernelObject {
|
||||
/* Volume velocity scale. */
|
||||
float velocity_scale;
|
||||
|
||||
int pad[3];
|
||||
|
||||
/* TODO: separate array to avoid memory overhead when not used. */
|
||||
uint64_t light_set_membership;
|
||||
uint receiver_light_set;
|
||||
|
||||
@@ -14,18 +14,22 @@
|
||||
|
||||
CCL_NAMESPACE_BEGIN
|
||||
|
||||
bool BakeManager::get_baking() const
|
||||
BakeManager::BakeManager()
|
||||
{
|
||||
return use_baking_;
|
||||
need_update_ = true;
|
||||
use_camera_ = false;
|
||||
}
|
||||
|
||||
void BakeManager::set_baking(Scene *scene, const bool use)
|
||||
{
|
||||
if (use_baking_ == use) {
|
||||
return;
|
||||
}
|
||||
BakeManager::~BakeManager() {}
|
||||
|
||||
use_baking_ = use;
|
||||
bool BakeManager::get_baking() const
|
||||
{
|
||||
return !object_name.empty();
|
||||
}
|
||||
|
||||
void BakeManager::set(Scene *scene, const std::string &object_name_)
|
||||
{
|
||||
object_name = object_name_;
|
||||
|
||||
/* create device and update scene */
|
||||
scene->film->tag_modified();
|
||||
@@ -66,8 +70,8 @@ void BakeManager::device_update(Device * /*device*/,
|
||||
|
||||
kbake->use_camera = use_camera_;
|
||||
|
||||
if (use_baking_) {
|
||||
const scoped_callback_timer timer([scene](double time) {
|
||||
if (!object_name.empty()) {
|
||||
scoped_callback_timer timer([scene](double time) {
|
||||
if (scene->update_stats) {
|
||||
scene->update_stats->bake.times.add_entry({"device_update", time});
|
||||
}
|
||||
@@ -76,9 +80,9 @@ void BakeManager::device_update(Device * /*device*/,
|
||||
kbake->use = true;
|
||||
|
||||
int object_index = 0;
|
||||
for (Object *object : scene->objects) {
|
||||
foreach (Object *object, scene->objects) {
|
||||
const Geometry *geom = object->get_geometry();
|
||||
if (object->get_is_bake_target() && geom->geometry_type == Geometry::MESH) {
|
||||
if (object->name == object_name && geom->geometry_type == Geometry::MESH) {
|
||||
kbake->object_index = object_index;
|
||||
kbake->tri_offset = geom->prim_offset;
|
||||
break;
|
||||
|
||||
@@ -15,10 +15,10 @@ CCL_NAMESPACE_BEGIN
|
||||
|
||||
class BakeManager {
|
||||
public:
|
||||
BakeManager() = default;
|
||||
~BakeManager() = default;
|
||||
BakeManager();
|
||||
~BakeManager();
|
||||
|
||||
void set_baking(Scene *scene, const bool use);
|
||||
void set(Scene *scene, const std::string &object_name);
|
||||
bool get_baking() const;
|
||||
|
||||
void set_use_camera(bool use_camera);
|
||||
|
||||
@@ -645,7 +645,7 @@ void GeometryManager::device_update_displacement_images(Device *device,
|
||||
}
|
||||
|
||||
ImageSlotTextureNode *image_node = static_cast<ImageSlotTextureNode *>(node);
|
||||
for (int i = 0; i < image_node->handle.num_svm_slots(); i++) {
|
||||
for (int i = 0; i < image_node->handle.num_tiles(); i++) {
|
||||
const int slot = image_node->handle.svm_slot(i);
|
||||
if (slot != -1) {
|
||||
bump_images.insert(slot);
|
||||
@@ -941,28 +941,12 @@ void GeometryManager::device_update(Device *device,
|
||||
});
|
||||
TaskPool pool;
|
||||
|
||||
/* Work around Embree/oneAPI bug #129596 with BVH updates. */
|
||||
const bool use_multithreaded_build = first_bvh_build ||
|
||||
!device->info.contains_device_type(DEVICE_ONEAPI);
|
||||
first_bvh_build = false;
|
||||
|
||||
size_t i = 0;
|
||||
foreach (Geometry *geom, scene->geometry) {
|
||||
if (geom->is_modified() || geom->need_update_bvh_for_offset) {
|
||||
need_update_scene_bvh = true;
|
||||
if (use_multithreaded_build) {
|
||||
pool.push(function_bind(&Geometry::compute_bvh,
|
||||
geom,
|
||||
device,
|
||||
dscene,
|
||||
&scene->params,
|
||||
&progress,
|
||||
i,
|
||||
num_bvh));
|
||||
}
|
||||
else {
|
||||
geom->compute_bvh(device, dscene, &scene->params, &progress, i, num_bvh);
|
||||
}
|
||||
pool.push(function_bind(
|
||||
&Geometry::compute_bvh, geom, device, dscene, &scene->params, &progress, i, num_bvh));
|
||||
if (geom->need_build_bvh(bvh_layout)) {
|
||||
i++;
|
||||
}
|
||||
|
||||
@@ -228,7 +228,6 @@ class GeometryManager {
|
||||
|
||||
/* Update Flags */
|
||||
bool need_flags_update;
|
||||
bool first_bvh_build = true;
|
||||
|
||||
/* Constructor/Destructor */
|
||||
GeometryManager();
|
||||
|
||||
@@ -70,10 +70,10 @@ const char *name_from_type(ImageDataType type)
|
||||
ImageHandle::ImageHandle() : manager(NULL) {}
|
||||
|
||||
ImageHandle::ImageHandle(const ImageHandle &other)
|
||||
: slots(other.slots), is_tiled(other.is_tiled), manager(other.manager)
|
||||
: tile_slots(other.tile_slots), manager(other.manager)
|
||||
{
|
||||
/* Increase image user count. */
|
||||
for (const size_t slot : slots) {
|
||||
foreach (const size_t slot, tile_slots) {
|
||||
manager->add_image_user(slot);
|
||||
}
|
||||
}
|
||||
@@ -82,10 +82,9 @@ ImageHandle &ImageHandle::operator=(const ImageHandle &other)
|
||||
{
|
||||
clear();
|
||||
manager = other.manager;
|
||||
is_tiled = other.is_tiled;
|
||||
slots = other.slots;
|
||||
tile_slots = other.tile_slots;
|
||||
|
||||
for (const size_t slot : slots) {
|
||||
foreach (const size_t slot, tile_slots) {
|
||||
manager->add_image_user(slot);
|
||||
}
|
||||
|
||||
@@ -99,72 +98,67 @@ ImageHandle::~ImageHandle()
|
||||
|
||||
void ImageHandle::clear()
|
||||
{
|
||||
for (const size_t slot : slots) {
|
||||
foreach (const size_t slot, tile_slots) {
|
||||
manager->remove_image_user(slot);
|
||||
}
|
||||
|
||||
slots.clear();
|
||||
manager = nullptr;
|
||||
tile_slots.clear();
|
||||
manager = NULL;
|
||||
}
|
||||
|
||||
bool ImageHandle::empty() const
|
||||
{
|
||||
return slots.empty();
|
||||
return tile_slots.empty();
|
||||
}
|
||||
|
||||
int ImageHandle::num_tiles() const
|
||||
{
|
||||
return (is_tiled) ? slots.size() : 0;
|
||||
}
|
||||
|
||||
int ImageHandle::num_svm_slots() const
|
||||
{
|
||||
return slots.size();
|
||||
return tile_slots.size();
|
||||
}
|
||||
|
||||
ImageMetaData ImageHandle::metadata()
|
||||
{
|
||||
if (slots.empty()) {
|
||||
if (tile_slots.empty()) {
|
||||
return ImageMetaData();
|
||||
}
|
||||
|
||||
ImageManager::Image *img = manager->get_image_slot(slots.front());
|
||||
ImageManager::Image *img = manager->images[tile_slots.front()];
|
||||
manager->load_image_metadata(img);
|
||||
return img->metadata;
|
||||
}
|
||||
|
||||
int ImageHandle::svm_slot(const int slot_index) const
|
||||
int ImageHandle::svm_slot(const int tile_index) const
|
||||
{
|
||||
if (slot_index >= slots.size()) {
|
||||
if (tile_index >= tile_slots.size()) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (manager->osl_texture_system) {
|
||||
ImageManager::Image *img = manager->get_image_slot(slots[slot_index]);
|
||||
ImageManager::Image *img = manager->images[tile_slots[tile_index]];
|
||||
if (!img->loader->osl_filepath().empty()) {
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
return slots[slot_index];
|
||||
return tile_slots[tile_index];
|
||||
}
|
||||
|
||||
vector<int4> ImageHandle::get_svm_slots() const
|
||||
{
|
||||
const size_t num_nodes = divide_up(slots.size(), 2);
|
||||
const size_t num_nodes = divide_up(tile_slots.size(), 2);
|
||||
|
||||
vector<int4> svm_slots;
|
||||
svm_slots.reserve(num_nodes);
|
||||
for (size_t i = 0; i < num_nodes; i++) {
|
||||
int4 node;
|
||||
|
||||
size_t slot = slots[2 * i];
|
||||
node.x = manager->get_image_slot(slot)->loader->get_tile_number();
|
||||
size_t slot = tile_slots[2 * i];
|
||||
node.x = manager->images[slot]->loader->get_tile_number();
|
||||
node.y = slot;
|
||||
|
||||
if ((2 * i + 1) < slots.size()) {
|
||||
slot = slots[2 * i + 1];
|
||||
node.z = manager->get_image_slot(slot)->loader->get_tile_number();
|
||||
if ((2 * i + 1) < tile_slots.size()) {
|
||||
slot = tile_slots[2 * i + 1];
|
||||
node.z = manager->images[slot]->loader->get_tile_number();
|
||||
node.w = slot;
|
||||
}
|
||||
else {
|
||||
@@ -178,23 +172,23 @@ vector<int4> ImageHandle::get_svm_slots() const
|
||||
return svm_slots;
|
||||
}
|
||||
|
||||
device_texture *ImageHandle::image_memory() const
|
||||
device_texture *ImageHandle::image_memory(const int tile_index) const
|
||||
{
|
||||
if (slots.empty()) {
|
||||
return nullptr;
|
||||
if (tile_index >= tile_slots.size()) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
ImageManager::Image *img = manager->get_image_slot(slots[0]);
|
||||
return img ? img->mem : nullptr;
|
||||
ImageManager::Image *img = manager->images[tile_slots[tile_index]];
|
||||
return img ? img->mem : NULL;
|
||||
}
|
||||
|
||||
VDBImageLoader *ImageHandle::vdb_loader() const
|
||||
VDBImageLoader *ImageHandle::vdb_loader(const int tile_index) const
|
||||
{
|
||||
if (slots.empty()) {
|
||||
return nullptr;
|
||||
if (tile_index >= tile_slots.size()) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
ImageManager::Image *img = manager->get_image_slot(slots[0]);
|
||||
ImageManager::Image *img = manager->images[tile_slots[tile_index]];
|
||||
|
||||
if (img == NULL) {
|
||||
return NULL;
|
||||
@@ -220,7 +214,7 @@ ImageManager *ImageHandle::get_manager() const
|
||||
|
||||
bool ImageHandle::operator==(const ImageHandle &other) const
|
||||
{
|
||||
return manager == other.manager && is_tiled == other.is_tiled && slots == other.slots;
|
||||
return manager == other.manager && tile_slots == other.tile_slots;
|
||||
}
|
||||
|
||||
/* Image MetaData */
|
||||
@@ -385,7 +379,7 @@ ImageHandle ImageManager::add_image(const string &filename, const ImageParams &p
|
||||
const size_t slot = add_image_slot(new OIIOImageLoader(filename), params, false);
|
||||
|
||||
ImageHandle handle;
|
||||
handle.slots.push_back(slot);
|
||||
handle.tile_slots.push_back(slot);
|
||||
handle.manager = this;
|
||||
return handle;
|
||||
}
|
||||
@@ -396,13 +390,6 @@ ImageHandle ImageManager::add_image(const string &filename,
|
||||
{
|
||||
ImageHandle handle;
|
||||
handle.manager = this;
|
||||
handle.is_tiled = !tiles.empty();
|
||||
|
||||
if (!handle.is_tiled) {
|
||||
const size_t slot = add_image_slot(new OIIOImageLoader(filename), params, false);
|
||||
handle.slots.push_back(slot);
|
||||
return handle;
|
||||
}
|
||||
|
||||
foreach (int tile, tiles) {
|
||||
string tile_filename = filename;
|
||||
@@ -410,14 +397,14 @@ ImageHandle ImageManager::add_image(const string &filename,
|
||||
/* Since we don't have information about the exact tile format used in this code location,
|
||||
* just attempt all replacement patterns that Blender supports. */
|
||||
if (tile != 0) {
|
||||
string_replace(tile_filename, "<UDIM>", string_printf("%04d", tile));
|
||||
string_replace(tile_filename, "<UDIM>", string_printf("%04d", (int)tile));
|
||||
|
||||
int u = ((tile - 1001) % 10);
|
||||
int v = ((tile - 1001) / 10);
|
||||
string_replace(tile_filename, "<UVTILE>", string_printf("u%d_v%d", u + 1, v + 1));
|
||||
}
|
||||
const size_t slot = add_image_slot(new OIIOImageLoader(tile_filename), params, false);
|
||||
handle.slots.push_back(slot);
|
||||
handle.tile_slots.push_back(slot);
|
||||
}
|
||||
|
||||
return handle;
|
||||
@@ -430,7 +417,7 @@ ImageHandle ImageManager::add_image(ImageLoader *loader,
|
||||
const size_t slot = add_image_slot(loader, params, builtin);
|
||||
|
||||
ImageHandle handle;
|
||||
handle.slots.push_back(slot);
|
||||
handle.tile_slots.push_back(slot);
|
||||
handle.manager = this;
|
||||
return handle;
|
||||
}
|
||||
@@ -439,11 +426,9 @@ ImageHandle ImageManager::add_image(const vector<ImageLoader *> &loaders,
|
||||
const ImageParams ¶ms)
|
||||
{
|
||||
ImageHandle handle;
|
||||
handle.is_tiled = true;
|
||||
|
||||
for (ImageLoader *loader : loaders) {
|
||||
const size_t slot = add_image_slot(loader, params, true);
|
||||
handle.slots.push_back(slot);
|
||||
handle.tile_slots.push_back(slot);
|
||||
}
|
||||
|
||||
handle.manager = this;
|
||||
@@ -523,13 +508,6 @@ void ImageManager::remove_image_user(size_t slot)
|
||||
}
|
||||
}
|
||||
|
||||
ImageManager::Image *ImageManager::get_image_slot(const size_t slot)
|
||||
{
|
||||
/* Need mutex lock, images vector might get resized by another thread. */
|
||||
const thread_scoped_lock device_lock(images_mutex);
|
||||
return images[slot];
|
||||
}
|
||||
|
||||
static bool image_associate_alpha(ImageManager::Image *img)
|
||||
{
|
||||
/* For typical RGBA images we let OIIO convert to associated alpha,
|
||||
|
||||
@@ -146,20 +146,18 @@ class ImageHandle {
|
||||
|
||||
bool empty() const;
|
||||
int num_tiles() const;
|
||||
int num_svm_slots() const;
|
||||
|
||||
ImageMetaData metadata();
|
||||
int svm_slot(const int slot_index = 0) const;
|
||||
int svm_slot(const int tile_index = 0) const;
|
||||
vector<int4> get_svm_slots() const;
|
||||
device_texture *image_memory() const;
|
||||
device_texture *image_memory(const int tile_index = 0) const;
|
||||
|
||||
VDBImageLoader *vdb_loader() const;
|
||||
VDBImageLoader *vdb_loader(const int tile_index = 0) const;
|
||||
|
||||
ImageManager *get_manager() const;
|
||||
|
||||
protected:
|
||||
vector<size_t> slots;
|
||||
bool is_tiled = false;
|
||||
vector<size_t> tile_slots;
|
||||
ImageManager *manager;
|
||||
|
||||
friend class ImageManager;
|
||||
@@ -229,7 +227,6 @@ class ImageManager {
|
||||
size_t add_image_slot(ImageLoader *loader, const ImageParams ¶ms, const bool builtin);
|
||||
void add_image_user(size_t slot);
|
||||
void remove_image_user(size_t slot);
|
||||
Image *get_image_slot(const size_t slot);
|
||||
|
||||
void load_image_metadata(Image *img);
|
||||
|
||||
|
||||
@@ -95,8 +95,6 @@ NODE_DEFINE(Object)
|
||||
SOCKET_BOOLEAN(is_caustics_caster, "Cast Shadow Caustics", false);
|
||||
SOCKET_BOOLEAN(is_caustics_receiver, "Receive Shadow Caustics", false);
|
||||
|
||||
SOCKET_BOOLEAN(is_bake_target, "Bake Target", false);
|
||||
|
||||
SOCKET_NODE(particle_system, "Particle System", ParticleSystem::get_node_type());
|
||||
SOCKET_INT(particle_index, "Particle Index", 0);
|
||||
|
||||
@@ -576,8 +574,8 @@ void ObjectManager::device_update_object_transform(UpdateObjectTransformState *s
|
||||
kobject.dupli_generated[2] = ob->dupli_generated[2];
|
||||
kobject.dupli_uv[0] = ob->dupli_uv[0];
|
||||
kobject.dupli_uv[1] = ob->dupli_uv[1];
|
||||
kobject.num_geom_steps = (geom->get_motion_steps() - 1) / 2;
|
||||
kobject.num_tfm_steps = ob->motion.size();
|
||||
int totalsteps = geom->get_motion_steps();
|
||||
kobject.numsteps = (totalsteps - 1) / 2;
|
||||
kobject.numverts = (geom->geometry_type == Geometry::MESH ||
|
||||
geom->geometry_type == Geometry::VOLUME) ?
|
||||
static_cast<Mesh *>(geom)->get_verts().size() :
|
||||
@@ -1051,11 +1049,9 @@ void ObjectManager::apply_static_transforms(DeviceScene *dscene, Scene *scene, P
|
||||
Mesh *mesh = static_cast<Mesh *>(geom);
|
||||
apply = apply && mesh->get_subdivision_type() == Mesh::SUBDIVISION_NONE;
|
||||
}
|
||||
else if ((geom->geometry_type == Geometry::HAIR) ||
|
||||
(geom->geometry_type == Geometry::POINTCLOUD))
|
||||
{
|
||||
/* Can't apply non-uniform scale to curves and points, this can't be
|
||||
* represented by control points and radius alone. */
|
||||
else if (geom->geometry_type == Geometry::HAIR) {
|
||||
/* Can't apply non-uniform scale to curves, this can't be represented by
|
||||
* control points and radius alone. */
|
||||
float scale;
|
||||
apply = apply && transform_uniform_scale(object->tfm, scale);
|
||||
}
|
||||
|
||||
@@ -60,8 +60,6 @@ class Object : public Node {
|
||||
NODE_SOCKET_API(bool, is_caustics_caster)
|
||||
NODE_SOCKET_API(bool, is_caustics_receiver)
|
||||
|
||||
NODE_SOCKET_API(bool, is_bake_target)
|
||||
|
||||
NODE_SOCKET_API(float3, dupli_generated)
|
||||
NODE_SOCKET_API(float2, dupli_uv)
|
||||
|
||||
|
||||
@@ -45,7 +45,7 @@ int OSLShaderManager::ss_shared_users = 0;
|
||||
thread_mutex OSLShaderManager::ss_shared_mutex;
|
||||
thread_mutex OSLShaderManager::ss_mutex;
|
||||
|
||||
std::atomic<int> OSLCompiler::texture_shared_unique_id = 0;
|
||||
int OSLCompiler::texture_shared_unique_id = 0;
|
||||
|
||||
/* Shader Manager */
|
||||
|
||||
|
||||
@@ -5,8 +5,6 @@
|
||||
#ifndef __OSL_H__
|
||||
#define __OSL_H__
|
||||
|
||||
#include <atomic>
|
||||
|
||||
#include "util/array.h"
|
||||
#include "util/set.h"
|
||||
#include "util/string.h"
|
||||
@@ -180,7 +178,7 @@ class OSLCompiler {
|
||||
ShaderType current_type;
|
||||
Shader *current_shader;
|
||||
|
||||
static std::atomic<int> texture_shared_unique_id;
|
||||
static int texture_shared_unique_id;
|
||||
};
|
||||
|
||||
CCL_NAMESPACE_END
|
||||
|
||||
@@ -115,11 +115,6 @@ void PointCloud::reserve(int numpoints)
|
||||
attributes.resize(true);
|
||||
}
|
||||
|
||||
void PointCloud::clear_non_sockets()
|
||||
{
|
||||
Geometry::clear(true);
|
||||
}
|
||||
|
||||
void PointCloud::clear(const bool preserve_shaders)
|
||||
{
|
||||
Geometry::clear(preserve_shaders);
|
||||
|
||||
@@ -51,7 +51,6 @@ class PointCloud : public Geometry {
|
||||
~PointCloud();
|
||||
|
||||
/* Geometry */
|
||||
void clear_non_sockets();
|
||||
void clear(const bool preserver_shaders = false) override;
|
||||
|
||||
void resize(int numpoints);
|
||||
|
||||
@@ -263,6 +263,7 @@ ImageTextureNode::ImageTextureNode() : ImageSlotTextureNode(get_node_type())
|
||||
{
|
||||
colorspace = u_colorspace_raw;
|
||||
animated = false;
|
||||
tiles.push_back_slow(1001);
|
||||
}
|
||||
|
||||
ShaderNode *ImageTextureNode::clone(ShaderGraph *graph) const
|
||||
@@ -288,10 +289,8 @@ void ImageTextureNode::cull_tiles(Scene *scene, ShaderGraph *graph)
|
||||
/* Box projection computes its own UVs that always lie in the
|
||||
* 1001 tile, so there's no point in loading any others. */
|
||||
if (projection == NODE_IMAGE_PROJ_BOX) {
|
||||
if (tiles.size()) {
|
||||
tiles.clear();
|
||||
tiles.push_back_slow(1001);
|
||||
}
|
||||
tiles.clear();
|
||||
tiles.push_back_slow(1001);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -302,8 +301,8 @@ void ImageTextureNode::cull_tiles(Scene *scene, ShaderGraph *graph)
|
||||
return;
|
||||
}
|
||||
|
||||
/* Only check UVs for tile culling when using tiles. */
|
||||
if (tiles.size() == 0) {
|
||||
/* Only check UVs for tile culling if there are multiple tiles. */
|
||||
if (tiles.size() < 2) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -398,7 +397,7 @@ void ImageTextureNode::compile(SVMCompiler &compiler)
|
||||
if (projection != NODE_IMAGE_PROJ_BOX) {
|
||||
/* If there only is one image (a very common case), we encode it as a negative value. */
|
||||
int num_nodes;
|
||||
if (handle.num_tiles() == 0) {
|
||||
if (handle.num_tiles() == 1) {
|
||||
num_nodes = -handle.svm_slot();
|
||||
}
|
||||
else {
|
||||
@@ -431,7 +430,7 @@ void ImageTextureNode::compile(SVMCompiler &compiler)
|
||||
}
|
||||
}
|
||||
else {
|
||||
assert(handle.num_svm_slots() == 1);
|
||||
assert(handle.num_tiles() == 1);
|
||||
compiler.add_node(NODE_TEX_IMAGE_BOX,
|
||||
handle.svm_slot(),
|
||||
compiler.encode_uchar4(vector_offset,
|
||||
@@ -473,7 +472,7 @@ void ImageTextureNode::compile(OSLCompiler &compiler)
|
||||
alpha_type == IMAGE_ALPHA_IGNORE);
|
||||
const bool is_tiled = (filename.find("<UDIM>") != string::npos ||
|
||||
filename.find("<UVTILE>") != string::npos) ||
|
||||
handle.num_tiles() > 0;
|
||||
handle.num_tiles() > 1;
|
||||
|
||||
compiler.parameter(this, "projection");
|
||||
compiler.parameter(this, "projection_blend");
|
||||
|
||||
@@ -97,9 +97,8 @@ static int add_vertex(int3 v,
|
||||
int3 res,
|
||||
unordered_map<size_t, int> &used_verts)
|
||||
{
|
||||
const size_t vert_key = v.x + v.y * size_t(res.x + 1) +
|
||||
v.z * size_t(res.x + 1) * size_t(res.y + 1);
|
||||
const unordered_map<size_t, int>::iterator it = used_verts.find(vert_key);
|
||||
size_t vert_key = v.x + v.y * (res.x + 1) + v.z * (res.x + 1) * (res.y + 1);
|
||||
unordered_map<size_t, int>::iterator it = used_verts.find(vert_key);
|
||||
|
||||
if (it != used_verts.end()) {
|
||||
return it->second;
|
||||
@@ -688,10 +687,6 @@ void GeometryManager::create_volume_mesh(const Scene *scene, Volume *volume, Pro
|
||||
|
||||
ImageHandle &handle = attr.data_voxel();
|
||||
|
||||
if (handle.empty()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
/* Try building from OpenVDB grid directly. */
|
||||
VDBImageLoader *vdb_loader = handle.vdb_loader();
|
||||
openvdb::GridBase::ConstPtr grid;
|
||||
|
||||
@@ -6,7 +6,6 @@
|
||||
#include "util/algorithm.h"
|
||||
#include "util/foreach.h"
|
||||
#include "util/set.h"
|
||||
#include <chrono>
|
||||
|
||||
CCL_NAMESPACE_BEGIN
|
||||
|
||||
|
||||
@@ -161,22 +161,21 @@ DWORD GHOST_DropTargetWin32::allowedDropEffect(DWORD dw_allowed)
|
||||
|
||||
GHOST_TDragnDropTypes GHOST_DropTargetWin32::getGhostType(IDataObject *p_data_object)
|
||||
{
|
||||
/* File-names. Prefer looking for the CF_HDROP data format first as certain file-manager
|
||||
* applications send CF_TEXT as well. See issue #135672. */
|
||||
FORMATETC fmtetc = {CF_HDROP, 0, DVASPECT_CONTENT, -1, TYMED_HGLOBAL};
|
||||
if (p_data_object->QueryGetData(&fmtetc) == S_OK) {
|
||||
return GHOST_kDragnDropTypeFilenames;
|
||||
}
|
||||
|
||||
/* Text
|
||||
* NOTE: Unicode text is available as CF_TEXT too, the system can do the
|
||||
* conversion, but we do the conversion our self with #WC_NO_BEST_FIT_CHARS.
|
||||
*/
|
||||
fmtetc.cfFormat = CF_TEXT;
|
||||
FORMATETC fmtetc = {CF_TEXT, 0, DVASPECT_CONTENT, -1, TYMED_HGLOBAL};
|
||||
if (p_data_object->QueryGetData(&fmtetc) == S_OK) {
|
||||
return GHOST_kDragnDropTypeString;
|
||||
}
|
||||
|
||||
/* Files-names. */
|
||||
fmtetc.cfFormat = CF_HDROP;
|
||||
if (p_data_object->QueryGetData(&fmtetc) == S_OK) {
|
||||
return GHOST_kDragnDropTypeFilenames;
|
||||
}
|
||||
|
||||
return GHOST_kDragnDropTypeUnknown;
|
||||
}
|
||||
|
||||
|
||||
@@ -5320,20 +5320,7 @@ static bool xkb_compose_state_feed_and_get_utf8(
|
||||
const int utf8_buf_compose_len = xkb_compose_state_get_utf8(
|
||||
compose_state, utf8_buf_compose, sizeof(utf8_buf_compose));
|
||||
if (utf8_buf_compose_len > 0) {
|
||||
if (utf8_buf_compose_len > sizeof(GHOST_TEventKeyData::utf8_buf)) {
|
||||
/* TODO(@ideasman42): keyboard events in GHOST only support a single character.
|
||||
*
|
||||
* - In the case XKB compose enters multiple code-points only the first will be used.
|
||||
*
|
||||
* - Besides supporting multiple characters per key input,
|
||||
* one possible solution would be to generate an IME event.
|
||||
*
|
||||
* - In practice I'm not sure how common these are.
|
||||
* So far no bugs have been reported about this.
|
||||
*/
|
||||
CLOG_WARN(LOG, "key (compose_size=%d) exceeds the maximum size", utf8_buf_compose_len);
|
||||
}
|
||||
memcpy(r_utf8_buf, utf8_buf_compose, sizeof(GHOST_TEventKeyData::utf8_buf));
|
||||
memcpy(r_utf8_buf, utf8_buf_compose, utf8_buf_compose_len);
|
||||
handled = true;
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -239,7 +239,7 @@ bool autokeyframe_cfra_can_key(const Scene *scene, ID *id);
|
||||
*
|
||||
* \param rna_paths: Only inserts keys on those RNA paths.
|
||||
*/
|
||||
void autokeyframe_object(bContext *C, const Scene *scene, Object *ob, Span<RNAPath> rna_paths);
|
||||
void autokeyframe_object(bContext *C, Scene *scene, Object *ob, Span<RNAPath> rna_paths);
|
||||
/**
|
||||
* Auto-keyframing feature - for objects
|
||||
*
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
|
||||
namespace blender::animrig {
|
||||
|
||||
static eInsertKeyFlags get_autokey_flags(const Scene *scene)
|
||||
static eInsertKeyFlags get_autokey_flags(Scene *scene)
|
||||
{
|
||||
eInsertKeyFlags flag = INSERTKEY_NOFLAGS;
|
||||
|
||||
@@ -104,7 +104,7 @@ bool autokeyframe_cfra_can_key(const Scene *scene, ID *id)
|
||||
return true;
|
||||
}
|
||||
|
||||
void autokeyframe_object(bContext *C, const Scene *scene, Object *ob, Span<RNAPath> rna_paths)
|
||||
void autokeyframe_object(bContext *C, Scene *scene, Object *ob, Span<RNAPath> rna_paths)
|
||||
{
|
||||
BLI_assert(ob != nullptr);
|
||||
BLI_assert(scene != nullptr);
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
|
||||
namespace blender::asset_system::tests {
|
||||
|
||||
/* UUIDs from tests/files/asset_library/blender_assets.cats.txt */
|
||||
/* UUIDs from tests/data/asset_library/blender_assets.cats.txt */
|
||||
const bUUID UUID_ID_WITHOUT_PATH("e34dd2c5-5d2e-4668-9794-1db5de2a4f71");
|
||||
const bUUID UUID_POSES_ELLIE("df60e1f6-2259-475b-93d9-69a1b4a8db78");
|
||||
const bUUID UUID_POSES_ELLIE_WHITESPACE("b06132f6-5687-4751-a6dd-392740eb3c46");
|
||||
@@ -33,7 +33,7 @@ const bUUID UUID_POSES_RUZENA_FACE("82162c1f-06cc-4d91-a9bf-4f72c104e348");
|
||||
const bUUID UUID_WITHOUT_SIMPLENAME("d7916a31-6ca9-4909-955f-182ca2b81fa3");
|
||||
const bUUID UUID_ANOTHER_RUZENA("00000000-d9fa-4b91-b704-e6af1f1339ef");
|
||||
|
||||
/* UUIDs from tests/files/asset_library/modified_assets.cats.txt */
|
||||
/* UUIDs from tests/data/asset_library/modified_assets.cats.txt */
|
||||
const bUUID UUID_AGENT_47("c5744ba5-43f5-4f73-8e52-010ad4a61b34");
|
||||
|
||||
/* Subclass that adds accessors such that protected fields can be used in tests. */
|
||||
|
||||
@@ -384,7 +384,6 @@ static void write_slots(BlendWriter *writer, Span<animrig::Slot *> slots)
|
||||
BLO_write_struct_at_address(writer, ActionSlot, slot, &shallow_copy);
|
||||
}
|
||||
}
|
||||
#endif /* WITH_ANIM_BAKLAVA */
|
||||
|
||||
/**
|
||||
* Create a listbase from a Span of channel groups.
|
||||
@@ -577,6 +576,7 @@ static void action_blend_write(BlendWriter *writer, ID *id, const void *id_addre
|
||||
}
|
||||
|
||||
#ifdef WITH_ANIM_BAKLAVA
|
||||
|
||||
static void read_channelbag(BlendDataReader *reader, animrig::ChannelBag &channelbag)
|
||||
{
|
||||
BLO_read_pointer_array(
|
||||
|
||||
@@ -184,16 +184,7 @@ static bool binary_search_anim_path(const float *accum_len_arr,
|
||||
int cur_idx = 0, cur_base = 0;
|
||||
int cur_step = seg_size - 1;
|
||||
|
||||
/* Special case, for a single segment accessing the `right_len`
|
||||
* would be an invalid index, see: #132976. */
|
||||
if (UNLIKELY(seg_size == 1)) {
|
||||
*r_idx = 0;
|
||||
*r_frac = goal_len / accum_len_arr[0];
|
||||
return true;
|
||||
}
|
||||
|
||||
while (true) {
|
||||
BLI_assert(cur_idx + 1 < seg_size);
|
||||
cur_idx = cur_base + cur_step / 2;
|
||||
left_len = accum_len_arr[cur_idx];
|
||||
right_len = accum_len_arr[cur_idx + 1];
|
||||
|
||||
@@ -75,11 +75,6 @@ static struct {
|
||||
char temp_dirname_base[FILE_MAX];
|
||||
/** Volatile temporary directory (owned by Blender, removed on exit). */
|
||||
char temp_dirname_session[FILE_MAX];
|
||||
/**
|
||||
* True when this is a sub-directory owned & created by Blender,
|
||||
* false when a session directory couldn't be created - in this case don't delete it.
|
||||
*/
|
||||
bool temp_dirname_session_can_be_deleted;
|
||||
} g_app{};
|
||||
|
||||
/** \} */
|
||||
@@ -1143,19 +1138,16 @@ void BKE_appdir_app_templates(ListBase *templates)
|
||||
* \param tempdir_maxncpy: The size of the \a tempdir buffer.
|
||||
* \param userdir: Directory specified in user preferences (may be nullptr).
|
||||
* note that by default this is an empty string, only use when non-empty.
|
||||
*
|
||||
* \return true if `userdir` is used.
|
||||
*/
|
||||
static bool where_is_temp(char *tempdir, const size_t tempdir_maxncpy, const char *userdir)
|
||||
static void where_is_temp(char *tempdir, const size_t tempdir_maxncpy, const char *userdir)
|
||||
{
|
||||
if (userdir && BLI_temp_directory_path_copy_if_valid(tempdir, tempdir_maxncpy, userdir)) {
|
||||
return true;
|
||||
return;
|
||||
}
|
||||
BLI_temp_directory_path_get(tempdir, tempdir_maxncpy);
|
||||
return false;
|
||||
}
|
||||
|
||||
static bool tempdir_session_create(char *tempdir_session,
|
||||
static void tempdir_session_create(char *tempdir_session,
|
||||
const size_t tempdir_session_maxncpy,
|
||||
const char *tempdir)
|
||||
{
|
||||
@@ -1184,12 +1176,15 @@ static bool tempdir_session_create(char *tempdir_session,
|
||||
if (BLI_is_dir(tempdir_session)) {
|
||||
BLI_path_slash_ensure(tempdir_session, tempdir_session_maxncpy);
|
||||
/* Success. */
|
||||
return true;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
CLOG_WARN(&LOG, "Could not generate a temp file name for '%s'", tempdir_session);
|
||||
return false;
|
||||
CLOG_WARN(&LOG,
|
||||
"Could not generate a temp file name for '%s', falling back to '%s'",
|
||||
tempdir_session,
|
||||
tempdir);
|
||||
BLI_strncpy(tempdir_session, tempdir, tempdir_session_maxncpy);
|
||||
}
|
||||
|
||||
void BKE_tempdir_init(const char *userdir)
|
||||
@@ -1199,44 +1194,13 @@ void BKE_tempdir_init(const char *userdir)
|
||||
* Sets #g_app.temp_dirname_session to a #mkdtemp
|
||||
* generated sub-dir of #g_app.temp_dirname_base. */
|
||||
|
||||
where_is_temp(g_app.temp_dirname_base, sizeof(g_app.temp_dirname_base), userdir);
|
||||
|
||||
/* Clear existing temp dir, if needed. */
|
||||
BKE_tempdir_session_purge();
|
||||
|
||||
/* Perform two passes, the first pass for the user preference path,
|
||||
* then a second pass if the the preferences failed to create the *session* sub-directory.
|
||||
*
|
||||
* This avoid problems if the preferences points to a path without write access,
|
||||
* `C:\` or `/` for example. */
|
||||
g_app.temp_dirname_session_can_be_deleted = false;
|
||||
for (int pass = 0; pass < 2; pass += 1) {
|
||||
const bool from_userdir = where_is_temp(
|
||||
g_app.temp_dirname_base, sizeof(g_app.temp_dirname_base), pass == 0 ? userdir : nullptr);
|
||||
|
||||
/* Now that we have a valid temp dir, add system-generated unique sub-dir. */
|
||||
if (tempdir_session_create(g_app.temp_dirname_session,
|
||||
sizeof(g_app.temp_dirname_session),
|
||||
g_app.temp_dirname_base))
|
||||
{
|
||||
/* Created the session sub-directory. */
|
||||
g_app.temp_dirname_session_can_be_deleted = true;
|
||||
break;
|
||||
}
|
||||
|
||||
/* Only perform the second pass if the `userdir` was used
|
||||
* and failed to created the sub-directory. */
|
||||
if (from_userdir == false) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (UNLIKELY(g_app.temp_dirname_session_can_be_deleted == false)) {
|
||||
/* This should practically never happen as either the preferences or the systems
|
||||
* default temporary directory should be usable, if not, use the base directory and warn. */
|
||||
STRNCPY(g_app.temp_dirname_session, g_app.temp_dirname_base);
|
||||
CLOG_WARN(&LOG,
|
||||
"Could not generate a temp session subdirectory, falling back to '%s'",
|
||||
g_app.temp_dirname_base);
|
||||
}
|
||||
/* Now that we have a valid temp dir, add system-generated unique sub-dir. */
|
||||
tempdir_session_create(
|
||||
g_app.temp_dirname_session, sizeof(g_app.temp_dirname_session), g_app.temp_dirname_base);
|
||||
}
|
||||
|
||||
const char *BKE_tempdir_session()
|
||||
@@ -1251,11 +1215,6 @@ const char *BKE_tempdir_base()
|
||||
|
||||
void BKE_tempdir_session_purge()
|
||||
{
|
||||
if (g_app.temp_dirname_session_can_be_deleted == false) {
|
||||
/* It's possible this path references an arbitrary location
|
||||
* in that case *never* recursively remove, see: #139585. */
|
||||
return;
|
||||
}
|
||||
if (g_app.temp_dirname_session[0] && BLI_is_dir(g_app.temp_dirname_session)) {
|
||||
BLI_delete(g_app.temp_dirname_session, true, true);
|
||||
}
|
||||
|
||||
@@ -644,11 +644,10 @@ void BKE_curve_calc_modifiers_pre(Depsgraph *depsgraph,
|
||||
static bool do_curve_implicit_mesh_conversion(const Curve *curve,
|
||||
ModifierData *first_modifier,
|
||||
const Scene *scene,
|
||||
const ModifierMode required_mode,
|
||||
const bool editmode)
|
||||
const ModifierMode required_mode)
|
||||
{
|
||||
/* Skip implicit filling and conversion to mesh when using "fast text editing". */
|
||||
if ((curve->flag & CU_FAST) && editmode) {
|
||||
if (curve->flag & CU_FAST) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -711,9 +710,7 @@ static blender::bke::GeometrySet curve_calc_modifiers_post(Depsgraph *depsgraph,
|
||||
pretessellatePoint->next;
|
||||
|
||||
blender::bke::GeometrySet geometry_set;
|
||||
if (ob->type == OB_SURF ||
|
||||
do_curve_implicit_mesh_conversion(cu, md, scene, required_mode, editmode))
|
||||
{
|
||||
if (ob->type == OB_SURF || do_curve_implicit_mesh_conversion(cu, md, scene, required_mode)) {
|
||||
Mesh *mesh = BKE_mesh_new_nomain_from_curve_displist(ob, dispbase);
|
||||
geometry_set.replace_mesh(mesh);
|
||||
}
|
||||
|
||||
@@ -3981,7 +3981,7 @@ static void fluid_modifier_processDomain(FluidModifierData *fmd,
|
||||
has_config = manta_read_config(fds->fluid, fmd, data_frame);
|
||||
}
|
||||
|
||||
if (with_smoke || with_liquid) {
|
||||
if (with_smoke) {
|
||||
/* Read config and realloc fluid object if needed. */
|
||||
if (has_config && manta_needs_realloc(fds->fluid, fmd)) {
|
||||
BKE_fluid_reallocate_fluid(fds, fds->res, 1);
|
||||
|
||||
@@ -1712,7 +1712,6 @@ struct StampDataCustomField {
|
||||
|
||||
struct StampData {
|
||||
char file[512];
|
||||
char filename[512];
|
||||
char note[512];
|
||||
char date[512];
|
||||
char marker[512];
|
||||
@@ -1750,12 +1749,8 @@ static void stampdata(
|
||||
if (scene->r.stamp & R_STAMP_FILENAME) {
|
||||
const char *blendfile_path = BKE_main_blendfile_path_from_global();
|
||||
SNPRINTF(stamp_data->file,
|
||||
do_prefix ? "Path %s" : "%s",
|
||||
(blendfile_path[0] != '\0') ? blendfile_path : "<unsaved>");
|
||||
|
||||
const char* filename = BLI_path_basename(blendfile_path);
|
||||
SNPRINTF(stamp_data->filename,
|
||||
do_prefix ? "File %s" : "%s", (filename[0] != '\0') ? filename : "<untitled>");
|
||||
do_prefix ? "File %s" : "%s",
|
||||
(blendfile_path[0] != '\0') ? blendfile_path : "<untitled>");
|
||||
}
|
||||
else {
|
||||
stamp_data->file[0] = '\0';
|
||||
@@ -2096,28 +2091,6 @@ void BKE_image_stamp_buf(Scene *scene,
|
||||
/* Top left corner */
|
||||
y -= h;
|
||||
|
||||
/* also a little of space to the background. */
|
||||
buf_rectfill_area(rect,
|
||||
rectf,
|
||||
width,
|
||||
height,
|
||||
scene->r.bg_stamp,
|
||||
display,
|
||||
x - BUFF_MARGIN_X,
|
||||
y - BUFF_MARGIN_Y,
|
||||
w + BUFF_MARGIN_X,
|
||||
y + h + BUFF_MARGIN_Y);
|
||||
|
||||
/* and draw the text. */
|
||||
BLF_position(mono, x, y + y_ofs, 0.0);
|
||||
BLF_draw_buffer(mono, stamp_data.filename, sizeof(stamp_data.filename));
|
||||
|
||||
/* the extra pixel for background. */
|
||||
y -= BUFF_MARGIN_Y * 2;
|
||||
|
||||
/* Draw file *path* here, under the basename */
|
||||
y -= h;
|
||||
|
||||
/* also a little of space to the background. */
|
||||
buf_rectfill_area(rect,
|
||||
rectf,
|
||||
@@ -2231,29 +2204,6 @@ void BKE_image_stamp_buf(Scene *scene,
|
||||
}
|
||||
|
||||
/* Top left corner, below: File, Date, Memory, Render-time, Host-name. */
|
||||
if (TEXT_SIZE_CHECK(stamp_data.frame, w, h)) {
|
||||
y -= h;
|
||||
|
||||
/* and space for background. */
|
||||
buf_rectfill_area(rect,
|
||||
rectf,
|
||||
width,
|
||||
height,
|
||||
scene->r.bg_stamp,
|
||||
display,
|
||||
0,
|
||||
y - BUFF_MARGIN_Y,
|
||||
w + BUFF_MARGIN_X,
|
||||
y + h + BUFF_MARGIN_Y);
|
||||
|
||||
BLF_position(mono, x, y + y_ofs, 0.0);
|
||||
BLF_draw_buffer(mono, stamp_data.frame, sizeof(stamp_data.frame));
|
||||
|
||||
/* the extra pixel for background. */
|
||||
y -= BUFF_MARGIN_Y * 2;
|
||||
}
|
||||
|
||||
/* Top left corner, below File, Date, Memory, Rendertime, Hostname */
|
||||
BLF_enable(mono, BLF_WORD_WRAP);
|
||||
if (TEXT_SIZE_CHECK_WORD_WRAP(stamp_data.note, w, h)) {
|
||||
y -= h;
|
||||
|
||||
@@ -148,17 +148,6 @@ bool BKE_image_save_options_init(ImageSaveOptions *opts,
|
||||
* by the image saving code itself. */
|
||||
BKE_image_user_file_path_ex(bmain, iuser, ima, opts->filepath, false, false);
|
||||
|
||||
/* For movies, replace extension and add the frame number to avoid writing over the movie file
|
||||
* itself and provide a good default file path. */
|
||||
if (ima->source == IMA_SRC_MOVIE) {
|
||||
char filepath_no_ext[FILE_MAX];
|
||||
STRNCPY(filepath_no_ext, opts->filepath);
|
||||
BLI_path_extension_strip(filepath_no_ext);
|
||||
SNPRINTF(opts->filepath, "%s_%.*d", filepath_no_ext, 4, ibuf->fileframe);
|
||||
BKE_image_path_ext_from_imformat_ensure(
|
||||
opts->filepath, sizeof(opts->filepath), &opts->im_format);
|
||||
}
|
||||
|
||||
/* sanitize all settings */
|
||||
|
||||
/* unlikely but just in case */
|
||||
@@ -397,7 +386,6 @@ static bool image_save_single(ReportList *reports,
|
||||
if (rr == nullptr) {
|
||||
if (imf->imtype == R_IMF_IMTYPE_MULTILAYER) {
|
||||
BKE_report(reports, RPT_ERROR, "Did not write, no Multilayer Image");
|
||||
BKE_image_release_renderresult(opts->scene, ima, rr);
|
||||
BKE_image_release_ibuf(ima, ibuf, lock);
|
||||
return ok;
|
||||
}
|
||||
@@ -410,8 +398,8 @@ static bool image_save_single(ReportList *reports,
|
||||
R"(Did not write, the image doesn't have a "%s" and "%s" views)",
|
||||
STEREO_LEFT_NAME,
|
||||
STEREO_RIGHT_NAME);
|
||||
BKE_image_release_renderresult(opts->scene, ima, rr);
|
||||
BKE_image_release_ibuf(ima, ibuf, lock);
|
||||
BKE_image_release_renderresult(opts->scene, ima, rr);
|
||||
return ok;
|
||||
}
|
||||
|
||||
@@ -424,8 +412,8 @@ static bool image_save_single(ReportList *reports,
|
||||
R"(Did not write, the image doesn't have a "%s" and "%s" views)",
|
||||
STEREO_LEFT_NAME,
|
||||
STEREO_RIGHT_NAME);
|
||||
BKE_image_release_renderresult(opts->scene, ima, rr);
|
||||
BKE_image_release_ibuf(ima, ibuf, lock);
|
||||
BKE_image_release_renderresult(opts->scene, ima, rr);
|
||||
return ok;
|
||||
}
|
||||
}
|
||||
@@ -437,7 +425,6 @@ static bool image_save_single(ReportList *reports,
|
||||
/* save render result */
|
||||
ok = BKE_image_render_write_exr(
|
||||
reports, rr, opts->filepath, imf, save_as_render, nullptr, layer);
|
||||
BKE_image_release_renderresult(opts->scene, ima, rr);
|
||||
image_save_post(reports, ima, ibuf, ok, opts, true, opts->filepath, r_colorspace_changed);
|
||||
BKE_image_release_ibuf(ima, ibuf, lock);
|
||||
}
|
||||
@@ -452,7 +439,6 @@ static bool image_save_single(ReportList *reports,
|
||||
ok = BKE_imbuf_write_as(colormanaged_ibuf, opts->filepath, imf, save_copy);
|
||||
imbuf_save_post(ibuf, colormanaged_ibuf);
|
||||
}
|
||||
BKE_image_release_renderresult(opts->scene, ima, rr);
|
||||
image_save_post(reports,
|
||||
ima,
|
||||
ibuf,
|
||||
@@ -520,8 +506,6 @@ static bool image_save_single(ReportList *reports,
|
||||
ok &= ok_view;
|
||||
}
|
||||
|
||||
BKE_image_release_renderresult(opts->scene, ima, rr);
|
||||
|
||||
if (is_exr_rr) {
|
||||
BKE_image_release_ibuf(ima, ibuf, lock);
|
||||
}
|
||||
@@ -531,7 +515,6 @@ static bool image_save_single(ReportList *reports,
|
||||
if (imf->imtype == R_IMF_IMTYPE_MULTILAYER) {
|
||||
ok = BKE_image_render_write_exr(
|
||||
reports, rr, opts->filepath, imf, save_as_render, nullptr, layer);
|
||||
BKE_image_release_renderresult(opts->scene, ima, rr);
|
||||
image_save_post(reports, ima, ibuf, ok, opts, true, opts->filepath, r_colorspace_changed);
|
||||
BKE_image_release_ibuf(ima, ibuf, lock);
|
||||
}
|
||||
@@ -604,13 +587,11 @@ static bool image_save_single(ReportList *reports,
|
||||
for (int i = 0; i < 2; i++) {
|
||||
IMB_freeImBuf(ibuf_stereo[i]);
|
||||
}
|
||||
|
||||
BKE_image_release_renderresult(opts->scene, ima, rr);
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
||||
if (rr) {
|
||||
BKE_image_release_renderresult(opts->scene, ima, rr);
|
||||
BKE_image_release_ibuf(ima, ibuf, lock);
|
||||
}
|
||||
|
||||
return ok;
|
||||
|
||||
@@ -4338,7 +4338,6 @@ void BKE_lib_override_library_validate(Main *bmain, ID *id, ReportList *reports)
|
||||
* properly 'liboverride embedded' IDs, like root node-trees, or shape-keys. */
|
||||
if (!override_library_is_valid(*liboverride_id, *liboverride, reports)) {
|
||||
BKE_lib_override_library_make_local(nullptr, liboverride_id);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -842,12 +842,7 @@ static bool lib_query_unused_ids_tag_recurse(ID *id, UnusedIDsData &data)
|
||||
id_relations->tags |= MAINIDRELATIONS_ENTRY_TAGS_PROCESSED;
|
||||
}
|
||||
|
||||
/* If that ID is part of a dependency loop, but it does have a valid user (which is not part of
|
||||
* that loop), then that dependency loop does not form (or is not part of) an unused archipelago.
|
||||
*
|
||||
* In other words, this current `id` is used, and is therefore a valid user of the 'calling ID'
|
||||
* from previous recursion level.. */
|
||||
return is_part_of_dependency_loop && !has_valid_from_users;
|
||||
return is_part_of_dependency_loop;
|
||||
}
|
||||
|
||||
static void lib_query_unused_ids_tag(UnusedIDsData &data)
|
||||
|
||||
@@ -445,15 +445,11 @@ static void node_foreach_path(ID *id, BPathForeachPathData *bpath_data)
|
||||
for (bNode *node : ntree->all_nodes()) {
|
||||
if (node->type == SH_NODE_SCRIPT) {
|
||||
NodeShaderScript *nss = static_cast<NodeShaderScript *>(node->storage);
|
||||
if (nss->mode == NODE_SCRIPT_EXTERNAL && nss->filepath[0]) {
|
||||
BKE_bpath_foreach_path_fixed_process(bpath_data, nss->filepath, sizeof(nss->filepath));
|
||||
}
|
||||
BKE_bpath_foreach_path_fixed_process(bpath_data, nss->filepath, sizeof(nss->filepath));
|
||||
}
|
||||
else if (node->type == SH_NODE_TEX_IES) {
|
||||
NodeShaderTexIES *ies = static_cast<NodeShaderTexIES *>(node->storage);
|
||||
if (ies->mode == NODE_IES_EXTERNAL && ies->filepath[0]) {
|
||||
BKE_bpath_foreach_path_fixed_process(bpath_data, ies->filepath, sizeof(ies->filepath));
|
||||
}
|
||||
BKE_bpath_foreach_path_fixed_process(bpath_data, ies->filepath, sizeof(ies->filepath));
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -42,7 +42,6 @@
|
||||
|
||||
#include "BKE_callbacks.hh"
|
||||
#include "BLI_blenlib.h"
|
||||
#include "BLI_build_config.h"
|
||||
#include "BLI_math_rotation.h"
|
||||
#include "BLI_string.h"
|
||||
#include "BLI_string_utils.hh"
|
||||
@@ -716,10 +715,6 @@ static void scene_foreach_toolsettings(LibraryForeachIDData *data,
|
||||
do_undo_restore,
|
||||
scene_foreach_paint(data, paint, do_undo_restore, reader, paint_old));
|
||||
|
||||
/* WARNING: Handling this object pointer is fairly intricated, to support both 'regular'
|
||||
* foreach_id processing (in which case both sets of data, current and old, are the same), and
|
||||
* the restore-after-undo cases. It does not have a helper, because so far it is the only case
|
||||
* of having to deal with non-'paint' data in a sub-toolsett struct. */
|
||||
Object *gravity_object = toolsett->sculpt ? toolsett->sculpt->gravity_object : nullptr;
|
||||
Object *gravity_object_old = toolsett_old->sculpt->gravity_object;
|
||||
BKE_LIB_FOREACHID_UNDO_PRESERVE_PROCESS_IDSUPER_P(data,
|
||||
@@ -732,11 +727,7 @@ static void scene_foreach_toolsettings(LibraryForeachIDData *data,
|
||||
if (toolsett->sculpt) {
|
||||
toolsett->sculpt->gravity_object = gravity_object;
|
||||
}
|
||||
/* Do not re-assign `gravity_object_old` object if both current and old data are the same
|
||||
* (foreach_id case), that would nullify assignement above, making remapping cases fail. */
|
||||
if (toolsett_old != toolsett) {
|
||||
toolsett_old->sculpt->gravity_object = gravity_object_old;
|
||||
}
|
||||
toolsett_old->sculpt->gravity_object = gravity_object_old;
|
||||
}
|
||||
if (toolsett_old->gp_paint) {
|
||||
paint = toolsett->gp_paint ? &toolsett->gp_paint->paint : nullptr;
|
||||
@@ -956,22 +947,6 @@ static void scene_foreach_id(ID *id, LibraryForeachIDData *data)
|
||||
}
|
||||
}
|
||||
|
||||
static void scene_foreach_cache(ID *id,
|
||||
IDTypeForeachCacheFunctionCallback function_callback,
|
||||
void *user_data)
|
||||
{
|
||||
Scene *scene = (Scene *)id;
|
||||
IDCacheKey key{};
|
||||
key.id_session_uid = id->session_uid;
|
||||
key.identifier = offsetof(Scene, eevee.light_cache_data);
|
||||
|
||||
function_callback(id,
|
||||
&key,
|
||||
(void **)&scene->eevee.light_cache_data,
|
||||
IDTYPE_CACHE_CB_FLAGS_PERSISTENT,
|
||||
user_data);
|
||||
}
|
||||
|
||||
static bool seq_foreach_path_callback(Sequence *seq, void *user_data)
|
||||
{
|
||||
if (SEQ_HAS_PATH(seq)) {
|
||||
@@ -1027,13 +1002,22 @@ static void scene_foreach_cache(ID *id,
|
||||
Scene *scene = (Scene *)id;
|
||||
if (scene->ed != nullptr) {
|
||||
IDCacheKey key;
|
||||
// IDCacheKey key{};
|
||||
key.id_session_uid = id->session_uid;
|
||||
/* Preserve VSE thumbnail cache across global undo steps. */
|
||||
key.identifier = offsetof(Editing, runtime.thumbnail_cache);
|
||||
key.identifier = offsetof(Scene, eevee.light_cache_data);
|
||||
function_callback(id, &key, (void **)&scene->ed->runtime.thumbnail_cache, 0, user_data);
|
||||
|
||||
function_callback(id,
|
||||
&key,
|
||||
(void **)&scene->eevee.light_cache_data,
|
||||
IDTYPE_CACHE_CB_FLAGS_PERSISTENT,
|
||||
user_data);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static void scene_blend_write(BlendWriter *writer, ID *id, const void *id_address)
|
||||
{
|
||||
Scene *sce = (Scene *)id;
|
||||
|
||||
@@ -155,7 +155,7 @@ static void text_foreach_path(ID *id, BPathForeachPathData *bpath_data)
|
||||
{
|
||||
Text *text = (Text *)id;
|
||||
|
||||
if (text->filepath != nullptr && text->filepath[0] != '\0') {
|
||||
if (text->filepath != nullptr) {
|
||||
BKE_bpath_foreach_path_allocated_process(bpath_data, &text->filepath);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -691,7 +691,7 @@ struct MatView : NonCopyable, NonMovable {
|
||||
|
||||
friend std::ostream &operator<<(std::ostream &stream, const MatView &mat)
|
||||
{
|
||||
return stream << mat.mat;
|
||||
return stream << mat->mat;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -201,7 +201,6 @@ set(SRC
|
||||
BLI_bounds.hh
|
||||
BLI_bounds_types.hh
|
||||
BLI_boxpack_2d.h
|
||||
BLI_build_config.h
|
||||
BLI_buffer.h
|
||||
BLI_build_config.h
|
||||
BLI_cache_mutex.hh
|
||||
@@ -525,7 +524,6 @@ if(WITH_GTESTS)
|
||||
tests/BLI_bit_ref_test.cc
|
||||
tests/BLI_bit_span_test.cc
|
||||
tests/BLI_bit_vector_test.cc
|
||||
tests/BLI_build_config_test.cc
|
||||
tests/BLI_bitmap_test.cc
|
||||
tests/BLI_bounds_test.cc
|
||||
tests/BLI_build_config_test.cc
|
||||
|
||||
@@ -84,7 +84,7 @@ void BLI_task_parallel_mempool(BLI_mempool *mempool,
|
||||
}
|
||||
|
||||
if (use_userdata_chunk) {
|
||||
if (settings->func_free != NULL && userdata_chunk != NULL) {
|
||||
if (settings->func_free != NULL) {
|
||||
/* `func_free` should only free data that was created during execution of `func`. */
|
||||
settings->func_free(userdata, userdata_chunk);
|
||||
}
|
||||
@@ -138,7 +138,7 @@ void BLI_task_parallel_mempool(BLI_mempool *mempool,
|
||||
settings->func_reduce(
|
||||
userdata, userdata_chunk, mempool_iterator_data[i].tls.userdata_chunk);
|
||||
}
|
||||
if (settings->func_free && mempool_iterator_data[i].tls.userdata_chunk != NULL) {
|
||||
if (settings->func_free) {
|
||||
settings->func_free(userdata, mempool_iterator_data[i].tls.userdata_chunk);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -62,7 +62,7 @@ struct RangeTask {
|
||||
|
||||
~RangeTask()
|
||||
{
|
||||
if (settings->func_free != nullptr && userdata_chunk != nullptr) {
|
||||
if (settings->func_free != nullptr) {
|
||||
settings->func_free(userdata, userdata_chunk);
|
||||
}
|
||||
MEM_SAFE_FREE(userdata_chunk);
|
||||
@@ -131,7 +131,7 @@ void BLI_task_parallel_range(const int start,
|
||||
for (int i = start; i < stop; i++) {
|
||||
func(userdata, i, &tls);
|
||||
}
|
||||
if (settings->func_free != nullptr && settings->userdata_chunk != nullptr) {
|
||||
if (settings->func_free != nullptr) {
|
||||
settings->func_free(userdata, settings->userdata_chunk);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@ class BlendfileLoadingTest : public BlendfileLoadingBaseTest {};
|
||||
|
||||
TEST_F(BlendfileLoadingTest, CanaryTest)
|
||||
{
|
||||
/* Load the smallest blend file we have in the tests/files directory. */
|
||||
/* Load the smallest blend file we have in the tests/data directory. */
|
||||
if (!blendfile_load("modifier_stack" SEP_STR "array_test.blend")) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -247,9 +247,6 @@ static void edgetag_add_adjacent_uv(HeapSimple *heap,
|
||||
BMEdge *e_b;
|
||||
BMIter eiter;
|
||||
BM_ITER_ELEM (e_b, &eiter, l_a_verts[i]->v, BM_EDGES_OF_VERT) {
|
||||
if (e_b->l == nullptr) {
|
||||
continue;
|
||||
}
|
||||
BMLoop *l_first, *l_b;
|
||||
l_first = l_b = e_b->l;
|
||||
do {
|
||||
|
||||
@@ -431,15 +431,7 @@ void NodeOperationBuilder::determine_canvases()
|
||||
const rcti &to_canvas = link.to()->get_operation().get_canvas();
|
||||
|
||||
bool needs_conversion;
|
||||
if (link.from()->get_operation().get_flags().is_constant_operation) {
|
||||
/* COM_convert_canvas() below can introduce non-constant transform operations
|
||||
* to the input. This breaks the blur node (see BlurBaseOperation::init_data()),
|
||||
* where it is assumed that if the input operation is constant,
|
||||
* then it will remain constant after computing cavases as well.
|
||||
* So we avoid converting cavases explicitly for such cases. */
|
||||
needs_conversion = false;
|
||||
}
|
||||
else if (link.to()->get_resize_mode() == ResizeMode::Align) {
|
||||
if (link.to()->get_resize_mode() == ResizeMode::Align) {
|
||||
needs_conversion = from_canvas.xmin != to_canvas.xmin ||
|
||||
from_canvas.ymin != to_canvas.ymin;
|
||||
}
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0-or-later */
|
||||
|
||||
#include "BLI_string.h"
|
||||
#include <string>
|
||||
|
||||
#include "DNA_node_types.h"
|
||||
@@ -68,23 +67,6 @@ bool Evaluator::validate_node_tree()
|
||||
return false;
|
||||
}
|
||||
|
||||
for (const bNodeTree *node_tree : derived_node_tree_->used_btrees()) {
|
||||
for (const bNode *node : node_tree->all_nodes()) {
|
||||
/* The poll method of those two nodes perform raw pointer comparisons of node trees, so they
|
||||
* can wrongly fail since the compositor localizes the node tree, changing its pointer value
|
||||
* than the one in the main database. So handle those two nodes. */
|
||||
if (STR_ELEM(node->idname, "CompositorNodeRLayers", "CompositorNodeCryptomatteV2")) {
|
||||
continue;
|
||||
}
|
||||
|
||||
const char *disabled_hint = nullptr;
|
||||
if (!node->typeinfo->poll(node->typeinfo, node_tree, &disabled_hint)) {
|
||||
context_.set_info_message("Compositor node tree has unsupported nodes.");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -20,33 +20,11 @@ namespace blender::realtime_compositor {
|
||||
|
||||
using namespace nodes::derived_node_tree_types;
|
||||
|
||||
/* Returns true if any of the node group nodes that make up this tree context are muted. */
|
||||
static bool is_tree_context_muted(const DTreeContext &tree_context)
|
||||
{
|
||||
/* Root contexts are never muted. */
|
||||
if (tree_context.is_root()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
/* The node group that represents this context is muted. */
|
||||
if (tree_context.parent_node()->is_muted()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
/* Recursively check parent contexts up until the root context. */
|
||||
return is_tree_context_muted(*tree_context.parent_context());
|
||||
}
|
||||
|
||||
/* Add the viewer node which is marked as NODE_DO_OUTPUT in the given context to the given stack.
|
||||
* If no viewer nodes were found, composite nodes can be added as a fallback
|
||||
* viewer node. */
|
||||
static bool add_viewer_nodes_in_context(const DTreeContext *context, Stack<DNode> &node_stack)
|
||||
{
|
||||
/* Do not add viewers that are inside muted contexts. */
|
||||
if (is_tree_context_muted(*context)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
for (const bNode *node : context->btree().nodes_by_type("CompositorNodeViewer")) {
|
||||
if (node->flag & NODE_DO_OUTPUT && !(node->flag & NODE_MUTED)) {
|
||||
node_stack.push(DNode(context, node));
|
||||
@@ -71,31 +49,6 @@ static bool add_viewer_nodes_in_context(const DTreeContext *context, Stack<DNode
|
||||
return false;
|
||||
}
|
||||
|
||||
/* Add all File Output nodes inside the given tree_context recursively to the node stack. */
|
||||
static void add_file_output_nodes(const DTreeContext &tree_context, Stack<DNode> &node_stack)
|
||||
{
|
||||
for (const bNode *node : tree_context.btree().nodes_by_type("CompositorNodeOutputFile")) {
|
||||
if (node->flag & NODE_MUTED) {
|
||||
continue;
|
||||
}
|
||||
|
||||
node_stack.push(DNode(&tree_context, node));
|
||||
}
|
||||
|
||||
for (const bNode *node : tree_context.btree().group_nodes()) {
|
||||
if (node->flag & NODE_MUTED) {
|
||||
continue;
|
||||
}
|
||||
|
||||
const bNodeTree *group_tree = reinterpret_cast<const bNodeTree *>(node->id);
|
||||
if (!group_tree) {
|
||||
continue;
|
||||
}
|
||||
|
||||
add_file_output_nodes(*tree_context.child_context(*node), node_stack);
|
||||
}
|
||||
}
|
||||
|
||||
/* Add the output nodes whose result should be computed to the given stack. This includes File
|
||||
* Output, Composite, and Viewer nodes. Viewer nodes are a special case, as only the nodes that
|
||||
* satisfies the requirements in the add_viewer_nodes_in_context function are added. First, the
|
||||
@@ -110,7 +63,11 @@ static void add_output_nodes(const Context &context,
|
||||
|
||||
/* Only add File Output nodes if the context supports them. */
|
||||
if (context.use_file_output()) {
|
||||
add_file_output_nodes(root_context, node_stack);
|
||||
for (const bNode *node : root_context.btree().nodes_by_type("CompositorNodeOutputFile")) {
|
||||
if (!(node->flag & NODE_MUTED)) {
|
||||
node_stack.push(DNode(&root_context, node));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Only add the Composite output node if the context supports composite outputs. The active
|
||||
|
||||
@@ -405,10 +405,6 @@ void Instance::render_sample()
|
||||
/* Motion blur may need to do re-sync after a certain number of sample. */
|
||||
if (!is_viewport() && sampling.do_render_sync()) {
|
||||
render_sync();
|
||||
if (!info.empty()) {
|
||||
printf("%s", info.c_str());
|
||||
info = "";
|
||||
}
|
||||
}
|
||||
|
||||
DebugScope debug_scope(debug_scope_render_sample, "EEVEE.render_sample");
|
||||
|
||||
@@ -20,8 +20,8 @@ void PlanarProbe::set_view(const draw::View &view, int layer_id)
|
||||
this->world_to_object_transposed = float3x4(transpose(world_to_plane));
|
||||
this->normal = normalize(plane_to_world.z_axis());
|
||||
|
||||
float3 view_vec = view.is_persp() ? view.location() - plane_to_world.location() : view.forward();
|
||||
bool view_is_below_plane = dot(view_vec, plane_to_world.z_axis()) < 0.0;
|
||||
bool view_is_below_plane = dot(view.location() - plane_to_world.location(),
|
||||
plane_to_world.z_axis()) < 0.0;
|
||||
if (view_is_below_plane) {
|
||||
this->normal = -this->normal;
|
||||
}
|
||||
|
||||
@@ -243,8 +243,19 @@ void MotionBlurModule::render(View &view, GPUTexture **input_tx, GPUTexture **ou
|
||||
|
||||
tile_indirection_buf_.clear_to_zero();
|
||||
|
||||
const bool do_motion_vectors_swizzle = inst_.render_buffers.vector_tx_format() == GPU_RG16F;
|
||||
if (do_motion_vectors_swizzle) {
|
||||
/* Change texture swizzling to avoid complexity in gather pass shader. */
|
||||
GPU_texture_swizzle_set(inst_.render_buffers.vector_tx, "rgrg");
|
||||
}
|
||||
|
||||
inst_.manager->submit(motion_blur_ps_, view);
|
||||
|
||||
if (do_motion_vectors_swizzle) {
|
||||
/* Reset swizzle since this texture might be reused in other places. */
|
||||
GPU_texture_swizzle_set(inst_.render_buffers.vector_tx, "rgba");
|
||||
}
|
||||
|
||||
tiles_tx_.release();
|
||||
|
||||
DRW_stats_group_end();
|
||||
|
||||
@@ -82,12 +82,6 @@ void RenderBuffers::acquire(int2 extent)
|
||||
/* TODO(fclem): Make vector pass allocation optional if no TAA or motion blur is needed. */
|
||||
vector_tx.acquire(extent, vector_tx_format(), usage_attachment_read_write);
|
||||
|
||||
const bool do_motion_vectors_swizzle = vector_tx_format() == GPU_RG16F;
|
||||
if (do_motion_vectors_swizzle) {
|
||||
/* Change texture swizzling to avoid complexity in shaders. */
|
||||
GPU_texture_swizzle_set(vector_tx, "rgrg");
|
||||
}
|
||||
|
||||
int color_len = data.color_len + data.aovs.color_len;
|
||||
int value_len = data.value_len + data.aovs.value_len;
|
||||
|
||||
@@ -123,25 +117,18 @@ void RenderBuffers::release()
|
||||
// depth_tx.release();
|
||||
combined_tx.release();
|
||||
|
||||
const bool do_motion_vectors_swizzle = vector_tx_format() == GPU_RG16F;
|
||||
if (do_motion_vectors_swizzle) {
|
||||
/* Reset swizzle since this texture might be reused in other places. */
|
||||
GPU_texture_swizzle_set(vector_tx, "rgba");
|
||||
}
|
||||
vector_tx.release();
|
||||
|
||||
cryptomatte_tx.release();
|
||||
}
|
||||
|
||||
eGPUTextureFormat RenderBuffers::vector_tx_format()
|
||||
{
|
||||
const eViewLayerEEVEEPassType enabled_passes = inst_.film.enabled_passes_get();
|
||||
bool do_full_vector_render_pass = ((enabled_passes & EEVEE_RENDER_PASS_VECTOR) ||
|
||||
inst_.motion_blur.postfx_enabled()) &&
|
||||
!inst_.is_viewport();
|
||||
bool do_vector_render_pass = (enabled_passes & EEVEE_RENDER_PASS_VECTOR) ||
|
||||
(inst_.motion_blur.postfx_enabled() && !inst_.is_viewport());
|
||||
|
||||
/* Only RG16F (motion.prev) for the viewport. */
|
||||
return do_full_vector_render_pass ? GPU_RGBA16F : GPU_RG16F;
|
||||
/* Only RG16F when only doing only reprojection or motion blur. */
|
||||
return do_vector_render_pass ? GPU_RGBA16F : GPU_RG16F;
|
||||
}
|
||||
|
||||
} // namespace blender::eevee
|
||||
|
||||
@@ -165,14 +165,8 @@ bool VelocityModule::step_object_sync(Object *ob,
|
||||
vel.obj.ofs[STEP_PREVIOUS]) = ob->object_to_world();
|
||||
}
|
||||
if (vel.obj.ofs[STEP_NEXT] == -1) {
|
||||
if (inst_.is_viewport()) {
|
||||
/* Just set it to 0. motion.next is not meant to be valid in the viewport. */
|
||||
vel.obj.ofs[STEP_NEXT] = 0;
|
||||
}
|
||||
else {
|
||||
vel.obj.ofs[STEP_NEXT] = object_steps_usage[STEP_NEXT]++;
|
||||
object_steps[STEP_NEXT]->get_or_resize(vel.obj.ofs[STEP_NEXT]) = ob->object_to_world();
|
||||
}
|
||||
vel.obj.ofs[STEP_NEXT] = object_steps_usage[STEP_NEXT]++;
|
||||
object_steps[STEP_NEXT]->get_or_resize(vel.obj.ofs[STEP_NEXT]) = ob->object_to_world();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -219,11 +213,11 @@ bool VelocityModule::step_object_sync(Object *ob,
|
||||
if (step_ == STEP_CURRENT && has_motion == true && has_deform == false) {
|
||||
const float4x4 &obmat_curr = (*object_steps[STEP_CURRENT])[vel.obj.ofs[STEP_CURRENT]];
|
||||
const float4x4 &obmat_prev = (*object_steps[STEP_PREVIOUS])[vel.obj.ofs[STEP_PREVIOUS]];
|
||||
const float4x4 &obmat_next = (*object_steps[STEP_NEXT])[vel.obj.ofs[STEP_NEXT]];
|
||||
if (inst_.is_viewport()) {
|
||||
has_motion = (obmat_curr != obmat_prev);
|
||||
}
|
||||
else {
|
||||
const float4x4 &obmat_next = (*object_steps[STEP_NEXT])[vel.obj.ofs[STEP_NEXT]];
|
||||
has_motion = (obmat_curr != obmat_prev || obmat_curr != obmat_next);
|
||||
}
|
||||
}
|
||||
@@ -316,7 +310,6 @@ void VelocityModule::step_swap()
|
||||
std::swap(geometry_steps[step_a], geometry_steps[step_b]);
|
||||
std::swap(camera_steps[step_a], camera_steps[step_b]);
|
||||
std::swap(step_time[step_a], step_time[step_b]);
|
||||
std::swap(object_steps_usage[step_a], object_steps_usage[step_b]);
|
||||
|
||||
for (VelocityObjectData &vel : velocity_map.values()) {
|
||||
vel.obj.ofs[step_a] = vel.obj.ofs[step_b];
|
||||
@@ -347,9 +340,6 @@ void VelocityModule::begin_sync()
|
||||
step_ = STEP_CURRENT;
|
||||
step_camera_sync();
|
||||
object_steps_usage[step_] = 0;
|
||||
|
||||
/* STEP_NEXT is not used for viewport. (See #131134) */
|
||||
BLI_assert(!inst_.is_viewport() || object_steps_usage[STEP_NEXT] == 0);
|
||||
}
|
||||
|
||||
void VelocityModule::end_sync()
|
||||
|
||||
@@ -122,7 +122,6 @@ void velocity_local_pos_get(vec3 lP, int vert_id, out vec3 lP_prev, out vec3 lP_
|
||||
/**
|
||||
* Given a triple of position, compute the previous and next motion vectors.
|
||||
* Returns a tuple of world space motion deltas.
|
||||
* WARNING: The returned motion_next is invalid when rendering the viewport.
|
||||
*/
|
||||
void velocity_vertex(
|
||||
vec3 lP_prev, vec3 lP, vec3 lP_next, out vec3 motion_prev, out vec3 motion_next)
|
||||
|
||||
@@ -13,8 +13,7 @@
|
||||
* \{ */
|
||||
|
||||
/* Pass world space deltas to the fragment shader.
|
||||
* This is to make sure that the resulting motion vectors are valid even with displacement.
|
||||
* WARNING: The next value is invalid when rendering the viewport. */
|
||||
* This is to make sure that the resulting motion vectors are valid even with displacement. */
|
||||
GPU_SHADER_INTERFACE_INFO(eevee_velocity_surface_iface, "motion")
|
||||
.smooth(Type::VEC3, "prev")
|
||||
.smooth(Type::VEC3, "next");
|
||||
|
||||
@@ -30,6 +30,7 @@ void GPENCIL_render_init(GPENCIL_Data *vedata,
|
||||
GPENCIL_FramebufferList *fbl = vedata->fbl;
|
||||
GPENCIL_TextureList *txl = vedata->txl;
|
||||
|
||||
Scene *scene = DEG_get_evaluated_scene(depsgraph);
|
||||
const float *viewport_size = DRW_viewport_size_get();
|
||||
const int size[2] = {int(viewport_size[0]), int(viewport_size[1])};
|
||||
|
||||
@@ -83,8 +84,7 @@ void GPENCIL_render_init(GPENCIL_Data *vedata,
|
||||
}
|
||||
}
|
||||
|
||||
const bool do_region = !(rect->xmin == 0 && rect->ymin == 0 && rect->xmax == size[0] &&
|
||||
rect->ymax == size[1]);
|
||||
const bool do_region = (scene->r.mode & R_BORDER) != 0;
|
||||
const bool do_clear_z = !pix_z || do_region;
|
||||
const bool do_clear_col = !pix_col || do_region;
|
||||
|
||||
|
||||
@@ -74,10 +74,8 @@ struct FloatBufferCache {
|
||||
if (image_buffer->float_buffer.data != nullptr) {
|
||||
BLI_assert_msg(
|
||||
IMB_colormanagement_space_name_is_scene_linear(
|
||||
IMB_colormanagement_get_float_colorspace(image_buffer)) ||
|
||||
IMB_colormanagement_space_name_is_data(
|
||||
IMB_colormanagement_get_float_colorspace(image_buffer)),
|
||||
"Expected float buffer to be scene_linear or data - if there are code paths where this "
|
||||
IMB_colormanagement_get_float_colorspace(image_buffer)),
|
||||
"Expected float buffer to be scene_linear - if there are code paths where this "
|
||||
"isn't the case we should convert those and add to the FloatBufferCache as well.");
|
||||
return image_buffer;
|
||||
}
|
||||
|
||||
@@ -89,7 +89,7 @@ void neighbor_blend(
|
||||
void main()
|
||||
{
|
||||
ivec2 center_texel = ivec2(gl_FragCoord.xy);
|
||||
float line_kernel = sizeLine * 0.5 - 0.5;
|
||||
float line_kernel = sizePixel * 0.5 - 0.5;
|
||||
|
||||
fragColor = texelFetch(colorTex, center_texel, 0);
|
||||
|
||||
|
||||
@@ -2063,7 +2063,7 @@ static void draw_subdiv_cache_ensure_mat_offsets(DRWSubdivCache &cache,
|
||||
const int next_offset = (i == mesh_eval->faces_num - 1) ? number_of_quads :
|
||||
subdiv_face_offset[i + 1];
|
||||
const int quad_count = next_offset - subdiv_face_offset[i];
|
||||
const uint mat_index = uint(material_indices[i]) < mat_len ? uint(material_indices[i]) : 0;
|
||||
const int mat_index = material_indices[i];
|
||||
mat_start[mat_index] += quad_count;
|
||||
}
|
||||
|
||||
@@ -2082,7 +2082,7 @@ static void draw_subdiv_cache_ensure_mat_offsets(DRWSubdivCache &cache,
|
||||
MEM_mallocN(sizeof(int) * mesh_eval->faces_num, "per_face_mat_offset"));
|
||||
|
||||
for (int i = 0; i < mesh_eval->faces_num; i++) {
|
||||
const uint mat_index = uint(material_indices[i]) < mat_len ? uint(material_indices[i]) : 0;
|
||||
const int mat_index = material_indices[i];
|
||||
const int single_material_index = subdiv_face_offset[i];
|
||||
const int material_offset = mat_end[mat_index];
|
||||
const int next_offset = (i == mesh_eval->faces_num - 1) ? number_of_quads :
|
||||
|
||||
@@ -730,7 +730,6 @@ static void drw_call_obinfos_init(DRWObjectInfos *ob_infos, const Object *ob)
|
||||
else {
|
||||
ob_infos->ob_flag += (ob == DST.draw_ctx.obact) ? (1 << 4) : 0;
|
||||
}
|
||||
ob_infos->ob_flag += (ob->base_flag & BASE_HOLDOUT) ? (1 << 5) : 0;
|
||||
/* Negative scaling. */
|
||||
ob_infos->ob_flag *= (ob->transflag & OB_NEG_SCALE) ? -1.0f : 1.0f;
|
||||
/* Object Color. */
|
||||
|
||||
@@ -14,8 +14,6 @@
|
||||
#include "BKE_mesh_types.hh"
|
||||
#include "BKE_paint.hh"
|
||||
|
||||
#include "bmesh_class.hh"
|
||||
|
||||
#include "DRW_pbvh.hh"
|
||||
|
||||
namespace blender::draw {
|
||||
@@ -132,28 +130,6 @@ static Vector<SculptBatch> sculpt_batches_get_ex(const Object *ob,
|
||||
return result_batches;
|
||||
}
|
||||
|
||||
static const CustomData *get_cdata(const BMesh &bm, const bke::AttrDomain domain)
|
||||
{
|
||||
switch (domain) {
|
||||
case bke::AttrDomain::Point:
|
||||
return &bm.vdata;
|
||||
case bke::AttrDomain::Corner:
|
||||
return &bm.ldata;
|
||||
case bke::AttrDomain::Face:
|
||||
return &bm.pdata;
|
||||
default:
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
static bool bmesh_attribute_exists(const BMesh &bm,
|
||||
const bke::AttributeMetaData &meta_data,
|
||||
const StringRef name)
|
||||
{
|
||||
const CustomData *cdata = get_cdata(bm, meta_data.domain);
|
||||
return cdata && CustomData_get_offset_named(cdata, meta_data.data_type, name) != -1;
|
||||
}
|
||||
|
||||
Vector<SculptBatch> sculpt_batches_get(const Object *ob, SculptBatchFeature features)
|
||||
{
|
||||
Vector<pbvh::AttributeRequest, 16> attrs;
|
||||
@@ -169,30 +145,19 @@ Vector<SculptBatch> sculpt_batches_get(const Object *ob, SculptBatchFeature feat
|
||||
|
||||
const Mesh *mesh = BKE_object_get_original_mesh(ob);
|
||||
const bke::AttributeAccessor attributes = mesh->attributes();
|
||||
const SculptSession &ss = *ob->sculpt;
|
||||
|
||||
/* If Dyntopo is enabled, the source of truth for an attribute existing or not is the BMesh, not
|
||||
* the Mesh. */
|
||||
if (features & SCULPT_BATCH_VERTEX_COLOR) {
|
||||
if (const char *name = mesh->active_color_attribute) {
|
||||
if (const std::optional<bke::AttributeMetaData> meta_data = attributes.lookup_meta_data(
|
||||
name))
|
||||
{
|
||||
if (ss.bm) {
|
||||
if (bmesh_attribute_exists(*ss.bm, *meta_data, name)) {
|
||||
attrs.append(pbvh::GenericRequest{name, meta_data->data_type, meta_data->domain});
|
||||
}
|
||||
}
|
||||
else {
|
||||
attrs.append(pbvh::GenericRequest{name, meta_data->data_type, meta_data->domain});
|
||||
}
|
||||
attrs.append(pbvh::GenericRequest{name, meta_data->data_type, meta_data->domain});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (features & SCULPT_BATCH_UV) {
|
||||
const CustomData *corner_data = ss.bm ? &ss.bm->ldata : &mesh->corner_data;
|
||||
if (const char *name = CustomData_get_active_layer_name(corner_data, CD_PROP_FLOAT2)) {
|
||||
if (const char *name = CustomData_get_active_layer_name(&mesh->corner_data, CD_PROP_FLOAT2)) {
|
||||
attrs.append(pbvh::GenericRequest{name, CD_PROP_FLOAT2, bke::AttrDomain::Corner});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -293,7 +293,6 @@ float get_homogenous_z_offset(float vs_z, float hs_w, float vs_offset)
|
||||
#define DRW_BASE_FROM_DUPLI (1 << 2)
|
||||
#define DRW_BASE_FROM_SET (1 << 3)
|
||||
#define DRW_BASE_ACTIVE (1 << 4)
|
||||
#define DRW_BASE_HOLDOUT (1 << 5)
|
||||
|
||||
/* Wire Color Types, matching eV3DShadingColorType. */
|
||||
#define V3D_SHADING_SINGLE_COLOR 2
|
||||
|
||||
@@ -460,8 +460,8 @@ void animviz_calc_motionpaths(Depsgraph *depsgraph,
|
||||
mpt->keylist = ED_keylist_create();
|
||||
|
||||
ListBase *fcurve_list = nullptr;
|
||||
if (adt && adt->action) {
|
||||
/* Get pointer to animviz settings for each target. */
|
||||
if (adt) {
|
||||
/* get pointer to animviz settings for each target */
|
||||
bAnimVizSettings *avs = animviz_target_settings_get(mpt);
|
||||
|
||||
/* it is assumed that keyframes for bones are all grouped in a single group
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user