UI: Console Text Operations #108626
@ -650,8 +650,12 @@ mark_as_advanced(
|
||||
)
|
||||
|
||||
# OpenGL
|
||||
option(WITH_OPENGL_BACKEND "Enable OpenGL support as graphic backend" ON)
|
||||
mark_as_advanced(WITH_OPENGL_BACKEND)
|
||||
if(NOT APPLE)
|
||||
option(WITH_OPENGL_BACKEND "Enable OpenGL support as graphic backend" ON)
|
||||
mark_as_advanced(WITH_OPENGL_BACKEND)
|
||||
else()
|
||||
set(WITH_OPENGL_BACKEND OFF)
|
||||
endif()
|
||||
|
||||
# Vulkan
|
||||
option(WITH_VULKAN_BACKEND "Enable Vulkan as graphics backend (only for development)" OFF)
|
||||
|
@ -474,7 +474,7 @@ check_struct_comments: .FORCE
|
||||
@cd "$(BUILD_DIR)" ; \
|
||||
$(PYTHON) \
|
||||
"$(BLENDER_DIR)/build_files/cmake/cmake_static_check_clang.py" \
|
||||
--checks=struct_comments --match=".*"
|
||||
--checks=struct_comments --match=".*" --jobs=$(NPROCS)
|
||||
|
||||
check_clang_array: .FORCE
|
||||
@$(CMAKE_CONFIG)
|
||||
|
@ -174,4 +174,5 @@ include(cmake/shaderc.cmake)
|
||||
include(cmake/vulkan.cmake)
|
||||
include(cmake/pybind11.cmake)
|
||||
include(cmake/harvest.cmake)
|
||||
include(cmake/deps_html.cmake)
|
||||
include(cmake/cve_check.cmake)
|
||||
|
7
build_files/build_environment/cmake/deps.html.in
Normal file
7
build_files/build_environment/cmake/deps.html.in
Normal file
@ -0,0 +1,7 @@
|
||||
<html>
|
||||
<body>
|
||||
<table border=1>
|
||||
@HTMLCONTENTS@
|
||||
<table>
|
||||
</body>
|
||||
</html>
|
30
build_files/build_environment/cmake/deps_html.cmake
Normal file
30
build_files/build_environment/cmake/deps_html.cmake
Normal file
@ -0,0 +1,30 @@
|
||||
# SPDX-FileCopyrightText: 2023 Ray Molenkamp
|
||||
#
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
#
|
||||
# This outputs an html file with the name, version and homepage for
|
||||
# every dependency we have, this is used by the release manager to
|
||||
# update the licensing document.
|
||||
|
||||
set(HTMLCONTENTS)
|
||||
get_cmake_property(_variableNames VARIABLES)
|
||||
foreach(_variableName ${_variableNames})
|
||||
if(_variableName MATCHES "_URI$")
|
||||
string(REPLACE "_URI" "" DEP_NAME ${_variableName})
|
||||
set(DEP_VERSION "${${DEP_NAME}_VERSION}")
|
||||
# First see if DEP_HOMEPAGE is set, if it is use that.
|
||||
set(DEP_HOMEPAGE ${${DEP_NAME}_HOMEPAGE})
|
||||
if(NOT DEP_HOMEPAGE)
|
||||
# If the xxx_HOMEPAGE is not set but the URI for the archive is a known github format extract the reprository/project from the URI
|
||||
string(REGEX MATCH "https:\/\/(.*)github\.com\/(.+)\/(archive|releases|release|tar.gz)\/(.*)" DEP_PROJECT "${${_variableName}}")
|
||||
if(CMAKE_MATCH_2)
|
||||
set(DEP_HOMEPAGE "https://www.github.com/${CMAKE_MATCH_2}")
|
||||
else() # If that is also not set, error out to ensure this information is supplied
|
||||
message(FATAL_ERROR "${DEP_NAME} No homepage set, please set ${DEP_NAME}_HOMEPAGE in versions.cmake")
|
||||
endif()
|
||||
endif()
|
||||
set(HTMLCONTENTS "${HTMLCONTENTS}<tr><td>${DEP_NAME}</td><td>${DEP_VERSION}</td><td><a href=\"${DEP_HOMEPAGE}\" target=\"_blank\">${DEP_HOMEPAGE}</a></td></tr>\n")
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
configure_file(${CMAKE_SOURCE_DIR}/cmake/deps.html.in ${CMAKE_CURRENT_BINARY_DIR}/deps.html @ONLY)
|
@ -16,12 +16,14 @@ set(ZLIB_HASH 9b8aa094c4e5765dabf4da391f00d15c)
|
||||
set(ZLIB_HASH_TYPE MD5)
|
||||
set(ZLIB_FILE zlib-${ZLIB_VERSION}.tar.gz)
|
||||
set(ZLIB_CPE "cpe:2.3:a:zlib:zlib:${ZLIB_VERSION}:*:*:*:*:*:*:*")
|
||||
#set(ZLIB_HOMEPAGE https://zlib.net)
|
||||
|
||||
set(OPENAL_VERSION 1.21.1)
|
||||
set(OPENAL_URI http://openal-soft.org/openal-releases/openal-soft-${OPENAL_VERSION}.tar.bz2)
|
||||
set(OPENAL_HASH a936806ebd8de417b0ffd8cf3f48f456)
|
||||
set(OPENAL_HASH_TYPE MD5)
|
||||
set(OPENAL_FILE openal-soft-${OPENAL_VERSION}.tar.bz2)
|
||||
set(OPENAL_HOMEPAGE https://openal-soft.org/)
|
||||
|
||||
set(PNG_VERSION 1.6.37)
|
||||
set(PNG_URI http://prdownloads.sourceforge.net/libpng/libpng-${PNG_VERSION}.tar.xz)
|
||||
@ -29,6 +31,7 @@ set(PNG_HASH 505e70834d35383537b6491e7ae8641f1a4bed1876dbfe361201fc80868d88ca)
|
||||
set(PNG_HASH_TYPE SHA256)
|
||||
set(PNG_FILE libpng-${PNG_VERSION}.tar.xz)
|
||||
set(PNG_CPE "cpe:2.3:a:libpng:libpng:${PNG_VERSION}:*:*:*:*:*:*:*")
|
||||
set(PNG_HOMEPAGE http://www.libpng.org/pub/png/libpng.html)
|
||||
|
||||
set(JPEG_VERSION 2.1.3)
|
||||
set(JPEG_URI https://github.com/libjpeg-turbo/libjpeg-turbo/archive/${JPEG_VERSION}.tar.gz)
|
||||
@ -46,6 +49,7 @@ set(BOOST_HASH 077f074743ea7b0cb49c6ed43953ae95)
|
||||
set(BOOST_HASH_TYPE MD5)
|
||||
set(BOOST_FILE boost_${BOOST_VERSION_NODOTS}.tar.gz)
|
||||
set(BOOST_CPE "cpe:2.3:a:boost:boost:${BOOST_VERSION}:*:*:*:*:*:*:*")
|
||||
SET(BOOST_HOMEPAGE https://www.boost.org/)
|
||||
|
||||
set(BLOSC_VERSION 1.21.1)
|
||||
set(BLOSC_URI https://github.com/Blosc/c-blosc/archive/v${BLOSC_VERSION}.tar.gz)
|
||||
@ -59,6 +63,7 @@ set(PTHREADS_URI http://prdownloads.sourceforge.net/pthreads4w/pthreads4w-code-v
|
||||
set(PTHREADS_HASH f3bf81bb395840b3446197bcf4ecd653)
|
||||
set(PTHREADS_HASH_TYPE MD5)
|
||||
set(PTHREADS_FILE pthreads4w-code-${PTHREADS_VERSION}.zip)
|
||||
set(PTHREADS_HOMEPAGE https://github.com/fwbuilder/pthreads4w)
|
||||
|
||||
set(OPENEXR_VERSION 3.1.7)
|
||||
set(OPENEXR_URI https://github.com/AcademySoftwareFoundation/openexr/archive/v${OPENEXR_VERSION}.tar.gz)
|
||||
@ -96,6 +101,7 @@ set(FREETYPE_HASH 98bc3cf234fe88ef3cf24569251fe0a4)
|
||||
set(FREETYPE_HASH_TYPE MD5)
|
||||
set(FREETYPE_FILE freetype-${FREETYPE_VERSION}.tar.gz)
|
||||
SET(FREETYPE_CPE "cpe:2.3:a:freetype:freetype:${FREETYPE_VERSION}:*:*:*:*:*:*:*")
|
||||
set(FREETYPE_HOMEPAGE https://freetype.org/)
|
||||
|
||||
set(EPOXY_VERSION 1.5.10)
|
||||
set(EPOXY_URI https://github.com/anholt/libepoxy/archive/refs/tags/${EPOXY_VERSION}.tar.gz)
|
||||
@ -108,6 +114,7 @@ set(FREEGLUT_URI http://prdownloads.sourceforge.net/freeglut/freeglut/${FREEGLUT
|
||||
set(FREEGLUT_HASH 90c3ca4dd9d51cf32276bc5344ec9754)
|
||||
set(FREEGLUT_HASH_TYPE MD5)
|
||||
set(FREEGLUT_FILE freeglut-${FREEGLUT_VERSION}.tar.gz)
|
||||
set(FREEGLUT_HOMEPAGE https://freeglut.sourceforge.net/)
|
||||
|
||||
set(ALEMBIC_VERSION 1.8.3)
|
||||
set(ALEMBIC_URI https://github.com/alembic/alembic/archive/${ALEMBIC_VERSION}.tar.gz)
|
||||
@ -127,6 +134,7 @@ set(SDL_HASH a53acc02e1cca98c4123229069b67c9e)
|
||||
set(SDL_HASH_TYPE MD5)
|
||||
set(SDL_FILE SDL2-${SDL_VERSION}.tar.gz)
|
||||
set(SDL_CPE "cpe:2.3:a:libsdl:sdl:${SDL_VERSION}:*:*:*:*:*:*:*")
|
||||
set(SDL_HOMEPAGE https://www.libsdl.org)
|
||||
|
||||
set(OPENCOLLADA_VERSION v1.6.68)
|
||||
set(OPENCOLLADA_URI https://github.com/KhronosGroup/OpenCOLLADA/archive/${OPENCOLLADA_VERSION}.tar.gz)
|
||||
@ -195,6 +203,7 @@ set(TIFF_HASH d08c5f9eee6350fffc239e5993d92779)
|
||||
set(TIFF_HASH_TYPE MD5)
|
||||
set(TIFF_FILE tiff-${TIFF_VERSION}.tar.gz)
|
||||
set(TIFF_CPE "cpe:2.3:a:libtiff:libtiff:${TIFF_VERSION}:*:*:*:*:*:*:*")
|
||||
set(TIFF_HOMEPAGE http://www.simplesystems.org/libtiff/)
|
||||
|
||||
# Recent commit from 1.13.0.2 under development, which includes string table
|
||||
# changes that make the Cycles OptiX implementation work. Official 1.12 OSL
|
||||
@ -218,6 +227,7 @@ set(PYTHON_HASH 49b0342476b984e106d308c25d657f12)
|
||||
set(PYTHON_HASH_TYPE MD5)
|
||||
set(PYTHON_FILE Python-${PYTHON_VERSION}.tar.xz)
|
||||
set(PYTHON_CPE "cpe:2.3:a:python:python:${PYTHON_VERSION}:-:*:*:*:*:*:*")
|
||||
set(PYTHON_HOMEPAGE https://www.python.org/)
|
||||
|
||||
set(TBB_YEAR 2020)
|
||||
set(TBB_VERSION ${TBB_YEAR}_U3)
|
||||
@ -277,12 +287,14 @@ set(LAME_HASH 83e260acbe4389b54fe08e0bdbf7cddb)
|
||||
set(LAME_HASH_TYPE MD5)
|
||||
set(LAME_FILE lame-${LAME_VERSION}.tar.gz)
|
||||
set(LAME_CPE "cpe:2.3:a:lame_project:lame:${LAME_VERSION}:*:*:*:*:*:*:*")
|
||||
set(LAME_HOMEPAGE https://lame.sourceforge.io/)
|
||||
|
||||
set(OGG_VERSION 1.3.5)
|
||||
set(OGG_URI http://downloads.xiph.org/releases/ogg/libogg-${OGG_VERSION}.tar.gz)
|
||||
set(OGG_HASH 0eb4b4b9420a0f51db142ba3f9c64b333f826532dc0f48c6410ae51f4799b664)
|
||||
set(OGG_HASH_TYPE SHA256)
|
||||
set(OGG_FILE libogg-${OGG_VERSION}.tar.gz)
|
||||
set(OGG_HOMEPAGE https://xiph.org/ogg/)
|
||||
|
||||
set(VORBIS_VERSION 1.3.7)
|
||||
set(VORBIS_URI http://downloads.xiph.org/releases/vorbis/libvorbis-${VORBIS_VERSION}.tar.gz)
|
||||
@ -290,12 +302,14 @@ set(VORBIS_HASH 0e982409a9c3fc82ee06e08205b1355e5c6aa4c36bca58146ef399621b0ce5ab
|
||||
set(VORBIS_HASH_TYPE SHA256)
|
||||
set(VORBIS_FILE libvorbis-${VORBIS_VERSION}.tar.gz)
|
||||
set(VORBIS_CPE "cpe:2.3:a:xiph.org:libvorbis:${VORBIS_VERSION}:*:*:*:*:*:*:*")
|
||||
set(VORBIS_HOMEPAGE https://xiph.org/vorbis/)
|
||||
|
||||
set(THEORA_VERSION 1.1.1)
|
||||
set(THEORA_URI http://downloads.xiph.org/releases/theora/libtheora-${THEORA_VERSION}.tar.bz2)
|
||||
set(THEORA_HASH b6ae1ee2fa3d42ac489287d3ec34c5885730b1296f0801ae577a35193d3affbc)
|
||||
set(THEORA_HASH_TYPE SHA256)
|
||||
set(THEORA_FILE libtheora-${THEORA_VERSION}.tar.bz2)
|
||||
set(THEORA_HOMEPAGE https://xiph.org/theora/)
|
||||
|
||||
set(FLAC_VERSION 1.4.2)
|
||||
set(FLAC_URI http://downloads.xiph.org/releases/flac/flac-${FLAC_VERSION}.tar.xz)
|
||||
@ -303,6 +317,7 @@ set(FLAC_HASH e322d58a1f48d23d9dd38f432672865f6f79e73a6f9cc5a5f57fcaa83eb5a8e4 )
|
||||
set(FLAC_HASH_TYPE SHA256)
|
||||
set(FLAC_FILE flac-${FLAC_VERSION}.tar.xz)
|
||||
set(FLAC_CPE "cpe:2.3:a:flac_project:flac:${FLAC_VERSION}:*:*:*:*:*:*:*")
|
||||
set(FLAC_HOMEPAGE https://xiph.org/flac/)
|
||||
|
||||
set(VPX_VERSION 1.11.0)
|
||||
set(VPX_URI https://github.com/webmproject/libvpx/archive/v${VPX_VERSION}/libvpx-v${VPX_VERSION}.tar.gz)
|
||||
@ -316,12 +331,14 @@ set(OPUS_URI https://archive.mozilla.org/pub/opus/opus-${OPUS_VERSION}.tar.gz)
|
||||
set(OPUS_HASH 65b58e1e25b2a114157014736a3d9dfeaad8d41be1c8179866f144a2fb44ff9d)
|
||||
set(OPUS_HASH_TYPE SHA256)
|
||||
set(OPUS_FILE opus-${OPUS_VERSION}.tar.gz)
|
||||
set(OPUS_HOMEPAGE https://opus-codec.org/)
|
||||
|
||||
set(X264_VERSION 35fe20d1ba49918ec739a5b068c208ca82f977f7)
|
||||
set(X264_URI https://code.videolan.org/videolan/x264/-/archive/${X264_VERSION}/x264-${X264_VERSION}.tar.gz)
|
||||
set(X264_HASH bb4f7da03936b5a030ed5827133b58eb3f701d7e5dce32cca4ba6df93797d42e)
|
||||
set(X264_HASH_TYPE SHA256)
|
||||
set(X264_FILE x264-${X264_VERSION}.tar.gz)
|
||||
set(X264_HOMEPAGE https://www.videolan.org/developers/x264.html)
|
||||
|
||||
set(OPENJPEG_VERSION 2.5.0)
|
||||
set(OPENJPEG_SHORT_VERSION 2.5)
|
||||
@ -337,18 +354,21 @@ set(FFMPEG_HASH 47d062731c9f66a78380e35a19aac77cebceccd1c7cc309b9c82343ffc430c3d
|
||||
set(FFMPEG_HASH_TYPE SHA256)
|
||||
set(FFMPEG_FILE ffmpeg-${FFMPEG_VERSION}.tar.bz2)
|
||||
set(FFMPEG_CPE "cpe:2.3:a:ffmpeg:ffmpeg:${FFMPEG_VERSION}:*:*:*:*:*:*:*")
|
||||
set(FFMPEG_HOMEPAGE https://ffmpeg.org/)
|
||||
|
||||
set(FFTW_VERSION 3.3.10)
|
||||
set(FFTW_URI http://www.fftw.org/fftw-${FFTW_VERSION}.tar.gz)
|
||||
set(FFTW_HASH 8ccbf6a5ea78a16dbc3e1306e234cc5c)
|
||||
set(FFTW_HASH_TYPE MD5)
|
||||
set(FFTW_FILE fftw-${FFTW_VERSION}.tar.gz)
|
||||
set(FFTW_HOMEPAGE https://www.fftw.org/)
|
||||
|
||||
set(ICONV_VERSION 1.16)
|
||||
set(ICONV_URI http://ftp.gnu.org/pub/gnu/libiconv/libiconv-${ICONV_VERSION}.tar.gz)
|
||||
set(ICONV_HASH 7d2a800b952942bb2880efb00cfd524c)
|
||||
set(ICONV_HASH_TYPE MD5)
|
||||
set(ICONV_FILE libiconv-${ICONV_VERSION}.tar.gz)
|
||||
set(ICONV_HOMEPAGE https://www.gnu.org/software/libiconv/)
|
||||
|
||||
set(SNDFILE_VERSION 1.1.0)
|
||||
set(SNDFILE_URI https://github.com/libsndfile/libsndfile/releases/download/1.1.0/libsndfile-${SNDFILE_VERSION}.tar.xz)
|
||||
@ -363,6 +383,7 @@ set(WEBP_HASH b5e2e414a8adee4c25fe56b18dd9c549)
|
||||
set(WEBP_HASH_TYPE MD5)
|
||||
set(WEBP_FILE libwebp-${WEBP_VERSION}.tar.gz)
|
||||
set(WEBP_CPE "cpe:2.3:a:webmproject:libwebp:${WEBP_VERSION}:*:*:*:*:*:*:*")
|
||||
set(WEBP_HOMEPAGE https://developers.google.com/speed/webp)
|
||||
|
||||
set(SPNAV_VERSION 1.1)
|
||||
set(SPNAV_URI https://github.com/FreeSpacenav/libspnav/releases/download/v${SPNAV_VERSION}/libspnav-${SPNAV_VERSION}.tar.gz)
|
||||
@ -382,6 +403,7 @@ set(XML2_HASH 76808c467a58c31e2dbd511e71d5fd13)
|
||||
set(XML2_HASH_TYPE MD5)
|
||||
set(XML2_FILE libxml2-${XML2_VERSION}.tar.xz)
|
||||
set(XML2_CPE "cpe:2.3:a:xmlsoft:libxml2:${XML2_VERSION}:*:*:*:*:*:*:*")
|
||||
set(XML2_HOMEPAGE https://gitlab.gnome.org/GNOME/libxml2)
|
||||
|
||||
set(YAMLCPP_VERSION 0.7.0)
|
||||
set(YAMLCPP_URI https://codeload.github.com/jbeder/yaml-cpp/tar.gz/yaml-cpp-${YAMLCPP_VERSION})
|
||||
@ -416,6 +438,7 @@ set(FLEXBISON_URI http://prdownloads.sourceforge.net/winflexbison/win_flex_bison
|
||||
set(FLEXBISON_HASH 6b549d43e34ece0e8ed05af92daa31c4)
|
||||
set(FLEXBISON_HASH_TYPE MD5)
|
||||
set(FLEXBISON_FILE win_flex_bison-${FLEXBISON_VERSION}.zip)
|
||||
set(FLEXBISON_HOMEPAGE https://github.com/lexxmark/winflexbison)
|
||||
|
||||
set(FLEX_VERSION 2.6.4)
|
||||
set(FLEX_URI https://github.com/westes/flex/releases/download/v${FLEX_VERSION}/flex-${FLEX_VERSION}.tar.gz)
|
||||
@ -437,6 +460,7 @@ set(BZIP2_HASH ab5a03176ee106d3f0fa90e381da478ddae405918153cca248e682cd0c4a2269)
|
||||
set(BZIP2_HASH_TYPE SHA256)
|
||||
set(BZIP2_FILE bzip2_${BZIP2_VERSION}.orig.tar.gz)
|
||||
set(BZIP2_CPE "cpe:2.3:a:bzip:bzip2:${BZIP2_VERSION}:*:*:*:*:*:*:*")
|
||||
SET(BZIP2_HOMEPAGE https://sourceware.org/bzip2/)
|
||||
|
||||
# NOTE: This will *HAVE* to match the version python ships on windows which
|
||||
# is hardcoded in pythons PCbuild/get_externals.bat. For compliance reasons there
|
||||
@ -447,12 +471,14 @@ set(FFI_HASH 72fba7922703ddfa7a028d513ac15a85c8d54c8d67f55fa5a4802885dc652056)
|
||||
set(FFI_HASH_TYPE SHA256)
|
||||
set(FFI_FILE libffi-${FFI_VERSION}.tar.gz)
|
||||
set(FFI_CPE "cpe:2.3:a:libffi_project:libffi:${FFI_VERSION}:*:*:*:*:*:*:*")
|
||||
SET(FFI_HOMEPAGE https://sourceware.org/libffi/)
|
||||
|
||||
set(LZMA_VERSION 5.2.5)
|
||||
set(LZMA_URI https://tukaani.org/xz/xz-${LZMA_VERSION}.tar.bz2)
|
||||
set(LZMA_HASH 5117f930900b341493827d63aa910ff5e011e0b994197c3b71c08a20228a42df)
|
||||
set(LZMA_HASH_TYPE SHA256)
|
||||
set(LZMA_FILE xz-${LZMA_VERSION}.tar.bz2)
|
||||
set(LZMA_HOMEPAGE https://tukaani.org/lzma/)
|
||||
|
||||
# NOTE: Python's build has been modified to use our ssl version.
|
||||
set(SSL_VERSION 3.0.9)
|
||||
@ -461,6 +487,7 @@ set(SSL_HASH eb1ab04781474360f77c318ab89d8c5a03abc38e63d65a603cabbf1b00a1dc90)
|
||||
set(SSL_HASH_TYPE SHA256)
|
||||
set(SSL_FILE openssl-${SSL_VERSION}.tar.gz)
|
||||
set(SSL_CPE "cpe:2.3:a:openssl:openssl:${SSL_VERSION}:*:*:*:*:*:*:*")
|
||||
set(SSL_HOMEPAGE https://www.openssl.org)
|
||||
|
||||
# Note: This will *HAVE* to match the version python ships on windows which
|
||||
# is hardcoded in pythons PCbuild/get_externals.bat for compliance reasons there
|
||||
@ -472,6 +499,7 @@ set(SQLITE_HASH b8c2d4bc0094f5c0ce985dc0e237dfcbaa1f6275)
|
||||
set(SQLITE_HASH_TYPE SHA1)
|
||||
set(SQLITE_FILE sqlite-autoconf-${SQLLITE_LONG_VERSION}.tar.gz)
|
||||
set(SQLITE_CPE "cpe:2.3:a:sqlite:sqlite:${SQLITE_VERSION}:*:*:*:*:*:*:*")
|
||||
set(SQLITE_HOMEPAGE https://www.sqlite.org)
|
||||
|
||||
set(EMBREE_VERSION 4.1.0)
|
||||
set(EMBREE_URI https://github.com/embree/embree/archive/v${EMBREE_VERSION}.zip)
|
||||
@ -502,6 +530,7 @@ set(LIBGLU_URI ftp://ftp.freedesktop.org/pub/mesa/glu/glu-${LIBGLU_VERSION}.tar.
|
||||
set(LIBGLU_HASH 151aef599b8259efe9acd599c96ea2a3)
|
||||
set(LIBGLU_HASH_TYPE MD5)
|
||||
set(LIBGLU_FILE glu-${LIBGLU_VERSION}.tar.xz)
|
||||
set(LIBGLU_HOMEPAGE https://gitlab.freedesktop.org/mesa/glu)
|
||||
|
||||
set(MESA_VERSION 21.1.5)
|
||||
set(MESA_URI ftp://ftp.freedesktop.org/pub/mesa/mesa-${MESA_VERSION}.tar.xz)
|
||||
@ -509,6 +538,7 @@ set(MESA_HASH 022c7293074aeeced2278c872db4fa693147c70f8595b076cf3f1ef81520766d)
|
||||
set(MESA_HASH_TYPE SHA256)
|
||||
set(MESA_FILE mesa-${MESA_VERSION}.tar.xz)
|
||||
set(MESA_CPE "cpe:2.3:a:mesa3d:mesa:${MESA_VERSION}:*:*:*:*:*:*:*")
|
||||
set(MESA_HOMEPAGE https://www.mesa3d.org/)
|
||||
|
||||
set(NASM_VERSION 2.15.02)
|
||||
set(NASM_URI https://github.com/netwide-assembler/nasm/archive/nasm-${NASM_VERSION}.tar.gz)
|
||||
@ -528,18 +558,21 @@ set(WL_PROTOCOLS_FILE wayland-protocols-${WL_PROTOCOLS_VERSION}.tar.gz)
|
||||
set(WL_PROTOCOLS_URI https://gitlab.freedesktop.org/wayland/wayland-protocols/-/archive/${WL_PROTOCOLS_VERSION}/${WL_PROTOCOLS_FILE})
|
||||
set(WL_PROTOCOLS_HASH a28ff59a56e2ebb746048b6ef8d931d6)
|
||||
set(WL_PROTOCOLS_HASH_TYPE MD5)
|
||||
set(WL_PROTOCOLS_HOMEPAGE https://gitlab.freedesktop.org/wayland/wayland-protocols)
|
||||
|
||||
set(WAYLAND_VERSION 1.22.0)
|
||||
set(WAYLAND_FILE wayland-${WAYLAND_VERSION}.tar.xz)
|
||||
set(WAYLAND_URI https://gitlab.freedesktop.org/wayland/wayland/-/releases/${WAYLAND_VERSION}/downloads/wayland-${WAYLAND_VERSION}.tar.xz)
|
||||
set(WAYLAND_HASH 7410ab549e3928fce9381455b17b0803)
|
||||
set(WAYLAND_HASH_TYPE MD5)
|
||||
set(WAYLAND_HOMEPAGE https://gitlab.freedesktop.org/wayland/wayland)
|
||||
|
||||
set(WAYLAND_LIBDECOR_VERSION 0.1.0)
|
||||
set(WAYLAND_LIBDECOR_FILE libdecor-${WAYLAND_LIBDECOR_VERSION}.tar.xz)
|
||||
set(WAYLAND_LIBDECOR_URI https://gitlab.gnome.org/jadahl/libdecor/uploads/81adf91d27620e20bcc5f6b9b312d768/libdecor-${WAYLAND_LIBDECOR_VERSION}.tar.xz )
|
||||
set(WAYLAND_LIBDECOR_HASH 47b59eba76faa3787f0878bf8700e912)
|
||||
set(WAYLAND_LIBDECOR_HASH_TYPE MD5)
|
||||
set(WAYLAND_LIBDECOR_HOMEPAGE https://gitlab.freedesktop.org/libdecor/libdecor)
|
||||
|
||||
set(ISPC_VERSION v1.17.0)
|
||||
set(ISPC_URI https://github.com/ispc/ispc/archive/${ISPC_VERSION}.tar.gz)
|
||||
@ -553,6 +586,7 @@ set(GMP_HASH 0b82665c4a92fd2ade7440c13fcaa42b)
|
||||
set(GMP_HASH_TYPE MD5)
|
||||
set(GMP_FILE gmp-${GMP_VERSION}.tar.xz)
|
||||
set(GMP_CPE "cpe:2.3:a:gmplib:gmp:${GMP_VERSION}:*:*:*:*:*:*:*")
|
||||
set(GMP_HOMEPAGE https://gmplib.org/)
|
||||
|
||||
set(POTRACE_VERSION 1.16)
|
||||
set(POTRACE_URI http://potrace.sourceforge.net/download/${POTRACE_VERSION}/potrace-${POTRACE_VERSION}.tar.gz)
|
||||
@ -560,6 +594,7 @@ set(POTRACE_HASH 5f0bd87ddd9a620b0c4e65652ef93d69)
|
||||
set(POTRACE_HASH_TYPE MD5)
|
||||
set(POTRACE_FILE potrace-${POTRACE_VERSION}.tar.gz)
|
||||
set(POTRACE_CPE "cpe:2.3:a:icoasoft:potrace:${POTRACE_VERSION}:*:*:*:*:*:*:*")
|
||||
set(POTRACE_HOMEPAGE https://potrace.sourceforge.net/)
|
||||
|
||||
set(HARU_VERSION 2_3_0)
|
||||
set(HARU_URI https://github.com/libharu/libharu/archive/RELEASE_${HARU_VERSION}.tar.gz)
|
||||
@ -743,6 +778,7 @@ set(AOM_URI https://storage.googleapis.com/aom-releases/libaom-${AOM_VERSION}.ta
|
||||
set(AOM_HASH bd754b58c3fa69f3ffd29da77de591bd9c26970e3b18537951336d6c0252e354)
|
||||
set(AOM_HASH_TYPE SHA256)
|
||||
set(AOM_FILE libaom-${AOM_VERSION}.tar.gz)
|
||||
SET(AOM_HOMEPAGE https://aomedia.googlesource.com/aom/)
|
||||
|
||||
set(FRIBIDI_VERSION v1.0.12)
|
||||
set(FRIBIDI_URI https://github.com/fribidi/fribidi/archive/refs/tags/${FRIBIDI_VERSION}.tar.gz)
|
||||
@ -785,15 +821,17 @@ set(SHADERC_GLSLANG_FILE glslang-${SHADERC_GLSLANG_VERSION}.tar.gz)
|
||||
|
||||
set(VULKAN_VERSION v1.2.198)
|
||||
|
||||
set(VULKAN_HEADERS_URI https://github.com/KhronosGroup/Vulkan-Headers/archive/refs/tags/${VULKAN_VERSION}.tar.gz)
|
||||
set(VULKAN_HEADERS_VERSION ${VULKAN_VERSION})
|
||||
set(VULKAN_HEADERS_URI https://github.com/KhronosGroup/Vulkan-Headers/archive/refs/tags/${VULKAN_HEADERS_VERSION}.tar.gz)
|
||||
set(VULKAN_HEADERS_HASH 64fe73e887c963ad546bfc7f9505fa1d)
|
||||
set(VULKAN_HEADERS_HASH_TYPE MD5)
|
||||
set(VULKAN_HEADERS_FILE Vulkan-Headers-${VULKAN_VERSION}.tar.gz)
|
||||
set(VULKAN_HEADERS_FILE Vulkan-Headers-${VULKAN_HEADERS_VERSION}.tar.gz)
|
||||
|
||||
set(VULKAN_LOADER_URI https://github.com/KhronosGroup/Vulkan-Loader/archive/refs/tags/${VULKAN_VERSION}.tar.gz)
|
||||
set(VULKAN_LOADER_VERSION ${VULKAN_VERSION})
|
||||
set(VULKAN_LOADER_URI https://github.com/KhronosGroup/Vulkan-Loader/archive/refs/tags/${VULKAN_LOADER_VERSION}.tar.gz)
|
||||
set(VULKAN_LOADER_HASH 015170a74f648fd2b41e209b6bf1ebc4)
|
||||
set(VULKAN_LOADER_HASH_TYPE MD5)
|
||||
set(VULKAN_LOADER_FILE Vulkan-Loader-${VULKAN_VERSION}.tar.gz)
|
||||
set(VULKAN_LOADER_FILE Vulkan-Loader-${VULKAN_LOADER_VERSION}.tar.gz)
|
||||
|
||||
set(PYBIND11_VERSION 2.10.1)
|
||||
set(PYBIND11_URI https://github.com/pybind/pybind11/archive/refs/tags/v${PYBIND11_VERSION}.tar.gz)
|
||||
|
@ -24,3 +24,57 @@ index 7c2f43d..106b1d5 100644
|
||||
DISABLE_STACK_PROTECTOR_FOR_INTERSECTORS(${EMBREE_LIBRARY_FILES_AVX2})
|
||||
ADD_LIBRARY(embree_avx2 STATIC ${EMBREE_LIBRARY_FILES_AVX2})
|
||||
TARGET_LINK_LIBRARIES(embree_avx2 PRIVATE tasking)
|
||||
diff --git a/kernels/rthwif/rtbuild/rtbuild.cpp b/kernels/rthwif/rtbuild/rtbuild.cpp
|
||||
index 6d439f939..367b1ce7b 100644
|
||||
--- a/kernels/rthwif/rtbuild/rtbuild.cpp
|
||||
+++ b/kernels/rthwif/rtbuild/rtbuild.cpp
|
||||
@@ -10,7 +10,7 @@ namespace embree
|
||||
{
|
||||
using namespace embree::isa;
|
||||
|
||||
- static std::unique_ptr<tbb::task_arena> g_arena;
|
||||
+ static tbb::task_arena g_arena(tbb::this_task_arena::max_concurrency(),tbb::this_task_arena::max_concurrency());
|
||||
|
||||
typedef enum _ze_raytracing_accel_format_internal_t {
|
||||
ZE_RTAS_DEVICE_FORMAT_EXP_INVALID = 0, // invalid acceleration structure format
|
||||
@@ -210,13 +210,10 @@ namespace embree
|
||||
|
||||
RTHWIF_API void zeRTASInitExp()
|
||||
{
|
||||
- uint32_t numThreads = tbb::this_task_arena::max_concurrency();
|
||||
- g_arena.reset(new tbb::task_arena(numThreads,numThreads));
|
||||
}
|
||||
|
||||
RTHWIF_API void zeRTASExitExp()
|
||||
{
|
||||
- g_arena.reset();
|
||||
}
|
||||
|
||||
typedef struct _zet_base_desc_t
|
||||
@@ -740,7 +737,7 @@ namespace embree
|
||||
//if (op->hBuilder != hBuilder)
|
||||
// return ZE_RESULT_ERROR_INVALID_ARGUMENT;
|
||||
|
||||
- g_arena->execute([&](){ op->group.run([=](){
|
||||
+ g_arena.execute([&](){ op->group.run([=](){
|
||||
op->errorCode = zeRTASBuilderBuildExpInternal(args,
|
||||
pScratchBuffer, scratchBufferSizeBytes,
|
||||
pRtasBuffer, rtasBufferSizeBytes,
|
||||
@@ -753,7 +750,7 @@ namespace embree
|
||||
else
|
||||
{
|
||||
ze_result_t errorCode = ZE_RESULT_SUCCESS;
|
||||
- g_arena->execute([&](){ errorCode = zeRTASBuilderBuildExpInternal(args,
|
||||
+ g_arena.execute([&](){ errorCode = zeRTASBuilderBuildExpInternal(args,
|
||||
pScratchBuffer, scratchBufferSizeBytes,
|
||||
pRtasBuffer, rtasBufferSizeBytes,
|
||||
pBuildUserPtr, pBounds, pRtasBufferSizeBytes);
|
||||
@@ -801,7 +798,7 @@ namespace embree
|
||||
VALIDATE(hParallelOperation);
|
||||
|
||||
ze_rtas_parallel_operation_t* op = (ze_rtas_parallel_operation_t*) hParallelOperation;
|
||||
- g_arena->execute([&](){ op->group.wait(); });
|
||||
+ g_arena.execute([&](){ op->group.wait(); });
|
||||
return op->errorCode;
|
||||
}
|
||||
}
|
||||
|
@ -47,9 +47,6 @@ ClangSourceLocation = Any
|
||||
|
||||
USE_VERBOSE = os.environ.get("VERBOSE", None) is not None
|
||||
|
||||
# Turn off for debugging.
|
||||
USE_MULTIPROCESS = True
|
||||
|
||||
CLANG_BIND_DIR = os.environ.get("CLANG_BIND_DIR")
|
||||
CLANG_LIB_DIR = os.environ.get("CLANG_LIB_DIR")
|
||||
|
||||
@ -440,6 +437,7 @@ def source_info_filter(
|
||||
def run_checks_on_project(
|
||||
check_ids: Sequence[str],
|
||||
regex_list: Sequence[re.Pattern[str]],
|
||||
jobs: int,
|
||||
) -> None:
|
||||
source_info = project_source_info.build_info(ignore_prefix_list=CHECKER_IGNORE_PREFIX)
|
||||
source_defines = project_source_info.build_defines_as_args()
|
||||
@ -464,9 +462,11 @@ def run_checks_on_project(
|
||||
|
||||
import multiprocessing
|
||||
|
||||
if USE_MULTIPROCESS:
|
||||
job_total = multiprocessing.cpu_count() + 1
|
||||
with multiprocessing.Pool(processes=job_total) as pool:
|
||||
if jobs <= 0:
|
||||
jobs = multiprocessing.cpu_count() * 2
|
||||
|
||||
if jobs > 1:
|
||||
with multiprocessing.Pool(processes=jobs) as pool:
|
||||
# No `istarmap`, use an intermediate function.
|
||||
for result in pool.imap(check_source_file_for_imap, all_args):
|
||||
if result:
|
||||
@ -515,6 +515,17 @@ def create_parser(checkers_all: Sequence[str]) -> argparse.ArgumentParser:
|
||||
"Multiple checkers may be passed at once (comma separated, no spaces)."),
|
||||
required=True,
|
||||
)
|
||||
parser.add_argument(
|
||||
"--jobs",
|
||||
dest="jobs",
|
||||
type=int,
|
||||
default=0,
|
||||
help=(
|
||||
"The number of processes to use. "
|
||||
"Defaults to zero which detects the available cores, 1 is single threaded (useful for debugging)."
|
||||
),
|
||||
required=False,
|
||||
)
|
||||
|
||||
return parser
|
||||
|
||||
@ -536,7 +547,12 @@ def main() -> int:
|
||||
print("Error in expression: \"{:s}\"\n {!r}".format(expr, ex))
|
||||
return 1
|
||||
|
||||
run_checks_on_project(args.checks.split(','), regex_list)
|
||||
run_checks_on_project(
|
||||
args.checks.split(','),
|
||||
regex_list,
|
||||
args.jobs,
|
||||
)
|
||||
|
||||
return 0
|
||||
|
||||
|
||||
|
@ -3,8 +3,7 @@
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
set(INC
|
||||
.
|
||||
../atomic
|
||||
PUBLIC .
|
||||
)
|
||||
|
||||
set(INC_SYS
|
||||
@ -19,9 +18,12 @@ set(SRC
|
||||
|
||||
set(LIB
|
||||
PRIVATE bf::intern::guardedalloc
|
||||
PRIVATE bf::intern::atomic
|
||||
)
|
||||
|
||||
# Disabled for makesdna/makesrna.
|
||||
add_definitions(-DWITH_CLOG_PTHREADS)
|
||||
|
||||
blender_add_lib(bf_intern_clog "${SRC}" "${INC}" "${INC_SYS}" "${LIB}")
|
||||
|
||||
# Disabled for makesdna/makesrna.
|
||||
target_compile_definitions(bf_intern_clog PRIVATE WITH_CLOG_PTHREADS)
|
||||
|
||||
add_library(bf::intern::clog ALIAS bf_intern_clog)
|
||||
|
@ -623,6 +623,8 @@ ccl_device_forceinline Spectrum mnee_eval_bsdf_contribution(ccl_private ShaderCl
|
||||
G = bsdf_G<MicrofacetType::GGX>(alpha2, cosNI, cosNO);
|
||||
}
|
||||
|
||||
Spectrum F = microfacet_fresnel(bsdf, wi, Ht, true);
|
||||
|
||||
/*
|
||||
* bsdf_do = (1 - F) * D_do * G * |h.wi| / (n.wi * n.wo)
|
||||
* pdf_dh = D_dh * cosThetaM
|
||||
@ -631,7 +633,7 @@ ccl_device_forceinline Spectrum mnee_eval_bsdf_contribution(ccl_private ShaderCl
|
||||
* contribution = bsdf_do * |do/dh| * |n.wo / n.h| / pdf_dh
|
||||
* = (1 - F) * G * |h.wi / (n.wi * n.h^2)|
|
||||
*/
|
||||
return bsdf->weight * G * fabsf(cosHI / (cosNI * sqr(cosThetaM)));
|
||||
return bsdf->weight * F * G * fabsf(cosHI / (cosNI * sqr(cosThetaM)));
|
||||
}
|
||||
|
||||
/* Compute transfer matrix determinant |T1| = |dx1/dxn| (and |dh/dx| in the process) */
|
||||
|
@ -403,6 +403,10 @@ ccl_device void osl_closure_microfacet_setup(KernelGlobals kg,
|
||||
else if (closure->distribution == make_string("ashikhmin_shirley", 11318482998918370922ull)) {
|
||||
sd->flag |= bsdf_ashikhmin_shirley_setup(bsdf);
|
||||
}
|
||||
/* Clearcoat */
|
||||
else if (closure->distribution == make_string("clearcoat", 3490136178980547276ull)) {
|
||||
sd->flag |= bsdf_microfacet_ggx_clearcoat_setup(bsdf, sd);
|
||||
}
|
||||
/* GGX (either single- or multi-scattering) */
|
||||
else {
|
||||
if (closure->refract == 1) {
|
||||
@ -645,30 +649,6 @@ ccl_device void osl_closure_principled_sheen_setup(
|
||||
sd->flag |= bsdf_principled_sheen_setup(sd, bsdf);
|
||||
}
|
||||
|
||||
ccl_device void osl_closure_principled_clearcoat_setup(
|
||||
KernelGlobals kg,
|
||||
ccl_private ShaderData *sd,
|
||||
uint32_t path_flag,
|
||||
float3 weight,
|
||||
ccl_private const PrincipledClearcoatClosure *closure)
|
||||
{
|
||||
weight *= 0.25f * closure->clearcoat;
|
||||
ccl_private MicrofacetBsdf *bsdf = (ccl_private MicrofacetBsdf *)bsdf_alloc(
|
||||
sd, sizeof(MicrofacetBsdf), rgb_to_spectrum(weight));
|
||||
if (!bsdf) {
|
||||
return;
|
||||
}
|
||||
|
||||
bsdf->N = ensure_valid_specular_reflection(sd->Ng, sd->wi, closure->N);
|
||||
bsdf->alpha_x = closure->clearcoat_roughness;
|
||||
bsdf->alpha_y = closure->clearcoat_roughness;
|
||||
bsdf->ior = 1.5f;
|
||||
|
||||
bsdf->T = zero_float3();
|
||||
|
||||
sd->flag |= bsdf_microfacet_ggx_clearcoat_setup(bsdf, sd);
|
||||
}
|
||||
|
||||
/* Variable cone emissive closure
|
||||
*
|
||||
* This primitive emits in a cone having a configurable penumbra area where the light decays to 0
|
||||
|
@ -136,12 +136,6 @@ OSL_CLOSURE_STRUCT_BEGIN(PrincipledSheen, principled_sheen)
|
||||
OSL_CLOSURE_STRUCT_MEMBER(PrincipledSheen, VECTOR, packed_float3, N, NULL)
|
||||
OSL_CLOSURE_STRUCT_END(PrincipledSheen, principled_sheen)
|
||||
|
||||
OSL_CLOSURE_STRUCT_BEGIN(PrincipledClearcoat, principled_clearcoat)
|
||||
OSL_CLOSURE_STRUCT_MEMBER(PrincipledClearcoat, VECTOR, packed_float3, N, NULL)
|
||||
OSL_CLOSURE_STRUCT_MEMBER(PrincipledClearcoat, FLOAT, float, clearcoat, NULL)
|
||||
OSL_CLOSURE_STRUCT_MEMBER(PrincipledClearcoat, FLOAT, float, clearcoat_roughness, NULL)
|
||||
OSL_CLOSURE_STRUCT_END(PrincipledClearcoat, principled_clearcoat)
|
||||
|
||||
OSL_CLOSURE_STRUCT_BEGIN(GenericEmissive, emission)
|
||||
OSL_CLOSURE_STRUCT_END(GenericEmissive, emission)
|
||||
|
||||
|
@ -24,13 +24,11 @@ shader node_principled_bsdf(string distribution = "multi_ggx",
|
||||
float ClearcoatRoughness = 0.03,
|
||||
float IOR = 1.45,
|
||||
float Transmission = 0.0,
|
||||
float TransmissionRoughness = 0.0,
|
||||
normal Normal = N,
|
||||
normal ClearcoatNormal = N,
|
||||
normal Tangent = normalize(dPdu),
|
||||
output closure color BSDF = 0)
|
||||
{
|
||||
float f = max(IOR, 1e-5);
|
||||
float diffuse_weight = (1.0 - clamp(Metallic, 0.0, 1.0)) * (1.0 - clamp(Transmission, 0.0, 1.0));
|
||||
float final_transmission = clamp(Transmission, 0.0, 1.0) * (1.0 - clamp(Metallic, 0.0, 1.0));
|
||||
float specular_weight = (1.0 - final_transmission);
|
||||
@ -92,34 +90,15 @@ shader node_principled_bsdf(string distribution = "multi_ggx",
|
||||
|
||||
if (final_transmission > 1e-5) {
|
||||
color Cspec0 = mix(color(1.0), BaseColor, SpecularTint);
|
||||
float eta = backfacing() ? 1.0 / f : f;
|
||||
float eta = max(IOR, 1e-5);
|
||||
eta = backfacing() ? 1.0 / eta : eta;
|
||||
|
||||
if (distribution == "ggx" || Roughness <= 5e-2) {
|
||||
float cosNI = dot(Normal, I);
|
||||
float Fr = fresnel_dielectric_cos(cosNI, eta);
|
||||
|
||||
float refl_roughness = Roughness;
|
||||
if (Roughness <= 1e-2)
|
||||
refl_roughness = 0.0;
|
||||
|
||||
float transmission_roughness = refl_roughness;
|
||||
if (distribution == "ggx")
|
||||
transmission_roughness = 1.0 - (1.0 - refl_roughness) * (1.0 - TransmissionRoughness);
|
||||
|
||||
closure color refraction = microfacet(
|
||||
"ggx", Normal, transmission_roughness * transmission_roughness, eta, 1);
|
||||
closure color reflection = microfacet_aniso_fresnel(
|
||||
Normal, T, r2, r2, Cspec0, color(1.0), eta, "ggx");
|
||||
BSDF += final_transmission * mix(BaseColor * refraction, reflection, Fr);
|
||||
}
|
||||
else {
|
||||
BSDF += final_transmission *
|
||||
dielectric_bsdf(Normal, vector(0.0), Cspec0, BaseColor, r2, r2, eta, "multi_ggx");
|
||||
}
|
||||
BSDF += final_transmission *
|
||||
dielectric_bsdf(Normal, vector(0.0), Cspec0, BaseColor, r2, r2, eta, distribution);
|
||||
}
|
||||
|
||||
if (Clearcoat > 1e-5) {
|
||||
BSDF += principled_clearcoat(
|
||||
ClearcoatNormal, Clearcoat, ClearcoatRoughness * ClearcoatRoughness);
|
||||
float clearcoat_r2 = ClearcoatRoughness * ClearcoatRoughness;
|
||||
BSDF += 0.25 * Clearcoat * microfacet("clearcoat", ClearcoatNormal, clearcoat_r2, 1.5, 0);
|
||||
}
|
||||
}
|
||||
|
@ -26,7 +26,6 @@ closure color ashikhmin_velvet(normal N, float sigma) BUILTIN;
|
||||
closure color ambient_occlusion() BUILTIN;
|
||||
closure color principled_diffuse(normal N, float roughness) BUILTIN;
|
||||
closure color principled_sheen(normal N) BUILTIN;
|
||||
closure color principled_clearcoat(normal N, float clearcoat, float clearcoat_roughness) BUILTIN;
|
||||
|
||||
/* Needed to pass along the color for multi-scattering saturation adjustment,
|
||||
* otherwise could be replaced by microfacet() */
|
||||
|
@ -69,8 +69,7 @@ ccl_device_noinline int svm_node_closure_bsdf(KernelGlobals kg,
|
||||
case CLOSURE_BSDF_PRINCIPLED_ID: {
|
||||
uint specular_offset, roughness_offset, specular_tint_offset, anisotropic_offset,
|
||||
sheen_offset, sheen_tint_offset, clearcoat_offset, clearcoat_roughness_offset,
|
||||
eta_offset, transmission_offset, anisotropic_rotation_offset,
|
||||
transmission_roughness_offset;
|
||||
eta_offset, transmission_offset, anisotropic_rotation_offset, pad1;
|
||||
uint4 data_node2 = read_node(kg, &offset);
|
||||
|
||||
float3 T = stack_load_float3(stack, data_node.y);
|
||||
@ -84,11 +83,8 @@ ccl_device_noinline int svm_node_closure_bsdf(KernelGlobals kg,
|
||||
&sheen_tint_offset,
|
||||
&clearcoat_offset,
|
||||
&clearcoat_roughness_offset);
|
||||
svm_unpack_node_uchar4(data_node2.x,
|
||||
&eta_offset,
|
||||
&transmission_offset,
|
||||
&anisotropic_rotation_offset,
|
||||
&transmission_roughness_offset);
|
||||
svm_unpack_node_uchar4(
|
||||
data_node2.x, &eta_offset, &transmission_offset, &anisotropic_rotation_offset, &pad1);
|
||||
|
||||
// get Disney principled parameters
|
||||
float metallic = param1;
|
||||
@ -103,7 +99,6 @@ ccl_device_noinline int svm_node_closure_bsdf(KernelGlobals kg,
|
||||
float clearcoat_roughness = stack_load_float(stack, clearcoat_roughness_offset);
|
||||
float transmission = stack_load_float(stack, transmission_offset);
|
||||
float anisotropic_rotation = stack_load_float(stack, anisotropic_rotation_offset);
|
||||
float transmission_roughness = stack_load_float(stack, transmission_roughness_offset);
|
||||
float eta = fmaxf(stack_load_float(stack, eta_offset), 1e-5f);
|
||||
|
||||
ClosureType distribution = (ClosureType)data_node2.y;
|
||||
@ -113,13 +108,7 @@ ccl_device_noinline int svm_node_closure_bsdf(KernelGlobals kg,
|
||||
if (anisotropic_rotation != 0.0f)
|
||||
T = rotate_around_axis(T, N, anisotropic_rotation * M_2PI_F);
|
||||
|
||||
/* calculate ior */
|
||||
float ior = (sd->flag & SD_BACKFACING) ? 1.0f / eta : eta;
|
||||
|
||||
/* Calculate fresnel for refraction. */
|
||||
float3 valid_reflection_N = maybe_ensure_valid_specular_reflection(sd, N);
|
||||
float cosNI = dot(valid_reflection_N, sd->wi);
|
||||
float fresnel = fresnel_dielectric_cos(cosNI, ior);
|
||||
|
||||
// calculate weights of the diffuse and specular part
|
||||
float diffuse_weight = (1.0f - saturatef(metallic)) * (1.0f - saturatef(transmission));
|
||||
@ -301,7 +290,7 @@ ccl_device_noinline int svm_node_closure_bsdf(KernelGlobals kg,
|
||||
}
|
||||
#endif
|
||||
|
||||
/* BSDF */
|
||||
/* Transmission */
|
||||
#ifdef __CAUSTICS_TRICKS__
|
||||
if (kernel_data.integrator.caustics_reflective ||
|
||||
kernel_data.integrator.caustics_refractive || (path_flag & PATH_RAY_DIFFUSE) == 0)
|
||||
@ -311,100 +300,27 @@ ccl_device_noinline int svm_node_closure_bsdf(KernelGlobals kg,
|
||||
Spectrum glass_weight = weight * final_transmission;
|
||||
Spectrum cspec0 = base_color * specular_tint + make_float3(1.0f - specular_tint);
|
||||
|
||||
/* Use single-scatter GGX. */
|
||||
if (roughness <= 5e-2f || distribution == CLOSURE_BSDF_MICROFACET_GGX_GLASS_ID) {
|
||||
ccl_private MicrofacetBsdf *bsdf = (ccl_private MicrofacetBsdf *)bsdf_alloc(
|
||||
sd, sizeof(MicrofacetBsdf), glass_weight);
|
||||
ccl_private FresnelDielectricTint *fresnel =
|
||||
(bsdf != NULL) ? (ccl_private FresnelDielectricTint *)closure_alloc_extra(
|
||||
sd, sizeof(FresnelDielectricTint)) :
|
||||
NULL;
|
||||
|
||||
float refl_roughness = roughness;
|
||||
if (bsdf && fresnel) {
|
||||
bsdf->N = valid_reflection_N;
|
||||
bsdf->T = zero_float3();
|
||||
|
||||
/* reflection */
|
||||
#ifdef __CAUSTICS_TRICKS__
|
||||
if (kernel_data.integrator.caustics_reflective || (path_flag & PATH_RAY_DIFFUSE) == 0)
|
||||
#endif
|
||||
{
|
||||
ccl_private MicrofacetBsdf *bsdf = (ccl_private MicrofacetBsdf *)bsdf_alloc(
|
||||
sd, sizeof(MicrofacetBsdf), glass_weight * fresnel);
|
||||
ccl_private FresnelGeneralizedSchlick *fresnel =
|
||||
(bsdf != NULL) ? (ccl_private FresnelGeneralizedSchlick *)closure_alloc_extra(
|
||||
sd, sizeof(FresnelGeneralizedSchlick)) :
|
||||
NULL;
|
||||
bsdf->alpha_x = bsdf->alpha_y = sqr(roughness);
|
||||
bsdf->ior = (sd->flag & SD_BACKFACING) ? 1.0f / eta : eta;
|
||||
|
||||
if (bsdf && fresnel) {
|
||||
bsdf->N = valid_reflection_N;
|
||||
bsdf->T = zero_float3();
|
||||
fresnel->reflection_tint = cspec0;
|
||||
fresnel->transmission_tint = base_color;
|
||||
|
||||
bsdf->alpha_x = refl_roughness * refl_roughness;
|
||||
bsdf->alpha_y = refl_roughness * refl_roughness;
|
||||
bsdf->ior = ior;
|
||||
|
||||
/* setup bsdf */
|
||||
sd->flag |= bsdf_microfacet_ggx_setup(bsdf);
|
||||
|
||||
fresnel->f0 = cspec0;
|
||||
fresnel->f90 = one_spectrum();
|
||||
fresnel->exponent = -1.0f;
|
||||
fresnel->reflection_tint = one_spectrum();
|
||||
fresnel->transmission_tint = zero_spectrum();
|
||||
|
||||
bsdf_microfacet_setup_fresnel_generalized_schlick(kg, bsdf, sd, fresnel, false);
|
||||
}
|
||||
}
|
||||
|
||||
/* refraction */
|
||||
#ifdef __CAUSTICS_TRICKS__
|
||||
if (kernel_data.integrator.caustics_refractive || (path_flag & PATH_RAY_DIFFUSE) == 0)
|
||||
#endif
|
||||
{
|
||||
/* This is to prevent MNEE from receiving a null BSDF. */
|
||||
float refraction_fresnel = fmaxf(0.0001f, 1.0f - fresnel);
|
||||
ccl_private MicrofacetBsdf *bsdf = (ccl_private MicrofacetBsdf *)bsdf_alloc(
|
||||
sd,
|
||||
sizeof(MicrofacetBsdf),
|
||||
rgb_to_spectrum(base_color) * glass_weight * refraction_fresnel);
|
||||
if (bsdf) {
|
||||
bsdf->N = valid_reflection_N;
|
||||
bsdf->T = zero_float3();
|
||||
|
||||
if (distribution == CLOSURE_BSDF_MICROFACET_GGX_GLASS_ID)
|
||||
transmission_roughness = 1.0f - (1.0f - refl_roughness) *
|
||||
(1.0f - transmission_roughness);
|
||||
else
|
||||
transmission_roughness = refl_roughness;
|
||||
|
||||
bsdf->alpha_x = transmission_roughness * transmission_roughness;
|
||||
bsdf->alpha_y = transmission_roughness * transmission_roughness;
|
||||
bsdf->ior = ior;
|
||||
|
||||
/* setup bsdf */
|
||||
sd->flag |= bsdf_microfacet_ggx_refraction_setup(bsdf);
|
||||
}
|
||||
}
|
||||
} /* Use multi-scatter GGX. */
|
||||
else {
|
||||
ccl_private MicrofacetBsdf *bsdf = (ccl_private MicrofacetBsdf *)bsdf_alloc(
|
||||
sd, sizeof(MicrofacetBsdf), glass_weight);
|
||||
ccl_private FresnelGeneralizedSchlick *fresnel =
|
||||
(bsdf != NULL) ? (ccl_private FresnelGeneralizedSchlick *)closure_alloc_extra(
|
||||
sd, sizeof(FresnelGeneralizedSchlick)) :
|
||||
NULL;
|
||||
|
||||
if (bsdf && fresnel) {
|
||||
bsdf->N = valid_reflection_N;
|
||||
bsdf->T = zero_float3();
|
||||
|
||||
bsdf->alpha_x = roughness * roughness;
|
||||
bsdf->alpha_y = roughness * roughness;
|
||||
bsdf->ior = ior;
|
||||
|
||||
fresnel->f0 = make_spectrum(F0_from_ior(ior));
|
||||
fresnel->f90 = one_spectrum();
|
||||
fresnel->exponent = -1.0f;
|
||||
fresnel->reflection_tint = cspec0;
|
||||
fresnel->transmission_tint = base_color;
|
||||
|
||||
/* setup bsdf */
|
||||
sd->flag |= bsdf_microfacet_ggx_glass_setup(bsdf);
|
||||
bsdf_microfacet_setup_fresnel_generalized_schlick(kg, bsdf, sd, fresnel, true);
|
||||
}
|
||||
/* setup bsdf */
|
||||
sd->flag |= bsdf_microfacet_ggx_glass_setup(bsdf);
|
||||
const bool is_multiggx = (distribution == CLOSURE_BSDF_MICROFACET_MULTI_GGX_GLASS_ID);
|
||||
bsdf_microfacet_setup_fresnel_dielectric_tint(kg, bsdf, sd, fresnel, is_multiggx);
|
||||
}
|
||||
}
|
||||
#ifdef __CAUSTICS_TRICKS__
|
||||
|
@ -2659,7 +2659,6 @@ NODE_DEFINE(PrincipledBsdfNode)
|
||||
SOCKET_IN_FLOAT(clearcoat_roughness, "Clearcoat Roughness", 0.03f);
|
||||
SOCKET_IN_FLOAT(ior, "IOR", 0.0f);
|
||||
SOCKET_IN_FLOAT(transmission, "Transmission", 0.0f);
|
||||
SOCKET_IN_FLOAT(transmission_roughness, "Transmission Roughness", 0.0f);
|
||||
SOCKET_IN_FLOAT(anisotropic_rotation, "Anisotropic Rotation", 0.0f);
|
||||
SOCKET_IN_COLOR(emission, "Emission", zero_float3());
|
||||
SOCKET_IN_FLOAT(emission_strength, "Emission Strength", 1.0f);
|
||||
@ -2770,8 +2769,7 @@ void PrincipledBsdfNode::compile(SVMCompiler &compiler,
|
||||
ShaderInput *p_clearcoat_roughness,
|
||||
ShaderInput *p_ior,
|
||||
ShaderInput *p_transmission,
|
||||
ShaderInput *p_anisotropic_rotation,
|
||||
ShaderInput *p_transmission_roughness)
|
||||
ShaderInput *p_anisotropic_rotation)
|
||||
{
|
||||
ShaderInput *base_color_in = input("Base Color");
|
||||
ShaderInput *subsurface_color_in = input("Subsurface Color");
|
||||
@ -2796,7 +2794,6 @@ void PrincipledBsdfNode::compile(SVMCompiler &compiler,
|
||||
int clearcoat_roughness_offset = compiler.stack_assign(p_clearcoat_roughness);
|
||||
int ior_offset = compiler.stack_assign(p_ior);
|
||||
int transmission_offset = compiler.stack_assign(p_transmission);
|
||||
int transmission_roughness_offset = compiler.stack_assign(p_transmission_roughness);
|
||||
int anisotropic_rotation_offset = compiler.stack_assign(p_anisotropic_rotation);
|
||||
int subsurface_radius_offset = compiler.stack_assign(p_subsurface_radius);
|
||||
int subsurface_ior_offset = compiler.stack_assign(p_subsurface_ior);
|
||||
@ -2818,13 +2815,12 @@ void PrincipledBsdfNode::compile(SVMCompiler &compiler,
|
||||
compiler.encode_uchar4(
|
||||
sheen_offset, sheen_tint_offset, clearcoat_offset, clearcoat_roughness_offset));
|
||||
|
||||
compiler.add_node(compiler.encode_uchar4(ior_offset,
|
||||
transmission_offset,
|
||||
anisotropic_rotation_offset,
|
||||
transmission_roughness_offset),
|
||||
distribution,
|
||||
subsurface_method,
|
||||
SVM_STACK_INVALID);
|
||||
compiler.add_node(
|
||||
compiler.encode_uchar4(
|
||||
ior_offset, transmission_offset, anisotropic_rotation_offset, SVM_STACK_INVALID),
|
||||
distribution,
|
||||
subsurface_method,
|
||||
SVM_STACK_INVALID);
|
||||
|
||||
float3 bc_default = get_float3(base_color_in->socket_type);
|
||||
|
||||
@ -2866,8 +2862,7 @@ void PrincipledBsdfNode::compile(SVMCompiler &compiler)
|
||||
input("Clearcoat Roughness"),
|
||||
input("IOR"),
|
||||
input("Transmission"),
|
||||
input("Anisotropic Rotation"),
|
||||
input("Transmission Roughness"));
|
||||
input("Anisotropic Rotation"));
|
||||
}
|
||||
|
||||
void PrincipledBsdfNode::compile(OSLCompiler &compiler)
|
||||
|
@ -531,8 +531,7 @@ class PrincipledBsdfNode : public BsdfBaseNode {
|
||||
ShaderInput *clearcoat_roughness,
|
||||
ShaderInput *ior,
|
||||
ShaderInput *transmission,
|
||||
ShaderInput *anisotropic_rotation,
|
||||
ShaderInput *transmission_roughness);
|
||||
ShaderInput *anisotropic_rotation);
|
||||
|
||||
NODE_SOCKET_API(float3, base_color)
|
||||
NODE_SOCKET_API(float3, subsurface_color)
|
||||
@ -552,7 +551,6 @@ class PrincipledBsdfNode : public BsdfBaseNode {
|
||||
NODE_SOCKET_API(float, ior)
|
||||
NODE_SOCKET_API(float, transmission)
|
||||
NODE_SOCKET_API(float, anisotropic_rotation)
|
||||
NODE_SOCKET_API(float, transmission_roughness)
|
||||
NODE_SOCKET_API(float3, normal)
|
||||
NODE_SOCKET_API(float3, clearcoat_normal)
|
||||
NODE_SOCKET_API(float3, tangent)
|
||||
|
@ -4,7 +4,6 @@
|
||||
|
||||
set(INC
|
||||
.
|
||||
../clog
|
||||
../../source/blender/imbuf
|
||||
)
|
||||
|
||||
@ -75,6 +74,7 @@ set(LIB
|
||||
${Epoxy_LIBRARIES}
|
||||
PRIVATE bf::blenlib
|
||||
PRIVATE bf::dna
|
||||
PRIVATE bf::intern::clog
|
||||
)
|
||||
|
||||
if(WITH_OPENGL_BACKEND)
|
||||
|
@ -44,11 +44,7 @@ class GHOST_ContextCGL : public GHOST_Context {
|
||||
/**
|
||||
* Constructor.
|
||||
*/
|
||||
GHOST_ContextCGL(bool stereoVisual,
|
||||
NSView *metalView,
|
||||
CAMetalLayer *metalLayer,
|
||||
NSOpenGLView *openglView,
|
||||
GHOST_TDrawingContextType type);
|
||||
GHOST_ContextCGL(bool stereoVisual, NSView *metalView, CAMetalLayer *metalLayer, int debug);
|
||||
|
||||
/**
|
||||
* Destructor.
|
||||
@ -134,23 +130,11 @@ class GHOST_ContextCGL : public GHOST_Context {
|
||||
|
||||
private:
|
||||
/** Metal state */
|
||||
/* Set this flag to `true` when rendering with Metal API for Viewport.
|
||||
* TODO(Metal): This should be assigned to externally. */
|
||||
bool m_useMetalForRendering = false;
|
||||
NSView *m_metalView;
|
||||
CAMetalLayer *m_metalLayer;
|
||||
MTLRenderPipelineState *m_metalRenderPipeline;
|
||||
bool m_ownsMetalDevice;
|
||||
|
||||
/** OpenGL state, for GPUs that don't support Metal */
|
||||
NSOpenGLView *m_openGLView;
|
||||
|
||||
/** The OpenGL drawing context */
|
||||
NSOpenGLContext *m_openGLContext;
|
||||
|
||||
/** The virtualized default frame-buffer. */
|
||||
unsigned int m_defaultFramebuffer;
|
||||
|
||||
/** The virtualized default frame-buffer's texture. */
|
||||
/**
|
||||
* Texture that you can render into with Metal. The texture will be
|
||||
@ -191,5 +175,5 @@ class GHOST_ContextCGL : public GHOST_Context {
|
||||
void metalInitFramebuffer();
|
||||
void metalUpdateFramebuffer();
|
||||
void metalSwapBuffers();
|
||||
void initClear();
|
||||
void initClear(){};
|
||||
};
|
||||
|
@ -27,9 +27,7 @@
|
||||
|
||||
static void ghost_fatal_error_dialog(const char *msg)
|
||||
{
|
||||
/* clang-format off */
|
||||
@autoreleasepool {
|
||||
/* clang-format on */
|
||||
NSString *message = [NSString stringWithFormat:@"Error opening window:\n%s", msg];
|
||||
|
||||
NSAlert *alert = [[NSAlert alloc] init];
|
||||
@ -50,17 +48,12 @@ int GHOST_ContextCGL::s_sharedCount = 0;
|
||||
GHOST_ContextCGL::GHOST_ContextCGL(bool stereoVisual,
|
||||
NSView *metalView,
|
||||
CAMetalLayer *metalLayer,
|
||||
NSOpenGLView *openGLView,
|
||||
GHOST_TDrawingContextType type)
|
||||
int debug)
|
||||
: GHOST_Context(stereoVisual),
|
||||
m_useMetalForRendering(type == GHOST_kDrawingContextTypeMetal),
|
||||
m_metalView(metalView),
|
||||
m_metalLayer(metalLayer),
|
||||
m_metalRenderPipeline(nil),
|
||||
m_openGLView(openGLView),
|
||||
m_openGLContext(nil),
|
||||
m_defaultFramebuffer(0),
|
||||
m_debug(false)
|
||||
m_debug(debug)
|
||||
{
|
||||
/* Initialize Metal Swap-chain. */
|
||||
current_swapchain_index = 0;
|
||||
@ -68,6 +61,7 @@ GHOST_ContextCGL::GHOST_ContextCGL(bool stereoVisual,
|
||||
m_defaultFramebufferMetalTexture[i].texture = nil;
|
||||
m_defaultFramebufferMetalTexture[i].index = i;
|
||||
}
|
||||
|
||||
if (m_metalView) {
|
||||
m_ownsMetalDevice = false;
|
||||
metalInit();
|
||||
@ -107,31 +101,6 @@ GHOST_ContextCGL::~GHOST_ContextCGL()
|
||||
{
|
||||
metalFree();
|
||||
|
||||
if (!m_useMetalForRendering) {
|
||||
#ifdef WITH_OPENGL_BACKEND
|
||||
if (m_openGLContext != nil) {
|
||||
if (m_openGLContext == [NSOpenGLContext currentContext]) {
|
||||
[NSOpenGLContext clearCurrentContext];
|
||||
|
||||
if (m_openGLView) {
|
||||
[m_openGLView clearGLContext];
|
||||
}
|
||||
}
|
||||
|
||||
if (m_openGLContext != s_sharedOpenGLContext || s_sharedCount == 1) {
|
||||
assert(s_sharedCount > 0);
|
||||
|
||||
s_sharedCount--;
|
||||
|
||||
if (s_sharedCount == 0)
|
||||
s_sharedOpenGLContext = nil;
|
||||
|
||||
[m_openGLContext release];
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
if (m_ownsMetalDevice) {
|
||||
if (m_metalLayer) {
|
||||
[m_metalLayer release];
|
||||
@ -142,165 +111,45 @@ GHOST_ContextCGL::~GHOST_ContextCGL()
|
||||
|
||||
GHOST_TSuccess GHOST_ContextCGL::swapBuffers()
|
||||
{
|
||||
GHOST_TSuccess return_value = GHOST_kFailure;
|
||||
|
||||
if (!m_useMetalForRendering) {
|
||||
#ifdef WITH_OPENGL_BACKEND
|
||||
if (m_openGLContext != nil) {
|
||||
if (m_metalView) {
|
||||
metalSwapBuffers();
|
||||
}
|
||||
else if (m_openGLView) {
|
||||
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
|
||||
[m_openGLContext flushBuffer];
|
||||
[pool drain];
|
||||
}
|
||||
return_value = GHOST_kSuccess;
|
||||
}
|
||||
else {
|
||||
return_value = GHOST_kFailure;
|
||||
}
|
||||
#endif
|
||||
if (m_metalView) {
|
||||
metalSwapBuffers();
|
||||
}
|
||||
else {
|
||||
if (m_metalView) {
|
||||
metalSwapBuffers();
|
||||
}
|
||||
return_value = GHOST_kSuccess;
|
||||
}
|
||||
return return_value;
|
||||
return GHOST_kSuccess;
|
||||
}
|
||||
|
||||
GHOST_TSuccess GHOST_ContextCGL::setSwapInterval(int interval)
|
||||
{
|
||||
|
||||
if (!m_useMetalForRendering) {
|
||||
#ifdef WITH_OPENGL_BACKEND
|
||||
if (m_openGLContext != nil) {
|
||||
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
|
||||
[m_openGLContext setValues:&interval forParameter:NSOpenGLCPSwapInterval];
|
||||
[pool drain];
|
||||
return GHOST_kSuccess;
|
||||
}
|
||||
else {
|
||||
return GHOST_kFailure;
|
||||
}
|
||||
#endif
|
||||