Add Chromium-only Blender WebEngine parity work

This commit is contained in:
mes123456
2026-08-12 04:47:48 -04:00
commit 9fd26010f6
18225 changed files with 11622124 additions and 0 deletions

View File

@@ -0,0 +1,36 @@
commit 6d2b7f71b98bfa28e372b1f2d85f137280bdb3de
Author: James Zern <jzern@google.com>
Date: Tue Oct 7 14:08:44 2025 -0700
cmake: fix nasm detection w/3.0
nasm 3.0 separated Oflags (-Ox) output to `-hO` which is used to
validate the nasm binary. This change is compatible with older versions
(tested with NASM version 2.16.03 & 2.13.02).
Bug: aomedia:448994065
Fixed: aomedia:448994065
Change-Id: I704dcfe39ac6e68bc4d5b9e409fb59a0d277170e
diff --git a/build/cmake/aom_optimization.cmake b/build/cmake/aom_optimization.cmake
index 9cc34de362..2750a0be41 100644
--- a/build/cmake/aom_optimization.cmake
+++ b/build/cmake/aom_optimization.cmake
@@ -212,7 +212,7 @@ endfunction()
# Currently checks only for presence of required object formats and support for
# the -Ox argument (multipass optimization).
function(test_nasm)
- execute_process(COMMAND ${CMAKE_ASM_NASM_COMPILER} -hf
+ execute_process(COMMAND ${CMAKE_ASM_NASM_COMPILER} -hO
OUTPUT_VARIABLE nasm_helptext)
if(NOT "${nasm_helptext}" MATCHES "-Ox")
@@ -220,6 +220,8 @@ function(test_nasm)
FATAL_ERROR "Unsupported nasm: multipass optimization not supported.")
endif()
+ execute_process(COMMAND ${CMAKE_ASM_NASM_COMPILER} -hf
+ OUTPUT_VARIABLE nasm_helptext)
if("${AOM_TARGET_CPU}" STREQUAL "x86")
if("${AOM_TARGET_SYSTEM}" STREQUAL "Darwin")
if(NOT "${nasm_helptext}" MATCHES "macho32")

View File

@@ -0,0 +1,62 @@
# SPDX-FileCopyrightText: 2016 Blender Authors
#
# SPDX-License-Identifier: BSD-3-Clause
# - Find BLOSC library
# Find the native BLOSC includes and library
# This module defines
# BLOSC_INCLUDE_DIRS, where to find blosc.h, Set when
# BLOSC is found.
# BLOSC_LIBRARIES, libraries to link against to use BLOSC.
# BLOSC_ROOT_DIR, The base directory to search for BLOSC.
# This can also be an environment variable.
# BLOSC_FOUND, If false, do not try to use BLOSC.
#
# also defined, but not for general use are
# BLOSC_LIBRARY, where to find the BLOSC library.
# If BLOSC_ROOT_DIR was defined in the environment, use it.
IF(NOT BLOSC_ROOT_DIR AND NOT $ENV{BLOSC_ROOT_DIR} STREQUAL "")
SET(BLOSC_ROOT_DIR $ENV{BLOSC_ROOT_DIR})
ENDIF()
SET(_blosc_SEARCH_DIRS
${BLOSC_ROOT_DIR}
/opt/lib/blosc
)
FIND_PATH(BLOSC_INCLUDE_DIR
NAMES
blosc.h
HINTS
${_blosc_SEARCH_DIRS}
PATH_SUFFIXES
include
)
FIND_LIBRARY(BLOSC_LIBRARY
NAMES
blosc
HINTS
${_blosc_SEARCH_DIRS}
PATH_SUFFIXES
lib64 lib
)
# handle the QUIETLY and REQUIRED arguments and set BLOSC_FOUND to TRUE if
# all listed variables are TRUE
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(BLOSC DEFAULT_MSG
BLOSC_LIBRARY BLOSC_INCLUDE_DIR)
IF(BLOSC_FOUND)
SET(BLOSC_LIBRARIES ${BLOSC_LIBRARY})
SET(BLOSC_INCLUDE_DIRS ${BLOSC_INCLUDE_DIR})
ELSE()
SET(BLOSC_FOUND FALSE)
ENDIF()
MARK_AS_ADVANCED(
BLOSC_INCLUDE_DIR
BLOSC_LIBRARY
)

View File

@@ -0,0 +1,62 @@
# SPDX-FileCopyrightText: 2016 Blender Authors
#
# SPDX-License-Identifier: BSD-3-Clause
# - Find CPPUNIT library
# Find the native CPPUNIT includes and library
# This module defines
# CPPUNIT_INCLUDE_DIRS, where to find cppunit.h, Set when
# CPPUNIT is found.
# CPPUNIT_LIBRARIES, libraries to link against to use CPPUNIT.
# CPPUNIT_ROOT_DIR, The base directory to search for CPPUNIT.
# This can also be an environment variable.
# CPPUNIT_FOUND, If false, do not try to use CPPUNIT.
#
# also defined, but not for general use are
# CPPUNIT_LIBRARY, where to find the CPPUNIT library.
# If CPPUNIT_ROOT_DIR was defined in the environment, use it.
IF(NOT CPPUNIT_ROOT_DIR AND NOT $ENV{CPPUNIT_ROOT_DIR} STREQUAL "")
SET(CPPUNIT_ROOT_DIR $ENV{CPPUNIT_ROOT_DIR})
ENDIF()
SET(_cppunit_SEARCH_DIRS
${CPPUNIT_ROOT_DIR}
/opt/lib/cppunit
)
FIND_PATH(CPPUNIT_INCLUDE_DIR
NAMES
cppunit/Test.h
HINTS
${_cppunit_SEARCH_DIRS}
PATH_SUFFIXES
include
)
FIND_LIBRARY(CPPUNIT_LIBRARY
NAMES
cppunit
HINTS
${_cppunit_SEARCH_DIRS}
PATH_SUFFIXES
lib64 lib
)
# handle the QUIETLY and REQUIRED arguments and set CPPUNIT_FOUND to TRUE if
# all listed variables are TRUE
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(CPPUNIT DEFAULT_MSG
CPPUNIT_LIBRARY CPPUNIT_INCLUDE_DIR)
IF(CPPUNIT_FOUND)
SET(CPPUNIT_LIBRARIES ${CPPUNIT_LIBRARY})
SET(CPPUNIT_INCLUDE_DIRS ${CPPUNIT_INCLUDE_DIR})
ELSE()
SET(CPPUNIT_FOUND FALSE)
ENDIF()
MARK_AS_ADVANCED(
CPPUNIT_INCLUDE_DIR
CPPUNIT_LIBRARY
)

View File

@@ -0,0 +1,272 @@
# SPDX-FileCopyrightText: 2017-2023 Blender Authors
#
# SPDX-License-Identifier: BSD-3-Clause
# Module to find IlmBase
#
# This module will first look into the directories defined by the variables:
# - ILMBASE_HOME, ILMBASE_VERSION, ILMBASE_LIB_AREA
#
# It also supports non-standard names for the library components.
#
# To use a custom IlmBase:
# - Set the variable ILMBASE_CUSTOM to TRUE
# - Set the variable ILMBASE_CUSTOM_LIBRARIES to a list of the libraries to
# use, e.g. "SpiImath SpiHalf SpiIlmThread SpiIex"
# - Optionally set the variable ILMBASE_CUSTOM_INCLUDE_DIR to any
# particularly weird place that the OpenEXR/*.h files may be found
# - Optionally set the variable ILMBASE_CUSTOM_LIB_DIR to any
# particularly weird place that the libraries files may be found
#
# This module defines the following variables:
#
# ILMBASE_INCLUDE_DIR - where to find half.h, IlmBaseConfig.h, etc.
# ILMBASE_LIBRARIES - list of libraries to link against when using IlmBase.
# ILMBASE_FOUND - TRUE if IlmBase was found.
# Other standard issue macros
include(FindPackageHandleStandardArgs)
include(FindPackageMessage)
include(SelectLibraryConfigurations)
if(ILMBASE_USE_STATIC_LIBS)
set(_ilmbase_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES})
if(WIN32)
set(CMAKE_FIND_LIBRARY_SUFFIXES .lib .a ${CMAKE_FIND_LIBRARY_SUFFIXES})
else()
set(CMAKE_FIND_LIBRARY_SUFFIXES .a )
endif()
endif()
# Macro to assemble a helper state variable
macro(SET_STATE_VAR varname)
set(tmp_ilmbaselibs ${ILMBASE_CUSTOM_LIBRARIES})
separate_arguments(tmp_ilmbaselibs)
set(tmp_lst
${ILMBASE_CUSTOM} | ${tmp_ilmbaselibs} |
${ILMBASE_HOME} | ${ILMBASE_VERSION} | ${ILMBASE_LIB_AREA}
)
set(${varname} "${tmp_lst}")
unset(tmp_ilmbaselibs)
unset(tmp_lst)
endmacro()
# To enforce that find_* functions do not use inadvertently existing versions
if(ILMBASE_CUSTOM)
set(ILMBASE_FIND_OPTIONS "NO_DEFAULT_PATH")
endif()
# Macro to search for an include directory
macro(PREFIX_FIND_INCLUDE_DIR prefix includefile libpath_var)
string(TOUPPER ${prefix}_INCLUDE_DIR tmp_varname)
find_path(${tmp_varname} ${includefile}
HINTS ${${libpath_var}}
PATH_SUFFIXES include
${ILMBASE_FIND_OPTIONS}
)
if(${tmp_varname})
mark_as_advanced(${tmp_varname})
endif()
unset(tmp_varname)
endmacro()
# Macro to search for the given library and adds the cached
# variable names to the specified list
macro(PREFIX_FIND_LIB prefix libname libpath_var liblist_var cachelist_var)
string(TOUPPER ${prefix}_${libname} tmp_prefix)
# Handle new library names for OpenEXR 2.1 build via cmake
string(REPLACE "." "_" _ILMBASE_VERSION ${ILMBASE_VERSION})
string(SUBSTRING ${_ILMBASE_VERSION} 0 3 _ILMBASE_VERSION )
find_library(${tmp_prefix}_LIBRARY_RELEASE
NAMES ${libname} ${libname}-${_ILMBASE_VERSION}
HINTS ${${libpath_var}}
PATH_SUFFIXES lib
${ILMBASE_FIND_OPTIONS}
)
find_library(${tmp_prefix}_LIBRARY_DEBUG
NAMES ${libname}d ${libname}_d ${libname}debug ${libname}_debug
HINTS ${${libpath_var}}
PATH_SUFFIXES lib
${ILMBASE_FIND_OPTIONS}
)
# Properly define ${tmp_prefix}_LIBRARY (cached) and ${tmp_prefix}_LIBRARIES
select_library_configurations(${tmp_prefix})
list(APPEND ${liblist_var} ${tmp_prefix}_LIBRARIES)
# Add to the list of variables which should be reset
list(APPEND ${cachelist_var}
${tmp_prefix}_LIBRARY
${tmp_prefix}_LIBRARY_RELEASE
${tmp_prefix}_LIBRARY_DEBUG)
mark_as_advanced(
${tmp_prefix}_LIBRARY
${tmp_prefix}_LIBRARY_RELEASE
${tmp_prefix}_LIBRARY_DEBUG)
unset(tmp_prefix)
endmacro()
# Encode the current state of the external variables into a string
SET_STATE_VAR(ILMBASE_CURRENT_STATE)
# If the state has changed, clear the cached variables
if(ILMBASE_CACHED_STATE AND
NOT ILMBASE_CACHED_STATE STREQUAL ILMBASE_CURRENT_STATE)
foreach(libvar ${ILMBASE_CACHED_VARS})
unset(${libvar} CACHE)
endforeach()
endif()
# Generic search paths
set(IlmBase_generic_include_paths
${ILMBASE_CUSTOM_INCLUDE_DIR}
/usr/include
/usr/include/${CMAKE_LIBRARY_ARCHITECTURE}
/usr/local/include
/opt/local/include
)
set(IlmBase_generic_library_paths
${ILMBASE_CUSTOM_LIB_DIR}
/usr/lib
/usr/lib/${CMAKE_LIBRARY_ARCHITECTURE}
/usr/local/lib
/usr/local/lib/${CMAKE_LIBRARY_ARCHITECTURE}
/opt/local/lib
)
# Search paths for the IlmBase files
if(ILMBASE_HOME)
if(ILMBASE_VERSION)
set(IlmBase_include_paths
${ILMBASE_HOME}/ilmbase-${ILMBASE_VERSION}/include
${ILMBASE_HOME}/include/ilmbase-${ILMBASE_VERSION}
)
set(IlmBase_library_paths
${ILMBASE_HOME}/ilmbase-${ILMBASE_VERSION}/lib
${ILMBASE_HOME}/lib/ilmbase-${ILMBASE_VERSION}
)
endif()
list(APPEND IlmBase_include_paths ${ILMBASE_HOME}/include)
set(IlmBase_library_paths
${ILMBASE_HOME}/lib
${ILMBASE_HOME}/lib64
${ILMBASE_LIB_AREA}
${IlmBase_library_paths})
endif()
list(APPEND IlmBase_include_paths ${IlmBase_generic_include_paths})
list(APPEND IlmBase_library_paths ${IlmBase_generic_library_paths})
# Locate the header files
PREFIX_FIND_INCLUDE_DIR(IlmBase
OpenEXR/IlmBaseConfig.h IlmBase_include_paths)
if(ILMBASE_INCLUDE_DIR)
# Get the version from config file, if not already set.
if(NOT ILMBASE_VERSION)
FILE(STRINGS "${ILMBASE_INCLUDE_DIR}/OpenEXR/IlmBaseConfig.h" ILMBASE_BUILD_SPECIFICATION
REGEX "^[ \t]*#define[ \t]+ILMBASE_VERSION_STRING[ \t]+\"[.0-9]+\".*$")
if(ILMBASE_BUILD_SPECIFICATION)
if(NOT IlmBase_FIND_QUIETLY)
message(STATUS "${ILMBASE_BUILD_SPECIFICATION}")
endif()
string(REGEX REPLACE ".*#define[ \t]+ILMBASE_VERSION_STRING[ \t]+\"([.0-9]+)\".*"
"\\1" XYZ ${ILMBASE_BUILD_SPECIFICATION})
set("ILMBASE_VERSION" ${XYZ} CACHE STRING "Version of ILMBase lib")
else()
# Old versions (before 2.0?) do not have any version string,
# just assuming 2.0 should be fine though.
message(WARNING "Could not determine ILMBase library version, assuming 2.0.")
set("ILMBASE_VERSION" "2.0" CACHE STRING "Version of ILMBase lib")
endif()
endif()
endif()
if(ILMBASE_CUSTOM)
if(NOT ILMBASE_CUSTOM_LIBRARIES)
message(FATAL_ERROR "Custom IlmBase libraries requested but ILMBASE_CUSTOM_LIBRARIES is not set.")
endif()
set(IlmBase_Libraries ${ILMBASE_CUSTOM_LIBRARIES})
separate_arguments(IlmBase_Libraries)
else()
# elseif(${ILMBASE_VERSION} VERSION_LESS "2.1")
set(IlmBase_Libraries Half Iex Imath IlmThread)
# else()
# string(REGEX REPLACE "([0-9]+)[.]([0-9]+).*" "\\1_\\2" _ilmbase_libs_ver ${ILMBASE_VERSION})
# set(IlmBase_Libraries
# Half
# Iex-${_ilmbase_libs_ver}
# Imath-${_ilmbase_libs_ver}
# IlmThread-${_ilmbase_libs_ver}
# )
endif()
# Locate the IlmBase libraries
set(IlmBase_libvars "")
set(IlmBase_cachevars "")
foreach(ilmbase_lib ${IlmBase_Libraries})
PREFIX_FIND_LIB(IlmBase ${ilmbase_lib}
IlmBase_library_paths IlmBase_libvars IlmBase_cachevars)
endforeach()
# Create the list of variables that might need to be cleared
set(ILMBASE_CACHED_VARS
ILMBASE_INCLUDE_DIR ${IlmBase_cachevars}
CACHE INTERNAL "Variables set by FindIlmBase.cmake" FORCE)
# Store the current state so that variables might be cleared if required
set(ILMBASE_CACHED_STATE ${ILMBASE_CURRENT_STATE}
CACHE INTERNAL "State last seen by FindIlmBase.cmake" FORCE)
# Link with pthreads if required
if(NOT WIN32 AND EXISTS ${ILMBASE_INCLUDE_DIR}/OpenEXR/IlmBaseConfig.h)
file(STRINGS ${ILMBASE_INCLUDE_DIR}/OpenEXR/IlmBaseConfig.h
ILMBASE_HAVE_PTHREAD
REGEX "^[ \\t]*#define[ \\t]+HAVE_PTHREAD[ \\t]1[ \\t]*\$"
)
if(ILMBASE_HAVE_PTHREAD)
find_package(Threads)
if(CMAKE_USE_PTHREADS_INIT)
set(ILMBASE_PTHREADS ${CMAKE_THREAD_LIBS_INIT})
endif()
endif()
endif()
# Use the standard function to handle ILMBASE_FOUND
FIND_PACKAGE_HANDLE_STANDARD_ARGS(IlmBase DEFAULT_MSG
ILMBASE_INCLUDE_DIR ${IlmBase_libvars})
if(ILMBASE_FOUND)
set(ILMBASE_LIBRARIES "")
foreach(tmplib ${IlmBase_libvars})
list(APPEND ILMBASE_LIBRARIES ${${tmplib}})
endforeach()
list(APPEND ILMBASE_LIBRARIES ${ILMBASE_PTHREADS})
if(NOT IlmBase_FIND_QUIETLY)
FIND_PACKAGE_MESSAGE(ILMBASE
"Found IlmBase: ${ILMBASE_LIBRARIES}"
"[${ILMBASE_INCLUDE_DIR}][${ILMBASE_LIBRARIES}][${ILMBASE_CURRENT_STATE}]"
)
endif()
endif()
# Restore the original find library ordering
if(ILMBASE_USE_STATIC_LIBS )
set(CMAKE_FIND_LIBRARY_SUFFIXES ${_ilmbase_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES})
endif()
# Unset the helper variables to avoid pollution
unset(ILMBASE_CURRENT_STATE)
unset(IlmBase_include_paths)
unset(IlmBase_library_paths)
unset(IlmBase_generic_include_paths)
unset(IlmBase_generic_library_paths)
unset(IlmBase_libvars)
unset(IlmBase_cachevars)
unset(ILMBASE_PTHREADS)

View File

@@ -0,0 +1,62 @@
# SPDX-FileCopyrightText: 2016 Blender Authors
#
# SPDX-License-Identifier: BSD-3-Clause
# - Find LOGC4PLUS library
# Find the native LOGC4PLUS includes and library
# This module defines
# LOGC4PLUS_INCLUDE_DIRS, where to find logc4plus.h, Set when
# LOGC4PLUS is found.
# LOGC4PLUS_LIBRARIES, libraries to link against to use LOGC4PLUS.
# LOGC4PLUS_ROOT_DIR, The base directory to search for LOGC4PLUS.
# This can also be an environment variable.
# LOGC4PLUS_FOUND, If false, do not try to use LOGC4PLUS.
#
# also defined, but not for general use are
# LOGC4PLUS_LIBRARY, where to find the LOGC4PLUS library.
# If LOGC4PLUS_ROOT_DIR was defined in the environment, use it.
IF(NOT LOGC4PLUS_ROOT_DIR AND NOT $ENV{LOGC4PLUS_ROOT_DIR} STREQUAL "")
SET(LOGC4PLUS_ROOT_DIR $ENV{LOGC4PLUS_ROOT_DIR})
ENDIF()
SET(_logc4plus_SEARCH_DIRS
${LOGC4PLUS_ROOT_DIR}
/opt/lib/logc4plus
)
FIND_PATH(LOGC4PLUS_INCLUDE_DIR
NAMES
logc4plus.h
HINTS
${_logc4plus_SEARCH_DIRS}
PATH_SUFFIXES
include
)
FIND_LIBRARY(LOGC4PLUS_LIBRARY
NAMES
logc4plus
HINTS
${_logc4plus_SEARCH_DIRS}
PATH_SUFFIXES
lib64 lib
)
# handle the QUIETLY and REQUIRED arguments and set LOGC4PLUS_FOUND to TRUE if
# all listed variables are TRUE
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(LOGC4PLUS DEFAULT_MSG
LOGC4PLUS_LIBRARY LOGC4PLUS_INCLUDE_DIR)
IF(LOGC4PLUS_FOUND)
SET(LOGC4PLUS_LIBRARIES ${LOGC4PLUS_LIBRARY})
SET(LOGC4PLUS_INCLUDE_DIRS ${LOGC4PLUS_INCLUDE_DIR})
ELSE()
SET(LOGC4PLUS_FOUND FALSE)
ENDIF()
MARK_AS_ADVANCED(
LOGC4PLUS_INCLUDE_DIR
LOGC4PLUS_LIBRARY
)

View File

@@ -0,0 +1,249 @@
# SPDX-FileCopyrightText: 2017-2023 Blender Authors
#
# SPDX-License-Identifier: BSD-3-Clause
# Module to find OpenEXR.
#
# This module will first look into the directories defined by the variables:
# - OPENEXR_HOME, OPENEXR_VERSION, OPENEXR_LIB_AREA
#
# It also supports non-standard names for the library components.
#
# To use a custom OpenEXR
# - Set the variable OPENEXR_CUSTOM to TRUE
# - Set the variable OPENEXR_CUSTOM_LIBRARY to the name of the library to
# use, e.g. "SpiIlmImf"
# - Optionally set the variable OPENEXR_CUSTOM_INCLUDE_DIR to any
# particularly weird place that the OpenEXR/*.h files may be found
# - Optionally set the variable OPENEXR_CUSTOM_LIB_DIR to any
# particularly weird place that the libraries files may be found
#
# This module defines the following variables:
#
# OPENEXR_INCLUDE_DIR - where to find ImfRgbaFile.h, OpenEXRConfig, etc.
# OPENEXR_LIBRARIES - list of libraries to link against when using OpenEXR.
# This list does NOT include the IlmBase libraries.
# These are defined by the FindIlmBase module.
# OPENEXR_FOUND - TRUE if OpenEXR was found.
# Other standard issue macros
include(SelectLibraryConfigurations)
include(FindPackageHandleStandardArgs)
include(FindPackageMessage)
if(OPENEXR_USE_STATIC_LIBS)
set(_openexr_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES})
if(WIN32)
set(CMAKE_FIND_LIBRARY_SUFFIXES .lib .a ${CMAKE_FIND_LIBRARY_SUFFIXES})
else()
set(CMAKE_FIND_LIBRARY_SUFFIXES .a )
endif()
endif()
# Macro to assemble a helper state variable
macro(SET_STATE_VAR varname)
set(tmp_lst
${OPENEXR_CUSTOM} | ${OPENEXR_CUSTOM_LIBRARY} |
${OPENEXR_HOME} | ${OPENEXR_VERSION} | ${OPENEXR_LIB_AREA}
)
set(${varname} "${tmp_lst}")
unset(tmp_lst)
endmacro()
# To enforce that find_* functions do not use inadvertently existing versions
if(OPENEXR_CUSTOM)
set(OPENEXR_FIND_OPTIONS "NO_DEFAULT_PATH")
endif()
# Macro to search for an include directory
macro(PREFIX_FIND_INCLUDE_DIR prefix includefile libpath_var)
string(TOUPPER ${prefix}_INCLUDE_DIR tmp_varname)
find_path(${tmp_varname} ${includefile}
HINTS ${${libpath_var}}
PATH_SUFFIXES include
${OPENEXR_FIND_OPTIONS}
)
if(${tmp_varname})
mark_as_advanced(${tmp_varname})
endif()
unset(tmp_varname)
endmacro()
# Macro to search for the given library and adds the cached
# variable names to the specified list
macro(PREFIX_FIND_LIB prefix libname libpath_var liblist_var cachelist_var)
string(TOUPPER ${prefix}_${libname} tmp_prefix)
# Handle new library names for OpenEXR 2.1 build via cmake
string(REPLACE "." "_" _ILMBASE_VERSION ${ILMBASE_VERSION})
string(SUBSTRING ${_ILMBASE_VERSION} 0 3 _ILMBASE_VERSION )
find_library(${tmp_prefix}_LIBRARY_RELEASE
NAMES ${libname} ${libname}-${_ILMBASE_VERSION}
HINTS ${${libpath_var}}
PATH_SUFFIXES lib
${OPENEXR_FIND_OPTIONS}
)
find_library(${tmp_prefix}_LIBRARY_DEBUG
NAMES ${libname}d ${libname}_d ${libname}debug ${libname}_debug
HINTS ${${libpath_var}}
PATH_SUFFIXES lib
${OPENEXR_FIND_OPTIONS}
)
# Properly define ${tmp_prefix}_LIBRARY (cached) and ${tmp_prefix}_LIBRARIES
select_library_configurations(${tmp_prefix})
list(APPEND ${liblist_var} ${tmp_prefix}_LIBRARIES)
# Add to the list of variables which should be reset
list(APPEND ${cachelist_var}
${tmp_prefix}_LIBRARY
${tmp_prefix}_LIBRARY_RELEASE
${tmp_prefix}_LIBRARY_DEBUG)
mark_as_advanced(
${tmp_prefix}_LIBRARY
${tmp_prefix}_LIBRARY_RELEASE
${tmp_prefix}_LIBRARY_DEBUG)
unset(tmp_prefix)
endmacro()
# Encode the current state of the external variables into a string
SET_STATE_VAR(OPENEXR_CURRENT_STATE)
# If the state has changed, clear the cached variables
if(OPENEXR_CACHED_STATE AND
NOT OPENEXR_CACHED_STATE STREQUAL OPENEXR_CURRENT_STATE)
foreach(libvar ${OPENEXR_CACHED_VARS})
unset(${libvar} CACHE)
endforeach()
endif()
# Generic search paths
set(OpenEXR_generic_include_paths
${OPENEXR_CUSTOM_INCLUDE_DIR}
/usr/include
/usr/include/${CMAKE_LIBRARY_ARCHITECTURE}
/usr/local/include
/opt/local/include
)
set(OpenEXR_generic_library_paths
${OPENEXR_CUSTOM_LIB_DIR}
/usr/lib
/usr/lib/${CMAKE_LIBRARY_ARCHITECTURE}
/usr/local/lib
/usr/local/lib/${CMAKE_LIBRARY_ARCHITECTURE}
/opt/local/lib
)
# Search paths for the OpenEXR files
if(OPENEXR_HOME)
set(OpenEXR_library_paths
${OPENEXR_HOME}/lib
${OPENEXR_HOME}/lib64)
if(OPENEXR_VERSION)
set(OpenEXR_include_paths
${OPENEXR_HOME}/openexr-${OPENEXR_VERSION}/include
${OPENEXR_HOME}/include/openexr-${OPENEXR_VERSION})
list(APPEND OpenEXR_library_paths
${OPENEXR_HOME}/openexr-${OPENEXR_VERSION}/lib
${OPENEXR_HOME}/lib/openexr-${OPENEXR_VERSION})
endif()
list(APPEND OpenEXR_include_paths ${OPENEXR_HOME}/include)
if(OPENEXR_LIB_AREA)
list(INSERT OpenEXR_library_paths 2 ${OPENEXR_LIB_AREA})
endif()
endif()
if(ILMBASE_HOME AND OPENEXR_VERSION)
list(APPEND OpenEXR_include_paths
${ILMBASE_HOME}/include/openexr-${OPENEXR_VERSION})
endif()
list(APPEND OpenEXR_include_paths ${OpenEXR_generic_include_paths})
list(APPEND OpenEXR_library_paths ${OpenEXR_generic_library_paths})
# Locate the header files
PREFIX_FIND_INCLUDE_DIR(OpenEXR
OpenEXR/ImfArray.h OpenEXR_include_paths)
if(OPENEXR_INCLUDE_DIR)
# Get the version from config file, if not already set.
if(NOT OPENEXR_VERSION)
FILE(STRINGS "${OPENEXR_INCLUDE_DIR}/OpenEXR/OpenEXRConfig.h" OPENEXR_BUILD_SPECIFICATION
REGEX "^[ \t]*#define[ \t]+OPENEXR_VERSION_STRING[ \t]+\"[.0-9]+\".*$")
if(OPENEXR_BUILD_SPECIFICATION)
if(NOT OpenEXR_FIND_QUIETLY)
message(STATUS "${OPENEXR_BUILD_SPECIFICATION}")
endif()
string(REGEX REPLACE ".*#define[ \t]+OPENEXR_VERSION_STRING[ \t]+\"([.0-9]+)\".*"
"\\1" XYZ ${OPENEXR_BUILD_SPECIFICATION})
set("OPENEXR_VERSION" ${XYZ} CACHE STRING "Version of OpenEXR lib")
else()
# Old versions (before 2.0?) do not have any version string,
# just assuming 2.0 should be fine though.
message(WARNING "Could not determine ILMBase library version, assuming 2.0.")
set("OPENEXR_VERSION" "2.0" CACHE STRING "Version of OpenEXR lib")
endif()
endif()
endif()
if(OPENEXR_CUSTOM)
if(NOT OPENEXR_CUSTOM_LIBRARY)
message(FATAL_ERROR "Custom OpenEXR library requested but OPENEXR_CUSTOM_LIBRARY is not set.")
endif()
set(OpenEXR_Library ${OPENEXR_CUSTOM_LIBRARY})
else()
# elseif(${OPENEXR_VERSION} VERSION_LESS "2.1")
set(OpenEXR_Library IlmImf)
# else()
# string(REGEX REPLACE "([0-9]+)[.]([0-9]+).*" "\\1_\\2" _openexr_libs_ver ${OPENEXR_VERSION})
# set(OpenEXR_Library IlmImf-${_openexr_libs_ver})
endif()
# Locate the OpenEXR library
set(OpenEXR_libvars "")
set(OpenEXR_cachevars "")
PREFIX_FIND_LIB(OpenEXR ${OpenEXR_Library}
OpenEXR_library_paths OpenEXR_libvars OpenEXR_cachevars)
# Create the list of variables that might need to be cleared
set(OPENEXR_CACHED_VARS
OPENEXR_INCLUDE_DIR ${OpenEXR_cachevars}
CACHE INTERNAL "Variables set by FindOpenEXR.cmake" FORCE)
# Store the current state so that variables might be cleared if required
set(OPENEXR_CACHED_STATE ${OPENEXR_CURRENT_STATE}
CACHE INTERNAL "State last seen by FindOpenEXR.cmake" FORCE)
# Always link explicitly with zlib
set(OPENEXR_ZLIB ${ZLIB_LIBRARIES})
# Use the standard function to handle OPENEXR_FOUND
FIND_PACKAGE_HANDLE_STANDARD_ARGS(OpenEXR DEFAULT_MSG
OPENEXR_INCLUDE_DIR ${OpenEXR_libvars})
if(OPENEXR_FOUND)
set(OPENEXR_LIBRARIES "")
foreach(tmplib ${OpenEXR_libvars})
list(APPEND OPENEXR_LIBRARIES ${${tmplib}})
endforeach()
list(APPEND OPENEXR_LIBRARIES ${ZLIB_LIBRARIES})
if(NOT OpenEXR_FIND_QUIETLY)
FIND_PACKAGE_MESSAGE(OPENEXR
"Found OpenEXR: ${OPENEXR_LIBRARIES}"
"[${OPENEXR_INCLUDE_DIR}][${OPENEXR_LIBRARIES}][${OPENEXR_CURRENT_STATE}]"
)
endif()
endif()
# Restore the original find library ordering
if(OPENEXR_USE_STATIC_LIBS )
set(CMAKE_FIND_LIBRARY_SUFFIXES ${_openexr_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES})
endif()
# Unset the helper variables to avoid pollution
unset(OPENEXR_CURRENT_STATE)
unset(OpenEXR_include_paths)
unset(OpenEXR_library_paths)
unset(OpenEXR_generic_include_paths)
unset(OpenEXR_generic_library_paths)
unset(OpenEXR_libvars)
unset(OpenEXR_cachevars)

View File

@@ -0,0 +1,75 @@
# SPDX-FileCopyrightText: 2009 Kitware, Inc.
# SPDX-FileCopyrightText: 2009 Will Dicharry <wdicharry@stellarscience.com>
# SPDX-FileCopyrightText: 2005-2009 Kitware, Inc.
#
# SPDX-License-Identifier: BSD-3-Clause
# select_library_configurations( basename )
#
# This macro takes a library base name as an argument, and will choose good
# values for basename_LIBRARY, basename_LIBRARIES, basename_LIBRARY_DEBUG, and
# basename_LIBRARY_RELEASE depending on what has been found and set. If only
# basename_LIBRARY_RELEASE is defined, basename_LIBRARY, basename_LIBRARY_DEBUG,
# and basename_LIBRARY_RELEASE will be set to the release value. If only
# basename_LIBRARY_DEBUG is defined, then basename_LIBRARY,
# basename_LIBRARY_DEBUG and basename_LIBRARY_RELEASE will take the debug value.
#
# If the generator supports configuration types, then basename_LIBRARY and
# basename_LIBRARIES will be set with debug and optimized flags specifying the
# library to be used for the given configuration. If no build type has been set
# or the generator in use does not support configuration types, then
# basename_LIBRARY and basename_LIBRARIES will take only the release values.
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
# This macro was adapted from the FindQt4 CMake module and is maintained by Will
# Dicharry <wdicharry@stellarscience.com>.
# Utility macro to check if one variable exists while another doesn't, and set
# one that doesn't exist to the one that exists.
macro( _set_library_name basename GOOD BAD )
if( ${basename}_LIBRARY_${GOOD} AND NOT ${basename}_LIBRARY_${BAD} )
set( ${basename}_LIBRARY_${BAD} ${${basename}_LIBRARY_${GOOD}} )
set( ${basename}_LIBRARY ${${basename}_LIBRARY_${GOOD}} )
set( ${basename}_LIBRARIES ${${basename}_LIBRARY_${GOOD}} )
endif( ${basename}_LIBRARY_${GOOD} AND NOT ${basename}_LIBRARY_${BAD} )
endmacro( _set_library_name )
macro( select_library_configurations basename )
# if only the release version was found, set the debug to be the release
# version.
_set_library_name( ${basename} RELEASE DEBUG )
# if only the debug version was found, set the release value to be the
# debug value.
_set_library_name( ${basename} DEBUG RELEASE )
if( ${basename}_LIBRARY_DEBUG AND ${basename}_LIBRARY_RELEASE )
# if the generator supports configuration types or CMAKE_BUILD_TYPE
# is set, then set optimized and debug options.
if( CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE )
set( ${basename}_LIBRARY
optimized ${${basename}_LIBRARY_RELEASE}
debug ${${basename}_LIBRARY_DEBUG} )
set( ${basename}_LIBRARIES
optimized ${${basename}_LIBRARY_RELEASE}
debug ${${basename}_LIBRARY_DEBUG} )
else( CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE )
# If there are no configuration types or build type, just use
# the release version
set( ${basename}_LIBRARY ${${basename}_LIBRARY_RELEASE} )
set( ${basename}_LIBRARIES ${${basename}_LIBRARY_RELEASE} )
endif( CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE )
endif( ${basename}_LIBRARY_DEBUG AND ${basename}_LIBRARY_RELEASE )
set( ${basename}_LIBRARY ${${basename}_LIBRARY} CACHE FILEPATH
"The ${basename} library" )
if( ${basename}_LIBRARY )
set( ${basename}_FOUND TRUE )
endif( ${basename}_LIBRARY )
mark_as_advanced( ${basename}_LIBRARY
${basename}_LIBRARY_RELEASE
${basename}_LIBRARY_DEBUG
)
endmacro( select_library_configurations )

View File

@@ -0,0 +1,22 @@
cmake_minimum_required(VERSION 3.10)
project(libgmpxx)
include_directories(. cxx ${GMP_INCLUDE_DIR})
add_definitions(-D__GMP_WITHIN_GMPXX)
add_library(libgmpxx SHARED
cxx/dummy.cc
cxx/isfuns.cc
cxx/ismpf.cc
cxx/ismpq.cc
cxx/ismpz.cc
cxx/ismpznw.cc
cxx/limits.cc
cxx/osdoprnti.cc
cxx/osfuns.cc
cxx/osmpf.cc
cxx/osmpq.cc
cxx/osmpz.cc
)
target_link_libraries(libgmpxx ${GMP_LIBRARY})
install(TARGETS libgmpxx DESTINATION lib)

View File

@@ -0,0 +1,54 @@
project(potrace)
cmake_minimum_required(VERSION 3.10)
include_directories(src/include)
set(SOURCES
src/backend_dxf.c
src/backend_eps.c
src/backend_geojson.c
src/backend_pdf.c
src/backend_pgm.c
src/backend_svg.c
src/backend_xfig.c
src/bbox.c
src/bitmap_io.c
src/curve.c
src/decompose.c
src/flate.c
src/greymap.c
src/lzw.c
src/potracelib.c
src/progress_bar.c
src/render.c
src/trace.c
src/trans.c
)
set(HEADERS
src/potracelib.h
)
if(WIN32)
add_definitions(/D_USE_MATH_DEFINES)
endif()
add_definitions(/DPOTRACE="POTrace")
add_definitions(/DVERSION="Blender")
add_definitions(/DHAVE_INTTYPES_H)
add_library(${PROJECT_NAME} STATIC ${HEADERS} ${SOURCES})
set_target_properties(${PROJECT_NAME} PROPERTIES
LIBRARY_OUTPUT_NAME "${PROJECT_NAME}"
PUBLIC_HEADER "${HEADERS}"
)
install(TARGETS ${PROJECT_NAME}
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib
PUBLIC_HEADER DESTINATION include
)

View File

@@ -0,0 +1,32 @@
# SPDX-License-Identifier: BSD-3-Clause
# Copyright Contributors to the OpenColorIO Project.
project(pystring)
cmake_minimum_required(VERSION 3.10)
set(HEADERS
pystring.h
)
set(SOURCES
pystring.cpp
)
add_library(${PROJECT_NAME} STATIC ${HEADERS} ${SOURCES})
if(UNIX)
set(pystring_CXX_FLAGS "${pystring_CXX_FLAGS} -fPIC")
endif()
set_target_properties(${PROJECT_NAME} PROPERTIES
COMPILE_FLAGS "${PLATFORM_COMPILE_FLAGS} ${pystring_CXX_FLAGS}"
PUBLIC_HEADER "${HEADERS}"
)
install(TARGETS ${PROJECT_NAME}
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib
PUBLIC_HEADER DESTINATION include
)

View File

@@ -0,0 +1,101 @@
# Based on the VCPKG version of theora
cmake_minimum_required(VERSION 3.10)
project(theora LANGUAGES C)
set(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}")
FIND_PACKAGE(OGG REQUIRED)
file(GLOB HEADERS
"include/theora/codec.h"
"include/theora/theora.h"
"include/theora/theoradec.h"
"include/theora/theoraenc.h"
)
include_directories("include")
include_directories(${OGG_INCLUDE_DIR})
set(LIBTHEORA_COMMON
"lib/apiwrapper.c"
"lib/bitpack.c"
"lib/dequant.c"
"lib/fragment.c"
"lib/idct.c"
"lib/info.c"
"lib/internal.c"
"lib/state.c"
"lib/quant.c"
"lib/x86_vc/mmxfrag.c"
"lib/x86_vc/mmxidct.c"
"lib/x86_vc/mmxstate.c"
"lib/x86_vc/x86state.c"
)
set(LIBTHEORA_ENC
"lib/analyze.c"
"lib/encapiwrapper.c"
"lib/encfrag.c"
"lib/encinfo.c"
"lib/encode.c"
"lib/enquant.c"
"lib/fdct.c"
"lib/huffenc.c"
"lib/mathops.c"
"lib/mcenc.c"
"lib/rate.c"
"lib/tokenize.c"
"lib/x86_vc/mmxencfrag.c"
"lib/x86_vc/mmxfdct.c"
"lib/x86_vc/x86enc.c"
)
set(LIBTHEORA_DEC
"lib/decapiwrapper.c"
"lib/decinfo.c"
"lib/decode.c"
"lib/huffdec.c"
)
add_definitions(-D_CRT_SECURE_NO_DEPRECATE)
add_definitions(-D_CRT_NONSTDC_NO_DEPRECATE)
add_library(theora-common OBJECT ${LIBTHEORA_COMMON} ${HEADERS})
add_library(theora-enc OBJECT ${LIBTHEORA_ENC} ${HEADERS})
add_library(theora-dec OBJECT ${LIBTHEORA_DEC} ${HEADERS})
add_library(theora $<TARGET_OBJECTS:theora-common> $<TARGET_OBJECTS:theora-enc> $<TARGET_OBJECTS:theora-dec> "libtheora.def")
target_link_libraries(theora ${OGG_LIBRARY})
add_library(theoraenc $<TARGET_OBJECTS:theora-common> $<TARGET_OBJECTS:theora-enc> "win32/xmingw32/libtheoraenc-all.def")
target_link_libraries(theoraenc ${OGG_LIBRARY})
add_library(theoradec $<TARGET_OBJECTS:theora-common> $<TARGET_OBJECTS:theora-dec> "win32/xmingw32/libtheoradec-all.def")
target_link_libraries(theoradec ${OGG_LIBRARY})
# pkgconfig vars
set(prefix ${LIBDIR}/theora)
set(exec_prefix ${LIBDIR}/theora/bin)
set(libdir ${LIBDIR}/theora/lib)
set(includedir ${LIBDIR}/theora/include)
configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/theora.pc.in
${CMAKE_CURRENT_BINARY_DIR}/theora.pc
@ONLY
)
install(
FILES ${CMAKE_CURRENT_BINARY_DIR}/theora.pc
DESTINATION lib/pkgconfig
)
install(FILES ${HEADERS} DESTINATION include/theora)
install(TARGETS theora theoraenc theoradec
RUNTIME DESTINATION bin
LIBRARY DESTINATION bin
ARCHIVE DESTINATION lib
)

View File

@@ -0,0 +1,668 @@
/* config.h. Generated from config.in by configure. */
/* config.in. Generated from configure.ac by autoheader. */
/*
Copyright 1996-2020 Free Software Foundation, Inc.
This file is part of the GNU MP Library.
The GNU MP Library is free software; you can redistribute it and/or modify
it under the terms of either:
* the GNU Lesser General Public License as published by the Free
Software Foundation; either version 3 of the License, or (at your
option) any later version.
or
* the GNU General Public License as published by the Free Software
Foundation; either version 2 of the License, or (at your option) any
later version.
or both in parallel, as here.
The GNU MP Library is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received copies of the GNU General Public License and the
GNU Lesser General Public License along with the GNU MP Library. If not,
see https://www.gnu.org/licenses/.
*/
/* Define if building universal (internal helper macro) */
/* #undef AC_APPLE_UNIVERSAL_BUILD */
/* The gmp-mparam.h file (a string) the tune program should suggest updating.
*/
#define GMP_MPARAM_H_SUGGEST "./mpn/x86_64/coreisbr/gmp-mparam.h"
/* Define to 1 if you have the `alarm' function. */
#define HAVE_ALARM 1
/* Define to 1 if alloca() works (via gmp-impl.h). */
#define HAVE_ALLOCA 1
/* Define to 1 if you have <alloca.h> and it should be used (not on Ultrix).
*/
/* #undef HAVE_ALLOCA_H */
/* Define to 1 if the compiler accepts gcc style __attribute__ ((const)) */
//#define HAVE_ATTRIBUTE_CONST 1
/* Define to 1 if the compiler accepts gcc style __attribute__ ((malloc)) */
//#define HAVE_ATTRIBUTE_MALLOC 1
/* Define to 1 if the compiler accepts gcc style __attribute__ ((mode (XX)))
*/
//#define HAVE_ATTRIBUTE_MODE 1
/* Define to 1 if the compiler accepts gcc style __attribute__ ((noreturn)) */
//#define HAVE_ATTRIBUTE_NORETURN 1
/* Define to 1 if you have the `attr_get' function. */
/* #undef HAVE_ATTR_GET */
/* Define to 1 if tests/libtests has calling conventions checking for the CPU
*/
/* #undef HAVE_CALLING_CONVENTIONS */
/* Define to 1 if you have the `clock' function. */
#define HAVE_CLOCK 1
/* Define to 1 if you have the `clock_gettime' function */
/* #undef HAVE_CLOCK_GETTIME */
/* Define to 1 if you have the `cputime' function. */
/* #undef HAVE_CPUTIME */
/* Define to 1 if you have the declaration of `fgetc', and to 0 if you don't.
*/
#define HAVE_DECL_FGETC 1
/* Define to 1 if you have the declaration of `fscanf', and to 0 if you don't.
*/
#define HAVE_DECL_FSCANF 1
/* Define to 1 if you have the declaration of `optarg', and to 0 if you don't.
*/
#define HAVE_DECL_OPTARG 1
/* Define to 1 if you have the declaration of `sys_errlist', and to 0 if you
don't. */
#define HAVE_DECL_SYS_ERRLIST 0
/* Define to 1 if you have the declaration of `sys_nerr', and to 0 if you
don't. */
#define HAVE_DECL_SYS_NERR 0
/* Define to 1 if you have the declaration of `ungetc', and to 0 if you don't.
*/
#define HAVE_DECL_UNGETC 1
/* Define to 1 if you have the declaration of `vfprintf', and to 0 if you
don't. */
#define HAVE_DECL_VFPRINTF 1
/* Define to 1 if you have the <dlfcn.h> header file. */
/* #undef HAVE_DLFCN_H */
/* Define one of the following to 1 for the format of a `double'.
If your format is not among these choices, or you don't know what it is,
then leave all undefined.
IEEE_LITTLE_SWAPPED means little endian, but with the two 4-byte halves
swapped, as used by ARM CPUs in little endian mode. */
/* #undef HAVE_DOUBLE_IEEE_BIG_ENDIAN */
#define HAVE_DOUBLE_IEEE_LITTLE_ENDIAN 1
/* #undef HAVE_DOUBLE_IEEE_LITTLE_SWAPPED */
/* #undef HAVE_DOUBLE_VAX_D */
/* #undef HAVE_DOUBLE_VAX_G */
/* #undef HAVE_DOUBLE_CRAY_CFP */
/* Define to 1 if you have the <fcntl.h> header file. */
#define HAVE_FCNTL_H 1
/* Define to 1 if you have the <float.h> header file. */
#define HAVE_FLOAT_H 1
/* Define to 1 if you have the `getpagesize' function. */
#define HAVE_GETPAGESIZE 1
/* Define to 1 if you have the `getrusage' function. */
/* #undef HAVE_GETRUSAGE */
/* Define to 1 if you have the `getsysinfo' function. */
/* #undef HAVE_GETSYSINFO */
/* Define to 1 if you have the `gettimeofday' function. */
#define HAVE_GETTIMEOFDAY 1
/* Define to 1 if the compiler accepts gcc style __attribute__ ((visibility))
and __attribute__ ((alias)) */
#define HAVE_HIDDEN_ALIAS 1
/* Define one of these to 1 for the host CPU family.
If your CPU is not in any of these families, leave all undefined.
For an AMD64 chip, define "x86" in ABI=32, but not in ABI=64. */
/* #undef HAVE_HOST_CPU_FAMILY_alpha */
/* #undef HAVE_HOST_CPU_FAMILY_m68k */
/* #undef HAVE_HOST_CPU_FAMILY_power */
/* #undef HAVE_HOST_CPU_FAMILY_powerpc */
/* #undef HAVE_HOST_CPU_FAMILY_x86 */
#define HAVE_HOST_CPU_FAMILY_x86_64 1
/* Define one of the following to 1 for the host CPU, as per the output of
./config.guess. If your CPU is not listed here, leave all undefined. */
/* #undef HAVE_HOST_CPU_alphaev67 */
/* #undef HAVE_HOST_CPU_alphaev68 */
/* #undef HAVE_HOST_CPU_alphaev7 */
/* #undef HAVE_HOST_CPU_m68020 */
/* #undef HAVE_HOST_CPU_m68030 */
/* #undef HAVE_HOST_CPU_m68040 */
/* #undef HAVE_HOST_CPU_m68060 */
/* #undef HAVE_HOST_CPU_m68360 */
/* #undef HAVE_HOST_CPU_powerpc604 */
/* #undef HAVE_HOST_CPU_powerpc604e */
/* #undef HAVE_HOST_CPU_powerpc750 */
/* #undef HAVE_HOST_CPU_powerpc7400 */
/* #undef HAVE_HOST_CPU_supersparc */
/* #undef HAVE_HOST_CPU_i386 */
/* #undef HAVE_HOST_CPU_i586 */
/* #undef HAVE_HOST_CPU_i686 */
/* #undef HAVE_HOST_CPU_pentium */
/* #undef HAVE_HOST_CPU_pentiummmx */
/* #undef HAVE_HOST_CPU_pentiumpro */
/* #undef HAVE_HOST_CPU_pentium2 */
/* #undef HAVE_HOST_CPU_pentium3 */
/* #undef HAVE_HOST_CPU_pentium4 */
/* #undef HAVE_HOST_CPU_core2 */
/* #undef HAVE_HOST_CPU_nehalem */
/* #undef HAVE_HOST_CPU_westmere */
/* #undef HAVE_HOST_CPU_sandybridge */
#define HAVE_HOST_CPU_ivybridge 1
/* #undef HAVE_HOST_CPU_haswell */
/* #undef HAVE_HOST_CPU_broadwell */
/* #undef HAVE_HOST_CPU_skylake */
/* #undef HAVE_HOST_CPU_silvermont */
/* #undef HAVE_HOST_CPU_goldmont */
/* #undef HAVE_HOST_CPU_k8 */
/* #undef HAVE_HOST_CPU_k10 */
/* #undef HAVE_HOST_CPU_bulldozer */
/* #undef HAVE_HOST_CPU_piledriver */
/* #undef HAVE_HOST_CPU_steamroller */
/* #undef HAVE_HOST_CPU_excavator */
/* #undef HAVE_HOST_CPU_zen */
/* #undef HAVE_HOST_CPU_bobcat */
/* #undef HAVE_HOST_CPU_jaguar */
/* #undef HAVE_HOST_CPU_s390_z900 */
/* #undef HAVE_HOST_CPU_s390_z990 */
/* #undef HAVE_HOST_CPU_s390_z9 */
/* #undef HAVE_HOST_CPU_s390_z10 */
/* #undef HAVE_HOST_CPU_s390_z196 */
/* Define to 1 iff we have a s390 with 64-bit registers. */
/* #undef HAVE_HOST_CPU_s390_zarch */
/* Define to 1 if the system has the type `intmax_t'. */
#define HAVE_INTMAX_T 1
/* Define to 1 if the system has the type `intptr_t'. */
#define HAVE_INTPTR_T 1
/* Define to 1 if you have the <inttypes.h> header file. */
#define HAVE_INTTYPES_H 1
/* Define to 1 if you have the <invent.h> header file. */
/* #undef HAVE_INVENT_H */
/* Define to 1 if you have the <langinfo.h> header file. */
/* #undef HAVE_LANGINFO_H */
/* Define one of these to 1 for the endianness of `mp_limb_t'.
If the endianness is not a simple big or little, or you don't know what
it is, then leave both undefined. */
/* #undef HAVE_LIMB_BIG_ENDIAN */
#define HAVE_LIMB_LITTLE_ENDIAN 1
/* Define to 1 if you have the `localeconv' function. */
#define HAVE_LOCALECONV 1
/* Define to 1 if you have the <locale.h> header file. */
#define HAVE_LOCALE_H 1
/* Define to 1 if the system has the type `long double'. */
#define HAVE_LONG_DOUBLE 1
/* Define to 1 if the system has the type `long long'. */
#define HAVE_LONG_LONG 1
/* Define to 1 if you have the <machine/hal_sysinfo.h> header file. */
/* #undef HAVE_MACHINE_HAL_SYSINFO_H */
/* Define to 1 if you have the <memory.h> header file. */
#define HAVE_MEMORY_H 1
/* Define to 1 if you have the `memset' function. */
#define HAVE_MEMSET 1
/* Define to 1 if you have the `mmap' function. */
/* #undef HAVE_MMAP */
/* Define to 1 if you have the `mprotect' function. */
#define HAVE_MPROTECT 1
/* Define to 1 each of the following for which a native (ie. CPU specific)
implementation of the corresponding routine exists. */
#define HAVE_NATIVE_mpn_add_n 1
/* #undef HAVE_NATIVE_mpn_add_n_sub_n */
#define HAVE_NATIVE_mpn_add_nc 1
/* #undef HAVE_NATIVE_mpn_addaddmul_1msb0 */
#define HAVE_NATIVE_mpn_addlsh1_n 1
#define HAVE_NATIVE_mpn_addlsh2_n 1
#define HAVE_NATIVE_mpn_addlsh_n 1
#define HAVE_NATIVE_mpn_addlsh1_nc 1
#define HAVE_NATIVE_mpn_addlsh2_nc 1
#define HAVE_NATIVE_mpn_addlsh_nc 1
/* #undef HAVE_NATIVE_mpn_addlsh1_n_ip1 */
/* #undef HAVE_NATIVE_mpn_addlsh2_n_ip1 */
/* #undef HAVE_NATIVE_mpn_addlsh_n_ip1 */
/* #undef HAVE_NATIVE_mpn_addlsh1_nc_ip1 */
/* #undef HAVE_NATIVE_mpn_addlsh2_nc_ip1 */
/* #undef HAVE_NATIVE_mpn_addlsh_nc_ip1 */
/* #undef HAVE_NATIVE_mpn_addlsh1_n_ip2 */
/* #undef HAVE_NATIVE_mpn_addlsh2_n_ip2 */
/* #undef HAVE_NATIVE_mpn_addlsh_n_ip2 */
/* #undef HAVE_NATIVE_mpn_addlsh1_nc_ip2 */
/* #undef HAVE_NATIVE_mpn_addlsh2_nc_ip2 */
/* #undef HAVE_NATIVE_mpn_addlsh_nc_ip2 */
/* #undef HAVE_NATIVE_mpn_addmul_1c */
#define HAVE_NATIVE_mpn_addmul_2 1
/* #undef HAVE_NATIVE_mpn_addmul_3 */
/* #undef HAVE_NATIVE_mpn_addmul_4 */
/* #undef HAVE_NATIVE_mpn_addmul_5 */
/* #undef HAVE_NATIVE_mpn_addmul_6 */
/* #undef HAVE_NATIVE_mpn_addmul_7 */
/* #undef HAVE_NATIVE_mpn_addmul_8 */
/* #undef HAVE_NATIVE_mpn_addmul_2s */
#define HAVE_NATIVE_mpn_and_n 1
#define HAVE_NATIVE_mpn_andn_n 1
#define HAVE_NATIVE_mpn_bdiv_dbm1c 1
#define HAVE_NATIVE_mpn_bdiv_q_1 1
#define HAVE_NATIVE_mpn_pi1_bdiv_q_1 1
#define HAVE_NATIVE_mpn_cnd_add_n 1
#define HAVE_NATIVE_mpn_cnd_sub_n 1
#define HAVE_NATIVE_mpn_com 1
#define HAVE_NATIVE_mpn_copyd 1
#define HAVE_NATIVE_mpn_copyi 1
/* #undef HAVE_NATIVE_mpn_div_qr_1n_pi1 */
/* #undef HAVE_NATIVE_mpn_div_qr_2 */
#define HAVE_NATIVE_mpn_divexact_1 1
/* #undef HAVE_NATIVE_mpn_divexact_by3c */
#define HAVE_NATIVE_mpn_divrem_1 1
/* #undef HAVE_NATIVE_mpn_divrem_1c */
#define HAVE_NATIVE_mpn_divrem_2 1
/* #undef HAVE_NATIVE_mpn_gcd_1 */
#define HAVE_NATIVE_mpn_gcd_11 1
/* #undef HAVE_NATIVE_mpn_gcd_22 */
#define HAVE_NATIVE_mpn_hamdist 1
#define HAVE_NATIVE_mpn_invert_limb 1
#define HAVE_NATIVE_mpn_ior_n 1
#define HAVE_NATIVE_mpn_iorn_n 1
#define HAVE_NATIVE_mpn_lshift 1
#define HAVE_NATIVE_mpn_lshiftc 1
/* #undef HAVE_NATIVE_mpn_lshsub_n */
/* #undef HAVE_NATIVE_mpn_mod_1 */
#define HAVE_NATIVE_mpn_mod_1_1p 1
/* #undef HAVE_NATIVE_mpn_mod_1c */
#define HAVE_NATIVE_mpn_mod_1s_2p 1
#define HAVE_NATIVE_mpn_mod_1s_4p 1
#define HAVE_NATIVE_mpn_mod_34lsub1 1
#define HAVE_NATIVE_mpn_modexact_1_odd 1
#define HAVE_NATIVE_mpn_modexact_1c_odd 1
#define HAVE_NATIVE_mpn_mul_1 1
#define HAVE_NATIVE_mpn_mul_1c 1
#define HAVE_NATIVE_mpn_mul_2 1
/* #undef HAVE_NATIVE_mpn_mul_3 */
/* #undef HAVE_NATIVE_mpn_mul_4 */
/* #undef HAVE_NATIVE_mpn_mul_5 */
/* #undef HAVE_NATIVE_mpn_mul_6 */
#define HAVE_NATIVE_mpn_mul_basecase 1
#define HAVE_NATIVE_mpn_mullo_basecase 1
#define HAVE_NATIVE_mpn_nand_n 1
#define HAVE_NATIVE_mpn_nior_n 1
#define HAVE_NATIVE_mpn_popcount 1
#define HAVE_NATIVE_mpn_preinv_divrem_1 1
/* #undef HAVE_NATIVE_mpn_preinv_mod_1 */
#define HAVE_NATIVE_mpn_redc_1 1
/* #undef HAVE_NATIVE_mpn_redc_2 */
#define HAVE_NATIVE_mpn_rsblsh1_n 1
#define HAVE_NATIVE_mpn_rsblsh2_n 1
#define HAVE_NATIVE_mpn_rsblsh_n 1
#define HAVE_NATIVE_mpn_rsblsh1_nc 1
/* #undef HAVE_NATIVE_mpn_rsblsh2_nc */
/* #undef HAVE_NATIVE_mpn_rsblsh_nc */
#define HAVE_NATIVE_mpn_rsh1add_n 1
#define HAVE_NATIVE_mpn_rsh1add_nc 1
#define HAVE_NATIVE_mpn_rsh1sub_n 1
#define HAVE_NATIVE_mpn_rsh1sub_nc 1
#define HAVE_NATIVE_mpn_rshift 1
/* #undef HAVE_NATIVE_mpn_sbpi1_bdiv_r */
#define HAVE_NATIVE_mpn_sqr_basecase 1
/* #undef HAVE_NATIVE_mpn_sqr_diagonal */
#define HAVE_NATIVE_mpn_sqr_diag_addlsh1 1
#define HAVE_NATIVE_mpn_sub_n 1
#define HAVE_NATIVE_mpn_sub_nc 1
#define HAVE_NATIVE_mpn_sublsh1_n 1
#define HAVE_NATIVE_mpn_sublsh2_n 1
/* #undef HAVE_NATIVE_mpn_sublsh_n */
/* #undef HAVE_NATIVE_mpn_sublsh1_nc */
/* #undef HAVE_NATIVE_mpn_sublsh2_nc */
/* #undef HAVE_NATIVE_mpn_sublsh_nc */
/* #undef HAVE_NATIVE_mpn_sublsh1_n_ip1 */
/* #undef HAVE_NATIVE_mpn_sublsh2_n_ip1 */
/* #undef HAVE_NATIVE_mpn_sublsh_n_ip1 */
/* #undef HAVE_NATIVE_mpn_sublsh1_nc_ip1 */
/* #undef HAVE_NATIVE_mpn_sublsh2_nc_ip1 */
/* #undef HAVE_NATIVE_mpn_sublsh_nc_ip1 */
/* #undef HAVE_NATIVE_mpn_submul_1c */
/* #undef HAVE_NATIVE_mpn_tabselect */
/* #undef HAVE_NATIVE_mpn_udiv_qrnnd */
/* #undef HAVE_NATIVE_mpn_udiv_qrnnd_r */
/* #undef HAVE_NATIVE_mpn_umul_ppmm */
/* #undef HAVE_NATIVE_mpn_umul_ppmm_r */
#define HAVE_NATIVE_mpn_xor_n 1
#define HAVE_NATIVE_mpn_xnor_n 1
/* Define to 1 if you have the `nl_langinfo' function. */
/* #undef HAVE_NL_LANGINFO */
/* Define to 1 if you have the <nl_types.h> header file. */
/* #undef HAVE_NL_TYPES_H */
/* Define to 1 if you have the `obstack_vprintf' function. */
/* #undef HAVE_OBSTACK_VPRINTF */
/* Define to 1 if you have the `popen' function. */
#define HAVE_POPEN 1
/* Define to 1 if you have the `processor_info' function. */
/* #undef HAVE_PROCESSOR_INFO */
/* Define to 1 if <sys/pstat.h> `struct pst_processor' exists and contains
`psp_iticksperclktick'. */
/* #undef HAVE_PSP_ITICKSPERCLKTICK */
/* Define to 1 if you have the `pstat_getprocessor' function. */
/* #undef HAVE_PSTAT_GETPROCESSOR */
/* Define to 1 if the system has the type `ptrdiff_t'. */
#define HAVE_PTRDIFF_T 1
/* Define to 1 if the system has the type `quad_t'. */
/* #undef HAVE_QUAD_T */
/* Define to 1 if you have the `raise' function. */
#define HAVE_RAISE 1
/* Define to 1 if you have the `read_real_time' function. */
/* #undef HAVE_READ_REAL_TIME */
/* Define to 1 if you have the `sigaction' function. */
/* #undef HAVE_SIGACTION */
/* Define to 1 if you have the `sigaltstack' function. */
/* #undef HAVE_SIGALTSTACK */
/* Define to 1 if you have the `sigstack' function. */
/* #undef HAVE_SIGSTACK */
/* Tune directory speed_cyclecounter, undef=none, 1=32bits, 2=64bits) */
#define HAVE_SPEED_CYCLECOUNTER 2
/* Define to 1 if you have the <sstream> header file. */
#define HAVE_SSTREAM 1
/* Define to 1 if the system has the type `stack_t'. */
/* #undef HAVE_STACK_T */
/* Define to 1 if you have the <stdint.h> header file. */
#define HAVE_STDINT_H 1
/* Define to 1 if you have the <stdlib.h> header file. */
#define HAVE_STDLIB_H 1
/* Define to 1 if the system has the type `std::locale'. */
#define HAVE_STD__LOCALE 1
/* Define to 1 if you have the `strchr' function. */
#define HAVE_STRCHR 1
/* Define to 1 if you have the `strerror' function. */
#define HAVE_STRERROR 1
/* Define to 1 if you have the <strings.h> header file. */
#define HAVE_STRINGS_H 1
/* Define to 1 if you have the <string.h> header file. */
#define HAVE_STRING_H 1
/* Define to 1 if you have the `strnlen' function. */
#define HAVE_STRNLEN 1
/* Define to 1 if you have the `strtol' function. */
#define HAVE_STRTOL 1
/* Define to 1 if you have the `strtoul' function. */
#define HAVE_STRTOUL 1
/* Define to 1 if you have the `sysconf' function. */
/* #undef HAVE_SYSCONF */
/* Define to 1 if you have the `sysctl' function. */
/* #undef HAVE_SYSCTL */
/* Define to 1 if you have the `sysctlbyname' function. */
/* #undef HAVE_SYSCTLBYNAME */
/* Define to 1 if you have the `syssgi' function. */
/* #undef HAVE_SYSSGI */
/* Define to 1 if you have the <sys/attributes.h> header file. */
/* #undef HAVE_SYS_ATTRIBUTES_H */
/* Define to 1 if you have the <sys/iograph.h> header file. */
/* #undef HAVE_SYS_IOGRAPH_H */
/* Define to 1 if you have the <sys/mman.h> header file. */
/* #undef HAVE_SYS_MMAN_H */
/* Define to 1 if you have the <sys/param.h> header file. */
#define HAVE_SYS_PARAM_H 1
/* Define to 1 if you have the <sys/processor.h> header file. */
/* #undef HAVE_SYS_PROCESSOR_H */
/* Define to 1 if you have the <sys/pstat.h> header file. */
/* #undef HAVE_SYS_PSTAT_H */
/* Define to 1 if you have the <sys/resource.h> header file. */
/* #undef HAVE_SYS_RESOURCE_H */
/* Define to 1 if you have the <sys/stat.h> header file. */
#define HAVE_SYS_STAT_H 1
/* Define to 1 if you have the <sys/sysctl.h> header file. */
/* #undef HAVE_SYS_SYSCTL_H */
/* Define to 1 if you have the <sys/sysinfo.h> header file. */
/* #undef HAVE_SYS_SYSINFO_H */
/* Define to 1 if you have the <sys/syssgi.h> header file. */
/* #undef HAVE_SYS_SYSSGI_H */
/* Define to 1 if you have the <sys/systemcfg.h> header file. */
/* #undef HAVE_SYS_SYSTEMCFG_H */
/* Define to 1 if you have the <sys/times.h> header file. */
/* #undef HAVE_SYS_TIMES_H */
/* Define to 1 if you have the <sys/time.h> header file. */
#define HAVE_SYS_TIME_H 1
/* Define to 1 if you have the <sys/types.h> header file. */
#define HAVE_SYS_TYPES_H 1
/* Define to 1 if you have the `times' function. */
/* #undef HAVE_TIMES */
/* Define to 1 if the system has the type `uint_least32_t'. */
#define HAVE_UINT_LEAST32_T 1
/* Define to 1 if you have the <unistd.h> header file. */
#define HAVE_UNISTD_H 1
/* Define to 1 if you have the `vsnprintf' function and it works properly. */
/* #undef HAVE_VSNPRINTF */
/* Define to 1 for Windos/64 */
#define HOST_DOS64 1
/* Assembler local label prefix */
#define LSYM_PREFIX "L"
/* Define to the sub-directory where libtool stores uninstalled libraries. */
#define LT_OBJDIR ".libs/"
/* Define to 1 to disable the use of inline assembly */
/* #undef NO_ASM */
/* Name of package */
#define PACKAGE "gmp"
/* Define to the address where bug reports for this package should be sent. */
#define PACKAGE_BUGREPORT "gmp-bugs@gmplib.org, see https://gmplib.org/manual/Reporting-Bugs.html"
/* Define to the full name of this package. */
#define PACKAGE_NAME "GNU MP"
/* Define to the full name and version of this package. */
#define PACKAGE_STRING "GNU MP 6.2.0"
/* Define to the one symbol short name of this package. */
#define PACKAGE_TARNAME "gmp"
/* Define to the home page for this package. */
#define PACKAGE_URL "http://www.gnu.org/software/gmp/"
/* Define to the version of this package. */
#define PACKAGE_VERSION "6.2.0"
/* Define as the return type of signal handlers (`int' or `void'). */
#define RETSIGTYPE void
/* The size of `mp_limb_t', as computed by sizeof. */
#define SIZEOF_MP_LIMB_T 8
/* The size of `unsigned', as computed by sizeof. */
#define SIZEOF_UNSIGNED 4
/* The size of `unsigned long', as computed by sizeof. */
#define SIZEOF_UNSIGNED_LONG 4
/* The size of `unsigned short', as computed by sizeof. */
#define SIZEOF_UNSIGNED_SHORT 2
/* The size of `void *', as computed by sizeof. */
#define SIZEOF_VOID_P 8
/* Define to 1 if sscanf requires writable inputs */
/* #undef SSCANF_WRITABLE_INPUT */
/* Define to 1 if you have the ANSI C header files. */
#define STDC_HEADERS 1
/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
#define TIME_WITH_SYS_TIME 1
/* Maximum size the tune program can test for SQR_TOOM2_THRESHOLD */
/* #undef TUNE_SQR_TOOM2_MAX */
/* Version number of package */
#define VERSION "6.2.0"
/* Define to 1 to enable ASSERT checking, per --enable-assert */
/* #undef WANT_ASSERT */
/* Define to 1 to enable GMP_CPU_TYPE faking cpuid, per --enable-fake-cpuid */
/* #undef WANT_FAKE_CPUID */
/* Define to 1 when building a fat binary. */
/* #undef WANT_FAT_BINARY */
/* Define to 1 to enable FFTs for multiplication, per --enable-fft */
#define WANT_FFT 1
/* Define to 1 to enable old mpn_mul_fft_full for multiplication, per
--enable-old-fft-full */
/* #undef WANT_OLD_FFT_FULL */
/* Define to 1 if --enable-profiling=gprof */
/* #undef WANT_PROFILING_GPROF */
/* Define to 1 if --enable-profiling=instrument */
/* #undef WANT_PROFILING_INSTRUMENT */
/* Define to 1 if --enable-profiling=prof */
/* #undef WANT_PROFILING_PROF */
/* Define one of these to 1 for the desired temporary memory allocation
method, per --enable-alloca. */
#define WANT_TMP_ALLOCA 1
/* #undef WANT_TMP_REENTRANT */
/* #undef WANT_TMP_NOTREENTRANT */
/* #undef WANT_TMP_DEBUG */
/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
significant byte first (like Motorola and SPARC, unlike Intel). */
#if defined AC_APPLE_UNIVERSAL_BUILD
# if defined __BIG_ENDIAN__
# define WORDS_BIGENDIAN 1
# endif
#else
# ifndef WORDS_BIGENDIAN
/* # undef WORDS_BIGENDIAN */
# endif
#endif
/* Define to 1 if the assembler understands the mulx instruction */
/* #undef X86_ASM_MULX */
/* Define to 1 if `lex' declares `yytext' as a `char *' by default, not a
`char[]'. */
/* #undef YYTEXT_POINTER */
/* Define to `__inline__' or `__inline' if that's what the C compiler
calls it, or to nothing if 'inline' is not supported under any name. */
#ifndef __cplusplus
/* #undef inline */
#endif
/* Define to the equivalent of the C99 'restrict' keyword, or to
nothing if this is not supported. Do not define if restrict is
supported directly. */
#define restrict __restrict
/* Work around a bug in Sun C++: it does not support _Restrict or
__restrict__, even though the corresponding Sun C compiler ends up with
"#define restrict _Restrict" or "#define restrict __restrict__" in the
previous line. Perhaps some future version of Sun C++ will work with
restrict; if so, hopefully it defines __RESTRICT like Sun C does. */
#if defined __SUNPRO_CC && !defined __RESTRICT
# define _Restrict
# define __restrict__
#endif
/* Define to empty if the keyword `volatile' does not work. Warning: valid
code using `volatile' can become incorrect without. Disable with care. */
/* #undef volatile */

View File

@@ -0,0 +1,208 @@
diff --git a/libdevice/cmake/modules/SYCLLibdevice.cmake b/libdevice/cmake/modules/SYCLLibdevice.cmake
index 2f0cef3a2..eb64a812e 100644
--- a/libdevice/cmake/modules/SYCLLibdevice.cmake
+++ b/libdevice/cmake/modules/SYCLLibdevice.cmake
@@ -64,7 +64,7 @@ if (WIN32)
list(APPEND compile_opts -D_ALLOW_ITERATOR_DEBUG_LEVEL_MISMATCH)
endif()
-add_custom_target(libsycldevice)
+add_custom_target(libsycldevice ALL)
set(filetypes obj obj-new-offload spv bc)
set(filetypes_no_spv obj obj-new-offload bc)
diff --git a/opencl/CMakeLists.txt b/opencl/CMakeLists.txt
index 6c771c709..1e840ebfe 100644
--- a/opencl/CMakeLists.txt
+++ b/opencl/CMakeLists.txt
@@ -11,6 +11,11 @@ if (MSVC)
)
endif()
+# Blender code below is determined to use FetchContent_Declare
+# temporarily allow it (but feed it our downloaded tarball
+# in the OpenCL_HEADERS variable
+set(FETCHCONTENT_FULLY_DISCONNECTED OFF)
+
# Repo URLs
set(OCL_HEADERS_REPO
@@ -77,5 +82,6 @@ endif()
FetchContent_MakeAvailable(ocl-icd)
add_library(OpenCL-ICD ALIAS OpenCL)
+set(FETCHCONTENT_FULLY_DISCONNECTED ON)
add_subdirectory(opencl-aot)
diff --git a/sycl/cmake/modules/FetchUnifiedRuntime.cmake b/sycl/cmake/modules/FetchUnifiedRuntime.cmake
index 33368f2b9..02d4cc106 100644
--- a/sycl/cmake/modules/FetchUnifiedRuntime.cmake
+++ b/sycl/cmake/modules/FetchUnifiedRuntime.cmake
@@ -92,8 +92,12 @@ if(IS_DIRECTORY "${UR_INTREE_SOURCE_DIR}")
# to link statically on windows
if(WIN32)
set(UMF_BUILD_SHARED_LIBRARY OFF CACHE INTERNAL "Build UMF shared library")
- set(UMF_LINK_HWLOC_STATICALLY ON CACHE INTERNAL "static HWLOC")
endif()
+ # hwloc is disabled and not linked statically - Blender does not need
+ # NUMA-aware memory placement. This avoids pulling in hwloc as an
+ # additional build dependency.
+ set(UMF_LINK_HWLOC_STATICALLY OFF CACHE INTERNAL "static HWLOC")
+ set(UMF_DISABLE_HWLOC ${SYCL_UMF_DISABLE_HWLOC} CACHE INTERNAL "Disable hwloc for UMF")
add_subdirectory(${UNIFIED_RUNTIME_SOURCE_DIR} ${UR_INTREE_BINARY_DIR})
elseif(SYCL_UR_USE_FETCH_CONTENT)
include(FetchContent)
@@ -149,8 +153,12 @@ elseif(SYCL_UR_USE_FETCH_CONTENT)
# to link statically on windows
if(WIN32)
set(UMF_BUILD_SHARED_LIBRARY OFF CACHE INTERNAL "Build UMF shared library")
- set(UMF_LINK_HWLOC_STATICALLY ON CACHE INTERNAL "static HWLOC")
endif()
+ # hwloc is disabled and not linked statically - Blender does not need
+ # NUMA-aware memory placement. This avoids pulling in hwloc as an
+ # additional build dependency.
+ set(UMF_LINK_HWLOC_STATICALLY OFF CACHE INTERNAL "static HWLOC")
+ set(UMF_DISABLE_HWLOC ${SYCL_UMF_DISABLE_HWLOC} CACHE INTERNAL "Disable hwloc for UMF")
fetch_adapter_source(level_zero
${UNIFIED_RUNTIME_REPO}
@@ -362,6 +370,15 @@ if(CMAKE_SYSTEM_NAME STREQUAL Windows)
-DUMF_LINK_HWLOC_STATICALLY:BOOL=${UMF_LINK_HWLOC_STATICALLY}
-DUMF_DISABLE_HWLOC:BOOL=${UMF_DISABLE_HWLOC}
-DSYCL_EMHASH_DIR:STRING=${SYCL_EMHASH_DIR}
+ # These variables must be explicitly forwarded to the inner ExternalProject
+ # build on Windows because it uses a separate CMake invocation via
+ # ExternalProject_Add, which does not inherit the parent's cache. Without
+ # forwarding, the sub-build falls back to system defaults and fails to
+ # find Blender's bundled Python and parallel hashmap headers.
+ -DXPTIFW_PARALLEL_HASHMAP_HEADERS:STRING=${XPTIFW_PARALLEL_HASHMAP_HEADERS}
+ -DPython3_ROOT_DIR:STRING=${Python3_ROOT_DIR}
+ -DPython3_EXECUTABLE:STRING=${Python3_EXECUTABLE}
+ -DPYTHON_EXECUTABLE:STRING=${PYTHON_EXECUTABLE}
# Enable d suffix in UMF
-DUMF_USE_DEBUG_POSTFIX:BOOL=ON
)
diff --git a/sycl/source/detail/kernel_bundle_impl.hpp b/sycl/source/detail/kernel_bundle_impl.hpp
index 932805444..9cd8f1a21 100644
--- a/sycl/source/detail/kernel_bundle_impl.hpp
+++ b/sycl/source/detail/kernel_bundle_impl.hpp
@@ -27,6 +27,7 @@
#include <cstdint>
#include <cstring>
#include <memory>
+#include <sstream>
#include <unordered_set>
#include <vector>
diff --git a/sycl/source/detail/kernel_name_based_cache_t.hpp b/sycl/source/detail/kernel_name_based_cache_t.hpp
index ef92112dc..17923815e 100644
--- a/sycl/source/detail/kernel_name_based_cache_t.hpp
+++ b/sycl/source/detail/kernel_name_based_cache_t.hpp
@@ -9,7 +9,7 @@
#include <detail/hashers.hpp>
#include <detail/kernel_arg_mask.hpp>
-#include <emhash/hash_table8.hpp>
+#include <hash_table8.hpp>
#include <sycl/detail/spinlock.hpp>
#include <sycl/detail/ur.hpp>
diff --git a/sycl/source/detail/unordered_multimap.hpp b/sycl/source/detail/unordered_multimap.hpp
index 4d495ed06..e96d71870 100644
--- a/sycl/source/detail/unordered_multimap.hpp
+++ b/sycl/source/detail/unordered_multimap.hpp
@@ -7,7 +7,7 @@
//===--------------------------------------------------------------===//
#pragma once
#include <detail/hashers.hpp>
-#include <emhash/hash_table8.hpp>
+#include <hash_table8.hpp>
#include <utility>
#include <vector>
diff --git a/unified-runtime/cmake/FetchLevelZero.cmake b/unified-runtime/cmake/FetchLevelZero.cmake
index cf1ca5e82..65b6750c6 100644
--- a/unified-runtime/cmake/FetchLevelZero.cmake
+++ b/unified-runtime/cmake/FetchLevelZero.cmake
@@ -132,19 +132,15 @@ elseif (UR_COMPUTE_RUNTIME_FETCH_REPO)
set(COMPUTE_RUNTIME_LEVEL_ZERO_INCLUDE "${exp-headers_SOURCE_DIR}")
set(COMPUTE_RUNTIME_REPO_PATH "${exp-headers_SOURCE_DIR}/../..")
-
-# When UR_COMPUTE_RUNTIME_FETCH_REPO is OFF, use UR_COMPUTE_RUNTIME_REPO as repo.
-else()
-
- # Check if UR_COMPUTE_RUNTIME_REPO is set. Throw if not.
- if (UR_COMPUTE_RUNTIME_REPO STREQUAL "")
- message(FATAL_ERROR "UR_COMPUTE_RUNTIME_FETCH_REPO is set to OFF but UR_COMPUTE_RUNTIME_REPO is not set. Please set it to the compute runtime repo.")
- endif()
-
- set(COMPUTE_RUNTIME_LEVEL_ZERO_INCLUDE "${UR_COMPUTE_RUNTIME_REPO}/level_zero/include")
- set(COMPUTE_RUNTIME_REPO_PATH "${UR_COMPUTE_RUNTIME_REPO}")
endif()
+# Compute Runtime is decoupled to avoid pulling in a large unnecessary
+# dependency. It bundles its own copy of Level Zero headers, but Blender
+# uses the official Level Zero SDK instead. If future UR code requires
+# Compute Runtime-specific headers, this will need revisiting.
+set(COMPUTE_RUNTIME_LEVEL_ZERO_INCLUDE "")
+set(COMPUTE_RUNTIME_REPO_PATH "")
+
message(STATUS "Using Level Zero include headers from ${COMPUTE_RUNTIME_LEVEL_ZERO_INCLUDE}")
add_library(ComputeRuntimeLevelZero-Headers INTERFACE)
diff --git a/unified-runtime/source/adapters/level_zero/common.hpp b/unified-runtime/source/adapters/level_zero/common.hpp
index d39f2dcd2..cf2978665 100644
--- a/unified-runtime/source/adapters/level_zero/common.hpp
+++ b/unified-runtime/source/adapters/level_zero/common.hpp
@@ -31,7 +31,9 @@
#include <ze_api.h>
#include <zes_api.h>
-#include <level_zero/ze_intel_gpu.h>
+// ze_intel_gpu.h is removed because it comes from Compute Runtime, which
+// Blender does not depend on. We use the official Level Zero SDK headers
+// instead. Symbols from this header are guarded or backported where needed.
#include <umf_pools/disjoint_pool_config_parser.hpp>
#include "common/ur_ref_count.hpp"
diff --git a/xptifw/include/xpti_string_table.hpp b/xptifw/include/xpti_string_table.hpp
index bd48df019..5106e7eb8 100644
--- a/xptifw/include/xpti_string_table.hpp
+++ b/xptifw/include/xpti_string_table.hpp
@@ -7,7 +7,7 @@
#include "parallel_hashmap/phmap.h"
#include "xpti/xpti_data_types.h"
-#include <emhash/hash_table7.hpp>
+#include <hash_table7.hpp>
#include <atomic>
#include <shared_mutex>
diff --git a/xptifw/src/CMakeLists.txt b/xptifw/src/CMakeLists.txt
index de2274129..fa575434d 100644
--- a/xptifw/src/CMakeLists.txt
+++ b/xptifw/src/CMakeLists.txt
@@ -18,7 +18,7 @@ FetchContent_Declare(parallel-hashmap
FetchContent_GetProperties(parallel-hashmap)
FetchContent_MakeAvailable(parallel-hashmap)
-set(XPTIFW_PARALLEL_HASHMAP_HEADERS "${parallel-hashmap_SOURCE_DIR}")
+# XPTIFW_PARALLEL_HASHMAP_HEADERS is already set from from Blender's build system.
file(GLOB SOURCES *.cpp)
diff --git a/xptifw/src/xpti_trace_framework.cpp b/xptifw/src/xpti_trace_framework.cpp
index 001b806d8..8c46de805 100644
--- a/xptifw/src/xpti_trace_framework.cpp
+++ b/xptifw/src/xpti_trace_framework.cpp
@@ -19,7 +19,7 @@
#include "xpti_int64_hash_table.hpp"
#include "xpti_object_table.hpp"
#include "xpti_string_table.hpp"
-#include <emhash/hash_table7.hpp>
+#include <hash_table7.hpp>
#include <algorithm>
#include <array>

View File

@@ -0,0 +1,101 @@
diff --git a/unified-runtime/source/adapters/level_zero/platform.cpp b/unified-runtime/source/adapters/level_zero/platform.cpp
index 3eed2d875..a41c3701c 100644
--- a/unified-runtime/source/adapters/level_zero/platform.cpp
+++ b/unified-runtime/source/adapters/level_zero/platform.cpp
@@ -272,15 +272,10 @@ ur_result_t ur_platform_handle_t_::initialize() {
ZeDriverEuCountExtensionFound = true;
}
}
- if (strncmp(extension.name,
- ZEX_INTEL_QUEUE_COPY_OPERATIONS_OFFLOAD_HINT_EXP_NAME,
- strlen(ZEX_INTEL_QUEUE_COPY_OPERATIONS_OFFLOAD_HINT_EXP_NAME) +
- 1) == 0) {
- if (extension.version ==
- ZEX_INTEL_QUEUE_COPY_OPERATIONS_OFFLOAD_HINT_EXP_VERSION_1_0) {
- ZeCopyOffloadExtensionSupported = true;
- }
- }
+ // Backport of https://github.com/intel/llvm/pull/21050, adapted by
+ // Xavier Hallade for the DPC++ v6.3 release.
+ // These changes may already be included in a future DPC++ release
+ // branch - if so, this patch can be removed.
if (strncmp(extension.name, ZE_BINDLESS_IMAGE_EXP_NAME,
strlen(ZE_BINDLESS_IMAGE_EXP_NAME) + 1) == 0) {
if (extension.version == ZE_BINDLESS_IMAGE_EXP_VERSION_1_0) {
@@ -526,6 +521,9 @@ ur_result_t ur_platform_handle_t_::initialize() {
ZeMemGetPitchFor2dImageExt.Supported =
ZeMemGetPitchFor2dImageExt.zeMemGetPitchFor2dImage != nullptr;
+ // BACKPORT(#21050)
+ ZeCopyOffloadExtensionSupported = this->isDriverVersionNewerOrSimilar(1, 14, 0);
+
return UR_RESULT_SUCCESS;
}
diff --git a/unified-runtime/source/adapters/level_zero/v2/command_list_cache.cpp b/unified-runtime/source/adapters/level_zero/v2/command_list_cache.cpp
index a8dd67fc9..a65050534 100644
--- a/unified-runtime/source/adapters/level_zero/v2/command_list_cache.cpp
+++ b/unified-runtime/source/adapters/level_zero/v2/command_list_cache.cpp
@@ -13,11 +13,10 @@
#include "../device.hpp"
-template <>
-ze_structure_type_t
-getZeStructureType<zex_intel_queue_copy_operations_offload_hint_exp_desc_t>() {
- return ZEX_INTEL_STRUCTURE_TYPE_QUEUE_COPY_OPERATIONS_OFFLOAD_HINT_EXP_PROPERTIES;
-}
+// BACKPORT(#21050)
+#ifndef ZE_COMMAND_QUEUE_FLAG_COPY_OFFLOAD_HINT
+#define ZE_COMMAND_QUEUE_FLAG_COPY_OFFLOAD_HINT ZE_BIT(2)
+#endif
bool v2::immediate_command_list_descriptor_t::operator==(
const immediate_command_list_descriptor_t &rhs) const {
@@ -61,7 +60,7 @@ static bool ForceDisableCopyOffload = [] {
raii::ze_command_list_handle_t
command_list_cache_t::createCommandList(const command_list_descriptor_t &desc) {
- ZeStruct<zex_intel_queue_copy_operations_offload_hint_exp_desc_t> offloadDesc;
+ // BACKPORT(#21050)
auto requestedCopyOffload =
std::visit([](auto &&arg) { return arg.CopyOffloadEnabled; }, desc);
@@ -76,8 +75,7 @@ command_list_cache_t::createCommandList(const command_list_descriptor_t &desc) {
requestedCopyOffload = false;
}
- offloadDesc.copyOffloadEnabled = requestedCopyOffload;
-
+ // BACKPORT(#21050)
if (auto ImmCmdDesc =
std::get_if<immediate_command_list_descriptor_t>(&desc)) {
ze_command_list_handle_t ZeCommandList;
@@ -91,7 +89,11 @@ command_list_cache_t::createCommandList(const command_list_descriptor_t &desc) {
QueueDesc.flags |= ZE_COMMAND_QUEUE_FLAG_EXPLICIT_ONLY;
QueueDesc.index = ImmCmdDesc->Index.value();
}
- QueueDesc.pNext = &offloadDesc;
+
+ // BACKPORT(#21050)
+ if (requestedCopyOffload && ZeCopyOffloadExtensionSupported) {
+ QueueDesc.flags |= ZE_COMMAND_QUEUE_FLAG_COPY_OFFLOAD_HINT;
+ }
UR_LOG(DEBUG,
"create command list ordinal: {}, type: immediate, "
@@ -114,11 +116,12 @@ command_list_cache_t::createCommandList(const command_list_descriptor_t &desc) {
CmdListDesc.flags =
RegCmdDesc.IsInOrder ? ZE_COMMAND_LIST_FLAG_IN_ORDER : 0;
CmdListDesc.commandQueueGroupOrdinal = RegCmdDesc.Ordinal;
- CmdListDesc.pNext = &offloadDesc;
+ // BACKPORT(#21050)
ZeStruct<ze_mutable_command_list_exp_desc_t> ZeMutableCommandListDesc;
if (IsMutable) {
ZeMutableCommandListDesc.flags = 0;
- offloadDesc.pNext = &ZeMutableCommandListDesc;
+ // BACKPORT(#21050)
+ CmdListDesc.pNext = &ZeMutableCommandListDesc;
}
UR_LOG(DEBUG,

View File

@@ -0,0 +1,19 @@
diff --git a/unified-runtime/source/adapters/level_zero/adapter.cpp b/unified-runtime/source/adapters/level_zero/adapter.cpp
index 7fb83133c..e1fe3a80a 100644
--- a/unified-runtime/source/adapters/level_zero/adapter.cpp
+++ b/unified-runtime/source/adapters/level_zero/adapter.cpp
@@ -23,13 +23,8 @@
ZeUSMImportExtension ZeUSMImport;
-// Due to multiple DLLMain definitions with SYCL, Global Adapter is init at
-// variable creation.
-#if defined(_WIN32)
-ur_adapter_handle_t_ *GlobalAdapter = new ur_adapter_handle_t_();
-#else
+// This is a backport of the upstream bugfix https://github.com/intel/llvm/pull/21490
ur_adapter_handle_t_ *GlobalAdapter;
-#endif
// This is a temporary workaround on windows, where UR adapter is teardowned
// before the UR loader, which will result in access violation when we use print
// function as the overrided print function was already released with the UR

View File

@@ -0,0 +1,70 @@
diff -Naur eigen.base/Eigen/src/SparseCore/SparseDenseProduct.h external_eigen/Eigen/src/SparseCore/SparseDenseProduct.h
--- eigen.base/Eigen/src/SparseCore/SparseDenseProduct.h 2026-01-12 11:46:25.135745600 -0800
+++ external_eigen/Eigen/src/SparseCore/SparseDenseProduct.h 2026-01-15 11:02:49.671711500 -0800
@@ -13,6 +13,10 @@
// IWYU pragma: private
#include "./InternalHeaderCheck.h"
+#ifdef EIGEN_HAS_TBB
+#include <tbb/parallel_for.h>
+#endif
+
namespace Eigen {
namespace internal {
@@ -49,6 +53,15 @@
#endif
for (Index c = 0; c < rhs.cols(); ++c) {
+#ifdef EIGEN_HAS_TBB
+ if(lhsEval.nonZerosEstimate() > 20000) {
+ tbb::parallel_for(tbb::blocked_range<Index>(0, n, 1024),
+ [&](const tbb::blocked_range<Index>& range) {
+ for(Index i=range.begin(); i<range.end(); ++i)
+ processRow(lhsEval,rhs,res,alpha,i,c);
+ });
+ } else
+#else
#ifdef EIGEN_HAS_OPENMP
// This 20000 threshold has been found experimentally on 2D and 3D Poisson problems.
// It basically represents the minimal amount of work to be done to be worth it.
@@ -57,6 +70,7 @@
for (Index i = 0; i < n; ++i) processRow(lhsEval, rhs, res, alpha, i, c);
} else
#endif
+#endif
{
for (Index i = 0; i < n; ++i) processRow(lhsEval, rhs, res, alpha, i, c);
}
@@ -123,14 +137,24 @@
Index n = lhs.rows();
LhsEval lhsEval(lhs);
-#ifdef EIGEN_HAS_OPENMP
- Index threads = Eigen::nbThreads();
- // This 20000 threshold has been found experimentally on 2D and 3D Poisson problems.
- // It basically represents the minimal amount of work to be done to be worth it.
- if (threads > 1 && lhsEval.nonZerosEstimate() * rhs.cols() > 20000) {
-#pragma omp parallel for schedule(dynamic, (n + threads * 4 - 1) / (threads * 4)) num_threads(threads)
- for (Index i = 0; i < n; ++i) processRow(lhsEval, rhs, res, alpha, i);
+#ifdef EIGEN_HAS_TBB
+ if(lhsEval.nonZerosEstimate()*rhs.cols() > 20000) {
+ tbb::parallel_for(tbb::blocked_range<Index>(0, n, 1024),
+ [&](const tbb::blocked_range<Index>& range) {
+ for(Index i=range.begin(); i<range.end(); ++i)
+ processRow(lhsEval,rhs,res,alpha,i);
+ });
} else
+#else
+ #ifdef EIGEN_HAS_OPENMP
+ Index threads = Eigen::nbThreads();
+ // This 20000 threshold has been found experimentally on 2D and 3D Poisson problems.
+ // It basically represents the minimal amount of work to be done to be worth it.
+ if (threads > 1 && lhsEval.nonZerosEstimate() * rhs.cols() > 20000) {
+ #pragma omp parallel for schedule(dynamic, (n + threads * 4 - 1) / (threads * 4)) num_threads(threads)
+ for (Index i = 0; i < n; ++i) processRow(lhsEval, rhs, res, alpha, i);
+ } else
+ #endif
#endif
{
for (Index i = 0; i < n; ++i) processRow(lhsEval, rhs, res, alpha, i);

View File

@@ -0,0 +1,39 @@
diff --git a/common/cmake/dpcpp.cmake b/common/cmake/dpcpp.cmake
index a15c179..4760e63 100644
--- a/common/cmake/dpcpp.cmake
+++ b/common/cmake/dpcpp.cmake
@@ -45,7 +45,7 @@ IF (EMBREE_SYCL_SUPPORT)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-sycl") # makes dpcpp compiler compatible with clang++
- SET(CMAKE_CXX_FLAGS_SYCL "-fsycl -fsycl-unnamed-lambda -Xclang -fsycl-allow-func-ptr")
+ SET(CMAKE_CXX_FLAGS_SYCL "-fsycl -nolibsycl -fsycl-unnamed-lambda -Xclang -fsycl-allow-func-ptr")
SET(CMAKE_CXX_FLAGS_SYCL "${CMAKE_CXX_FLAGS_SYCL} -Wno-mismatched-tags -Wno-pessimizing-move -Wno-reorder -Wno-unneeded-internal-declaration -Wno-delete-non-abstract-non-virtual-dtor -Wno-dangling-field -Wno-unknown-pragmas -Wno-logical-op-parentheses")
IF (SYCL_ONEAPI_ICX AND WIN32)
diff --git a/kernels/CMakeLists.txt b/kernels/CMakeLists.txt
index b827807..648603a 100644
--- a/kernels/CMakeLists.txt
+++ b/kernels/CMakeLists.txt
@@ -216,6 +216,12 @@ embree_files(EMBREE_LIBRARY_FILES_AVX512 ${AVX512})
#message("AVX2: ${EMBREE_LIBRARY_FILES_AVX2}")
#message("AVX512: ${EMBREE_LIBRARY_FILES_AVX512}")
+# Bundle Neon2x into the main static library.
+IF(EMBREE_ISA_NEON2X AND EMBREE_STATIC_LIB)
+ LIST(APPEND EMBREE_LIBRARY_FILES ${EMBREE_LIBRARY_FILES_AVX2})
+ LIST(REMOVE_DUPLICATES EMBREE_LIBRARY_FILES)
+ENDIF()
+
# replaces all .cpp files with a dummy file that includes that .cpp file
# this is to work around an ICC name mangling issue related to lambda functions under windows
MACRO (CreateISADummyFiles list isa)
@@ -318,7 +324,7 @@ IF (EMBREE_ISA_AVX AND EMBREE_LIBRARY_FILES_AVX)
ENDIF()
ENDIF()
-IF (EMBREE_ISA_AVX2 AND EMBREE_LIBRARY_FILES_AVX2)
+IF (EMBREE_ISA_AVX2 AND EMBREE_LIBRARY_FILES_AVX2 AND NOT (EMBREE_ISA_NEON2X AND EMBREE_STATIC_LIB))
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)

View File

@@ -0,0 +1,7 @@
<Project>
<PropertyGroup>
<LLVMInstallDir>${EMBREE_LLVM_INSTALL_PATH}</LLVMInstallDir>
<LLVMToolsVersion>${LLVM_VERSION}</LLVMToolsVersion>
<VCToolsVersion>${EMBREE_VCTOOLS_VERSION}</VCToolsVersion>
</PropertyGroup>
</Project>

View File

@@ -0,0 +1,144 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index fcd396d..2d2740c 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,6 +1,6 @@
cmake_minimum_required(VERSION 3.12)
-project(emhash_bench)
+project(emhash)
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Release)
@@ -8,41 +8,89 @@ endif()
set(CMAKE_CXX_STANDARD 17)
+option(WITH_BENCHMARKS "Build benchmarks." ON)
+
message("------------ Options -------------")
message(" CMAKE_BUILD_TYPE: ${CMAKE_BUILD_TYPE}")
message(" CMAKE_SYSTEM_NAME: ${CMAKE_SYSTEM_NAME}")
message(" CMAKE_SYSTEM_PROCESSOR: ${CMAKE_SYSTEM_PROCESSOR} ")
message(" CMAKE_CXX_COMPILER_ID: ${CMAKE_CXX_COMPILER_ID} ${CMAKE_CXX_COMPILER_VERSION}")
-include_directories(${PROJECT_SOURCE_DIR})
-include_directories(${PROJECT_SOURCE_DIR}/thirdparty)
-include_directories(${PROJECT_SOURCE_DIR}/bench)
-
-add_definitions(-DHAVE_BOOST=1 -DABSL_HAMP=1 -DEMH_PSL=16)# -DET=1)
-find_package(Threads REQUIRED)
-
-if(WIN32)
- set(CMAKE_CXX_FLAGS "/WX- /MP")
- set(CMAKE_CXX_FLAGS_DEBUG "/W3 /Zi /Od /WX- ${CMAKE_CXX_FLAGS}")
- set(CMAKE_CXX_FLAGS_RELEASE "/Ob1 /Ot /Oi /Oy /GL /arch:AVX ${CMAKE_CXX_FLAGS}")
- add_compile_options(/Ob2 /DNDEBUG /O2 /Ot /Oi /Oy /GL /arch:AVX)
-elseif(1)
- set(CMAKE_CXX_FLAGS_DEBUG "-g fno-strict-aliasing ${CMAKE_CXX_FLAGS}")
- set(CMAKE_CXX_FLAGS "-flto -march=native ${CMAKE_CXX_FLAGS}")
+add_library(emhash INTERFACE)
+
+set(EMHASH_HEADERS
+ hash_set2.hpp
+ hash_set3.hpp
+ hash_set4.hpp
+ hash_set8.hpp
+ hash_table5.hpp
+ hash_table6.hpp
+ hash_table7.hpp
+ hash_table8.hpp
+)
+
+set_target_properties(emhash PROPERTIES PUBLIC_HEADER "${EMHASH_HEADERS}")
+
+target_include_directories(
+ emhash INTERFACE
+ $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}}>
+ $<INSTALL_INTERFACE:include>
+)
+
+include(GNUInstallDirs)
+include(CMakePackageConfigHelpers)
+
+install(TARGETS emhash
+ EXPORT emhash-targets
+ PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
+)
+
+install(EXPORT emhash-targets
+ FILE emhashTargets.cmake
+ NAMESPACE emhash::
+ DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/emhash
+)
+
+configure_package_config_file(${CMAKE_CURRENT_SOURCE_DIR}/config.cmake.in
+ "${CMAKE_CURRENT_BINARY_DIR}/emhashConfig.cmake"
+ INSTALL_DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/emhash
+)
+
+install(FILES
+ "${CMAKE_CURRENT_BINARY_DIR}/emhashConfig.cmake"
+ DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/emhash
+)
+
+if(WITH_BENCHMARKS)
+ include_directories(${PROJECT_SOURCE_DIR})
+ include_directories(${PROJECT_SOURCE_DIR}/thirdparty)
+ include_directories(${PROJECT_SOURCE_DIR}/bench)
+ add_definitions(-DHAVE_BOOST=1 -DABSL_HAMP=1 -DEMH_PSL=16)# -DET=1)
+ find_package(Threads REQUIRED)
+ if(WIN32)
+ set(CMAKE_CXX_FLAGS "/WX- /MP")
+ set(CMAKE_CXX_FLAGS_DEBUG "/W3 /Zi /Od /WX- ${CMAKE_CXX_FLAGS}")
+ set(CMAKE_CXX_FLAGS_RELEASE "/Ob1 /Ot /Oi /Oy /GL /arch:AVX ${CMAKE_CXX_FLAGS}")
+ add_compile_options(/Ob2 /DNDEBUG /O2 /Ot /Oi /Oy /GL /arch:AVX)
+ elseif(1)
+ set(CMAKE_CXX_FLAGS_DEBUG "-g fno-strict-aliasing ${CMAKE_CXX_FLAGS}")
+ set(CMAKE_CXX_FLAGS "-flto=auto -march=native ${CMAKE_CXX_FLAGS}")
+ endif()
+
+ add_executable(ebench ${PROJECT_SOURCE_DIR}/bench/ebench.cpp)
+ add_executable(sbench ${PROJECT_SOURCE_DIR}/bench/sbench.cpp)
+ add_executable(mbench ${PROJECT_SOURCE_DIR}/bench/martin_bench.cpp)
+ add_executable(bs ${PROJECT_SOURCE_DIR}/bench/bstring.cpp)
+ add_executable(bi ${PROJECT_SOURCE_DIR}/bench/buint64.cpp)
+ add_executable(fbench ${PROJECT_SOURCE_DIR}/bench/fbench.cpp)
+ add_executable(hbench ${PROJECT_SOURCE_DIR}/bench/hbench.cpp)
+ #add_executable(qbench ${PROJECT_SOURCE_DIR}/bench/qbench.cpp)
+ #add_executable(sibench ${PROJECT_SOURCE_DIR}/bench/simple_bench.cpp)
+
+ #target_link_libraries(ebench PRIVATE Threads::Threads)
+ #target_link_libraries(sbench PRIVATE Threads::Threads)
+ #target_link_libraries(mbench PRIVATE Threads::Threads)
+ #target_link_libraries(hbench PRIVATE Threads::Threads)
+ #target_link_libraries(fbench PRIVATE Threads::Threads)
endif()
-add_executable(ebench ${PROJECT_SOURCE_DIR}/bench/ebench.cpp)
-add_executable(sbench ${PROJECT_SOURCE_DIR}/bench/sbench.cpp)
-add_executable(mbench ${PROJECT_SOURCE_DIR}/bench/martin_bench.cpp)
-add_executable(bs ${PROJECT_SOURCE_DIR}/bench/bstring.cpp)
-add_executable(bi ${PROJECT_SOURCE_DIR}/bench/buint64.cpp)
-add_executable(fbench ${PROJECT_SOURCE_DIR}/bench/fbench.cpp)
-add_executable(hbench ${PROJECT_SOURCE_DIR}/bench/hbench.cpp)
-#add_executable(qbench ${PROJECT_SOURCE_DIR}/bench/qbench.cpp)
-#add_executable(sibench ${PROJECT_SOURCE_DIR}/bench/simple_bench.cpp)
-
-#target_link_libraries(ebench PRIVATE Threads::Threads)
-#target_link_libraries(sbench PRIVATE Threads::Threads)
-#target_link_libraries(mbench PRIVATE Threads::Threads)
-#target_link_libraries(hbench PRIVATE Threads::Threads)
-#target_link_libraries(fbench PRIVATE Threads::Threads)
diff --git a/config.cmake.in b/config.cmake.in
new file mode 100644
index 0000000..341806c
--- /dev/null
+++ b/config.cmake.in
@@ -0,0 +1,5 @@
+@PACKAGE_INIT@
+
+include("${CMAKE_CURRENT_LIST_DIR}/emhashTargets.cmake")
+
+check_required_components(emhash)
\ No newline at end of file

View File

@@ -0,0 +1,19 @@
--- a/src/dispatch_wgl.c 2022-08-04 17:45:13.144924705 +0200
+++ b/src/dispatch_wgl.c 2022-08-04 17:45:47.657482971 +0200
@@ -78,6 +78,8 @@
if (!first_context_current) {
first_context_current = true;
} else {
+ /* BLENDER: disable slow dispatch table switching. */
+#if 0
if (!already_switched_to_dispatch_table) {
already_switched_to_dispatch_table = true;
gl_switch_to_dispatch_table();
@@ -86,6 +88,7 @@
gl_init_dispatch_table();
wgl_init_dispatch_table();
+#endif
}
}

View File

@@ -0,0 +1,33 @@
diff --git a/configure b/configure
index 1759694274..620512c7d3 100755
--- a/configure
+++ b/configure
@@ -7342,7 +7342,7 @@ enabled libopencv && { check_pkg_config libopencv opencv4 opencv2/core/c
enabled libopencolorio && require_pkg_config_cxx libopencolorio "OpenColorIO" OpenColorIO/OpenColorIO.h OCIO_NAMESPACE::Config
enabled libopenh264 && require_pkg_config libopenh264 "openh264 >= 1.3.0" wels/codec_api.h WelsGetCodecVersion
enabled libopenjpeg && { check_pkg_config libopenjpeg "libopenjp2 >= 2.1.0" openjpeg.h opj_version ||
- { require_pkg_config libopenjpeg "libopenjp2 >= 2.1.0" openjpeg.h opj_version -DOPJ_STATIC && add_cppflags -DOPJ_STATIC; } }
+ { require_pkg_config libopenjpeg "libopenjp2 >= 2.1.0" openjpeg.h opj_version "-DOPJ_STATIC $pthreads_extralibs $libm_extralibs" && add_cppflags "-DOPJ_STATIC $pthreads_extralibs $libm_extralibs"; } }
enabled libopenmpt && require_pkg_config libopenmpt "libopenmpt >= 0.2.6557" libopenmpt/libopenmpt.h openmpt_module_create -lstdc++ && append libopenmpt_extralibs "-lstdc++"
enabled libopenvino && { { check_pkg_config libopenvino openvino openvino/c/openvino.h ov_core_create && enable openvino2; } ||
{ check_pkg_config libopenvino openvino c_api/ie_c_api.h ie_c_api_version ||
@@ -7392,8 +7392,8 @@ enabled libvmaf && require_pkg_config libvmaf "libvmaf >= 2.0.0" libvm
enabled libvmaf && check_pkg_config libvmaf_cuda "libvmaf >= 2.0.0" libvmaf_cuda.h vmaf_cuda_state_init
enabled libvo_amrwbenc && { check_pkg_config libvo_amrwbenc vo-amrwbenc vo-amrwbenc/enc_if.h E_IF_init ||
require libvo_amrwbenc vo-amrwbenc/enc_if.h E_IF_init -lvo-amrwbenc; }
-enabled libvorbis && require_pkg_config libvorbis vorbis vorbis/codec.h vorbis_info_init &&
- require_pkg_config libvorbisenc vorbisenc vorbis/vorbisenc.h vorbis_encode_init
+enabled libvorbis && require_pkg_config libvorbis vorbis vorbis/codec.h vorbis_info_init $libm_extralibs &&
+ require_pkg_config libvorbisenc vorbisenc vorbis/vorbisenc.h vorbis_encode_init $libm_extralibs
enabled whisper && require_pkg_config whisper "whisper >= 1.7.5" whisper.h whisper_init_from_file_with_params
@@ -7429,7 +7429,7 @@ enabled libx264 && require_pkg_config libx264 x264 "stdint.h x264.h" x
require_cpp_condition libx264 x264.h "X264_BUILD >= 158"; } &&
check_cpp_condition libx264_hdr10 x264.h "X264_BUILD >= 163" &&
check_cpp_condition libx262 x264.h "X264_MPEG2"
-enabled libx265 && require_pkg_config libx265 x265 x265.h x265_api_get &&
+enabled libx265 && require_pkg_config libx265 x265 x265.h x265_api_get $pthreads_extralibs &&
require_cpp_condition libx265 x265.h "X265_BUILD >= 89"
enabled libxavs && require libxavs "stdint.h xavs.h" xavs_encoder_encode "-lxavs $pthreads_extralibs $libm_extralibs"
enabled libxavs2 && require_pkg_config libxavs2 "xavs2 >= 1.3.0" "stdint.h xavs2.h" xavs2_api_get

View File

@@ -0,0 +1,62 @@
diff --git a/configure b/configure
index ffa407d53d..8a7cb7065c 100755
--- a/configure
+++ b/configure
@@ -7232,7 +7232,7 @@ enabled gnutls && require_pkg_config gnutls gnutls gnutls/gnutls.h gn
enabled jni && { [ $target_os = "android" ] && check_headers jni.h && enabled pthreads || die "ERROR: jni not found"; }
enabled ladspa && require_headers "ladspa.h dlfcn.h"
enabled lcms2 && require_pkg_config lcms2 "lcms2 >= 2.13" lcms2.h cmsCreateContext
-enabled libaom && require_pkg_config libaom "aom >= 2.0.0" aom/aom_codec.h aom_codec_version
+enabled libaom && { require libaom aom/aom_codec.h aom_codec_version -laom; }
enabled liboapv && require_pkg_config liboapv "oapv >= 0.2.0.0" "oapv/oapv.h" oapve_encode
enabled libaribb24 && { check_pkg_config libaribb24 "aribb24 > 1.0.3" "aribb24/aribb24.h" arib_instance_new ||
{ enabled gpl && require_pkg_config libaribb24 aribb24 "aribb24/aribb24.h" arib_instance_new; } ||
@@ -7341,18 +7341,17 @@ enabled libopencv && { check_pkg_config libopencv opencv4 opencv2/core/c
require libopencv opencv2/core/core_c.h cvCreateImageHeader -lopencv_core -lopencv_imgproc; }
enabled libopencolorio && require_pkg_config_cxx libopencolorio "OpenColorIO" OpenColorIO/OpenColorIO.h OCIO_NAMESPACE::Config
enabled libopenh264 && require_pkg_config libopenh264 "openh264 >= 1.3.0" wels/codec_api.h WelsGetCodecVersion
-enabled libopenjpeg && { check_pkg_config libopenjpeg "libopenjp2 >= 2.1.0" openjpeg.h opj_version ||
- { require_pkg_config libopenjpeg "libopenjp2 >= 2.1.0" openjpeg.h opj_version -DOPJ_STATIC && add_cppflags -DOPJ_STATIC; } }
+enabled libopenjpeg && require libopenjpeg openjpeg.h opj_version "-DOPJ_STATIC" -lopenjp2
enabled libopenmpt && require_pkg_config libopenmpt "libopenmpt >= 0.2.6557" libopenmpt/libopenmpt.h openmpt_module_create -lstdc++ && append libopenmpt_extralibs "-lstdc++"
enabled libopenvino && { { check_pkg_config libopenvino openvino openvino/c/openvino.h ov_core_create && enable openvino2; } ||
{ check_pkg_config libopenvino openvino c_api/ie_c_api.h ie_c_api_version ||
require libopenvino c_api/ie_c_api.h ie_c_api_version -linference_engine_c_api; } }
enabled libopus && {
enabled libopus_decoder && {
- require_pkg_config libopus opus opus_multistream.h opus_multistream_decoder_create
+ require libopus opus_multistream.h opus_multistream_decoder_create -lopus
}
enabled libopus_encoder && {
- require_pkg_config libopus opus opus_multistream.h opus_multistream_surround_encoder_create
+ require libopus opus_multistream.h opus_multistream_encoder_create -lopus
}
}
enabled libplacebo && require_pkg_config libplacebo "libplacebo >= 5.229.0" libplacebo/vulkan.h pl_vulkan_create
@@ -7392,8 +7391,8 @@ enabled libvmaf && require_pkg_config libvmaf "libvmaf >= 2.0.0" libvm
enabled libvmaf && check_pkg_config libvmaf_cuda "libvmaf >= 2.0.0" libvmaf_cuda.h vmaf_cuda_state_init
enabled libvo_amrwbenc && { check_pkg_config libvo_amrwbenc vo-amrwbenc vo-amrwbenc/enc_if.h E_IF_init ||
require libvo_amrwbenc vo-amrwbenc/enc_if.h E_IF_init -lvo-amrwbenc; }
-enabled libvorbis && require_pkg_config libvorbis vorbis vorbis/codec.h vorbis_info_init &&
- require_pkg_config libvorbisenc vorbisenc vorbis/vorbisenc.h vorbis_encode_init
+enabled libvorbis && require libvorbis vorbis/codec.h vorbis_info_init -lvorbis -logg -lvorbisfile &&
+ require libvorbisenc vorbis/vorbisenc.h vorbis_encode_init -lvorbis -lvorbisenc -logg -lvorbisfile
enabled whisper && require_pkg_config whisper "whisper >= 1.7.5" whisper.h whisper_init_from_file_with_params
@@ -7423,13 +7422,13 @@ enabled libvvenc && require_pkg_config libvvenc "libvvenc >= 1.6.1" "vv
enabled libwebp && {
enabled libwebp_encoder && require_pkg_config libwebp "libwebp >= 0.2.0" webp/encode.h WebPGetEncoderVersion
enabled libwebp_anim_encoder && check_pkg_config libwebp_anim_encoder "libwebpmux >= 0.4.0" webp/mux.h WebPAnimEncoderOptionsInit; }
-enabled libx264 && require_pkg_config libx264 x264 "stdint.h x264.h" x264_encoder_encode &&
+enabled libx264 && require libx264 "stdint.h x264.h" x264_encoder_encode -lx264 &&
require_cpp_condition libx264 x264.h "X264_BUILD >= 155" && {
[ "$toolchain" != "msvc" ] ||
require_cpp_condition libx264 x264.h "X264_BUILD >= 158"; } &&
check_cpp_condition libx264_hdr10 x264.h "X264_BUILD >= 163" &&
check_cpp_condition libx262 x264.h "X264_MPEG2"
-enabled libx265 && require_pkg_config libx265 x265 x265.h x265_api_get &&
+enabled libx265 && require libx265 "x265.h" x265_api_get -lx265 &&
require_cpp_condition libx265 x265.h "X265_BUILD >= 89"
enabled libxavs && require libxavs "stdint.h xavs.h" xavs_encoder_encode "-lxavs $pthreads_extralibs $libm_extralibs"
enabled libxavs2 && require_pkg_config libxavs2 "xavs2 >= 1.3.0" "stdint.h xavs2.h" xavs2_api_get

View File

@@ -0,0 +1,219 @@
https://github.com/westes/flex/issues/436
https://bugs.gentoo.org/705800
https://developers.redhat.com/blog/2019/04/22/implicit-function-declarations-flexs-use-of-reallocarray
https://github.com/westes/flex/commit/4b5111d9772b5c160340ca96f08d30d7f6db5cda
https://github.com/westes/flex/commit/24fd0551333e7eded87b64dd36062da3df2f6380
https://github.com/westes/flex/commit/0db9f8903a446e7026874be519b8dc55a471f014
https://github.com/westes/flex/commit/a17d79e9c722a6735b6d2a8f152287404f27df32
https://github.com/westes/flex/commit/4081efa0831b15d7e4e4255401c225ad8262426d
https://github.com/westes/flex/commit/1985bb3c7abed940e91ad816504ef08a18c3b7c1
From 4b5111d9772b5c160340ca96f08d30d7f6db5cda Mon Sep 17 00:00:00 2001
From: Explorer09 <explorer09@gmail.com>
Date: Mon, 4 Sep 2017 08:28:53 +0800
Subject: [PATCH] scanner: Include flexdef.h at %top block of scan.l
config.h may define macros that alter the API of the standard library
funtions, and so it should be included before any other standard
header, even before the skeleton's standard header inclusion.
For example: config.h may #define _GNU_SOURCE that would expose the
reallocarray() prototype from <stdlib.h> on glibc 2.26+ systems. If we
include <stdlib.h> before config.h, reallocarray() would not be
available for use in lex file since the second include doesn't help
due to header guard.
For now our config.h might `#define malloc rpl_malloc` -- this
substitution must work before including stdlib.h, or else the compiler
will complain about missing prototypes, and may result in incorrect
code in scan.l (gcc warning: return makes pointer from integer without
a cast [-Wint-conversion]).
Fixes #247.
--- a/src/scan.l
+++ b/src/scan.l
@@ -1,5 +1,11 @@
/* scan.l - scanner for flex input -*-C-*- */
+%top{
+/* flexdef.h includes config.h, which may contain macros that alter the API */
+/* of libc functions. Must include first before any libc header. */
+#include "flexdef.h"
+}
+
%{
/* Copyright (c) 1990 The Regents of the University of California. */
/* All rights reserved. */
@@ -32,7 +38,6 @@
/* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR */
/* PURPOSE. */
-#include "flexdef.h"
#include "parse.h"
extern bool tablesverify, tablesext;
extern int trlcontxt; /* Set in parse.y for each rule. */
From 24fd0551333e7eded87b64dd36062da3df2f6380 Mon Sep 17 00:00:00 2001
From: Explorer09 <explorer09@gmail.com>
Date: Mon, 4 Sep 2017 10:47:33 +0800
Subject: [PATCH] build: AC_USE_SYSTEM_EXTENSIONS in configure.ac.
This would, e.g. define _GNU_SOURCE in config.h, enabling the
reallocarray() prototype in glibc 2.26+ on Linux systems with that
version of glibc.
Fixes #241.
--- a/configure.ac
+++ b/configure.ac
@@ -25,8 +25,10 @@
# autoconf requirements and initialization
AC_INIT([the fast lexical analyser generator],[2.6.4],[flex-help@lists.sourceforge.net],[flex])
+AC_PREREQ([2.60])
AC_CONFIG_SRCDIR([src/scan.l])
AC_CONFIG_AUX_DIR([build-aux])
+AC_USE_SYSTEM_EXTENSIONS
LT_INIT
AM_INIT_AUTOMAKE([1.15 -Wno-portability foreign std-options dist-lzip parallel-tests subdir-objects])
AC_CONFIG_HEADER([src/config.h])
From 0db9f8903a446e7026874be519b8dc55a471f014 Mon Sep 17 00:00:00 2001
From: Lukasz Baj <l.baj@radytek.com>
Date: Fri, 22 Sep 2017 10:24:46 +0200
Subject: [PATCH] build: Remove custom reallocarray() declaration.
Use one from <stdlib.h> instead because that is more portable.
--- a/src/flexdef.h
+++ b/src/flexdef.h
@@ -631,10 +631,6 @@ extern int sectnum, nummt, hshcol, dfaeql, numeps, eps2, num_reallocs;
extern int tmpuses, totnst, peakpairs, numuniq, numdup, hshsave;
extern int num_backing_up, bol_needed;
-#ifndef HAVE_REALLOCARRAY
-void *reallocarray(void *, size_t, size_t);
-#endif
-
void *allocate_array(int, size_t);
void *reallocate_array(void *, int, size_t);
From a17d79e9c722a6735b6d2a8f152287404f27df32 Mon Sep 17 00:00:00 2001
From: Explorer09 <explorer09@gmail.com>
Date: Sat, 14 Oct 2017 00:36:54 +0800
Subject: [PATCH] scanner: Define _POSIX_C_SOURCE when needed in skeleton.
The function fileno() is defined by POSIX. When flex would otherwise not provide that feature macro, we define it.
Fixes #263
--- a/src/flex.skl
+++ b/src/flex.skl
@@ -218,6 +218,14 @@ m4_ifdef( [[M4_YY_TABLES_EXTERNAL]],
/* begin standard C headers. */
%if-c-only
+m4_ifdef( [[M4_YY_ALWAYS_INTERACTIVE]], ,
+[[m4_ifdef( [[M4_YY_NEVER_INTERACTIVE]], ,
+[[#ifndef _POSIX_C_SOURCE
+#define _POSIX_C_SOURCE 1 /* for fileno() */
+#ifndef _POSIX_SOURCE
+#define _POSIX_SOURCE 1
+#endif
+#endif]])]])
#include <stdio.h>
#include <string.h>
#include <errno.h>
From 4081efa0831b15d7e4e4255401c225ad8262426d Mon Sep 17 00:00:00 2001
From: Explorer09 <explorer09@gmail.com>
Date: Thu, 8 Mar 2018 10:04:36 +0800
Subject: [PATCH] scanner: Fix glibc features.h dependency in skeleton.
Commit a17d79e9c722a6735b6d2a8f152287404f27df32 defines _POSIX_C_SOURCE
to the minimum of 1 if it's not defined in the user's scanner code or
the compiling environment. However in glibc the macros are not yet set
up until one of the libc headers is included. This unfortunately have
made us overwrite the default _POSIX_C_SOURCE value that would be
defined by glibc (200809L at the time of writing), causing regressions
in user code.
Now in this patch:
1. Ensure feature test macros have been set up in glibc before checking
or defining any of them in our skeleton code.
2. Have a more conservative logic when determining the need to define
_POSIX_C_SOURCE (required for fileno()).
Fixes: #313
Note:
It could be tricky for application code to ensure feature test macros
have been set up in glibc, since <features.h> is no portable header and
not meant to be included directly by applications. The way to do it is
to include a libc header which in turn includes <features.h>. However,
many of the glibc headers check __USE_POSIX (a glibc internal macro
defined if _POSIX_C_SOURCE is defined) and determine which interfaces
to expose already, making the headers inappropriate for our goal.
Those which don't depend on _POSIX_C_SOURCE, and are also available
since ANSI C89, are only <assert.h>, <errno.h> and <math.h>.
<assert.h> is finally favored due to other considerations:
- <math.h> check for __USE_XOPEN in glibc, making a dependency on
_XOPEN_SOURCE, besides it exposes much more interfaces than we need.
- In djgpp, <errno.h> depends on _POSIX_SOURCE to hide definitions of
some errno values when it's defined.
- <assert.h> exposes the fewest interfaces among the 3 headers and, at
the time of writing, checks for only C99 (for __func__), C11 (for
_Static_assert), and _GNU_SOURCE when needed.
Signed-off-by: Kang-Che Sung <explorer09@gmail.com>
--- a/src/flex.skl
+++ b/src/flex.skl
@@ -220,11 +220,21 @@ m4_ifdef( [[M4_YY_TABLES_EXTERNAL]],
%if-c-only
m4_ifdef( [[M4_YY_ALWAYS_INTERACTIVE]], ,
[[m4_ifdef( [[M4_YY_NEVER_INTERACTIVE]], ,
-[[#ifndef _POSIX_C_SOURCE
-#define _POSIX_C_SOURCE 1 /* for fileno() */
-#ifndef _POSIX_SOURCE
-#define _POSIX_SOURCE 1
+[[/* Feature test macros. Flex uses functions that require a minimum set of
+ * macros defined. As defining some macros may hide function declarations that
+ * user code might use, be conservative and respect user's definitions as much
+ * as possible. In glibc, feature test macros may not be all set up until one
+ * of the libc header (that includes <features.h>) is included. This creates
+ * a circular dependency when we check the macros. <assert.h> is the safest
+ * header we can include and does not declare too many functions we don't need.
+ */
+#if !defined(__GNU_LIBRARY__) && defined(__STDC__)
+#include <assert.h>
#endif
+#if !(defined(_POSIX_C_SOURCE) || defined(_XOPEN_SOURCE) || \
+ defined(_POSIX_SOURCE))
+# define _POSIX_C_SOURCE 1 /* Required for fileno() */
+# define _POSIX_SOURCE 1
#endif]])]])
#include <stdio.h>
#include <string.h>
From 1985bb3c7abed940e91ad816504ef08a18c3b7c1 Mon Sep 17 00:00:00 2001
From: Explorer09 <explorer09@gmail.com>
Date: Thu, 8 Mar 2018 09:53:24 +0800
Subject: [PATCH] scanner: correct comments about __STDC_LIMIT_MACROS.
No code changes.
Signed-off-by: Kang-Che Sung <explorer09@gmail.com>
--- a/src/flexint.h
+++ b/src/flexint.h
@@ -7,8 +7,8 @@
#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
-/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
- * if you want the limit (max/min) macros for int types.
+/* C++ systems might need __STDC_LIMIT_MACROS defined before including
+ * <stdint.h>, if you want the limit (max/min) macros for int types.
*/
#ifndef __STDC_LIMIT_MACROS
#define __STDC_LIMIT_MACROS 1

View File

@@ -0,0 +1,50 @@
diff -Naur gmp-6.2.1-clean/Makefile.am gmp-6.2.1-dirty/Makefile.am
--- gmp-6.2.1-clean/Makefile.am 2020-11-14 18:45:09.000000000 +0000
+++ gmp-6.2.1-dirty/Makefile.am 2023-01-24 13:06:03.527956700 +0000
@@ -112,7 +112,7 @@
LIBGMPXX_LT_AGE = 6
-SUBDIRS = tests mpn mpz mpq mpf printf scanf rand cxx demos tune doc
+SUBDIRS = tests mpn mpz mpq mpf printf scanf rand cxx demos tune
EXTRA_DIST = configfsf.guess configfsf.sub .gdbinit INSTALL.autoconf \
COPYING.LESSERv3 COPYINGv2 COPYINGv3
diff -Naur gmp-6.2.1-clean/Makefile.in gmp-6.2.1-dirty/Makefile.in
--- gmp-6.2.1-clean/Makefile.in 2020-11-14 18:45:16.000000000 +0000
+++ gmp-6.2.1-dirty/Makefile.in 2023-01-24 13:06:47.691201700 +0000
@@ -572,7 +572,7 @@
LIBGMPXX_LT_CURRENT = 11
LIBGMPXX_LT_REVISION = 0
LIBGMPXX_LT_AGE = 7
-SUBDIRS = tests mpn mpz mpq mpf printf scanf rand cxx demos tune doc
+SUBDIRS = tests mpn mpz mpq mpf printf scanf rand cxx demos tune
# Put asl.h here for now.
diff -Naur gmp-6.2.1-clean/configure gmp-6.2.1-dirty/configure
--- gmp-6.2.1-clean/configure 2020-11-14 18:45:15.000000000 +0000
+++ gmp-6.2.1-dirty/configure 2023-01-24 14:06:26.822206200 +0000
@@ -12142,8 +12142,8 @@
#
if test "$enable_shared" = yes; then
GMP_LDFLAGS="$GMP_LDFLAGS -no-undefined -Wl,--export-all-symbols"
- LIBGMP_LDFLAGS="$LIBGMP_LDFLAGS -Wl,--output-def,.libs/libgmp-3.dll.def"
- LIBGMPXX_LDFLAGS="$LIBGMP_LDFLAGS -Wl,--output-def,.libs/libgmpxx-3.dll.def"
+ #LIBGMP_LDFLAGS="$LIBGMP_LDFLAGS -Wl,--output-def,.libs/libgmp-3.dll.def"
+ #LIBGMPXX_LDFLAGS="$LIBGMP_LDFLAGS -Wl,--output-def,.libs/libgmpxx-3.dll.def"
LIBGMP_DLL=1
fi
;;
diff -Naur gmp-6.2.1-clean/gmp-h.in gmp-6.2.1-dirty/gmp-h.in
--- gmp-6.2.1-clean/gmp-h.in 2020-11-14 18:45:09.000000000 +0000
+++ gmp-6.2.1-dirty/gmp-h.in 2023-01-24 14:07:02.962184400 +0000
@@ -398,7 +398,7 @@
/* Microsoft's C compiler accepts __inline */
#ifdef _MSC_VER
-#define __GMP_EXTERN_INLINE __inline
+#define __GMP_EXTERN_INLINE static __inline
#endif
/* Recent enough Sun C compilers want "inline" */

View File

@@ -0,0 +1,68 @@
diff --git a/hiprt/hiprt_libpath.h b/hiprt/hiprt_libpath.h
index 58daa96..88cbcf2 100644
--- a/hiprt/hiprt_libpath.h
+++ b/hiprt/hiprt_libpath.h
@@ -34,7 +34,7 @@
#ifdef HIPRT_PREFER_HIP_5
const char* g_hip_paths[] = { "amdhip64.dll", "amdhip64_6.dll", NULL };
#else
-const char* g_hip_paths[] = { "amdhip64_6.dll", "amdhip64.dll", NULL };
+const char* g_hip_paths[] = { "amdhip64_7.dll", "amdhip64_6.dll", "amdhip64.dll", NULL };
#endif
const char* g_hiprtc_paths[] = {
@@ -72,9 +72,13 @@ const char* g_hip_paths[] = {
"/opt/rocm/lib/libamdhip64.so",
"/opt/rocm/hip/lib/libamdhip64.so",
- "libamdhip64.so.5",
- "/opt/rocm/lib/libamdhip64.so.5",
- "/opt/rocm/hip/lib/libamdhip64.so.5",
+ "libamdhip64.so.7",
+ "/opt/rocm/lib/libamdhip64.so.7",
+ "/opt/rocm/hip/lib/libamdhip64.so.7",
+
+ "libamdhip64.so.6",
+ "/opt/rocm/lib/libamdhip64.so.6",
+ "/opt/rocm/hip/lib/libamdhip64.so.6",
NULL };
#endif
diff --git a/hiprt/impl/hiprt_device_impl.h b/hiprt/impl/hiprt_device_impl.h
index 0687234..bc0737a 100644
--- a/hiprt/impl/hiprt_device_impl.h
+++ b/hiprt/impl/hiprt_device_impl.h
@@ -362,10 +362,10 @@ TraversalBase<Stack>::testInternalNode( const hiprtRay& ray, const float3& invD,
auto result = __builtin_amdgcn_image_bvh_intersect_ray_l(
encodeBaseAddr( nodes, nodeIndex ),
ray.maxT,
- float4{ ray.origin.x, ray.origin.y, ray.origin.z, 0.0f }.data,
- float4{ ray.direction.x, ray.direction.y, ray.direction.z, 0.0f }.data,
- float4{ invD.x, invD.y, invD.z, 0.0f }.data,
- m_descriptor.data );
+ { ray.origin.x, ray.origin.y, ray.origin.z, 0.0f },
+ { ray.direction.x, ray.direction.y, ray.direction.z, 0.0f },
+ { invD.x, invD.y, invD.z, 0.0f },
+ { m_descriptor.x, m_descriptor.y, m_descriptor.z, m_descriptor.w } );
#endif
if ( m_stack.vacancy() < 3 )
{
@@ -397,11 +397,13 @@ HIPRT_DEVICE bool TraversalBase<Stack>::testTriangleNode(
hit.normal = node.m_triPair.fetchTriangle( leafIndex & 1 ).normal( node.m_flags >> ( ( leafIndex & 1 ) * 8 ) );
}
#else
- const float4 origin = float4{ ray.origin.x, ray.origin.y, ray.origin.z, 0.0f };
- const float4 direction = float4{ ray.direction.x, ray.direction.y, ray.direction.z, 0.0f };
- const float4 invDir = float4{ invD.x, invD.y, invD.z, 0.0f };
- auto result = __builtin_amdgcn_image_bvh_intersect_ray_l(
- encodeBaseAddr( nodes, leafIndex ), ray.maxT, origin.data, direction.data, invDir.data, m_descriptor.data );
+ auto result = __builtin_amdgcn_image_bvh_intersect_ray_l(
+ encodeBaseAddr( nodes, leafIndex ),
+ ray.maxT,
+ { ray.origin.x, ray.origin.y, ray.origin.z, 0.0f },
+ { ray.direction.x, ray.direction.y, ray.direction.z, 0.0f },
+ { invD.x, invD.y, invD.z, 0.0f },
+ { m_descriptor.x, m_descriptor.y, m_descriptor.z, m_descriptor.w } );
float invDenom = __ocml_native_recip_f32( __int_as_float( result[1] ) );
float t = __int_as_float( result[0] ) * invDenom;
hasHit = ray.minT <= t && t <= ray.maxT;

View File

@@ -0,0 +1,12 @@
diff -Naur ispc-1.28.0/cmake/GenerateBuiltins.cmake external_ispc/cmake/GenerateBuiltins.cmake
--- ispc-1.28.0/cmake/GenerateBuiltins.cmake 2025-08-12 06:34:22.000000000 -0600
+++ external_ispc/cmake/GenerateBuiltins.cmake 2025-09-10 10:40:05.793808800 -0600
@@ -334,7 +334,7 @@
add_custom_command(
OUTPUT ${bc}
- COMMAND cat ${input} | \"${LLVM_AS_EXECUTABLE}\" -o ${bc}
+ COMMAND ${CMAKE_COMMAND} -E cat ${input} | \"${LLVM_AS_EXECUTABLE}\" -o ${bc}
DEPENDS ${input}
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
)

View File

@@ -0,0 +1,47 @@
diff --git a/Makefile.MSVC b/Makefile.MSVC
index 6538911..530c9f9 100644
--- a/Makefile.MSVC
+++ b/Makefile.MSVC
@@ -61,6 +61,10 @@ ASM = NO # or it could be ML64 if we want to use it...
GTK = NO
! ENDIF
! ENDIF
+! IF "$(MSVCVER)" == "ARM64"
+ASM = NO
+GTK = NO
+! ENDIF
! ELSE
! IF "$(COMP)" == ""
COMP = MSVC
@@ -99,7 +103,13 @@ SNDFILE = NO
! ENDIF
OFF = win32
+! IF "$(MSVCVER)" == "Win64"
+MACHINE = /machine:x64
+! ELSEIF "$(MSVCVER)" == "ARM64"
+MACHINE = /machine:ARM64
+! ELSE
MACHINE = /machine:I386
+! ENDIF
LIB_OPTS = /nologo $(MACHINE)
! MESSAGE ----------------------------------------------------------------------
@@ -150,6 +160,8 @@ LIB_OPTS = /nologo $(MACHINE)
! ELSE
! IF "$(MSVCVER)" == "Win64"
! MESSAGE + using MS 64-Bit Compiler
+! ELSEIF "$(MSVCVER)" == "ARM64"
+! MESSAGE + using MS ARM64 Compiler
! ELSE
! MESSAGE using MS COMPILER
! IF "$(CPU)" == "P1"
@@ -209,6 +221,8 @@ CC_OPTS = /nologo /DWin64 /O2b2ity /GAy /Gs1024 /Zp8 /GL /GS- /Zi
CC_OPTS = /nologo /O2 /Wp64 /Oi /GL /arch:SSE /fp:precise
! ELSEif "$(CPU)"=="P6"
CC_OPTS = /nologo /O2 /Ob2 /GAy /Gs1024 /Zp8 /Zi
+! ELSEIF "$(MSVCVER)" == "ARM64"
+CC_OPTS = /nologo /O2 /Ob3 /GAy /Zi
!else
CC_OPTS = /nologo /O2 /Ob2 /GAy /Gs1024 /QIfdiv /QI0f /YX
! ENDIF

View File

@@ -0,0 +1,28 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index b2114c3..c7205a8 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -100,13 +100,6 @@ if(MSVC)
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${CMAKE_CXX_LINKER_WRAPPER_FLAG}/DYNAMICBASE")
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${CMAKE_CXX_LINKER_WRAPPER_FLAG}/guard:cf")
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${CMAKE_CXX_LINKER_WRAPPER_FLAG}/LTCG /INCREMENTAL:NO")
- # enable Spectre Mitigation, not supported by clang-cl
- if((NOT CMAKE_CXX_COMPILER_ID STREQUAL Clang) AND (NOT CMAKE_CXX_COMPILER_ID STREQUAL IntelLLVM))
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /Qspectre")
- endif()
- if((NOT CMAKE_C_COMPILER_ID STREQUAL Clang) AND NOT (CMAKE_C_COMPILER_ID STREQUAL IntelLLVM))
- set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /Qspectre")
- endif()
endif()
#CXX compiler support
@@ -161,9 +154,6 @@ if(MSVC)
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /Zi")
set(CMAKE_SHARED_LINKER_FLAGS_RELEASE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE} ${CMAKE_CXX_LINKER_WRAPPER_FLAG}/DEBUG ${CMAKE_CXX_LINKER_WRAPPER_FLAG}/OPT:REF ${CMAKE_CXX_LINKER_WRAPPER_FLAG}/OPT:ICF")
- # enable CET shadow stack
- set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${CMAKE_CXX_LINKER_WRAPPER_FLAG}/CETCOMPAT")
-
#Use of sccache with MSVC requires workaround of replacing /Zi with /Z7
#https://github.com/mozilla/sccache
if(USE_Z7) #sccache

View File

@@ -0,0 +1,63 @@
; Based on VCPKG's implementation
EXPORTS
; Old alpha API
theora_version_string
theora_version_number
theora_decode_header
theora_decode_init
theora_decode_packetin
theora_decode_YUVout
theora_control
theora_packet_isheader
theora_packet_iskeyframe
theora_granule_shift
theora_granule_frame
theora_granule_time
theora_info_init
theora_info_clear
theora_clear
theora_comment_init
theora_comment_add
theora_comment_add_tag
theora_comment_query
theora_comment_query_count
theora_comment_clear
; New theora-exp API
th_version_string
th_version_number
th_decode_headerin
th_decode_alloc
th_setup_free
th_decode_ctl
th_decode_packetin
th_decode_ycbcr_out
th_decode_free
th_packet_isheader
th_packet_iskeyframe
th_granule_frame
th_granule_time
th_info_init
th_info_clear
th_comment_init
th_comment_add
th_comment_add_tag
th_comment_query
th_comment_query_count
th_comment_clear
; Old alpha API
theora_encode_init
theora_encode_YUVin
theora_encode_packetout
theora_encode_header
theora_encode_comment
theora_encode_tables
; New theora-exp API
th_encode_alloc
th_encode_ctl
th_encode_flushheader
th_encode_ycbcr_in
th_encode_packetout
th_encode_free
TH_VP31_QUANT_INFO
TH_VP31_HUFF_CODES

View File

@@ -0,0 +1,467 @@
diff -Naur ll.org/llvm/lib/Support/Unix/Path.inc ll/llvm/lib/Support/Unix/Path.inc
--- ll.org/llvm/lib/Support/Unix/Path.inc 2023-08-01 06:41:14.360891600 -0600
+++ ll/llvm/lib/Support/Unix/Path.inc 2023-08-01 07:20:02.063130200 -0600
@@ -1476,7 +1476,9 @@
std::error_code copy_file(const Twine &From, const Twine &To) {
std::string FromS = From.str();
std::string ToS = To.str();
-#if __has_builtin(__builtin_available)
+ // BLENDER: This optimization makes LLVM not build on older Xcode versions,
+ // just disable until everyone has new enough Xcode versions.
+#if 0
if (__builtin_available(macos 10.12, *)) {
// Optimistically try to use clonefile() and handle errors, rather than
// calling stat() to see if it'll work.
diff -Naur ll.org/llvm/lib/WindowsManifest/CMakeLists.txt ll/llvm/lib/WindowsManifest/CMakeLists.txt
--- ll.org/llvm/lib/WindowsManifest/CMakeLists.txt 2024-11-13 19:29:25.362863529 +0100
+++ ll/llvm/lib/WindowsManifest/CMakeLists.txt 2024-11-13 19:29:43.376850350 +0100
@@ -17,18 +17,3 @@
LINK_COMPONENTS
Support
)
-
-# This block is only needed for llvm-config. When we deprecate llvm-config and
-# move to using CMake export, this block can be removed.
-if(LLVM_ENABLE_LIBXML2)
- # CMAKE_BUILD_TYPE is only meaningful to single-configuration generators.
- if(CMAKE_BUILD_TYPE)
- string(TOUPPER ${CMAKE_BUILD_TYPE} build_type)
- get_property(libxml2_library TARGET LibXml2::LibXml2 PROPERTY LOCATION_${build_type})
- endif()
- if(NOT libxml2_library)
- get_property(libxml2_library TARGET LibXml2::LibXml2 PROPERTY LOCATION)
- endif()
- get_library_name(${libxml2_library} libxml2_library)
- set_property(TARGET LLVMWindowsManifest PROPERTY LLVM_SYSTEM_LIBS ${libxml2_library})
-endif()
diff -Naur ll.org/llvm/lib/WindowsManifest/CMakeLists.txt ll/llvm/lib/WindowsManifest/CMakeLists.txt
--- ll.org/clang/lib/Headers/__clang_cuda_device_functions.h 2025-05-01 18:14:10.942308400 +0200
+++ ll/clang/lib/Headers/__clang_cuda_device_functions.h 2025-05-01 20:13:48.298269900 +0200
@@ -49,6 +49,7 @@
__DEVICE__ int __clz(int __a) { return __nv_clz(__a); }
__DEVICE__ int __clzll(long long __a) { return __nv_clzll(__a); }
__DEVICE__ float __cosf(float __a) { return __nv_fast_cosf(__a); }
+#if __CUDA_ARCH__ >= 600
__DEVICE__ double __dAtomicAdd(double *__p, double __v) {
return __nvvm_atom_add_gen_d(__p, __v);
}
@@ -58,6 +59,7 @@
__DEVICE__ double __dAtomicAdd_system(double *__p, double __v) {
return __nvvm_atom_sys_add_gen_d(__p, __v);
}
+#endif
__DEVICE__ double __dadd_rd(double __a, double __b) {
return __nv_dadd_rd(__a, __b);
}
@@ -176,16 +178,19 @@
__DEVICE__ float __fAtomicAdd(float *__p, float __v) {
return __nvvm_atom_add_gen_f(__p, __v);
}
+#if __CUDA_ARCH__ >= 600
__DEVICE__ float __fAtomicAdd_block(float *__p, float __v) {
return __nvvm_atom_cta_add_gen_f(__p, __v);
}
__DEVICE__ float __fAtomicAdd_system(float *__p, float __v) {
return __nvvm_atom_sys_add_gen_f(__p, __v);
}
+#endif
__DEVICE__ float __fAtomicExch(float *__p, float __v) {
return __nv_int_as_float(
__nvvm_atom_xchg_gen_i((int *)__p, __nv_float_as_int(__v)));
}
+#if __CUDA_ARCH__ >= 600
__DEVICE__ float __fAtomicExch_block(float *__p, float __v) {
return __nv_int_as_float(
__nvvm_atom_cta_xchg_gen_i((int *)__p, __nv_float_as_int(__v)));
@@ -194,6 +199,7 @@
return __nv_int_as_float(
__nvvm_atom_sys_xchg_gen_i((int *)__p, __nv_float_as_int(__v)));
}
+#endif
__DEVICE__ float __fadd_rd(float __a, float __b) {
return __nv_fadd_rd(__a, __b);
}
@@ -340,93 +346,113 @@
__DEVICE__ int __iAtomicAdd(int *__p, int __v) {
return __nvvm_atom_add_gen_i(__p, __v);
}
+#if __CUDA_ARCH__ >= 600
__DEVICE__ int __iAtomicAdd_block(int *__p, int __v) {
return __nvvm_atom_cta_add_gen_i(__p, __v);
}
__DEVICE__ int __iAtomicAdd_system(int *__p, int __v) {
return __nvvm_atom_sys_add_gen_i(__p, __v);
}
+#endif
__DEVICE__ int __iAtomicAnd(int *__p, int __v) {
return __nvvm_atom_and_gen_i(__p, __v);
}
+#if __CUDA_ARCH__ >= 600
__DEVICE__ int __iAtomicAnd_block(int *__p, int __v) {
return __nvvm_atom_cta_and_gen_i(__p, __v);
}
__DEVICE__ int __iAtomicAnd_system(int *__p, int __v) {
return __nvvm_atom_sys_and_gen_i(__p, __v);
}
+#endif
__DEVICE__ int __iAtomicCAS(int *__p, int __cmp, int __v) {
return __nvvm_atom_cas_gen_i(__p, __cmp, __v);
}
+#if __CUDA_ARCH__ >= 600
__DEVICE__ int __iAtomicCAS_block(int *__p, int __cmp, int __v) {
return __nvvm_atom_cta_cas_gen_i(__p, __cmp, __v);
}
__DEVICE__ int __iAtomicCAS_system(int *__p, int __cmp, int __v) {
return __nvvm_atom_sys_cas_gen_i(__p, __cmp, __v);
}
+#endif
__DEVICE__ int __iAtomicExch(int *__p, int __v) {
return __nvvm_atom_xchg_gen_i(__p, __v);
}
+#if __CUDA_ARCH__ >= 600
__DEVICE__ int __iAtomicExch_block(int *__p, int __v) {
return __nvvm_atom_cta_xchg_gen_i(__p, __v);
}
__DEVICE__ int __iAtomicExch_system(int *__p, int __v) {
return __nvvm_atom_sys_xchg_gen_i(__p, __v);
}
+#endif
__DEVICE__ int __iAtomicMax(int *__p, int __v) {
return __nvvm_atom_max_gen_i(__p, __v);
}
+#if __CUDA_ARCH__ >= 600
__DEVICE__ int __iAtomicMax_block(int *__p, int __v) {
return __nvvm_atom_cta_max_gen_i(__p, __v);
}
__DEVICE__ int __iAtomicMax_system(int *__p, int __v) {
return __nvvm_atom_sys_max_gen_i(__p, __v);
}
+#endif
__DEVICE__ int __iAtomicMin(int *__p, int __v) {
return __nvvm_atom_min_gen_i(__p, __v);
}
+#if __CUDA_ARCH__ >= 600
__DEVICE__ int __iAtomicMin_block(int *__p, int __v) {
return __nvvm_atom_cta_min_gen_i(__p, __v);
}
__DEVICE__ int __iAtomicMin_system(int *__p, int __v) {
return __nvvm_atom_sys_min_gen_i(__p, __v);
}
+#endif
__DEVICE__ int __iAtomicOr(int *__p, int __v) {
return __nvvm_atom_or_gen_i(__p, __v);
}
+#if __CUDA_ARCH__ >= 600
__DEVICE__ int __iAtomicOr_block(int *__p, int __v) {
return __nvvm_atom_cta_or_gen_i(__p, __v);
}
__DEVICE__ int __iAtomicOr_system(int *__p, int __v) {
return __nvvm_atom_sys_or_gen_i(__p, __v);
}
+#endif
__DEVICE__ int __iAtomicXor(int *__p, int __v) {
return __nvvm_atom_xor_gen_i(__p, __v);
}
+#if __CUDA_ARCH__ >= 600
__DEVICE__ int __iAtomicXor_block(int *__p, int __v) {
return __nvvm_atom_cta_xor_gen_i(__p, __v);
}
__DEVICE__ int __iAtomicXor_system(int *__p, int __v) {
return __nvvm_atom_sys_xor_gen_i(__p, __v);
}
+#endif
__DEVICE__ long long __illAtomicMax(long long *__p, long long __v) {
return __nvvm_atom_max_gen_ll(__p, __v);
}
+#if __CUDA_ARCH__ >= 600
__DEVICE__ long long __illAtomicMax_block(long long *__p, long long __v) {
return __nvvm_atom_cta_max_gen_ll(__p, __v);
}
__DEVICE__ long long __illAtomicMax_system(long long *__p, long long __v) {
return __nvvm_atom_sys_max_gen_ll(__p, __v);
}
+#endif
__DEVICE__ long long __illAtomicMin(long long *__p, long long __v) {
return __nvvm_atom_min_gen_ll(__p, __v);
}
+#if __CUDA_ARCH__ >= 600
__DEVICE__ long long __illAtomicMin_block(long long *__p, long long __v) {
return __nvvm_atom_cta_min_gen_ll(__p, __v);
}
__DEVICE__ long long __illAtomicMin_system(long long *__p, long long __v) {
return __nvvm_atom_sys_min_gen_ll(__p, __v);
}
+#endif
__DEVICE__ double __int2double_rn(int __a) { return __nv_int2double_rn(__a); }
__DEVICE__ float __int2float_rd(int __a) { return __nv_int2float_rd(__a); }
__DEVICE__ float __int2float_rn(int __a) { return __nv_int2float_rn(__a); }
@@ -463,30 +489,36 @@
__DEVICE__ long long __llAtomicAnd(long long *__p, long long __v) {
return __nvvm_atom_and_gen_ll(__p, __v);
}
+#if __CUDA_ARCH__ >= 600
__DEVICE__ long long __llAtomicAnd_block(long long *__p, long long __v) {
return __nvvm_atom_cta_and_gen_ll(__p, __v);
}
__DEVICE__ long long __llAtomicAnd_system(long long *__p, long long __v) {
return __nvvm_atom_sys_and_gen_ll(__p, __v);
}
+#endif
__DEVICE__ long long __llAtomicOr(long long *__p, long long __v) {
return __nvvm_atom_or_gen_ll(__p, __v);
}
+#if __CUDA_ARCH__ >= 600
__DEVICE__ long long __llAtomicOr_block(long long *__p, long long __v) {
return __nvvm_atom_cta_or_gen_ll(__p, __v);
}
__DEVICE__ long long __llAtomicOr_system(long long *__p, long long __v) {
return __nvvm_atom_sys_or_gen_ll(__p, __v);
}
+#endif
__DEVICE__ long long __llAtomicXor(long long *__p, long long __v) {
return __nvvm_atom_xor_gen_ll(__p, __v);
}
+#if __CUDA_ARCH__ >= 600
__DEVICE__ long long __llAtomicXor_block(long long *__p, long long __v) {
return __nvvm_atom_cta_xor_gen_ll(__p, __v);
}
__DEVICE__ long long __llAtomicXor_system(long long *__p, long long __v) {
return __nvvm_atom_sys_xor_gen_ll(__p, __v);
}
+#endif
__DEVICE__ float __log10f(float __a) { return __nv_fast_log10f(__a); }
__DEVICE__ float __log2f(float __a) { return __nv_fast_log2f(__a); }
__DEVICE__ float __logf(float __a) { return __nv_fast_logf(__a); }
@@ -532,6 +564,7 @@
__DEVICE__ unsigned int __uAtomicAdd(unsigned int *__p, unsigned int __v) {
return __nvvm_atom_add_gen_i((int *)__p, __v);
}
+#if __CUDA_ARCH__ >= 600
__DEVICE__ unsigned int __uAtomicAdd_block(unsigned int *__p,
unsigned int __v) {
return __nvvm_atom_cta_add_gen_i((int *)__p, __v);
@@ -540,9 +573,11 @@
unsigned int __v) {
return __nvvm_atom_sys_add_gen_i((int *)__p, __v);
}
+#endif
__DEVICE__ unsigned int __uAtomicAnd(unsigned int *__p, unsigned int __v) {
return __nvvm_atom_and_gen_i((int *)__p, __v);
}
+#if __CUDA_ARCH__ >= 600
__DEVICE__ unsigned int __uAtomicAnd_block(unsigned int *__p,
unsigned int __v) {
return __nvvm_atom_cta_and_gen_i((int *)__p, __v);
@@ -551,10 +586,12 @@
unsigned int __v) {
return __nvvm_atom_sys_and_gen_i((int *)__p, __v);
}
+#endif
__DEVICE__ unsigned int __uAtomicCAS(unsigned int *__p, unsigned int __cmp,
unsigned int __v) {
return __nvvm_atom_cas_gen_i((int *)__p, __cmp, __v);
}
+#if __CUDA_ARCH__ >= 600
__DEVICE__ unsigned int
__uAtomicCAS_block(unsigned int *__p, unsigned int __cmp, unsigned int __v) {
return __nvvm_atom_cta_cas_gen_i((int *)__p, __cmp, __v);
@@ -563,9 +600,11 @@
__uAtomicCAS_system(unsigned int *__p, unsigned int __cmp, unsigned int __v) {
return __nvvm_atom_sys_cas_gen_i((int *)__p, __cmp, __v);
}
+#endif
__DEVICE__ unsigned int __uAtomicDec(unsigned int *__p, unsigned int __v) {
return __nvvm_atom_dec_gen_ui(__p, __v);
}
+#if __CUDA_ARCH__ >= 600
__DEVICE__ unsigned int __uAtomicDec_block(unsigned int *__p,
unsigned int __v) {
return __nvvm_atom_cta_dec_gen_ui(__p, __v);
@@ -574,9 +613,11 @@
unsigned int __v) {
return __nvvm_atom_sys_dec_gen_ui(__p, __v);
}
+#endif
__DEVICE__ unsigned int __uAtomicExch(unsigned int *__p, unsigned int __v) {
return __nvvm_atom_xchg_gen_i((int *)__p, __v);
}
+#if __CUDA_ARCH__ >= 600
__DEVICE__ unsigned int __uAtomicExch_block(unsigned int *__p,
unsigned int __v) {
return __nvvm_atom_cta_xchg_gen_i((int *)__p, __v);
@@ -585,9 +626,11 @@
unsigned int __v) {
return __nvvm_atom_sys_xchg_gen_i((int *)__p, __v);
}
+#endif
__DEVICE__ unsigned int __uAtomicInc(unsigned int *__p, unsigned int __v) {
return __nvvm_atom_inc_gen_ui(__p, __v);
}
+#if __CUDA_ARCH__ >= 600
__DEVICE__ unsigned int __uAtomicInc_block(unsigned int *__p,
unsigned int __v) {
return __nvvm_atom_cta_inc_gen_ui(__p, __v);
@@ -596,9 +639,11 @@
unsigned int __v) {
return __nvvm_atom_sys_inc_gen_ui(__p, __v);
}
+#endif
__DEVICE__ unsigned int __uAtomicMax(unsigned int *__p, unsigned int __v) {
return __nvvm_atom_max_gen_ui(__p, __v);
}
+#if __CUDA_ARCH__ >= 600
__DEVICE__ unsigned int __uAtomicMax_block(unsigned int *__p,
unsigned int __v) {
return __nvvm_atom_cta_max_gen_ui(__p, __v);
@@ -607,9 +652,11 @@
unsigned int __v) {
return __nvvm_atom_sys_max_gen_ui(__p, __v);
}
+#endif
__DEVICE__ unsigned int __uAtomicMin(unsigned int *__p, unsigned int __v) {
return __nvvm_atom_min_gen_ui(__p, __v);
}
+#if __CUDA_ARCH__ >= 600
__DEVICE__ unsigned int __uAtomicMin_block(unsigned int *__p,
unsigned int __v) {
return __nvvm_atom_cta_min_gen_ui(__p, __v);
@@ -618,9 +665,11 @@
unsigned int __v) {
return __nvvm_atom_sys_min_gen_ui(__p, __v);
}
+#endif
__DEVICE__ unsigned int __uAtomicOr(unsigned int *__p, unsigned int __v) {
return __nvvm_atom_or_gen_i((int *)__p, __v);
}
+#if __CUDA_ARCH__ >= 600
__DEVICE__ unsigned int __uAtomicOr_block(unsigned int *__p, unsigned int __v) {
return __nvvm_atom_cta_or_gen_i((int *)__p, __v);
}
@@ -628,9 +677,11 @@
unsigned int __v) {
return __nvvm_atom_sys_or_gen_i((int *)__p, __v);
}
+#endif
__DEVICE__ unsigned int __uAtomicXor(unsigned int *__p, unsigned int __v) {
return __nvvm_atom_xor_gen_i((int *)__p, __v);
}
+#if __CUDA_ARCH__ >= 600
__DEVICE__ unsigned int __uAtomicXor_block(unsigned int *__p,
unsigned int __v) {
return __nvvm_atom_cta_xor_gen_i((int *)__p, __v);
@@ -639,6 +690,7 @@
unsigned int __v) {
return __nvvm_atom_sys_xor_gen_i((int *)__p, __v);
}
+#endif
__DEVICE__ unsigned int __uhadd(unsigned int __a, unsigned int __b) {
return __nv_uhadd(__a, __b);
}
@@ -688,6 +740,7 @@
unsigned long long __v) {
return __nvvm_atom_add_gen_ll((long long *)__p, __v);
}
+#if __CUDA_ARCH__ >= 600
__DEVICE__ unsigned long long __ullAtomicAdd_block(unsigned long long *__p,
unsigned long long __v) {
return __nvvm_atom_cta_add_gen_ll((long long *)__p, __v);
@@ -696,10 +749,12 @@
unsigned long long __v) {
return __nvvm_atom_sys_add_gen_ll((long long *)__p, __v);
}
+#endif
__DEVICE__ unsigned long long __ullAtomicAnd(unsigned long long *__p,
unsigned long long __v) {
return __nvvm_atom_and_gen_ll((long long *)__p, __v);
}
+#if __CUDA_ARCH__ >= 600
__DEVICE__ unsigned long long __ullAtomicAnd_block(unsigned long long *__p,
unsigned long long __v) {
return __nvvm_atom_cta_and_gen_ll((long long *)__p, __v);
@@ -708,11 +763,13 @@
unsigned long long __v) {
return __nvvm_atom_sys_and_gen_ll((long long *)__p, __v);
}
+#endif
__DEVICE__ unsigned long long __ullAtomicCAS(unsigned long long *__p,
unsigned long long __cmp,
unsigned long long __v) {
return __nvvm_atom_cas_gen_ll((long long *)__p, __cmp, __v);
}
+#if __CUDA_ARCH__ >= 600
__DEVICE__ unsigned long long __ullAtomicCAS_block(unsigned long long *__p,
unsigned long long __cmp,
unsigned long long __v) {
@@ -723,10 +780,12 @@
unsigned long long __v) {
return __nvvm_atom_sys_cas_gen_ll((long long *)__p, __cmp, __v);
}
+#endif
__DEVICE__ unsigned long long __ullAtomicExch(unsigned long long *__p,
unsigned long long __v) {
return __nvvm_atom_xchg_gen_ll((long long *)__p, __v);
}
+#if __CUDA_ARCH__ >= 600
__DEVICE__ unsigned long long __ullAtomicExch_block(unsigned long long *__p,
unsigned long long __v) {
return __nvvm_atom_cta_xchg_gen_ll((long long *)__p, __v);
@@ -735,10 +794,12 @@
unsigned long long __v) {
return __nvvm_atom_sys_xchg_gen_ll((long long *)__p, __v);
}
+#endif
__DEVICE__ unsigned long long __ullAtomicMax(unsigned long long *__p,
unsigned long long __v) {
return __nvvm_atom_max_gen_ull(__p, __v);
}
+#if __CUDA_ARCH__ >= 600
__DEVICE__ unsigned long long __ullAtomicMax_block(unsigned long long *__p,
unsigned long long __v) {
return __nvvm_atom_cta_max_gen_ull(__p, __v);
@@ -747,10 +808,12 @@
unsigned long long __v) {
return __nvvm_atom_sys_max_gen_ull(__p, __v);
}
+#endif
__DEVICE__ unsigned long long __ullAtomicMin(unsigned long long *__p,
unsigned long long __v) {
return __nvvm_atom_min_gen_ull(__p, __v);
}
+#if __CUDA_ARCH__ >= 600
__DEVICE__ unsigned long long __ullAtomicMin_block(unsigned long long *__p,
unsigned long long __v) {
return __nvvm_atom_cta_min_gen_ull(__p, __v);
@@ -759,10 +822,12 @@
unsigned long long __v) {
return __nvvm_atom_sys_min_gen_ull(__p, __v);
}
+#endif
__DEVICE__ unsigned long long __ullAtomicOr(unsigned long long *__p,
unsigned long long __v) {
return __nvvm_atom_or_gen_ll((long long *)__p, __v);
}
+#if __CUDA_ARCH__ >= 600
__DEVICE__ unsigned long long __ullAtomicOr_block(unsigned long long *__p,
unsigned long long __v) {
return __nvvm_atom_cta_or_gen_ll((long long *)__p, __v);
@@ -771,10 +836,12 @@
unsigned long long __v) {
return __nvvm_atom_sys_or_gen_ll((long long *)__p, __v);
}
+#endif
__DEVICE__ unsigned long long __ullAtomicXor(unsigned long long *__p,
unsigned long long __v) {
return __nvvm_atom_xor_gen_ll((long long *)__p, __v);
}
+#if __CUDA_ARCH__ >= 600
__DEVICE__ unsigned long long __ullAtomicXor_block(unsigned long long *__p,
unsigned long long __v) {
return __nvvm_atom_cta_xor_gen_ll((long long *)__p, __v);
@@ -783,6 +850,7 @@
unsigned long long __v) {
return __nvvm_atom_sys_xor_gen_ll((long long *)__p, __v);
}
+#endif
__DEVICE__ unsigned int __umul24(unsigned int __a, unsigned int __b) {
return __nv_umul24(__a, __b);
}

View File

@@ -0,0 +1,40 @@
--- ll\clang\lib\Headers\__clang_cuda_math_forward_declares.h 2025-12-05 10:13:42.161742700 -0800
+++ ll\clang\lib\Headers\__clang_cuda_math_forward_declares.h 2025-12-11 08:12:38.769391500 -0800
@@ -68,6 +68,37 @@
__DEVICE__ float fdim(float, float);
__DEVICE__ double floor(double);
__DEVICE__ float floor(float);
+/*
+ BLENDER: clang++ with -language=cuda and -std=c++20 options trigger some error
+ in the MSVC STL headers during the build of the OSL CUDA kernels. by providing
+ this overload we sidestep this issue. nothing appears to be ending up calling it,
+ since there are no linker errors, so i guess we're safe doing this?
+
+ =========8<=========8<=========8<=========8<=========8<=========8<=========8<=========8<=========8<=========8<=========8<
+In file included from <built-in>:1:
+In file included from C:\db\build\S\VS1564R\Release\llvm\lib\clang\20\include\__clang_cuda_runtime_wrapper.h:41:
+In file included from C:\db\build\S\VS1564R\Release\llvm\lib\clang\20\include\cuda_wrappers\cmath:28:
+c:\vs2022bt\VC\Tools\MSVC\14.44.35207\include\cmath:1591:12: error: call to 'fma' is ambiguous
+ 1591 | return _STD fma(_ArgT, _ArgB - _ArgA, _ArgA);
+ | ^~~~~~~~
+c:\vs2022bt\VC\Tools\MSVC\14.44.35207\include\yvals_core.h:1928:17: note: expanded from macro '_STD'
+ 1928 | #define _STD ::std::
+ | ^
+c:\vs2022bt\VC\Tools\MSVC\14.44.35207\include\cmath:1612:33: note: in instantiation of function template specialization 'std::_Linear_for_lerp<long double>' requested here
+ 1612 | const auto _Candidate = _Linear_for_lerp(_ArgA, _ArgB, _ArgT);
+ | ^
+c:\vs2022bt\VC\Tools\MSVC\14.44.35207\include\cmath:1681:12: note: in instantiation of function template specialization 'std::_Common_lerp<long double>' requested here
+ 1681 | return _Common_lerp(_ArgA, _ArgB, _ArgT);
+ | ^
+C:\db\build\S\VS1564R\Release\llvm\lib\clang\20\include\__clang_cuda_math_forward_declares.h:71:19: note: candidate function
+ 71 | __DEVICE__ double fma(double, double, double);
+ | ^
+C:\db\build\S\VS1564R\Release\llvm\lib\clang\20\include\__clang_cuda_math_forward_declares.h:72:18: note: candidate function
+ 72 | __DEVICE__ float fma(float, float, float);
+ | ^
+=========8<=========8<=========8<=========8<=========8<=========8<=========8<=========8<=========8<=========8<=========8<
+*/
+__DEVICE__ double fma(long double, long double, long double);
__DEVICE__ double fma(double, double, double);
__DEVICE__ float fma(float, float, float);
__DEVICE__ double fmax(double, double);

View File

@@ -0,0 +1,32 @@
From b96760b242a946f619525b13d7d389ddb8922ca1 Mon Sep 17 00:00:00 2001
From: Mark Final <mark.final@foundry.com>
Date: Wed, 15 Apr 2026 10:03:03 +0100
Subject: [PATCH] Fix crash on exit with a debug Python
Under the hood (in both before and after code), this statement is adding the Exception instance as an attribute to the module.
Other examples found using the pattern, suggesting the static variable scope was not needed:
- py::register_exception<mx::ExceptionOrphanedElement>(mod, "ExceptionOrphanedElement");
- py::register_exception<mx::ExceptionFoundCycle>(mod, "ExceptionFoundCycle");
- py::register_exception<mx::ExceptionParseError>(mod, "ExceptionParseError");
- py::register_exception<mx::ExceptionFileMissing>(mod, "ExceptionFileMissing");
Fixes https://github.com/AcademySoftwareFoundation/MaterialX/issues/2749
---
source/PyMaterialX/PyMaterialXCore/PyException.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/source/PyMaterialX/PyMaterialXCore/PyException.cpp b/source/PyMaterialX/PyMaterialXCore/PyException.cpp
index 6f953ffc06..222bedd93a 100644
--- a/source/PyMaterialX/PyMaterialXCore/PyException.cpp
+++ b/source/PyMaterialX/PyMaterialXCore/PyException.cpp
@@ -12,7 +12,7 @@ namespace mx = MaterialX;
void bindPyException(py::module& mod)
{
- static py::exception<mx::Exception> pyException(mod, "Exception");
+ py::register_exception<mx::Exception>(mod, "Exception");
py::register_exception_translator(
[](std::exception_ptr errPtr)

View File

@@ -0,0 +1,7 @@
@title MinGW-w64 32-bit GCC build environment
@echo Setting up environment for MinGW-w64 GCC 32-bit...
@set PATH=%CD%\bin;%CD%\msys\1.0\bin;%cd%\..\..\perl32\site\bin;%cd%\..\..\perl32\bin;%cd%\..\..\c\bin;%PATH%

View File

@@ -0,0 +1,7 @@
@title MSYS2 64-bit MSVC build environment
@echo Setting up environment for MSYS2 MSVC 64-bit...
@set PATH=%CD%\usr\bin;%cd%\..\..\perl\site\bin;%cd%\..\..\perl\perl\bin;%cd%\..\..\c\bin;%PATH%

View File

@@ -0,0 +1,129 @@
diff --git a/output/macho.h b/output/macho.h
index 538c531e..fd5e8849 100644
--- a/output/macho.h
+++ b/output/macho.h
@@ -60,6 +60,8 @@
#define LC_SEGMENT 0x1
#define LC_SEGMENT_64 0x19
#define LC_SYMTAB 0x2
+#define LC_VERSION_MIN_MACOSX 0x24
+#define LC_BUILD_VERSION 0x32
/* Symbol type bits */
#define N_STAB 0xe0
diff --git a/output/outmacho.c b/output/outmacho.c
index 08147883..de6ec902 100644
--- a/output/outmacho.c
+++ b/output/outmacho.c
@@ -38,6 +38,8 @@
#include "compiler.h"
+#include <stdlib.h>
+
#include "nctype.h"
#include "nasm.h"
@@ -64,6 +66,8 @@
#define MACHO_SYMCMD_SIZE 24
#define MACHO_NLIST_SIZE 12
#define MACHO_RELINFO_SIZE 8
+#define MACHO_BUILD_VERSION_SIZE 24
+#define MACHO_VERSION_MIN_MACOSX_SIZE 16
#define MACHO_HEADER64_SIZE 32
#define MACHO_SEGCMD64_SIZE 72
@@ -1224,6 +1228,46 @@ static void macho_layout_symbols (uint32_t *numsyms,
}
}
+static bool get_full_version_from_env (const char *variable_name,
+ int *r_major,
+ int *r_minor,
+ int *r_patch) {
+ *r_major = 0;
+ *r_minor = 0;
+ *r_patch = 0;
+
+ const char *value = getenv(variable_name);
+ if (value == NULL || value[0] == '\0') {
+ return false;
+ }
+
+ const char *current_value = value;
+ const char *end_value = value + strlen(value);
+
+ char *endptr;
+
+ *r_major = strtol(current_value, &endptr, 10);
+ if (endptr >= end_value) {
+ return true;
+ }
+ current_value = endptr + 1;
+
+ *r_minor = strtol(current_value, &endptr, 10);
+ if (endptr >= end_value) {
+ return true;
+ }
+ current_value = endptr + 1;
+
+ *r_patch = strtol(current_value, &endptr, 10);
+
+ return true;
+}
+
+static bool need_version_min_macosx_command (void) {
+ return getenv("MACOSX_DEPLOYMENT_TARGET") &&
+ getenv("MACOSX_SDK_VERSION");
+}
+
/* Calculate some values we'll need for writing later. */
static void macho_calculate_sizes (void)
@@ -1270,6 +1314,12 @@ static void macho_calculate_sizes (void)
head_sizeofcmds += fmt.segcmd_size + seg_nsects * fmt.sectcmd_size;
}
+ /* LC_VERSION_MIN_MACOSX */
+ if (need_version_min_macosx_command()) {
+ ++head_ncmds;
+ head_sizeofcmds += MACHO_VERSION_MIN_MACOSX_SIZE;
+ }
+
if (nsyms > 0) {
++head_ncmds;
head_sizeofcmds += MACHO_SYMCMD_SIZE;
@@ -1653,6 +1703,33 @@ static void macho_write (void)
else
nasm_warn(WARN_OTHER, "no sections?");
+#define ENCODE_BUILD_VERSION(major, minor, patch) \
+ (((major) << 16) | ((minor) << 8) | (patch))
+
+ if (0) {
+ fwriteint32_t(LC_BUILD_VERSION, ofile); /* cmd == LC_BUILD_VERSION */
+ fwriteint32_t(MACHO_BUILD_VERSION_SIZE, ofile); /* size of load command */
+ fwriteint32_t(1, ofile); /* platform */
+ fwriteint32_t(ENCODE_BUILD_VERSION(10, 13, 0), ofile); /* minos, X.Y.Z is encoded in nibbles xxxx.yy.zz */
+ fwriteint32_t(ENCODE_BUILD_VERSION(10, 15, 4), ofile); /* sdk, X.Y.Z is encoded in nibbles xxxx.yy.zz */
+ fwriteint32_t(0, ofile); /* number of tool entries following this */
+ }
+
+ if (need_version_min_macosx_command()) {
+ int sdk_major, sdk_minor, sdk_patch;
+ get_full_version_from_env("MACOSX_SDK_VERSION", &sdk_major, &sdk_minor, &sdk_patch);
+
+ int version_major, version_minor, version_patch;
+ get_full_version_from_env("MACOSX_DEPLOYMENT_TARGET", &version_major, &version_minor, &version_patch);
+
+ fwriteint32_t(LC_VERSION_MIN_MACOSX, ofile); /* cmd == LC_VERSION_MIN_MACOSX */
+ fwriteint32_t(MACHO_VERSION_MIN_MACOSX_SIZE, ofile); /* size of load command */
+ fwriteint32_t(ENCODE_BUILD_VERSION(version_major, version_minor, version_patch), ofile); /* minos, X.Y.Z is encoded in nibbles xxxx.yy.zz */
+ fwriteint32_t(ENCODE_BUILD_VERSION(sdk_major, sdk_minor, sdk_patch), ofile); /* sdk, X.Y.Z is encoded in nibbles xxxx.yy.zz */
+ }
+
+#undef ENCODE_BUILD_VERSION
+
if (nsyms > 0) {
/* write out symbol command */
fwriteint32_t(LC_SYMTAB, ofile); /* cmd == LC_SYMTAB */

View File

@@ -0,0 +1,80 @@
diff --git a/core/CMakeLists.txt b/core/CMakeLists.txt
index 27e2ed3..35a8541 100644
--- a/core/CMakeLists.txt
+++ b/core/CMakeLists.txt
@@ -95,6 +95,7 @@ set_target_properties(OpenImageDenoise_core PROPERTIES
OUTPUT_NAME ${OIDN_LIBRARY_NAME}_core
)
target_compile_definitions(OpenImageDenoise_core PRIVATE OIDN_LIBRARY_NAME="${OIDN_LIBRARY_NAME}")
+target_compile_definitions(OpenImageDenoise_core PRIVATE SHARED_POSTFIX=\"$<$<CONFIG:Debug>:$<TARGET_PROPERTY:OpenImageDenoise_core,DEBUG_POSTFIX>>\")
if(OIDN_LIBRARY_VERSIONED)
set_target_properties(OpenImageDenoise_core PROPERTIES VERSION ${PROJECT_VERSION})
diff --git a/core/module.cpp b/core/module.cpp
index 9cd9498..23a5593 100644
--- a/core/module.cpp
+++ b/core/module.cpp
@@ -29,7 +29,7 @@ OIDN_NAMESPACE_BEGIN
return true; // module already loaded
// Get the path of the module to load
- std::string filename = OIDN_LIBRARY_NAME "_" + name;
+ std::string filename = OIDN_LIBRARY_NAME "_" + name + SHARED_POSTFIX;
#if defined(_WIN32)
filename += ".dll";
#else
@@ -39,7 +39,8 @@ OIDN_NAMESPACE_BEGIN
const std::string versionStr = "";
#endif
#if defined(__APPLE__)
- filename = "lib" + filename + versionStr + ".dylib";
+ // BLENDER: version string is stripped on macOS.
+ filename = "lib" + filename + ".dylib";
#else
filename = "lib" + filename + ".so" + versionStr;
#endif
diff --git a/devices/CMakeLists.txt b/devices/CMakeLists.txt
index a0ea112..c6b31f9 100644
--- a/devices/CMakeLists.txt
+++ b/devices/CMakeLists.txt
@@ -60,6 +60,7 @@ if(OIDN_DEVICE_CUDA)
-DOIDN_WARN_AS_ERRORS:BOOL=${OIDN_WARN_AS_ERRORS}
-DOIDN_SANITIZER:STRING=${OIDN_SANITIZER}
-DOIDN_DEVICE_CUDA_API:STRING=${OIDN_DEVICE_CUDA_API}
+ -DPython_EXECUTABLE:STRING=${Python_EXECUTABLE}
)
if(DEFINED CUDAToolkit_ROOT)
list(APPEND _oidn_cuda_cache_args
@@ -170,6 +171,8 @@ if(OIDN_DEVICE_HIP)
-DOIDN_API_NAMESPACE:STRING=${OIDN_API_NAMESPACE}
-DOIDN_WARN_AS_ERRORS:BOOL=${OIDN_WARN_AS_ERRORS}
-DOIDN_SANITIZER:STRING=${OIDN_SANITIZER}
+ -DPython_EXECUTABLE:STRING=${Python_EXECUTABLE}
+ -DCMAKE_DEBUG_POSTFIX:STRING=${CMAKE_DEBUG_POSTFIX}
BUILD_ALWAYS TRUE
DEPENDS
OpenImageDenoise_core
diff --git a/devices/hip/hip_device.cpp b/devices/hip/hip_device.cpp
index 6093afc..2f0e67f 100644
--- a/devices/hip/hip_device.cpp
+++ b/devices/hip/hip_device.cpp
@@ -96,13 +96,19 @@ OIDN_NAMESPACE_BEGIN
HIPArch HIPDevice::getArch(const hipDeviceProp_t& prop)
{
const std::string name = getArchName(prop);
+ // BLENDER: this comment is meant to generate a merge conflict if the code
+ // here changes, so we know that hipSupportsDeviceOIDN should be updated.
if (name == "gfx1030" || name == "gfx1031" || name == "gfx1032" || name == "gfx1034" ||
name == "gfx1035" || name == "gfx1036")
return HIPArch::DL;
+ // BLENDER: this comment is meant to generate a merge conflict if the code
+ // here changes, so we know that hipSupportsDeviceOIDN should be updated.
if (name == "gfx1100" || name == "gfx1101" || name == "gfx1102" || name == "gfx1103" ||
name == "gfx1150" || name == "gfx1151" || name == "gfx1152" ||
name == "gfx1200" || name == "gfx1201")
return HIPArch::WMMA;
+ // BLENDER: this comment is meant to generate a merge conflict if the code
+ // here changes, so we know that hipSupportsDeviceOIDN should be updated.
else
return HIPArch::Unknown;
}

View File

@@ -0,0 +1,29 @@
Fix openexr trying to pull in libdeflate even if it has been included as a
static library.
diff -Naur openexr/cmake/OpenEXRConfig.cmake.in openexr/cmake/OpenEXRConfig.cmake.in
--- openexr/cmake/OpenEXRConfig.cmake.in 2026-01-16 13:44:08.143001800 -0800
+++ openexr/cmake/OpenEXRConfig.cmake.in 2026-01-21 15:51:39.475353400 -0800
@@ -14,7 +14,7 @@
find_dependency(Imath)
-if (@libdeflate_FOUND@)
+if (@libdeflate_FOUND@ AND @EXR_DEFLATE_SHARED@)
find_dependency(libdeflate)
endif()
diff -Naur openexr/cmake/OpenEXRSetup.cmake openexr/cmake/OpenEXRSetup.cmake
--- openexr/cmake/OpenEXRSetup.cmake 2026-01-16 13:44:08.143001800 -0800
+++ openexr/cmake/OpenEXRSetup.cmake 2026-01-21 15:51:28.225418400 -0800
@@ -212,8 +212,10 @@
if(libdeflate_FOUND)
if(TARGET libdeflate::libdeflate_shared)
set(EXR_DEFLATE_LIB libdeflate::libdeflate_shared)
+ set(EXR_DEFLATE_SHARED 1)
else()
set(EXR_DEFLATE_LIB libdeflate::libdeflate_static)
+ set(EXR_DEFLATE_SHARED 0)
endif()
set(EXR_DEFLATE_VERSION ${libdeflate_VERSION})
message(STATUS "Using libdeflate from ${libdeflate_DIR}")

View File

@@ -0,0 +1,23 @@
diff -Naur orig/CMakeLists.txt external_openimageio/CMakeLists.txt
--- orig/CMakeLists.txt 2020-05-10 21:43:52 -0600
+++ external_openimageio/CMakeLists.txt 2020-05-13 17:03:35 -0600
@@ -237,7 +237,7 @@
add_subdirectory (src/iinfo)
add_subdirectory (src/maketx)
add_subdirectory (src/oiiotool)
- add_subdirectory (src/testtex)
+ #add_subdirectory (src/testtex)
add_subdirectory (src/iv)
endif ()
diff -Naur orig/src/cmake/compiler.cmake external_openimageio/src/cmake/compiler.cmake
--- orig/src/cmake/compiler.cmake 2020-05-10 21:43:52 -0600
+++ external_openimageio/src/cmake/compiler.cmake 2020-05-13 17:02:54 -0600
@@ -204,6 +204,7 @@ if (MSVC)
add_compile_definitions (_CRT_NONSTDC_NO_WARNINGS)
add_compile_definitions (_SCL_SECURE_NO_WARNINGS)
add_compile_definitions (JAS_WIN_MSVC_BUILD)
+ add_compile_definitions (OPJ_STATIC)
# https://github.com/AcademySoftwareFoundation/OpenImageIO/issues/4641#issuecomment-2725013661
add_compile_definitions (_DISABLE_CONSTEXPR_MUTEX_CONSTRUCTOR)
endif (MSVC)

View File

@@ -0,0 +1,75 @@
From e626fab243ab7772fbd33d63777fd4bd9b2cfa99 Mon Sep 17 00:00:00 2001
From: Larry Gritz <lg@larrygritz.com>
Date: Mon, 6 Apr 2026 23:11:39 -0700
Subject: [PATCH] fix(dds): Fix broken reading of volumetric DDS files by
emulating tiles
Fixes #5132.
Reading DDS volumetric files used to work, but was broken by PR #4669
last year, the one where we added all the span-oriented API calls.
At that time, I did not realize/remember that DDS files could be
volumetric, observed that all the (other) volumetric files only
supported tiled access, and so in the course of that API refactor, I
removed the z parameter from the new read_scanlines API.
I don't want to break ABI compatibility again for this, so the
solution I came up with in this PR is just to make DDS volume files
report themselves as "tiled", with each tile being (width x 1 x 1),
i.e. what used to be one scanline, and it all just works out.
Signed-off-by: Larry Gritz <lg@larrygritz.com>
---
src/dds.imageio/ddsinput.cpp | 28 +++++++++++++++++++++++++---
1 file changed, 25 insertions(+), 3 deletions(-)
diff --git a/src/dds.imageio/ddsinput.cpp b/src/dds.imageio/ddsinput.cpp
index 53f80ed487..efc31323cc 100644
--- a/src/dds.imageio/ddsinput.cpp
+++ b/src/dds.imageio/ddsinput.cpp
@@ -862,6 +862,11 @@ DDSInput::seek_subimage(int subimage, int miplevel)
// detect texture type
if (m_dds.caps.flags2 & DDS_CAPS2_VOLUME) {
m_spec.attribute("textureformat", "Volume Texture");
+ // Because we don't support reading scanlines from volume textures,
+ // pretend it's tiled with width x 1 x 1 tiles.
+ m_spec.tile_width = m_spec.width;
+ m_spec.tile_height = 1;
+ m_spec.tile_depth = 1;
} else if (m_dds.caps.flags2 & DDS_CAPS2_CUBEMAP) {
m_spec.attribute("textureformat", "CubeFace Environment");
// check available cube map sides
@@ -1042,12 +1047,29 @@ DDSInput::read_native_tile(int subimage, int miplevel, int x, int y, int z,
if (!seek_subimage(subimage, miplevel))
return false;
+ // don't proceed if not tiled
+ if (m_spec.tile_width == 0)
+ return false;
+
+ if (m_dds.caps.flags2 & DDS_CAPS2_VOLUME) {
+ // This is a 3D volume file. For DDS files, we are emulating tiles,
+ // with each scanline as a tile.
+ if (m_buf.empty())
+ readimg_scanlines();
+ // We reported scanlines as tiles, so x must be 0.
+ if (x != 0)
+ return false;
+ size_t size = spec().scanline_bytes();
+ size_t offset = size * (size_t(z) * size_t(m_spec.height) + y);
+ if (offset + size > m_buf.size()) // Bounds check
+ return false;
+ memcpy(data, m_buf.data() + offset, size);
+ return true;
+ }
+
// static ints to keep track of the current cube face and re-seek and
// re-read face
static int lastx = -1, lasty = -1, lastz = -1;
- // don't proceed if not a cube map - use scanlines then instead
- if (!(m_dds.caps.flags2 & DDS_CAPS2_CUBEMAP))
- return false;
// make sure we get the right dimensions
if (x % m_spec.tile_width || y % m_spec.tile_height
|| z % m_spec.tile_width)

View File

@@ -0,0 +1,249 @@
commit 7e9a88d9705de0c82357fc9e69d2f0ff88a570be
Author: Brecht Van Lommel <brecht@blender.org>
Date: Mon Jan 26 07:39:18 2026 +0100
Fix race condition in table initialization with multiple threads
diff --git a/src/core/coding/ojph_block_encoder.cpp b/src/core/coding/ojph_block_encoder.cpp
index f9c8d89..019f4f1 100644
--- a/src/core/coding/ojph_block_encoder.cpp
+++ b/src/core/coding/ojph_block_encoder.cpp
@@ -44,6 +44,7 @@
#include <cstring>
#include <cstdint>
#include <climits>
+#include <mutex>
#include "ojph_mem.h"
#include "ojph_arch.h"
@@ -253,17 +254,16 @@ namespace ojph {
return true;
}
- /////////////////////////////////////////////////////////////////////////
- static bool tables_initialized = false;
-
/////////////////////////////////////////////////////////////////////////
bool initialize_block_encoder_tables() {
- if (!tables_initialized) {
+ static bool tables_initialized = false;
+ static std::once_flag tables_initialized_flag;
+ std::call_once(tables_initialized_flag, []() {
memset(vlc_tbl0, 0, 2048 * sizeof(ui16));
memset(vlc_tbl1, 0, 2048 * sizeof(ui16));
tables_initialized = vlc_init_tables();
tables_initialized = tables_initialized && uvlc_init_tables();
- }
+ });
return tables_initialized;
}
diff --git a/src/core/coding/ojph_block_encoder_avx2.cpp b/src/core/coding/ojph_block_encoder_avx2.cpp
index 1bc7a43..91d0195 100644
--- a/src/core/coding/ojph_block_encoder_avx2.cpp
+++ b/src/core/coding/ojph_block_encoder_avx2.cpp
@@ -42,6 +42,7 @@
#include <cstdint>
#include <climits>
#include <immintrin.h>
+#include <mutex>
#include "ojph_mem.h"
#include "ojph_arch.h"
@@ -220,17 +221,16 @@ namespace ojph {
return true;
}
- /////////////////////////////////////////////////////////////////////////
- static bool tables_initialized = false;
-
/////////////////////////////////////////////////////////////////////////
bool initialize_block_encoder_tables_avx2() {
- if (!tables_initialized) {
+ static bool tables_initialized = false;
+ static std::once_flag tables_initialized_flag;
+ std::call_once(tables_initialized_flag, []() {
memset(vlc_tbl0, 0, 2048 * sizeof(ui32));
memset(vlc_tbl1, 0, 2048 * sizeof(ui32));
tables_initialized = vlc_init_tables();
tables_initialized = tables_initialized && uvlc_init_tables();
- }
+ });
return tables_initialized;
}
diff --git a/src/core/coding/ojph_block_encoder_avx512.cpp b/src/core/coding/ojph_block_encoder_avx512.cpp
index 6de1f3b..3ae7684 100644
--- a/src/core/coding/ojph_block_encoder_avx512.cpp
+++ b/src/core/coding/ojph_block_encoder_avx512.cpp
@@ -42,6 +42,7 @@
#include <cstdint>
#include <climits>
#include <immintrin.h>
+#include <mutex>
#include "ojph_mem.h"
#include "ojph_block_encoder.h"
@@ -219,17 +220,16 @@ namespace ojph {
return true;
}
- /////////////////////////////////////////////////////////////////////////
- static bool tables_initialized = false;
-
/////////////////////////////////////////////////////////////////////////
bool initialize_block_encoder_tables_avx512() {
- if (!tables_initialized) {
+ static bool tables_initialized = false;
+ static std::once_flag tables_initialized_flag;
+ std::call_once(tables_initialized_flag, []() {
memset(vlc_tbl0, 0, 2048 * sizeof(ui32));
memset(vlc_tbl1, 0, 2048 * sizeof(ui32));
tables_initialized = vlc_init_tables();
tables_initialized = tables_initialized && uvlc_init_tables();
- }
+ });
return tables_initialized;
}
diff --git a/src/core/transform/ojph_colour.cpp b/src/core/transform/ojph_colour.cpp
index b3c05ae..ef147ad 100644
--- a/src/core/transform/ojph_colour.cpp
+++ b/src/core/transform/ojph_colour.cpp
@@ -37,6 +37,7 @@
#include <cmath>
#include <climits>
+#include <mutex>
#include "ojph_defs.h"
#include "ojph_arch.h"
@@ -104,27 +105,23 @@ namespace ojph {
(const float *y, const float *cb, const float *cr,
float *r, float *g, float *b, ui32 repeat) = NULL;
- //////////////////////////////////////////////////////////////////////////
- static bool colour_transform_functions_initialized = false;
-
//////////////////////////////////////////////////////////////////////////
void init_colour_transform_functions()
{
- if (colour_transform_functions_initialized)
- return;
-
+ static std::once_flag colour_transform_functions_init_flag;
+ std::call_once(colour_transform_functions_init_flag, []() {
#if !defined(OJPH_ENABLE_WASM_SIMD) || !defined(OJPH_EMSCRIPTEN)
- rev_convert = gen_rev_convert;
- rev_convert_nlt_type3 = gen_rev_convert_nlt_type3;
- irv_convert_to_integer = gen_irv_convert_to_integer;
- irv_convert_to_float = gen_irv_convert_to_float;
- irv_convert_to_integer_nlt_type3 = gen_irv_convert_to_integer_nlt_type3;
- irv_convert_to_float_nlt_type3 = gen_irv_convert_to_float_nlt_type3;
- rct_forward = gen_rct_forward;
- rct_backward = gen_rct_backward;
- ict_forward = gen_ict_forward;
- ict_backward = gen_ict_backward;
+ rev_convert = gen_rev_convert;
+ rev_convert_nlt_type3 = gen_rev_convert_nlt_type3;
+ irv_convert_to_integer = gen_irv_convert_to_integer;
+ irv_convert_to_float = gen_irv_convert_to_float;
+ irv_convert_to_integer_nlt_type3 = gen_irv_convert_to_integer_nlt_type3;
+ irv_convert_to_float_nlt_type3 = gen_irv_convert_to_float_nlt_type3;
+ rct_forward = gen_rct_forward;
+ rct_backward = gen_rct_backward;
+ ict_forward = gen_ict_forward;
+ ict_backward = gen_ict_backward;
#ifndef OJPH_DISABLE_SIMD
@@ -186,20 +183,19 @@ namespace ojph {
#else // OJPH_ENABLE_WASM_SIMD
- rev_convert = wasm_rev_convert;
- rev_convert_nlt_type3 = wasm_rev_convert_nlt_type3;
- irv_convert_to_integer = wasm_irv_convert_to_integer;
- irv_convert_to_float = wasm_irv_convert_to_float;
- irv_convert_to_integer_nlt_type3 = wasm_irv_convert_to_integer_nlt_type3;
- irv_convert_to_float_nlt_type3 = wasm_irv_convert_to_float_nlt_type3;
- rct_forward = wasm_rct_forward;
- rct_backward = wasm_rct_backward;
- ict_forward = wasm_ict_forward;
- ict_backward = wasm_ict_backward;
+ rev_convert = wasm_rev_convert;
+ rev_convert_nlt_type3 = wasm_rev_convert_nlt_type3;
+ irv_convert_to_integer = wasm_irv_convert_to_integer;
+ irv_convert_to_float = wasm_irv_convert_to_float;
+ irv_convert_to_integer_nlt_type3 = wasm_irv_convert_to_integer_nlt_type3;
+ irv_convert_to_float_nlt_type3 = wasm_irv_convert_to_float_nlt_type3;
+ rct_forward = wasm_rct_forward;
+ rct_backward = wasm_rct_backward;
+ ict_forward = wasm_ict_forward;
+ ict_backward = wasm_ict_backward;
#endif // !OJPH_ENABLE_WASM_SIMD
-
- colour_transform_functions_initialized = true;
+ });
}
//////////////////////////////////////////////////////////////////////////
diff --git a/src/core/transform/ojph_transform.cpp b/src/core/transform/ojph_transform.cpp
index c4313ab..f67ea1b 100644
--- a/src/core/transform/ojph_transform.cpp
+++ b/src/core/transform/ojph_transform.cpp
@@ -36,6 +36,7 @@
//***************************************************************************/
#include <cstdio>
+#include <mutex>
#include "ojph_arch.h"
#include "ojph_mem.h"
@@ -93,25 +94,21 @@ namespace ojph {
(const param_atk* atk, const line_buf* dst, const line_buf* lsrc,
const line_buf* hsrc, ui32 width, bool even) = NULL;
- ////////////////////////////////////////////////////////////////////////////
- static bool wavelet_transform_functions_initialized = false;
-
//////////////////////////////////////////////////////////////////////////
void init_wavelet_transform_functions()
{
- if (wavelet_transform_functions_initialized)
- return;
-
+ static std::once_flag wavelet_transform_functions_init_flag;
+ std::call_once(wavelet_transform_functions_init_flag, [](){
#if !defined(OJPH_ENABLE_WASM_SIMD) || !defined(OJPH_EMSCRIPTEN)
- rev_vert_step = gen_rev_vert_step;
- rev_horz_ana = gen_rev_horz_ana;
- rev_horz_syn = gen_rev_horz_syn;
+ rev_vert_step = gen_rev_vert_step;
+ rev_horz_ana = gen_rev_horz_ana;
+ rev_horz_syn = gen_rev_horz_syn;
- irv_vert_step = gen_irv_vert_step;
- irv_vert_times_K = gen_irv_vert_times_K;
- irv_horz_ana = gen_irv_horz_ana;
- irv_horz_syn = gen_irv_horz_syn;
+ irv_vert_step = gen_irv_vert_step;
+ irv_vert_times_K = gen_irv_vert_times_K;
+ irv_horz_ana = gen_irv_horz_ana;
+ irv_horz_syn = gen_irv_horz_syn;
#ifndef OJPH_DISABLE_SIMD
@@ -185,8 +182,7 @@ namespace ojph {
irv_horz_ana = wasm_irv_horz_ana;
irv_horz_syn = wasm_irv_horz_syn;
#endif // !OJPH_ENABLE_WASM_SIMD
-
- wavelet_transform_functions_initialized = true;
+ });
}
//////////////////////////////////////////////////////////////////////////

View File

@@ -0,0 +1,99 @@
diff -Naur openvdb-12.0.0/openvdb/openvdb/CMakeLists.txt openvdb/openvdb/openvdb/CMakeLists.txt
--- openvdb-12.0.0/openvdb/openvdb/CMakeLists.txt 2024-10-31 16:59:05.000000000 -0700
+++ openvdb/openvdb/openvdb/CMakeLists.txt 2024-12-11 08:47:05.635327200 -0800
@@ -148,6 +148,15 @@
endif()
endif()
+add_compile_definitions(
+ #Blender: prevent implicit TBB linkage
+ __TBB_NO_IMPLICIT_LINKAGE
+ #Blender: OpenEXR is static
+ OPENVDB_OPENEXR_STATICLIB
+ #Blender: Link the debug python libs rather than the release ones
+ $<$<CONFIG:Debug>:Py_DEBUG>
+)
+
if(USE_BLOSC)
# Find Blosc libraries
find_package(Blosc ${MINIMUM_BLOSC_VERSION} REQUIRED)
@@ -608,7 +617,12 @@
# imported targets.
if(OPENVDB_CORE_SHARED)
- add_library(openvdb_shared SHARED ${OPENVDB_LIBRARY_SOURCE_FILES})
+ if(WIN32)
+ configure_file(version.rc.in ${CMAKE_CURRENT_BINARY_DIR}/version.rc @ONLY)
+ add_library(openvdb_shared SHARED ${OPENVDB_LIBRARY_SOURCE_FILES} ${CMAKE_CURRENT_BINARY_DIR}/version.rc)
+ else()
+ add_library(openvdb_shared SHARED ${OPENVDB_LIBRARY_SOURCE_FILES})
+ endif()
endif()
if(OPENVDB_CORE_STATIC)
diff -Naur openvdb-12.0.0/openvdb/openvdb/python/CMakeLists.txt openvdb/openvdb/openvdb/python/CMakeLists.txt
--- openvdb-12.0.0/openvdb/openvdb/python/CMakeLists.txt 2024-10-31 16:59:05.000000000 -0700
+++ openvdb/openvdb/openvdb/python/CMakeLists.txt 2024-12-11 09:02:05.377733900 -0800
@@ -22,7 +22,9 @@
option(OPENVDB_BUILD_PYTHON_UNITTESTS [=[
"Include the OpenVDB Python unit test. Requires a python interpreter]=]
${OPENVDB_BUILD_UNITTESTS})
-
+#blender: prevent double _d for the python module
+set(CMAKE_DEBUG_POSTFIX "")
+add_compile_definitions($<$<CONFIG:Debug>:Py_DEBUG> __TBB_NO_IMPLICIT_LINKAGE)
#########################################################################
message(STATUS "----------------------------------------------------")
diff -Naur openvdb-12.0.0/openvdb/openvdb/version.rc.in openvdb/openvdb/openvdb/version.rc.in
--- openvdb-12.0.0/openvdb/openvdb/version.rc.in 1969-12-31 16:00:00.000000000 -0800
+++ openvdb/openvdb/openvdb/version.rc.in 2024-12-11 08:47:05.697536200 -0800
@@ -0,0 +1,48 @@
+#include <winver.h>
+
+#define VER_FILEVERSION @OpenVDB_MAJOR_VERSION@,@OpenVDB_MINOR_VERSION@,@OpenVDB_PATCH_VERSION@,0
+#define VER_FILEVERSION_STR "@OpenVDB_MAJOR_VERSION@.@OpenVDB_MINOR_VERSION@.@OpenVDB_PATCH_VERSION@.0\0"
+
+#define VER_PRODUCTVERSION @OpenVDB_MAJOR_VERSION@,@OpenVDB_MINOR_VERSION@,@OpenVDB_PATCH_VERSION@,0
+#define VER_PRODUCTVERSION_STR "@OpenVDB_MAJOR_VERSION@.@OpenVDB_MINOR_VERSION@\0"
+
+#ifndef DEBUG
+#define VER_DEBUG 0
+#else
+#define VER_DEBUG VS_FF_DEBUG
+#endif
+
+VS_VERSION_INFO VERSIONINFO
+FILEVERSION VER_FILEVERSION
+PRODUCTVERSION VER_PRODUCTVERSION
+FILEFLAGSMASK VS_FFI_FILEFLAGSMASK
+FILEFLAGS (VER_DEBUG)
+FILEOS VOS__WINDOWS32
+FILETYPE VFT_DLL
+FILESUBTYPE VFT2_UNKNOWN
+BEGIN
+ BLOCK "StringFileInfo"
+ BEGIN
+ BLOCK "040904E4"
+ BEGIN
+ VALUE "FileDescription", "OpenVDB"
+ VALUE "FileVersion", VER_FILEVERSION_STR
+ VALUE "InternalName", "OpenVDB"
+ VALUE "ProductName", "OpenVDB"
+ VALUE "ProductVersion", VER_PRODUCTVERSION_STR
+ END
+ END
+
+ BLOCK "VarFileInfo"
+ BEGIN
+ /* The following line should only be modified for localized versions. */
+ /* It consists of any number of WORD,WORD pairs, with each pair */
+ /* describing a language,codepage combination supported by the file. */
+ /* */
+ /* For example, a file might have values "0x409,1252" indicating that it */
+ /* supports English language (0x409) in the Windows ANSI codepage (1252). */
+
+ VALUE "Translation", 0x409, 1252
+
+ END
+END

View File

@@ -0,0 +1,12 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 17ee3fc2..9027d073 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -16,7 +16,6 @@ string(REGEX
message(STATUS "Opus project version: ${PROJECT_VERSION}")
project(Opus LANGUAGES C VERSION ${PROJECT_VERSION})
-include(opus_buildtype.cmake)
option(OPUS_STACK_PROTECTOR "Use stack protection" ON)
option(OPUS_USE_ALLOCA "Use alloca for stack arrays (on non-C99 compilers)" OFF)

View File

@@ -0,0 +1,18 @@
diff --git a/src/liboslcomp/oslcomp.cpp b/src/liboslcomp/oslcomp.cpp
index 8c2e77b..211b8a7 100644
--- a/src/liboslcomp/oslcomp.cpp
+++ b/src/liboslcomp/oslcomp.cpp
@@ -21,6 +21,13 @@
#if !defined(__STDC_CONSTANT_MACROS)
# define __STDC_CONSTANT_MACROS 1
#endif
+
+// clang uses CALLBACK in its templates which causes issues if it is already defined
+#ifdef _WIN32 && defined(CALLBACK)
+# undef CALLBACK
+#endif
+
+//
#include <clang/Basic/TargetInfo.h>
#include <clang/Frontend/CompilerInstance.h>
#include <clang/Frontend/TextDiagnosticPrinter.h>

View File

@@ -0,0 +1,26 @@
diff --git a/src/cmake/cuda_macros.cmake b/src/cmake/cuda_macros.cmake
index cf38234e..78c7580f 100644
--- a/src/cmake/cuda_macros.cmake
+++ b/src/cmake/cuda_macros.cmake
@@ -225,7 +225,7 @@ function ( CUDA_SHADEOPS_COMPILE prefix output_bc output_ptx input_srcs headers
add_custom_command ( OUTPUT ${linked_bc} ${linked_ptx}
COMMAND ${LLVM_LINK_TOOL} ${shadeops_bc_list} -o ${linked_bc}
COMMAND ${LLVM_OPT_TOOL} ${opt_tool_flags} ${linked_bc} -o ${linked_bc}
- COMMAND ${LLVM_LLC_TOOL} --march=nvptx64 -mcpu=${CUDA_TARGET_ARCH} ${linked_bc} -o ${linked_ptx}
+ COMMAND ${LLVM_LLC_TOOL} -march=nvptx64 -mcpu=${CUDA_TARGET_ARCH} -mattr=+ptx60 ${linked_bc} -o ${linked_ptx}
# This script converts all of the .weak functions defined in the PTX into .visible functions.
COMMAND ${Python3_EXECUTABLE} "${CMAKE_SOURCE_DIR}/src/build-scripts/process-ptx.py"
${linked_ptx} ${linked_ptx}
diff --git a/src/liboslexec/llvm_util.cpp b/src/liboslexec/llvm_util.cpp
index ad85cec1..8da4149c 100644
--- a/src/liboslexec/llvm_util.cpp
+++ b/src/liboslexec/llvm_util.cpp
@@ -1841,7 +1841,7 @@ LLVM_Util::nvptx_target_machine()
#else
ModuleTriple.str(),
#endif
- CUDA_TARGET_ARCH, "+ptx50", options, llvm::Reloc::Static,
+ CUDA_TARGET_ARCH, "+ptx60", options, llvm::Reloc::Static,
llvm::CodeModel::Small,
#if OSL_LLVM_VERSION >= 180
llvm::CodeGenOptLevel::Default

View File

@@ -0,0 +1,79 @@
Fix OSL cmake files using absolute include directory path in
their .cmake target files
diff --git a/src/liboslcomp/CMakeLists.txt b/src/liboslcomp/CMakeLists.txt
index 261168c5..0a9343dd 100644
--- a/src/liboslcomp/CMakeLists.txt
+++ b/src/liboslcomp/CMakeLists.txt
@@ -17,9 +17,8 @@ endif ()
FLEX_BISON (osllex.l oslgram.y osl lib_src compiler_headers)
add_library (${local_lib} ${lib_src})
-target_include_directories(${local_lib}
- PUBLIC
- ${CMAKE_INSTALL_FULL_INCLUDEDIR}
+target_include_directories(${local_lib} INTERFACE
+ $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
)
target_link_libraries (${local_lib}
PUBLIC
diff --git a/src/liboslexec/CMakeLists.txt b/src/liboslexec/CMakeLists.txt
index a1e2d18f..92562c2e 100644
--- a/src/liboslexec/CMakeLists.txt
+++ b/src/liboslexec/CMakeLists.txt
@@ -514,9 +514,8 @@ foreach(batched_target ${BATCHED_TARGET_LIST})
endif()
target_include_directories (${batched_target_lib}
- PUBLIC
- ${CMAKE_INSTALL_FULL_INCLUDEDIR}
- ${IMATH_INCLUDES}
+ INTERFACE
+ $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
PRIVATE
${ROBINMAP_INCLUDES}
)
@@ -534,9 +533,8 @@ endforeach(batched_target)
add_library (${local_lib} ${lib_src})
target_include_directories (${local_lib}
- PUBLIC
- ${CMAKE_INSTALL_FULL_INCLUDEDIR}
- ${IMATH_INCLUDES}
+ INTERFACE
+ $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
PRIVATE
"${CMAKE_SOURCE_DIR}/src/liboslcomp"
${ROBINMAP_INCLUDES}
diff --git a/src/liboslnoise/CMakeLists.txt b/src/liboslnoise/CMakeLists.txt
index 23bd4114..d5a84199 100644
--- a/src/liboslnoise/CMakeLists.txt
+++ b/src/liboslnoise/CMakeLists.txt
@@ -8,9 +8,8 @@ set (liboslnoise_srcs gabornoise.cpp simplexnoise.cpp)
#file ( GLOB compiler_headers "../liboslexec/*.h" )
add_library (${local_lib} ${liboslnoise_srcs})
-target_include_directories (${local_lib}
- PUBLIC
- ${CMAKE_INSTALL_FULL_INCLUDEDIR}
+target_include_directories(${local_lib} INTERFACE
+ $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
PRIVATE
../liboslexec)
target_include_directories (${local_lib} BEFORE PRIVATE ${OpenImageIO_INCLUDES})
diff --git a/src/liboslquery/CMakeLists.txt b/src/liboslquery/CMakeLists.txt
index 70a25259..d3522a37 100644
--- a/src/liboslquery/CMakeLists.txt
+++ b/src/liboslquery/CMakeLists.txt
@@ -9,9 +9,8 @@ file (GLOB compiler_headers "../liboslexec/*.h")
FLEX_BISON (../liboslexec/osolex.l ../liboslexec/osogram.y oso lib_src compiler_headers)
add_library (${local_lib} ${lib_src})
-target_include_directories (${local_lib}
- PUBLIC
- ${CMAKE_INSTALL_FULL_INCLUDEDIR}
+target_include_directories(${local_lib} INTERFACE
+ $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
PRIVATE
../liboslexec)
target_link_libraries (${local_lib}

View File

@@ -0,0 +1,45 @@
diff -Naur pthreads4w-clean/Makefile pthreads4w-dirty/Makefile
--- pthreads4w-clean/Makefile 2022-11-18 10:08:27.266563200 +0000
+++ pthreads4w-dirty/Makefile 2022-11-18 10:16:59.465704400 +0000
@@ -185,7 +185,7 @@
@ $(MAKE) /E /nologo XCFLAGS="/MTd" EHFLAGS="$(VSEFLAGSD) /D__PTW32_STATIC_LIB /D__PTW32_BUILD_INLINED" CLEANUP=__PTW32_CLEANUP_SEH pthreadVSE$(PTW32_VER_DEBUG).inlined_static_stamp
VC-static:
- @ $(MAKE) /E /nologo XCFLAGS="/MT" EHFLAGS="$(VCFLAGS) /D__PTW32_STATIC_LIB /D__PTW32_BUILD_INLINED" CLEANUP=__PTW32_CLEANUP_C pthreadVC$(PTW32_VER).inlined_static_stamp
+ @ $(MAKE) /E /nologo XCFLAGS="/MD" EHFLAGS="$(VCFLAGS) /D__PTW32_STATIC_LIB /D__PTW32_BUILD_INLINED" CLEANUP=__PTW32_CLEANUP_C pthreadVC$(PTW32_VER).inlined_static_stamp
VC-static-debug:
@ $(MAKE) /E /nologo XCFLAGS="/MTd" EHFLAGS="$(VCFLAGSD) /D__PTW32_STATIC_LIB /D__PTW32_BUILD_INLINED" CLEANUP=__PTW32_CLEANUP_C pthreadVC$(PTW32_VER_DEBUG).inlined_static_stamp
diff -Naur pthreads4w-clean/context.h pthreads4w-dirty/context.h
--- pthreads4w-clean/context.h 2022-11-18 10:08:27.564507100 +0000
+++ pthreads4w-dirty/context.h 2022-11-18 10:13:50.209986300 +0000
@@ -62,7 +62,7 @@
#endif
#if defined(_ARM_) || defined(ARM) || defined(_M_ARM) || defined(_M_ARM64)
-#define PTW32_PROGCTR(Context) ((Context).Pc)
+#define __PTW32_PROGCTR(Context) ((Context).Pc)
#endif
#if !defined (__PTW32_PROGCTR)
diff -Naur pthreads4w-clean/version.rc pthreads4w-dirty/version.rc
--- pthreads4w-clean/version.rc 2022-11-18 10:08:30.101359500 +0000
+++ pthreads4w-dirty/version.rc 2022-11-18 10:14:44.651478200 +0000
@@ -63,6 +63,17 @@
# define __PTW32_VERSIONINFO_NAME "pthreadVSE2.DLL\0"
# define __PTW32_VERSIONINFO_DESCRIPTION "MS C SEH x86\0"
# endif
+# elif defined (__PTW32_ARCHARM64)
+# if defined(__PTW32_CLEANUP_C)
+# define __PTW32_VERSIONINFO_NAME "pthreadVC2.DLL\0"
+# define __PTW32_VERSIONINFO_DESCRIPTION "MS C arm64\0"
+# elif defined(__PTW32_CLEANUP_CXX)
+# define __PTW32_VERSIONINFO_NAME "pthreadVCE2.DLL\0"
+# define __PTW32_VERSIONINFO_DESCRIPTION "MS C++ arm64\0"
+# elif defined(__PTW32_CLEANUP_SEH)
+# define __PTW32_VERSIONINFO_NAME "pthreadVSE2.DLL\0"
+# define __PTW32_VERSIONINFO_DESCRIPTION "MS C SEH arm64\0"
+# endif
# endif
#elif defined(__GNUC__)
# if defined(_M_X64)

View File

@@ -0,0 +1,34 @@
--- a/PCbuild/prepare_ssl.bat 2022-10-30 11:48:14 -0600
+++ b/PCbuild/prepare_ssl.bat 2022-10-30 11:53:16 -0600
@@ -47,12 +47,13 @@
if "%PERL%" == "" where perl > "%TEMP%\perl.loc" 2> nul && set /P PERL= <"%TEMP%\perl.loc" & del "%TEMP%\perl.loc"
if "%PERL%" == "" (echo Cannot locate perl.exe on PATH or as PERL variable & exit /b 4)
-%MSBUILD% "%PCBUILD%\openssl.vcxproj" /p:Configuration=Release /p:Platform=Win32
-if errorlevel 1 exit /b
+REM Blender: we only need x64, ssl is kind of a long build, so just build what we need
+REM %MSBUILD% "%PCBUILD%\openssl.vcxproj" /p:Configuration=Release /p:Platform=Win32
+REM if errorlevel 1 exit /b
-%MSBUILD% "%PCBUILD%\openssl.vcxproj" /p:Configuration=Release /p:Platform=x64
-if errorlevel 1 exit /b
-%MSBUILD% "%PCBUILD%\openssl.vcxproj" /p:Configuration=Release /p:Platform=ARM
-if errorlevel 1 exit /b
+REM %MSBUILD% "%PCBUILD%\openssl.vcxproj" /p:Configuration=Release /p:Platform=x64
+REM if errorlevel 1 exit /b
+REM %MSBUILD% "%PCBUILD%\openssl.vcxproj" /p:Configuration=Release /p:Platform=ARM
+REM if errorlevel 1 exit /b
%MSBUILD% "%PCBUILD%\openssl.vcxproj" /p:Configuration=Release /p:Platform=ARM64
if errorlevel 1 exit /b
diff -aurw Python-3.10.12/PCbuild/openssl.vcxproj external_python/PCbuild/openssl.vcxproj
--- Python-3.10.12/PCbuild/openssl.vcxproj 2023-06-06 16:30:33 -0600
+++ external_python/PCbuild/openssl.vcxproj 2023-06-20 08:50:43 -0600
@@ -98,7 +98,7 @@
<Target Name="_CopyToOutput" AfterTargets="Build">
<ItemGroup>
- <_Built Include="$(opensslDir)\LICENSE" />
+ <_Built Include="$(opensslDir)\LICENSE.txt" />
<_Built Include="$(IntDir)\libcrypto.lib;$(IntDir)\libcrypto-*.dll;$(IntDir)\libcrypto-*.pdb" />
<_Built Include="$(IntDir)\libssl.lib;$(IntDir)\libssl-*.dll;$(IntDir)\libssl-*.pdb" />
<_AppLink Include="$(opensslDir)\ms\applink.c" />

View File

@@ -0,0 +1,34 @@
--- a/PCbuild/prepare_ssl.bat 2022-10-30 11:48:14 -0600
+++ b/PCbuild/prepare_ssl.bat 2022-10-30 11:53:16 -0600
@@ -47,12 +47,13 @@
if "%PERL%" == "" where perl > "%TEMP%\perl.loc" 2> nul && set /P PERL= <"%TEMP%\perl.loc" & del "%TEMP%\perl.loc"
if "%PERL%" == "" (echo Cannot locate perl.exe on PATH or as PERL variable & exit /b 4)
-%MSBUILD% "%PCBUILD%\openssl.vcxproj" /p:Configuration=Release /p:Platform=Win32
-if errorlevel 1 exit /b
+REM Blender: we only need x64, ssl is kind of a long build, so just build what we need
+REM %MSBUILD% "%PCBUILD%\openssl.vcxproj" /p:Configuration=Release /p:Platform=Win32
+REM if errorlevel 1 exit /b
%MSBUILD% "%PCBUILD%\openssl.vcxproj" /p:Configuration=Release /p:Platform=x64
if errorlevel 1 exit /b
-%MSBUILD% "%PCBUILD%\openssl.vcxproj" /p:Configuration=Release /p:Platform=ARM
-if errorlevel 1 exit /b
-%MSBUILD% "%PCBUILD%\openssl.vcxproj" /p:Configuration=Release /p:Platform=ARM64
-if errorlevel 1 exit /b
+REM %MSBUILD% "%PCBUILD%\openssl.vcxproj" /p:Configuration=Release /p:Platform=ARM
+REM if errorlevel 1 exit /b
+REM %MSBUILD% "%PCBUILD%\openssl.vcxproj" /p:Configuration=Release /p:Platform=ARM64
+REM if errorlevel 1 exit /b
diff -aurw Python-3.10.12/PCbuild/openssl.vcxproj external_python/PCbuild/openssl.vcxproj
--- Python-3.10.12/PCbuild/openssl.vcxproj 2023-06-06 16:30:33 -0600
+++ external_python/PCbuild/openssl.vcxproj 2023-06-20 08:50:43 -0600
@@ -98,7 +98,7 @@
<Target Name="_CopyToOutput" AfterTargets="Build">
<ItemGroup>
- <_Built Include="$(opensslDir)\LICENSE" />
+ <_Built Include="$(opensslDir)\LICENSE.txt" />
<_Built Include="$(IntDir)\libcrypto.lib;$(IntDir)\libcrypto-*.dll;$(IntDir)\libcrypto-*.pdb" />
<_Built Include="$(IntDir)\libssl.lib;$(IntDir)\libssl-*.dll;$(IntDir)\libssl-*.pdb" />
<_AppLink Include="$(opensslDir)\ms\applink.c" />

View File

@@ -0,0 +1,13 @@
diff --git a/src/common/mathmisc.h b/src/common/mathmisc.h
index d8bcc14..66f3378 100644
--- a/src/common/mathmisc.h
+++ b/src/common/mathmisc.h
@@ -26,6 +26,8 @@
#include "sysutils.h"
+#include <cstdlib>
+
#ifndef M_PI
#define M_PI 3.14159265358979323846
#endif // M_PI

View File

@@ -0,0 +1,36 @@
diff -Naur rubberband-4.0.0/rubberband/RubberBandLiveShifter.h external_rubberband/rubberband/RubberBandLiveShifter.h
--- rubberband-4.0.0/rubberband/RubberBandLiveShifter.h 2024-10-25 09:26:08.000000000 -0700
+++ external_rubberband/rubberband/RubberBandLiveShifter.h 2026-03-10 08:06:31.677491500 -0700
@@ -30,7 +30,7 @@
#undef RUBBERBAND_LIVE_DLLEXPORT
#ifdef _MSC_VER
-#define RUBBERBAND_LIVE_DLLEXPORT __declspec(dllexport)
+#define RUBBERBAND_LIVE_DLLEXPORT
#else
#define RUBBERBAND_LIVE_DLLEXPORT
#endif
diff -Naur rubberband-4.0.0/rubberband/RubberBandStretcher.h external_rubberband/rubberband/RubberBandStretcher.h
--- rubberband-4.0.0/rubberband/RubberBandStretcher.h 2024-10-25 09:26:08.000000000 -0700
+++ external_rubberband/rubberband/RubberBandStretcher.h 2026-03-10 08:08:49.779572600 -0700
@@ -31,7 +31,7 @@
#undef RUBBERBAND_DLLEXPORT
#ifdef _MSC_VER
#ifndef RUBBERBAND_STATIC
-#define RUBBERBAND_DLLEXPORT __declspec(dllexport)
+#define RUBBERBAND_DLLEXPORT
#else
#define RUBBERBAND_DLLEXPORT
#endif
diff -Naur rubberband-4.0.0/rubberband/rubberband-c.h external_rubberband/rubberband/rubberband-c.h
--- rubberband-4.0.0/rubberband/rubberband-c.h 2024-10-25 09:26:08.000000000 -0700
+++ external_rubberband/rubberband/rubberband-c.h 2026-03-10 08:06:31.693140200 -0700
@@ -36,7 +36,7 @@
#undef RB_EXTERN
#ifdef _MSC_VER
#ifndef RUBBERBAND_STATIC
-#define RB_EXTERN extern __declspec(dllexport)
+#define RB_EXTERN extern
#else
#define RB_EXTERN extern
#endif

View File

@@ -0,0 +1,395 @@
diff --git a/src/ogg.c b/src/ogg.c
index 529941af8..e2d679d41 100644
--- a/src/ogg.c
+++ b/src/ogg.c
@@ -211,12 +211,16 @@ ogg_read_first_page (SF_PRIVATE *psf, OGG_PRIVATE *odata)
int
ogg_write_page (SF_PRIVATE *psf, ogg_page *page)
-{ int bytes ;
+{ int n ;
- bytes = psf_fwrite (page->header, 1, page->header_len, psf) ;
- bytes += psf_fwrite (page->body, 1, page->body_len, psf) ;
+ n = psf_fwrite (page->header, 1, page->header_len, psf) ;
+ if (n == page->header_len)
+ n += psf_fwrite (page->body, 1, page->body_len, psf) ;
- return bytes == page->header_len + page->body_len ;
+ if (n != page->body_len + page->header_len)
+ return -1 ;
+
+ return n ;
} /* ogg_write_page */
sf_count_t
diff --git a/src/ogg_opus.c b/src/ogg_opus.c
index 511653ecc..e01224b99 100644
--- a/src/ogg_opus.c
+++ b/src/ogg_opus.c
@@ -827,15 +827,16 @@ ogg_opus_write_header (SF_PRIVATE *psf, int UNUSED (calc_length))
/* The first page MUST only contain the header, so flush it out now */
ogg_stream_packetin (&odata->ostream, &op) ;
- for ( ; (nn = ogg_stream_flush (&odata->ostream, &odata->opage)) ; )
- { if (! (nn = ogg_write_page (psf, &odata->opage)))
+ while (ogg_stream_flush (&odata->ostream, &odata->opage))
+ { nn = ogg_write_page (psf, &odata->opage) ;
+ if (nn < 0)
{ psf_log_printf (psf, "Opus : Failed to write header!\n") ;
if (psf->error)
return psf->error ;
return SFE_INTERNAL ;
} ;
psf->dataoffset += nn ;
- }
+ } ;
/*
** Metadata Tags (manditory)
@@ -850,15 +851,16 @@ ogg_opus_write_header (SF_PRIVATE *psf, int UNUSED (calc_length))
vorbiscomment_write_tags (psf, &op, &opustags_ident, opus_get_version_string (), - (OGG_OPUS_COMMENT_PAD)) ;
op.packetno = 2 ;
ogg_stream_packetin (&odata->ostream, &op) ;
- for ( ; (nn = ogg_stream_flush (&odata->ostream, &odata->opage)) ; )
- { if (! (nn = ogg_write_page (psf, &odata->opage)))
+ while (ogg_stream_flush (&odata->ostream, &odata->opage))
+ { nn = ogg_write_page (psf, &odata->opage) ;
+ if (nn < 0)
{ psf_log_printf (psf, "Opus : Failed to write comments!\n") ;
if (psf->error)
return psf->error ;
return SFE_INTERNAL ;
} ;
psf->dataoffset += nn ;
- }
+ } ;
return 0 ;
} /* ogg_opus_write_header */
@@ -1132,7 +1134,8 @@ ogg_opus_write_out (SF_PRIVATE *psf, OGG_PRIVATE *odata, OPUS_PRIVATE *oopus)
if (nbytes > 0)
{ oopus->u.encode.last_segments -= ogg_page_segments (&odata->opage) ;
oopus->pg_pos = oopus->pkt_pos ;
- ogg_write_page (psf, &odata->opage) ;
+ if (ogg_write_page (psf, &odata->opage) < 0)
+ return -1 ;
}
else
break ;
diff --git a/src/ogg_vorbis.c b/src/ogg_vorbis.c
index add123966..fae252ca0 100644
--- a/src/ogg_vorbis.c
+++ b/src/ogg_vorbis.c
@@ -82,28 +82,6 @@
/* How many seconds in the future to not bother bisection searching for. */
#define VORBIS_SEEK_THRESHOLD 2
-typedef int convert_func (SF_PRIVATE *psf, int, void *, int, int, float **) ;
-
-static int vorbis_read_header (SF_PRIVATE *psf) ;
-static int vorbis_write_header (SF_PRIVATE *psf, int calc_length) ;
-static int vorbis_close (SF_PRIVATE *psf) ;
-static int vorbis_command (SF_PRIVATE *psf, int command, void *data, int datasize) ;
-static int vorbis_byterate (SF_PRIVATE *psf) ;
-static int vorbis_calculate_granulepos (SF_PRIVATE *psf, uint64_t *gp_out) ;
-static int vorbis_skip (SF_PRIVATE *psf, uint64_t target_gp) ;
-static int vorbis_seek_trysearch (SF_PRIVATE *psf, uint64_t target_gp) ;
-static sf_count_t vorbis_seek (SF_PRIVATE *psf, int mode, sf_count_t offset) ;
-static sf_count_t vorbis_read_s (SF_PRIVATE *psf, short *ptr, sf_count_t len) ;
-static sf_count_t vorbis_read_i (SF_PRIVATE *psf, int *ptr, sf_count_t len) ;
-static sf_count_t vorbis_read_f (SF_PRIVATE *psf, float *ptr, sf_count_t len) ;
-static sf_count_t vorbis_read_d (SF_PRIVATE *psf, double *ptr, sf_count_t len) ;
-static sf_count_t vorbis_write_s (SF_PRIVATE *psf, const short *ptr, sf_count_t len) ;
-static sf_count_t vorbis_write_i (SF_PRIVATE *psf, const int *ptr, sf_count_t len) ;
-static sf_count_t vorbis_write_f (SF_PRIVATE *psf, const float *ptr, sf_count_t len) ;
-static sf_count_t vorbis_write_d (SF_PRIVATE *psf, const double *ptr, sf_count_t len) ;
-static sf_count_t vorbis_read_sample (SF_PRIVATE *psf, void *ptr, sf_count_t lens, convert_func *transfn) ;
-static int vorbis_rnull (SF_PRIVATE *psf, int samples, void *vptr, int off , int channels, float **pcm) ;
-
typedef struct
{ int id ;
const char *name ;
@@ -145,6 +123,45 @@ typedef struct
sf_count_t last_page ;
} VORBIS_PRIVATE ;
+typedef int convert_func (SF_PRIVATE *psf, int, void *, int, int, float **) ;
+
+static int vorbis_read_header (SF_PRIVATE *psf) ;
+static int vorbis_write_header (SF_PRIVATE *psf, int calc_length) ;
+static int vorbis_close (SF_PRIVATE *psf) ;
+static int vorbis_command (SF_PRIVATE *psf, int command, void *data, int datasize) ;
+static int vorbis_byterate (SF_PRIVATE *psf) ;
+static int vorbis_calculate_granulepos (SF_PRIVATE *psf, uint64_t *gp_out) ;
+static int vorbis_skip (SF_PRIVATE *psf, uint64_t target_gp) ;
+static int vorbis_seek_trysearch (SF_PRIVATE *psf, uint64_t target_gp) ;
+static sf_count_t vorbis_seek (SF_PRIVATE *psf, int mode, sf_count_t offset) ;
+static sf_count_t vorbis_read_s (SF_PRIVATE *psf, short *ptr, sf_count_t len) ;
+static sf_count_t vorbis_read_i (SF_PRIVATE *psf, int *ptr, sf_count_t len) ;
+static sf_count_t vorbis_read_f (SF_PRIVATE *psf, float *ptr, sf_count_t len) ;
+static sf_count_t vorbis_read_d (SF_PRIVATE *psf, double *ptr, sf_count_t len) ;
+static sf_count_t vorbis_write_s (SF_PRIVATE *psf, const short *ptr, sf_count_t len) ;
+static sf_count_t vorbis_write_i (SF_PRIVATE *psf, const int *ptr, sf_count_t len) ;
+static sf_count_t vorbis_write_f (SF_PRIVATE *psf, const float *ptr, sf_count_t len) ;
+static sf_count_t vorbis_write_d (SF_PRIVATE *psf, const double *ptr, sf_count_t len) ;
+static sf_count_t vorbis_read_sample (SF_PRIVATE *psf, void *ptr, sf_count_t lens, convert_func *transfn) ;
+static int vorbis_write_samples (SF_PRIVATE *psf, OGG_PRIVATE *odata, VORBIS_PRIVATE *vdata, int in_frames) ;
+static int vorbis_rnull (SF_PRIVATE *psf, int samples, void *vptr, int off , int channels, float **pcm) ;
+static void vorbis_log_error (SF_PRIVATE *psf, int error) ;
+
+
+static void
+vorbis_log_error(SF_PRIVATE *psf, int error) {
+ switch (error)
+ { case 0: return;
+ case OV_EIMPL: psf->error = SFE_UNIMPLEMENTED ; break ;
+ case OV_ENOTVORBIS: psf->error = SFE_MALFORMED_FILE ; break ;
+ case OV_EBADHEADER: psf->error = SFE_MALFORMED_FILE ; break ;
+ case OV_EVERSION: psf->error = SFE_UNSUPPORTED_ENCODING ; break ;
+ case OV_EFAULT:
+ case OV_EINVAL:
+ default: psf->error = SFE_INTERNAL ;
+ } ;
+} ;
+
static int
vorbis_read_header (SF_PRIVATE *psf)
{ OGG_PRIVATE *odata = (OGG_PRIVATE *) psf->container_data ;
@@ -380,7 +397,6 @@ vorbis_write_header (SF_PRIVATE *psf, int UNUSED (calc_length))
{ ogg_packet header ;
ogg_packet header_comm ;
ogg_packet header_code ;
- int result ;
vorbis_analysis_headerout (&vdata->vdsp, &vdata->vcomment, &header, &header_comm, &header_code) ;
ogg_stream_packetin (&odata->ostream, &header) ; /* automatically placed in its own page */
@@ -390,9 +406,9 @@ vorbis_write_header (SF_PRIVATE *psf, int UNUSED (calc_length))
/* This ensures the actual
* audio data will start on a new page, as per spec
*/
- while ((result = ogg_stream_flush (&odata->ostream, &odata->opage)) != 0)
- { ogg_write_page (psf, &odata->opage) ;
- } ;
+ while (ogg_stream_flush (&odata->ostream, &odata->opage))
+ if (ogg_write_page (psf, &odata->opage) < 0)
+ return -1 ;
}
return 0 ;
@@ -402,6 +418,7 @@ static int
vorbis_close (SF_PRIVATE *psf)
{ OGG_PRIVATE* odata = psf->container_data ;
VORBIS_PRIVATE *vdata = psf->codec_data ;
+ int ret = 0 ;
if (odata == NULL || vdata == NULL)
return 0 ;
@@ -412,34 +429,14 @@ vorbis_close (SF_PRIVATE *psf)
if (psf->file.mode == SFM_WRITE)
{
if (psf->write_current <= 0)
- vorbis_write_header (psf, 0) ;
-
- vorbis_analysis_wrote (&vdata->vdsp, 0) ;
- while (vorbis_analysis_blockout (&vdata->vdsp, &vdata->vblock) == 1)
- {
+ ret = vorbis_write_header (psf, 0) ;
- /* analysis, assume we want to use bitrate management */
- vorbis_analysis (&vdata->vblock, NULL) ;
- vorbis_bitrate_addblock (&vdata->vblock) ;
-
- while (vorbis_bitrate_flushpacket (&vdata->vdsp, &odata->opacket))
- { /* weld the packet into the bitstream */
- ogg_stream_packetin (&odata->ostream, &odata->opacket) ;
-
- /* write out pages (if any) */
- while (!odata->eos)
- { int result = ogg_stream_pageout (&odata->ostream, &odata->opage) ;
- if (result == 0) break ;
- ogg_write_page (psf, &odata->opage) ;
-
- /* this could be set above, but for illustrative purposes, I do
- it here (to show that vorbis does know where the stream ends) */
-
- if (ogg_page_eos (&odata->opage)) odata->eos = 1 ;
- }
- }
- }
- }
+ if (ret == 0)
+ { /* A write of zero samples tells Vorbis the stream is done and to
+ flush. */
+ ret = vorbis_write_samples (psf, odata, vdata, 0) ;
+ } ;
+ } ;
/* ogg_page and ogg_packet structs always point to storage in
libvorbis. They are never freed or manipulated directly */
@@ -449,7 +446,7 @@ vorbis_close (SF_PRIVATE *psf)
vorbis_comment_clear (&vdata->vcomment) ;
vorbis_info_clear (&vdata->vinfo) ;
- return 0 ;
+ return ret ;
} /* vorbis_close */
int
@@ -688,33 +685,40 @@ vorbis_read_d (SF_PRIVATE *psf, double *ptr, sf_count_t lens)
/*==============================================================================
*/
-static void
+static int
vorbis_write_samples (SF_PRIVATE *psf, OGG_PRIVATE *odata, VORBIS_PRIVATE *vdata, int in_frames)
-{
- vorbis_analysis_wrote (&vdata->vdsp, in_frames) ;
+{ int ret ;
+
+ if ((ret = vorbis_analysis_wrote (&vdata->vdsp, in_frames)) != 0)
+ return ret ;
/*
** Vorbis does some data preanalysis, then divvies up blocks for
** more involved (potentially parallel) processing. Get a single
** block for encoding now.
*/
- while (vorbis_analysis_blockout (&vdata->vdsp, &vdata->vblock) == 1)
+ while ((ret = vorbis_analysis_blockout (&vdata->vdsp, &vdata->vblock)) == 1)
{
/* analysis, assume we want to use bitrate management */
- vorbis_analysis (&vdata->vblock, NULL) ;
- vorbis_bitrate_addblock (&vdata->vblock) ;
+ if ((ret = vorbis_analysis (&vdata->vblock, NULL)) != 0)
+ return ret ;
+ if ((ret = vorbis_bitrate_addblock (&vdata->vblock)) != 0)
+ return ret ;
- while (vorbis_bitrate_flushpacket (&vdata->vdsp, &odata->opacket))
+ while ((ret = vorbis_bitrate_flushpacket (&vdata->vdsp, &odata->opacket)) == 1)
{
/* weld the packet into the bitstream */
- ogg_stream_packetin (&odata->ostream, &odata->opacket) ;
+ if ((ret = ogg_stream_packetin (&odata->ostream, &odata->opacket)) != 0)
+ return ret ;
/* write out pages (if any) */
while (!odata->eos)
- { int result = ogg_stream_pageout (&odata->ostream, &odata->opage) ;
- if (result == 0)
+ { ret = ogg_stream_pageout (&odata->ostream, &odata->opage) ;
+ if (ret == 0)
break ;
- ogg_write_page (psf, &odata->opage) ;
+
+ if (ogg_write_page (psf, &odata->opage) < 0)
+ return -1 ;
/* This could be set above, but for illustrative purposes, I do
** it here (to show that vorbis does know where the stream ends) */
@@ -722,16 +726,22 @@ vorbis_write_samples (SF_PRIVATE *psf, OGG_PRIVATE *odata, VORBIS_PRIVATE *vdata
odata->eos = 1 ;
} ;
} ;
+ if (ret != 0)
+ return ret ;
} ;
+ if (ret != 0)
+ return ret ;
vdata->gp += in_frames ;
+
+ return 0 ;
} /* vorbis_write_data */
static sf_count_t
vorbis_write_s (SF_PRIVATE *psf, const short *ptr, sf_count_t lens)
{
- int i, m, j = 0 ;
+ int i, m, j = 0, ret ;
OGG_PRIVATE *odata = (OGG_PRIVATE *) psf->container_data ;
VORBIS_PRIVATE *vdata = (VORBIS_PRIVATE *) psf->codec_data ;
int in_frames = lens / psf->sf.channels ;
@@ -740,14 +750,17 @@ vorbis_write_s (SF_PRIVATE *psf, const short *ptr, sf_count_t lens)
for (m = 0 ; m < psf->sf.channels ; m++)
buffer [m][i] = (float) (ptr [j++]) / 32767.0f ;
- vorbis_write_samples (psf, odata, vdata, in_frames) ;
+ if ((ret = vorbis_write_samples (psf, odata, vdata, in_frames)))
+ { vorbis_log_error (psf, ret) ;
+ return 0 ;
+ } ;
return lens ;
} /* vorbis_write_s */
static sf_count_t
vorbis_write_i (SF_PRIVATE *psf, const int *ptr, sf_count_t lens)
-{ int i, m, j = 0 ;
+{ int i, m, j = 0, ret ;
OGG_PRIVATE *odata = (OGG_PRIVATE *) psf->container_data ;
VORBIS_PRIVATE *vdata = (VORBIS_PRIVATE *) psf->codec_data ;
int in_frames = lens / psf->sf.channels ;
@@ -756,14 +769,17 @@ vorbis_write_i (SF_PRIVATE *psf, const int *ptr, sf_count_t lens)
for (m = 0 ; m < psf->sf.channels ; m++)
buffer [m][i] = (float) (ptr [j++]) / 2147483647.0f ;
- vorbis_write_samples (psf, odata, vdata, in_frames) ;
+ if ((ret = vorbis_write_samples (psf, odata, vdata, in_frames)))
+ { vorbis_log_error (psf, ret) ;
+ return 0 ;
+ } ;
return lens ;
} /* vorbis_write_i */
static sf_count_t
vorbis_write_f (SF_PRIVATE *psf, const float *ptr, sf_count_t lens)
-{ int i, m, j = 0 ;
+{ int i, m, j = 0, ret ;
OGG_PRIVATE *odata = (OGG_PRIVATE *) psf->container_data ;
VORBIS_PRIVATE *vdata = (VORBIS_PRIVATE *) psf->codec_data ;
int in_frames = lens / psf->sf.channels ;
@@ -772,14 +788,17 @@ vorbis_write_f (SF_PRIVATE *psf, const float *ptr, sf_count_t lens)
for (m = 0 ; m < psf->sf.channels ; m++)
buffer [m][i] = ptr [j++] ;
- vorbis_write_samples (psf, odata, vdata, in_frames) ;
+ if ((ret = vorbis_write_samples (psf, odata, vdata, in_frames)) != 0)
+ { vorbis_log_error (psf, ret) ;
+ return 0 ;
+ } ;
return lens ;
} /* vorbis_write_f */
static sf_count_t
vorbis_write_d (SF_PRIVATE *psf, const double *ptr, sf_count_t lens)
-{ int i, m, j = 0 ;
+{ int i, m, j = 0, ret ;
OGG_PRIVATE *odata = (OGG_PRIVATE *) psf->container_data ;
VORBIS_PRIVATE *vdata = (VORBIS_PRIVATE *) psf->codec_data ;
int in_frames = lens / psf->sf.channels ;
@@ -788,7 +807,10 @@ vorbis_write_d (SF_PRIVATE *psf, const double *ptr, sf_count_t lens)
for (m = 0 ; m < psf->sf.channels ; m++)
buffer [m][i] = (float) ptr [j++] ;
- vorbis_write_samples (psf, odata, vdata, in_frames) ;
+ if ((ret = vorbis_write_samples (psf, odata, vdata, in_frames)) != 0)
+ { vorbis_log_error (psf, ret) ;
+ return 0 ;
+ } ;
return lens ;
} /* vorbis_write_d */
@@ -884,7 +906,7 @@ vorbis_seek_trysearch (SF_PRIVATE *psf, uint64_t target_gp)
return 0 ;
/* Search for a position a half large-block before our target. As Vorbis is
- ** lapped, every sample position come from two blocks, the "left" half of
+ ** lapped, every sample position comes from two blocks, the "left" half of
** one block and the "right" half of the previous block. The granule
** position of an Ogg page of a Vorbis stream is the sample offset of the
** last finished sample in the stream that can be decoded from a page. A

View File

@@ -0,0 +1,30 @@
--- config.sub
+++ config.sub
@@ -226,6 +226,7 @@
# Some are omitted here because they have special meanings below.
1750a | 580 \
| a29k \
+ | aarch64 \
| alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
| alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
| arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \
@@ -286,6 +287,7 @@
# Recognize the basic CPU types with company name.
580-* \
| a29k-* \
+ | aarch64-* \
| alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
| alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
| alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
--- config.guess 2024-07-11 13:42:08.171028863 +0200
+++ config.guess 2024-07-11 13:41:13.921323750 +0200
@@ -861,6 +861,9 @@
x86_64:Linux:*:*)
echo x86_64-unknown-linux-gnu
exit 0 ;;
+ aarch64:Linux:*:*)
+ echo aarch64-unknown-linux-gnu
+ exit 0 ;;
i*86:Linux:*:*)
# The BFD linker knows what the default object file format is, so
# first see if it will tell us. cd to the root directory to prevent

View File

@@ -0,0 +1,13 @@
diff -Naur tracy-orig/public/client/windows/TracyETW.cpp tracy-a64b9a20294d59421a2f57aeca3c6383d8c48169/public/client/windows/TracyETW.cpp
--- tracy-orig/public/client/windows/TracyETW.cpp 2026-04-11 09:29:44 -0600
+++ tracy-a64b9a20294d59421a2f57aeca3c6383d8c48169/public/client/windows/TracyETW.cpp 2026-05-04 11:33:43 -0600
@@ -6,6 +6,9 @@
#include <stdio.h>
#include <thread>
+#define CONTROLTRACE_ID TRACEHANDLE
+#define PROCESSTRACE_HANDLE TRACEHANDLE
+
namespace tracy
{
namespace etw

View File

@@ -0,0 +1,13 @@
# this otherwise leads to error C1258 due to too long path for XML log files
diff --git a/cmake/helpers.cmake b/cmake/helpers.cmake
index 2544a15..a6bfe76 100644
--- a/cmake/helpers.cmake
+++ b/cmake/helpers.cmake
@@ -265,7 +265,6 @@ function(add_umf_target_compile_options name)
${name}
PRIVATE /MD$<$<CONFIG:Debug>:d>
$<$<CONFIG:Release>:/sdl>
- $<$<CXX_COMPILER_ID:MSVC>:/analyze>
/DYNAMICBASE
/W4
/Gy

View File

@@ -0,0 +1,57 @@
diff --git a/cmake/defaults/msvcdefaults.cmake b/cmake/defaults/msvcdefaults.cmake
index 188684bd9..eca6859f9 100644
--- a/cmake/defaults/msvcdefaults.cmake
+++ b/cmake/defaults/msvcdefaults.cmake
@@ -124,9 +124,6 @@ _add_define("WIN32_LEAN_AND_MEAN")
# for all translation units.
set(_PXR_CXX_FLAGS "${_PXR_CXX_FLAGS} /bigobj")
-# Enable PDB generation.
-set(_PXR_CXX_FLAGS "${_PXR_CXX_FLAGS} /Zi")
-
# Enable multiprocessor builds.
set(_PXR_CXX_FLAGS "${_PXR_CXX_FLAGS} /MP")
set(_PXR_CXX_FLAGS "${_PXR_CXX_FLAGS} /Gm-")
diff --git a/cmake/macros/Private.cmake b/cmake/macros/Private.cmake
index e2dccb075..fc71099ce 100644
--- a/cmake/macros/Private.cmake
+++ b/cmake/macros/Private.cmake
@@ -968,7 +968,7 @@ function(_pxr_python_module NAME)
return()
endif()
- if (WIN32 AND PXR_USE_DEBUG_PYTHON)
+ if (WIN32 AND PXR_USE_DEBUG_PYTHON AND NOT "${CMAKE_DEBUG_POSTFIX}" STREQUAL "_d")
# On Windows when compiling with debug python the library must be named with _d.
set(LIBRARY_NAME "_${NAME}_d")
else()
diff --git a/pxr/imaging/hioOpenVDB/CMakeLists.txt b/pxr/imaging/hioOpenVDB/CMakeLists.txt
index c94b63c5a..b3bcae4eb 100644
--- a/pxr/imaging/hioOpenVDB/CMakeLists.txt
+++ b/pxr/imaging/hioOpenVDB/CMakeLists.txt
@@ -20,6 +20,12 @@ else()
LIST(APPEND __VDB_IMATH_LIBS ${OPENEXR_Half_LIBRARY})
endif()
+if (WIN32)
+ # OpenVDB uses constants from <cmath> that aren't available on
+ # Windows unless this is defined.
+ add_definitions(-D_USE_MATH_DEFINES)
+endif()
+
pxr_library(hioOpenVDB
LIBRARIES
ar
diff --git a/pxr/usdImaging/CMakeLists.txt b/pxr/usdImaging/CMakeLists.txt
index 53c026689..e99a5ac17 100644
--- a/pxr/usdImaging/CMakeLists.txt
+++ b/pxr/usdImaging/CMakeLists.txt
@@ -7,7 +7,7 @@ set(DIRS
usdVolImaging
usdAppUtils
usdviewq
- bin
+# bin
plugin
)

View File

@@ -0,0 +1,71 @@
diff --git a/pxr/external/boost/python/src/object/function.cpp b/pxr/external/boost/python/src/object/function.cpp
index 365837abb0..7e0b5b5f51 100644
--- a/pxr/external/boost/python/src/object/function.cpp
+++ b/pxr/external/boost/python/src/object/function.cpp
@@ -299,7 +299,8 @@ object function::signatures(bool show_return_type) const
void function::argument_error(PyObject* args, PyObject* /*keywords*/) const
{
- static handle<> exception(
+ // Intentionally leak to avoid unsafe refcount operations during shutdown.
+ static handle<>* exception = new handle<>(
PyErr_NewException(const_cast<char*>("Boost.Python.ArgumentError"), PyExc_TypeError, 0));
object message = "Python argument types in\n %s.%s("
@@ -318,7 +319,7 @@ void function::argument_error(PyObject* args, PyObject* /*keywords*/) const
#if PXR_BOOST_PYTHON_DEBUG_ERROR_MESSAGES
std::printf("\n--------\n%s\n--------\n", extract<const char*>(message)());
#endif
- PyErr_SetObject(exception.get(), message.ptr());
+ PyErr_SetObject(exception->get(), message.ptr());
throw_error_already_set();
}
@@ -405,13 +406,13 @@ namespace
handle<function> not_implemented_function()
{
-
- static object keeper(
+ // Intentionally leak to avoid unsafe refcount operations during shutdown.
+ static object* keeper = new object(
function_object(
py_function(&not_implemented, type_list<void>(), 2)
, python::detail::keyword_range())
);
- return handle<function>(borrowed(downcast<function>(keeper.ptr())));
+ return handle<function>(borrowed(downcast<function>(keeper->ptr())));
}
}
@@ -812,11 +813,12 @@ namespace detail
{
object PXR_BOOST_PYTHON_DECL make_raw_function(objects::py_function f)
{
- static keyword k;
+ // Intentionally leak to avoid unsafe refcount operations during shutdown.
+ static keyword* k = new keyword;
return objects::function_object(
f
- , keyword_range(&k,&k));
+ , keyword_range(k,k));
}
void PXR_BOOST_PYTHON_DECL pure_virtual_called()
{
diff --git a/pxr/external/boost/python/src/object/pickle_support.cpp b/pxr/external/boost/python/src/object/pickle_support.cpp
index 90f1280225..733cc86ab9 100644
--- a/pxr/external/boost/python/src/object/pickle_support.cpp
+++ b/pxr/external/boost/python/src/object/pickle_support.cpp
@@ -95,8 +95,9 @@ namespace {
object const& make_instance_reduce_function()
{
- static object result(&instance_reduce);
- return result;
+ // Intentionally leak to avoid unsafe refcount operations during shutdown.
+ static object* result = new object(&instance_reduce);
+ return *result;
}
}} // namespace PXR_BOOST_NAMESPACE::python

View File

@@ -0,0 +1,36 @@
diff --git a/pxr/base/tf/pyErrorInternal.cpp b/pxr/base/tf/pyErrorInternal.cpp
index a17b447956..5ee42db406 100644
--- a/pxr/base/tf/pyErrorInternal.cpp
+++ b/pxr/base/tf/pyErrorInternal.cpp
@@ -11,6 +11,7 @@
#include "pxr/base/tf/enum.h"
#include "pxr/base/tf/registryManager.h"
+#include "pxr/base/tf/staticData.h"
#include "pxr/external/boost/python/handle.hpp"
#include "pxr/external/boost/python/object.hpp"
@@ -23,18 +24,18 @@ TF_REGISTRY_FUNCTION(TfEnum) {
TF_ADD_ENUM_NAME(TF_PYTHON_EXCEPTION);
}
-// Should probably use a better mechanism.
-
-static handle<> _ExceptionClass;
+// The held handle<> is intentionally leaked to avoid Python refcount ops
+// during shutdown, which is unsafe if Python has been finalized.
+static TfStaticData<handle<>> _ExceptionClass;
handle<> Tf_PyGetErrorExceptionClass()
{
- return _ExceptionClass;
+ return *_ExceptionClass;
}
void Tf_PySetErrorExceptionClass(object const &cls)
{
- _ExceptionClass = handle<>(borrowed(cls.ptr()));
+ *_ExceptionClass = handle<>(borrowed(cls.ptr()));
}
TfPyExceptionStateScope::TfPyExceptionStateScope() :

View File

@@ -0,0 +1,452 @@
diff --git a/pxr/imaging/hdSt/indirectDrawBatch.cpp b/pxr/imaging/hdSt/indirectDrawBatch.cpp
index 4d1e181cf..57a85141e 100644
--- a/pxr/imaging/hdSt/indirectDrawBatch.cpp
+++ b/pxr/imaging/hdSt/indirectDrawBatch.cpp
@@ -94,11 +94,17 @@ HdSt_IndirectDrawBatch::HdSt_IndirectDrawBatch(
, _instanceCountOffset(0)
, _cullInstanceCountOffset(0)
, _needsTextureResourceRebinding(false)
+ , _vao(0)
{
_Init(drawItemInstance);
}
-HdSt_IndirectDrawBatch::~HdSt_IndirectDrawBatch() = default;
+HdSt_IndirectDrawBatch::~HdSt_IndirectDrawBatch()
+{
+ if (_vao) {
+ glDeleteVertexArrays(1, &_vao);
+ }
+}
/*virtual*/
void
@@ -1182,6 +1188,14 @@ HdSt_IndirectDrawBatch::_ExecuteDraw(
state.instancePrimvarBars);
}
+ // OpenGL core profile requries a VAO for binding buffers.
+ if (capabilities->GetCoreProfile()) {
+ if (!_vao) {
+ glCreateVertexArrays(1, &_vao);
+ }
+ glBindVertexArray(_vao);
+ }
+
state.BindResourcesForDrawing(renderPassState, *capabilities);
HdSt_GeometricShaderSharedPtr geometricShader = state.geometricShader;
@@ -1441,6 +1455,15 @@ HdSt_IndirectDrawBatch::_ExecuteFrustumCull(
cullingProgram.GetGeometricShader());
Hgi * hgi = resourceRegistry->GetHgi();
+ HgiCapabilities const *capabilities = hgi->GetCapabilities();
+
+ // OpenGL core profile requries a VAO for binding buffers.
+ if (capabilities->GetCoreProfile()) {
+ if (!_vao) {
+ glCreateVertexArrays(1, &_vao);
+ }
+ glBindVertexArray(_vao);
+ }
HgiGraphicsPipelineSharedPtr const & pso =
_GetCullPipeline(resourceRegistry,
diff --git a/pxr/imaging/hdSt/indirectDrawBatch.h b/pxr/imaging/hdSt/indirectDrawBatch.h
index 2b4c9dafb..aad43302a 100644
--- a/pxr/imaging/hdSt/indirectDrawBatch.h
+++ b/pxr/imaging/hdSt/indirectDrawBatch.h
@@ -184,6 +184,8 @@ private:
int _cullInstanceCountOffset;
bool _needsTextureResourceRebinding;
+
+ uint32_t _vao;
};
diff --git a/pxr/imaging/hdSt/renderPassState.cpp b/pxr/imaging/hdSt/renderPassState.cpp
index 19f47b7c9..c9f1cc236 100644
--- a/pxr/imaging/hdSt/renderPassState.cpp
+++ b/pxr/imaging/hdSt/renderPassState.cpp
@@ -769,7 +769,9 @@ HdStRenderPassState::Bind(HgiCapabilities const &hgiCapabilities)
// If not using GL_MULTISAMPLE, use GL_POINT_SMOOTH to render points as
// circles instead of square.
// XXX Switch points rendering to emit quad with FS that draws circle.
- glEnable(GL_POINT_SMOOTH);
+ if (!hgiCapabilities.GetCoreProfile()) {
+ glEnable(GL_POINT_SMOOTH);
+ }
}
// Default to seamless cubemap sampling.
@@ -816,8 +818,10 @@ HdStRenderPassState::Unbind(HgiCapabilities const &hgiCapabilities)
}
glEnable(GL_MULTISAMPLE);
- glDisable(GL_POINT_SMOOTH);
- glDisable(GL_POINT_SPRITE);
+ if (!hgiCapabilities.GetCoreProfile()) {
+ glDisable(GL_POINT_SMOOTH);
+ glDisable(GL_POINT_SPRITE);
+ }
}
void
diff --git a/pxr/imaging/hgi/capabilities.h b/pxr/imaging/hgi/capabilities.h
index b53197566..605e4d7ca 100644
--- a/pxr/imaging/hgi/capabilities.h
+++ b/pxr/imaging/hgi/capabilities.h
@@ -35,6 +35,11 @@ public:
HGI_API
virtual int GetShaderVersion() const = 0;
+ HGI_API
+ virtual bool GetCoreProfile() const {
+ return false;
+ }
+
HGI_API
size_t GetMaxUniformBlockSize() const {
return _maxUniformBlockSize;
diff --git a/pxr/imaging/hgiGL/blitCmds.cpp b/pxr/imaging/hgiGL/blitCmds.cpp
index ee1ce0bd0..cf6d1cd7c 100644
--- a/pxr/imaging/hgiGL/blitCmds.cpp
+++ b/pxr/imaging/hgiGL/blitCmds.cpp
@@ -132,7 +132,7 @@ HgiGLBlitCmds::_Submit(Hgi* hgi, HgiSubmitWaitType wait)
// Capture OpenGL state before executing the 'ops' and restore it when this
// function ends. We do this defensively because parts of our pipeline may
// not set and restore all relevant gl state.
- HgiGL_ScopedStateHolder openglStateGuard;
+ HgiGL_ScopedStateHolder openglStateGuard(*hgi->GetCapabilities());
HgiGL* hgiGL = static_cast<HgiGL*>(hgi);
HgiGLDevice* device = hgiGL->GetPrimaryDevice();
diff --git a/pxr/imaging/hgiGL/capabilities.cpp b/pxr/imaging/hgiGL/capabilities.cpp
index eaf70a477..dfd44f5fb 100644
--- a/pxr/imaging/hgiGL/capabilities.cpp
+++ b/pxr/imaging/hgiGL/capabilities.cpp
@@ -42,6 +42,7 @@ static const int _DefaultMaxClipDistances = 8;
HgiGLCapabilities::HgiGLCapabilities()
: _glVersion(0)
, _glslVersion(_DefaultGLSLVersion)
+ , _coreProfile(false)
{
_LoadCapabilities();
}
@@ -117,6 +118,11 @@ HgiGLCapabilities::_LoadCapabilities()
&uniformBufferOffsetAlignment);
_uniformBufferOffsetAlignment = uniformBufferOffsetAlignment;
}
+ if (_glVersion >= 320) {
+ GLint profileMask = 0;
+ glGetIntegerv(GL_CONTEXT_PROFILE_MASK, &profileMask);
+ _coreProfile = (profileMask & GL_CONTEXT_CORE_PROFILE_BIT);
+ }
if (_glVersion >= 430) {
GLint maxShaderStorageBlockSize = 0;
glGetIntegerv(GL_MAX_SHADER_STORAGE_BLOCK_SIZE,
@@ -250,4 +256,9 @@ HgiGLCapabilities::GetShaderVersion() const {
return _glslVersion;
}
+bool
+HgiGLCapabilities::GetCoreProfile() const {
+ return _coreProfile;
+}
+
PXR_NAMESPACE_CLOSE_SCOPE
diff --git a/pxr/imaging/hgiGL/capabilities.h b/pxr/imaging/hgiGL/capabilities.h
index 2ba137e95..64821ad27 100644
--- a/pxr/imaging/hgiGL/capabilities.h
+++ b/pxr/imaging/hgiGL/capabilities.h
@@ -35,6 +35,9 @@ public:
HGIGL_API
int GetShaderVersion() const override;
+ HGIGL_API
+ bool GetCoreProfile() const override;
+
private:
void _LoadCapabilities();
@@ -43,6 +46,9 @@ private:
// GLSL version
int _glslVersion; // 400, 410, ...
+
+ // Core Profile
+ bool _coreProfile;
};
PXR_NAMESPACE_CLOSE_SCOPE
diff --git a/pxr/imaging/hgiGL/computeCmds.cpp b/pxr/imaging/hgiGL/computeCmds.cpp
index 7aa3b40a3..00127f158 100644
--- a/pxr/imaging/hgiGL/computeCmds.cpp
+++ b/pxr/imaging/hgiGL/computeCmds.cpp
@@ -156,7 +156,7 @@ HgiGLComputeCmds::_Submit(Hgi* hgi, HgiSubmitWaitType wait)
// Capture OpenGL state before executing the 'ops' and restore it when this
// function ends. We do this defensively because parts of our pipeline may
// not set and restore all relevant gl state.
- HgiGL_ScopedStateHolder openglStateGuard;
+ HgiGL_ScopedStateHolder openglStateGuard(*hgi->GetCapabilities());
HgiGL* hgiGL = static_cast<HgiGL*>(hgi);
HgiGLDevice* device = hgiGL->GetPrimaryDevice();
diff --git a/pxr/imaging/hgiGL/graphicsCmds.cpp b/pxr/imaging/hgiGL/graphicsCmds.cpp
index b651963c1..f9e0a233e 100644
--- a/pxr/imaging/hgiGL/graphicsCmds.cpp
+++ b/pxr/imaging/hgiGL/graphicsCmds.cpp
@@ -244,7 +244,7 @@ HgiGLGraphicsCmds::_Submit(Hgi* hgi, HgiSubmitWaitType wait)
// Capture OpenGL state before executing the 'ops' and restore it when this
// function ends. We do this defensively because parts of our pipeline may
// not set and restore all relevant gl state.
- HgiGL_ScopedStateHolder openglStateGuard;
+ HgiGL_ScopedStateHolder openglStateGuard(*hgi->GetCapabilities());
// Resolve multisample textures
HgiGL* hgiGL = static_cast<HgiGL*>(hgi);
diff --git a/pxr/imaging/hgiGL/graphicsPipeline.cpp b/pxr/imaging/hgiGL/graphicsPipeline.cpp
index 22aa90067..7ddde98fb 100644
--- a/pxr/imaging/hgiGL/graphicsPipeline.cpp
+++ b/pxr/imaging/hgiGL/graphicsPipeline.cpp
@@ -25,7 +25,12 @@ HgiGLGraphicsPipeline::HgiGLGraphicsPipeline(
{
}
-HgiGLGraphicsPipeline::~HgiGLGraphicsPipeline() = default;
+HgiGLGraphicsPipeline::~HgiGLGraphicsPipeline()
+{
+ if (_vao) {
+ glDeleteVertexArrays(1, &_vao);
+ }
+}
void
HgiGLGraphicsPipeline::BindPipeline()
@@ -33,6 +38,7 @@ HgiGLGraphicsPipeline::BindPipeline()
if (_vao) {
glBindVertexArray(0);
glDeleteVertexArrays(1, &_vao);
+ _vao = 0;
}
if (!_descriptor.vertexBuffers.empty()) {
@@ -91,6 +97,8 @@ HgiGLGraphicsPipeline::BindPipeline()
glBindVertexArray(_vao);
}
+ const bool coreProfile = _hgi->GetCapabilities()->GetCoreProfile();
+
//
// Depth Stencil State
//
@@ -150,7 +158,7 @@ HgiGLGraphicsPipeline::BindPipeline()
//
if (_descriptor.multiSampleState.multiSampleEnable) {
glEnable(GL_MULTISAMPLE);
- if (!_hgi->GetCapabilities()->IsSet(
+ if (!coreProfile && !_hgi->GetCapabilities()->IsSet(
HgiDeviceCapabilitiesBitsRoundPoints)) {
// Needed to get gl_pointCoord in FS.
glEnable(GL_POINT_SPRITE);
@@ -160,7 +168,9 @@ HgiGLGraphicsPipeline::BindPipeline()
// If not using GL_MULTISAMPLE, use GL_POINT_SMOOTH to render points as
// circles instead of square.
// XXX Switch points rendering to emit quad with FS that draws circle.
- glEnable(GL_POINT_SMOOTH);
+ if (!coreProfile) {
+ glEnable(GL_POINT_SMOOTH);
+ }
}
if (_descriptor.multiSampleState.alphaToCoverageEnable) {
glEnable(GL_SAMPLE_ALPHA_TO_COVERAGE);
@@ -195,7 +205,7 @@ HgiGLGraphicsPipeline::BindPipeline()
glFrontFace(GL_CCW);
}
- if (_descriptor.rasterizationState.lineWidth != 1.0f) {
+ if (!coreProfile && _descriptor.rasterizationState.lineWidth != 1.0f) {
glLineWidth(_descriptor.rasterizationState.lineWidth);
}
diff --git a/pxr/imaging/hgiGL/scopedStateHolder.cpp b/pxr/imaging/hgiGL/scopedStateHolder.cpp
index ea02aada6..0e80aac3b 100644
--- a/pxr/imaging/hgiGL/scopedStateHolder.cpp
+++ b/pxr/imaging/hgiGL/scopedStateHolder.cpp
@@ -9,6 +9,7 @@
#include "pxr/imaging/hgiGL/scopedStateHolder.h"
#include "pxr/imaging/hgiGL/conversions.h"
#include "pxr/imaging/hgiGL/diagnostic.h"
+#include "pxr/imaging/hgiGL/hgi.h"
#include "pxr/base/trace/trace.h"
#include "pxr/base/tf/diagnostic.h"
@@ -16,8 +17,10 @@
PXR_NAMESPACE_OPEN_SCOPE
-HgiGL_ScopedStateHolder::HgiGL_ScopedStateHolder()
- : _restoreRenderBuffer(0)
+HgiGL_ScopedStateHolder::HgiGL_ScopedStateHolder(
+ HgiCapabilities const& capabilities)
+ : _coreProfile(capabilities.GetCoreProfile())
+ , _restoreRenderBuffer(0)
, _restoreVao(0)
, _restoreDepthTest(false)
, _restoreDepthWriteMask(false)
@@ -102,7 +105,9 @@ HgiGL_ScopedStateHolder::HgiGL_ScopedStateHolder()
glGetBooleanv(
GL_SAMPLE_ALPHA_TO_ONE,
(GLboolean*)&_restoreSampleAlphaToOne);
- glGetFloatv(GL_LINE_WIDTH, &_lineWidth);
+ if (!_coreProfile) {
+ glGetFloatv(GL_LINE_WIDTH, &_lineWidth);
+ }
glGetBooleanv(GL_CULL_FACE, (GLboolean*)&_cullFace);
glGetIntegerv(GL_CULL_FACE_MODE, &_cullMode);
glGetIntegerv(GL_FRONT_FACE, &_frontFace);
@@ -126,8 +131,10 @@ HgiGL_ScopedStateHolder::HgiGL_ScopedStateHolder()
}
glGetBooleanv(GL_MULTISAMPLE, (GLboolean*)&_restoreMultiSample);
- glGetBooleanv(GL_POINT_SMOOTH, (GLboolean*)&_restorePointSmooth);
- glGetBooleanv(GL_POINT_SPRITE, (GLboolean*)&_restorePointSprite);
+ if (!_coreProfile) {
+ glGetBooleanv(GL_POINT_SMOOTH, (GLboolean*)&_restorePointSmooth);
+ glGetBooleanv(GL_POINT_SPRITE, (GLboolean*)&_restorePointSprite);
+ }
glGetIntegerv(GL_UNPACK_ALIGNMENT, &_restoreUnpackAlignment);
glGetIntegerv(GL_PACK_ALIGNMENT, &_restorePackAlignment);
@@ -230,7 +237,9 @@ HgiGL_ScopedStateHolder::~HgiGL_ScopedStateHolder()
_restoreViewport[2], _restoreViewport[3]);
glBindVertexArray(_restoreVao);
glBindRenderbuffer(GL_RENDERBUFFER, _restoreRenderBuffer);
- glLineWidth(_lineWidth);
+ if (!_coreProfile) {
+ glLineWidth(_lineWidth);
+ }
if (_cullFace) {
glEnable(GL_CULL_FACE);
} else {
@@ -280,16 +289,18 @@ HgiGL_ScopedStateHolder::~HgiGL_ScopedStateHolder()
glDisable(GL_MULTISAMPLE);
}
- if (_restorePointSmooth) {
- glEnable(GL_POINT_SMOOTH);
- } else {
- glDisable(GL_POINT_SMOOTH);
- }
+ if (!_coreProfile) {
+ if (_restorePointSmooth) {
+ glEnable(GL_POINT_SMOOTH);
+ } else {
+ glDisable(GL_POINT_SMOOTH);
+ }
- if (_restorePointSprite) {
- glEnable(GL_POINT_SPRITE);
- } else {
- glDisable(GL_POINT_SPRITE);
+ if (_restorePointSprite) {
+ glEnable(GL_POINT_SPRITE);
+ } else {
+ glDisable(GL_POINT_SPRITE);
+ }
}
glPixelStorei(GL_UNPACK_ALIGNMENT, _restoreUnpackAlignment);
diff --git a/pxr/imaging/hgiGL/scopedStateHolder.h b/pxr/imaging/hgiGL/scopedStateHolder.h
index 3a5b5d76a..d55428a62 100644
--- a/pxr/imaging/hgiGL/scopedStateHolder.h
+++ b/pxr/imaging/hgiGL/scopedStateHolder.h
@@ -15,6 +15,7 @@
PXR_NAMESPACE_OPEN_SCOPE
+class HgiCapabilities;
/// \class HgiGLScopedStateHolder
///
@@ -33,7 +34,7 @@ class HgiGL_ScopedStateHolder final
{
public:
HGIGL_API
- HgiGL_ScopedStateHolder();
+ HgiGL_ScopedStateHolder(HgiCapabilities const& capabilities);
HGIGL_API
~HgiGL_ScopedStateHolder();
@@ -42,6 +43,8 @@ private:
HgiGL_ScopedStateHolder& operator=(const HgiGL_ScopedStateHolder&) = delete;
HgiGL_ScopedStateHolder(const HgiGL_ScopedStateHolder&) = delete;
+ bool _coreProfile;
+
int32_t _restoreRenderBuffer;
int32_t _restoreVao;
diff --git a/pxr/imaging/hgiInterop/opengl.cpp b/pxr/imaging/hgiInterop/opengl.cpp
index 36bc59bdf..672b9b044 100644
--- a/pxr/imaging/hgiInterop/opengl.cpp
+++ b/pxr/imaging/hgiInterop/opengl.cpp
@@ -93,6 +93,7 @@ HgiInteropOpenGL::HgiInteropOpenGL()
, _fsDepth(0)
, _prgNoDepth(0)
, _prgDepth(0)
+ , _vao(0)
, _vertexBuffer(0)
{
_vs = _CompileShader(_vertexFullscreen120, GL_VERTEX_SHADER);
@@ -100,6 +101,7 @@ HgiInteropOpenGL::HgiInteropOpenGL()
_fsDepth = _CompileShader(_fragmentDepthFullscreen120, GL_FRAGMENT_SHADER);
_prgNoDepth = _LinkProgram(_vs, _fsNoDepth);
_prgDepth = _LinkProgram(_vs, _fsDepth);
+ glCreateVertexArrays(1, &_vao);
_vertexBuffer = _CreateVertexBuffer();
TF_VERIFY(glGetError() == GL_NO_ERROR);
}
@@ -112,6 +114,7 @@ HgiInteropOpenGL::~HgiInteropOpenGL()
glDeleteProgram(_prgNoDepth);
glDeleteProgram(_prgDepth);
glDeleteBuffers(1, &_vertexBuffer);
+ glDeleteVertexArrays(1, &_vao);
TF_VERIFY(glGetError() == GL_NO_ERROR);
}
@@ -185,10 +188,13 @@ HgiInteropOpenGL::CompositeToInterop(
}
// Get the current array buffer binding state
+ GLint restoreVao = 0;
+ glGetIntegerv(GL_VERTEX_ARRAY_BINDING, &restoreVao);
GLint restoreArrayBuffer = 0;
glGetIntegerv(GL_ARRAY_BUFFER_BINDING, &restoreArrayBuffer);
// Vertex attributes
+ glBindVertexArray(_vao);
const GLint locPosition = glGetAttribLocation(prg, "position");
glBindBuffer(GL_ARRAY_BUFFER, _vertexBuffer);
glVertexAttribPointer(locPosition, 4, GL_FLOAT, GL_FALSE,
@@ -254,6 +260,7 @@ HgiInteropOpenGL::CompositeToInterop(
glDisableVertexAttribArray(locPosition);
glDisableVertexAttribArray(locUv);
glBindBuffer(GL_ARRAY_BUFFER, restoreArrayBuffer);
+ glBindVertexArray(restoreVao);
if (!blendEnabled) {
glDisable(GL_BLEND);
diff --git a/pxr/imaging/hgiInterop/opengl.h b/pxr/imaging/hgiInterop/opengl.h
index b0dd64a71..5cd1bad95 100644
--- a/pxr/imaging/hgiInterop/opengl.h
+++ b/pxr/imaging/hgiInterop/opengl.h
@@ -45,6 +45,7 @@ private:
uint32_t _fsDepth;
uint32_t _prgNoDepth;
uint32_t _prgDepth;
+ uint32_t _vao;
uint32_t _vertexBuffer;
};

View File

@@ -0,0 +1,126 @@
diff --git a/pxr/base/arch/attributes.cpp b/pxr/base/arch/attributes.cpp
index 1309d6f24..b65893b9c 100644
--- a/pxr/base/arch/attributes.cpp
+++ b/pxr/base/arch/attributes.cpp
@@ -187,7 +187,7 @@ AddImage(const struct mach_header* mh, intptr_t slide)
return;
}
- const auto entries = GetConstructorEntries(mh, slide, "__DATA", "pxrctor");
+ const auto entries = GetConstructorEntries(mh, slide, "__DATA", "pxbctor");
// Execute in priority order.
for (size_t i = 0, n = entries.size(); i != n; ++i) {
@@ -203,7 +203,7 @@ static
void
RemoveImage(const struct mach_header* mh, intptr_t slide)
{
- const auto entries = GetConstructorEntries(mh, slide, "__DATA", "pxrdtor");
+ const auto entries = GetConstructorEntries(mh, slide, "__DATA", "pxbdtor");
// Execute in reverse priority order.
for (size_t i = entries.size(); i-- != 0; ) {
@@ -350,7 +350,7 @@ RunConstructors(HMODULE hModule)
// Do each HMODULE at most once.
if (visited->insert(hModule).second) {
// Execute in priority order.
- const auto entries = GetConstructorEntries(hModule, ".pxrctor");
+ const auto entries = GetConstructorEntries(hModule, ".pxbctor");
for (size_t i = 0, n = entries.size(); i != n; ++i) {
if (entries[i].function &&
entries[i].version == static_cast<unsigned>(PXR_VERSION)) {
@@ -370,7 +370,7 @@ RunDestructors(HMODULE hModule)
// Do each HMODULE at most once.
if (visited->insert(hModule).second) {
// Execute in reverse priority order.
- const auto entries = GetConstructorEntries(hModule, ".pxrdtor");
+ const auto entries = GetConstructorEntries(hModule, ".pxbdtor");
for (size_t i = entries.size(); i-- != 0; ) {
if (entries[i].function &&
entries[i].version == static_cast<unsigned>(PXR_VERSION)) {
diff --git a/pxr/base/arch/attributes.h b/pxr/base/arch/attributes.h
index 1c5971035..93432572a 100644
--- a/pxr/base/arch/attributes.h
+++ b/pxr/base/arch/attributes.h
@@ -264,22 +264,22 @@ struct Arch_ConstructorEntry {
unsigned int priority:8; // Priority of function
};
-// Emit a Arch_ConstructorEntry in the __Data,pxrctor section.
+// Emit a Arch_ConstructorEntry in the __Data,pxbctor section.
# define ARCH_CONSTRUCTOR(_name, _priority) \
static void _name(); \
static const Arch_ConstructorEntry _ARCH_CAT_NOEXPAND(arch_ctor_, _name) \
- __attribute__((used, section("__DATA,pxrctor"))) = { \
+ __attribute__((used, section("__DATA,pxbctor"))) = { \
reinterpret_cast<Arch_ConstructorEntry::Type>(&_name), \
static_cast<unsigned>(PXR_VERSION), \
_priority \
}; \
static void _name()
-// Emit a Arch_ConstructorEntry in the __Data,pxrdtor section.
+// Emit a Arch_ConstructorEntry in the __Data,pxbdtor section.
# define ARCH_DESTRUCTOR(_name, _priority) \
static void _name(); \
static const Arch_ConstructorEntry _ARCH_CAT_NOEXPAND(arch_dtor_, _name) \
- __attribute__((used, section("__DATA,pxrdtor"))) = { \
+ __attribute__((used, section("__DATA,pxbdtor"))) = { \
reinterpret_cast<Arch_ConstructorEntry::Type>(&_name), \
static_cast<unsigned>(PXR_VERSION), \
_priority \
@@ -291,10 +291,10 @@ struct Arch_ConstructorEntry {
// The used attribute is required to prevent these apparently unused functions
// from being removed by the linker.
# define ARCH_CONSTRUCTOR(_name, _priority) \
- __attribute__((used, section(".pxrctor"), constructor((_priority) + 100))) \
+ __attribute__((used, section(".pxbctor"), constructor((_priority) + 100))) \
static void _name()
# define ARCH_DESTRUCTOR(_name, _priority) \
- __attribute__((used, section(".pxrdtor"), destructor((_priority) + 100))) \
+ __attribute__((used, section(".pxbdtor"), destructor((_priority) + 100))) \
static void _name()
#elif defined(ARCH_OS_WINDOWS)
@@ -311,8 +311,8 @@ struct Arch_ConstructorEntry {
};
// Declare the special sections.
-# pragma section(".pxrctor", read)
-# pragma section(".pxrdtor", read)
+# pragma section(".pxbctor", read)
+# pragma section(".pxbdtor", read)
// Objects of this type run the ARCH_CONSTRUCTOR and ARCH_DESTRUCTOR functions
// for the library containing the object in the c'tor and d'tor, respectively.
@@ -322,14 +322,14 @@ struct Arch_ConstructorInit {
ARCH_API ~Arch_ConstructorInit();
};
-// Emit an Arch_ConstructorEntry in the .pxrctor section. The
+// Emit an Arch_ConstructorEntry in the .pxbctor section. The
// arch_{c,d}tor_unused assignment is a workaround to ensure arch_{c,d}tor
// isn't removed when /Zc:inline is enabled. In clang/gcc we use
// __attribute__((used)) to do that.
# define ARCH_CONSTRUCTOR(_name, _priority) \
static void _name(); \
namespace { \
- __declspec(allocate(".pxrctor")) \
+ __declspec(allocate(".pxbctor")) \
static const Arch_ConstructorEntry \
_ARCH_CAT_NOEXPAND(arch_ctor_, _name) = { \
reinterpret_cast<Arch_ConstructorEntry::Type>(&_name), \
@@ -344,11 +344,11 @@ struct Arch_ConstructorInit {
_ARCH_ENSURE_PER_LIB_INIT(Arch_ConstructorInit, _archCtorInit); \
static void _name()
- // Emit a Arch_ConstructorEntry in the .pxrdtor section.
+ // Emit a Arch_ConstructorEntry in the .pxbdtor section.
# define ARCH_DESTRUCTOR(_name, _priority) \
static void _name(); \
namespace { \
- __declspec(allocate(".pxrdtor")) \
+ __declspec(allocate(".pxbdtor")) \
static const Arch_ConstructorEntry \
_ARCH_CAT_NOEXPAND(arch_dtor_, _name) = { \
reinterpret_cast<Arch_ConstructorEntry::Type>(&_name), \

View File

@@ -0,0 +1,88 @@
diff --git a/pxr/usd/usd/wrapObject.cpp b/pxr/usd/usd/wrapObject.cpp
index ac38cb3be6..3145591945 100644
--- a/pxr/usd/usd/wrapObject.cpp
+++ b/pxr/usd/usd/wrapObject.cpp
@@ -125,7 +125,9 @@ static size_t __hash__(const UsdObject &self) { return hash_value(self); }
// an exception instead of crashing from Python.
// Store the original __getattribute__ so we can dispatch to it after verifying
-// validity.
+// validity. Note that this TfPyObjWrapper is intentionally leaked to avoid
+// running Python refcount operations in its d'tor during process shutdown,
+// which is unsafe if Python has been finalized.
static TfStaticData<TfPyObjWrapper> _object__getattribute__;
// This function gets wrapped as __getattribute__ on UsdObject.
diff --git a/pxr/usd/usd/wrapPrimDefinition.cpp b/pxr/usd/usd/wrapPrimDefinition.cpp
index 890efcad9b..83453930d1 100644
--- a/pxr/usd/usd/wrapPrimDefinition.cpp
+++ b/pxr/usd/usd/wrapPrimDefinition.cpp
@@ -9,6 +9,7 @@
#include "pxr/usd/usd/pyConversions.h"
#include "pxr/usd/usd/prim.h"
+#include "pxr/base/tf/staticData.h"
#include "pxr/base/tf/pyResultConversions.h"
#include "pxr/external/boost/python.hpp"
@@ -94,8 +95,15 @@ _WrapAttributeGetFallbackValue(const UsdPrimDefinition::Attribute &self)
// Override that prevents crashing if an attempt is made to call data access
// methods on an invalid UsdPrimDefinition::Property from python.
+
+// Store the original __getattribute__ so we can dispatch to it after verifying
+// validity. Note that this TfPyObjWrapper is intentionally leaked to avoid
+// running Python refcount operations in its d'tor during process shutdown,
+// which is unsafe if Python has been finalized.
+static TfStaticData<TfPyObjWrapper> _object__getattribute__;
+
static object
-__getattribute__Impl(object selfObj, const char *name, const object &getattribute) {
+__getattribute__(object selfObj, const char *name) {
// Allow attribute lookups if the attribute name starts with '__', if the
// object's Property is valid, or if the attribute is one of a specific
// inclusion list.
@@ -105,7 +113,7 @@ __getattribute__Impl(object selfObj, const char *name, const object &getattribut
strcmp(name, "IsAttribute") == 0 ||
strcmp(name, "IsRelationship") == 0) {
// Dispatch to object's __getattribute__.
- return getattribute(selfObj, name);
+ return (*_object__getattribute__)(selfObj, name);
} else {
// Otherwise raise a runtime error.
TfPyThrowRuntimeError(
@@ -198,15 +206,10 @@ void wrapUsdPrimDefinition()
.def("GetVariability", &This::Property::GetVariability)
.def("GetDocumentation", &This::Property::GetDocumentation)
;
- // Override __getattribute__ to prevent crashing if an attempt is made
- // to call data access methods on an invalid UsdPrimDefinition::Property
- // from python.
- static object __getattribute__ = object(clsObj.attr("__getattribute__"));
- clsObj.def("__getattribute__",
- +[](object selfObj, const char *name) {
- return __getattribute__Impl(
- selfObj, name, __getattribute__);
- });
+
+ // Save existing __getattribute__ and replace.
+ *_object__getattribute__ = object(clsObj.attr("__getattribute__"));
+ clsObj.def("__getattribute__", __getattribute__);
}
class_<This::Attribute, bases<This::Property>>("Attribute")
diff --git a/pxr/usd/usd/wrapSchemaBase.cpp b/pxr/usd/usd/wrapSchemaBase.cpp
index 9b773997d1..d121741b29 100644
--- a/pxr/usd/usd/wrapSchemaBase.cpp
+++ b/pxr/usd/usd/wrapSchemaBase.cpp
@@ -26,7 +26,9 @@ using namespace pxr_boost::python;
// and raise an exception instead of crashing from Python.
// Store the original __getattribute__ so we can dispatch to it after verifying
-// validity.
+// validity. Note that this TfPyObjWrapper is intentionally leaked to avoid
+// running Python refcount operations in its d'tor during process shutdown,
+// which is unsafe if Python has been finalized.
static TfStaticData<TfPyObjWrapper> _object__getattribute__;
// This function gets wrapped as __getattribute__ on UsdSchemaBase.

View File

@@ -0,0 +1,539 @@
From e4d9aec762ae16eef82ff65fbb7b128cf901d85a Mon Sep 17 00:00:00 2001
From: Aleksi Sapon <aleksi.sapon@autodesk.com>
Date: Fri, 11 Apr 2025 17:33:55 -0400
Subject: [PATCH] build_usd.py now installs Vulkan dependencies
---
build_scripts/build_usd.py | 122 ++++++++++++++++++++-
cmake/defaults/Packages.cmake | 60 +++++++---
cmake/modules/FindShaderC.cmake | 41 +++++++
pxr/imaging/hdSt/codeGen.cpp | 5 +-
pxr/imaging/hgiVulkan/CMakeLists.txt | 1 -
pxr/imaging/hgiVulkan/device.cpp | 19 +++-
pxr/imaging/hgiVulkan/diagnostic.cpp | 2 +-
pxr/imaging/hgiVulkan/resourceBindings.cpp | 6 +-
pxr/imaging/hgiVulkan/sampler.cpp | 5 +-
pxr/imaging/hgiVulkan/vk_mem_alloc.cpp | 10 --
pxr/imaging/hgiVulkan/vk_mem_alloc.h | 15 ---
pxr/imaging/hgiVulkan/vulkan.h | 6 +-
pxr/pxrConfig.cmake.in | 26 +++++
13 files changed, 257 insertions(+), 61 deletions(-)
create mode 100644 cmake/modules/FindShaderC.cmake
delete mode 100644 pxr/imaging/hgiVulkan/vk_mem_alloc.cpp
delete mode 100644 pxr/imaging/hgiVulkan/vk_mem_alloc.h
diff --git a/build_scripts/build_usd.py b/build_scripts/build_usd.py
index f5a587d02ba..387c4cc973c 100644
--- a/build_scripts/build_usd.py
+++ b/build_scripts/build_usd.py
@@ -1661,6 +1661,86 @@ def InstallAnimX(context, force, buildArgs):
ANIMX = Dependency("AnimX", InstallAnimX, "include/animx.h")
+############################################################
+# Vulkan SDK components
+VULKAN_SDK_VERSION = "1.3.296.0"
+
+VULKAN_HEADERS_URL = f"https://github.com/KhronosGroup/Vulkan-Headers/archive/refs/tags/vulkan-sdk-{VULKAN_SDK_VERSION}.zip"
+def InstallVulkanHeaders(context, force, buildArgs):
+ with CurrentWorkingDirectory(DownloadURL(VULKAN_HEADERS_URL, context, force, destFileName=f'Vulkan-Headers-{VULKAN_SDK_VERSION}.zip')):
+ extraArgs = buildArgs + [
+ '-DVULKAN_HEADERS_ENABLE_INSTALL=ON',
+ '-DVULKAN_HEADERS_ENABLE_MODULE=OFF',
+ '-DVULKAN_HEADERS_ENABLE_TESTS=OFF',
+ ]
+ RunCMake(context, force, extraArgs)
+
+VULKAN_HEADERS = Dependency("Vulkan-Headers", InstallVulkanHeaders, "include/vulkan/vulkan.h")
+
+VULKAN_UTILITY_LIBRARIES_URL = f"https://github.com/KhronosGroup/Vulkan-Utility-Libraries/archive/refs/tags/vulkan-sdk-{VULKAN_SDK_VERSION}.zip"
+def InstallVulkanUtilityLibraries(context, force, buildArgs):
+ with CurrentWorkingDirectory(DownloadURL(VULKAN_UTILITY_LIBRARIES_URL, context, force, destFileName=f'Vulkan-Utility-Libraries-{VULKAN_SDK_VERSION}.zip')):
+ extraArgs = buildArgs + [
+ '-DBUILD_TESTS=OFF',
+ ]
+ RunCMake(context, force, extraArgs)
+
+VULKAN_UTILITY_LIBRARIES = Dependency("Vulkan-Utility-Libraries", InstallVulkanUtilityLibraries, "include/vulkan/vk_enum_string_helper.h")
+
+VULKAN_LOADER_URL = f"https://github.com/KhronosGroup/Vulkan-Loader/archive/refs/tags/vulkan-sdk-{VULKAN_SDK_VERSION}.zip"
+def InstallLoaderVulkan(context, force, buildArgs):
+ with CurrentWorkingDirectory(DownloadURL(VULKAN_LOADER_URL, context, force, destFileName=f'Vulkan-Loader-{VULKAN_SDK_VERSION}.zip')):
+ extraArgs = buildArgs + [
+ f'-DVULKAN_HEADERS_INSTALL_DIR={context.instDir}',
+ '-DBUILD_TESTS=OFF',
+ '-UPDATE_DEPS=ON',
+ ]
+ RunCMake(context, force, extraArgs)
+
+VULKAN_LOADER = Dependency("Vulkan-Loader", InstallLoaderVulkan, "lib/cmake/VulkanLoader/VulkanLoaderConfig.cmake")
+
+# The VulkanMemoryAllocator version should match the one used by VULKAN_SDK_VERSION
+VULKAN_MEMORY_ALLOCATOR_VERSION = "3.2.1"
+VULKAN_MEMORY_ALLOCATOR_URL = f"https://github.com/GPUOpen-LibrariesAndSDKs/VulkanMemoryAllocator/archive/refs/tags/v{VULKAN_MEMORY_ALLOCATOR_VERSION}.zip"
+def InstallVulkanMemoryAllocator(context, force, buildArgs):
+ with CurrentWorkingDirectory(DownloadURL(VULKAN_MEMORY_ALLOCATOR_URL, context, force, destFileName=f'VulkanMemoryAllocator-{VULKAN_MEMORY_ALLOCATOR_VERSION}.zip')):
+ extraArgs = buildArgs + [
+ '-DVMA_ENABLE_INSTALL=ON',
+ '-DVMA_BUILD_SAMPLES=OFF',
+ '-DVMA_BUILD_DOCUMENTATION=OFF',
+ ]
+ RunCMake(context, force, extraArgs)
+
+VULKAN_MEMORY_ALLOCATOR = Dependency("VulkanMemoryAllocator", InstallVulkanMemoryAllocator, "include/vk_mem_alloc.h")
+
+# The shaderc version should match the one used by VULKAN_SDK_VERSION
+SHADERC_VERSION = "2024.3"
+SHADERC_URL = f"https://github.com/google/shaderc/archive/refs/tags/v{SHADERC_VERSION}.zip"
+def InstallShaderC(context, force, buildArgs):
+ with CurrentWorkingDirectory(DownloadURL(SHADERC_URL, context, force, destFileName=f'shaderc-{SHADERC_VERSION}.zip')):
+ Run(f'"{sys.executable}" utils/git-sync-deps')
+ PatchFile("third_party/CMakeLists.txt", [
+ ('set( SKIP_GLSLANG_INSTALL ${SHADERC_SKIP_INSTALL} )\n',
+ 'set( SKIP_GLSLANG_INSTALL ON )\n'),
+ ('set( SKIP_SPIRV_TOOLS_INSTALL ${SHADERC_SKIP_INSTALL} )\n',
+ 'set( SKIP_SPIRV_TOOLS_INSTALL ON )\n'),
+ ('set( SKIP_GOOGLETEST_INSTALL ${SHADERC_SKIP_INSTALL} )\n',
+ 'set( SKIP_GOOGLETEST_INSTALL ON} )\n'),
+ (' set(GLSLANG_ENABLE_INSTALL $<NOT:${SKIP_GLSLANG_INSTALL}>)\n',
+ ' set(GLSLANG_ENABLE_INSTALL OFF)\n'),
+ ])
+ extraArgs = buildArgs + [
+ '-DSHADERC_SKIP_INSTALL=OFF',
+ '-DSHADERC_SKIP_TESTS=ON',
+ '-DSHADERC_SKIP_EXAMPLES=ON',
+ '-DSHADERC_SKIP_COPYRIGHT_CHECK=ON',
+ '-DSHADERC_ENABLE_SHARED_CRT=ON',
+ '-DSHADERC_ENABLE_WGSL_OUTPUT=OFF',
+ ]
+ RunCMake(context, force, extraArgs)
+
+SHADERC = Dependency("shaderc", InstallShaderC, "include/shaderc/shaderc.h")
+
############################################################
# USD
@@ -2177,6 +2257,14 @@ def InstallUSD(context, force, buildArgs):
default=False, help="Enable Vulkan support")
subgroup.add_argument("--no-vulkan", dest="enable_vulkan", action="store_false",
help="Disable Vulkan support (default)")
+group.add_argument("--use-vulkan-sdk", dest="use_vulkan_sdk", type=str,
+ nargs='?', default=None, const='',
+ help="Use the Vulkan SDK to build HgiVulkan, "
+ "otherwise the necessary components will be "
+ "installed automactically be the script. "
+ "The argument optionally takes a path to the "
+ "SDK root, otherwise the VULKAN_SDK environment "
+ "variable is required to be set.")
group = parser.add_argument_group(title="Imaging Plugin Options")
subgroup = group.add_mutually_exclusive_group()
@@ -2404,6 +2492,7 @@ def __init__(self, args):
self.enableVulkan = (self.buildImaging
and args.enable_vulkan
and not embedded)
+ self.useVuklanSDK = args.use_vulkan_sdk
# - USD Imaging
self.buildUsdImaging = (args.build_imaging == USD_IMAGING and
@@ -2520,6 +2609,24 @@ def ForceBuildDependency(self, dep):
if context.buildUsdview:
requiredDependencies += [PYOPENGL, PYSIDE]
+if context.enableVulkan:
+ if context.useVuklanSDK is None:
+ # We don't want to use the Vulkan SDK, we build our own components.
+ os.environ.pop('VULKAN_SDK', None)
+ requiredDependencies += [VULKAN_HEADERS, VULKAN_UTILITY_LIBRARIES,
+ VULKAN_LOADER, VULKAN_MEMORY_ALLOCATOR,
+ SHADERC]
+ elif context.useVuklanSDK == '':
+ # We use the Vulkan SDK from the environment
+ if not 'VULKAN_SDK' in os.environ:
+ PrintError("Vulkan support cannot be enabled when VULKAN_SDK "
+ "environment variable is not set")
+ sys.exit(1)
+ context.useVuklanSDK = os.environ['VULKAN_SDK']
+ else:
+ # We use the Vulkan SDK from the command line
+ os.environ['VULKAN_SDK'] = context.useVuklanSDK
+
if context.buildAnimXTests:
requiredDependencies += [ANIMX]
@@ -2546,12 +2653,6 @@ def ForceBuildDependency(self, dep):
PrintError("Windows ARM64 builds require oneTBB. Enable via the --onetbb argument")
sys.exit(1)
-# Error out if user enables Vulkan support but env var VULKAN_SDK is not set.
-if context.enableVulkan and not 'VULKAN_SDK' in os.environ:
- PrintError("Vulkan support cannot be enabled when VULKAN_SDK environment "
- "variable is not set")
- sys.exit(1)
-
if context.targetWasm:
if "--no-onetbb" in sys.argv:
PrintError("Wasm target requires oneTBB")
@@ -2776,6 +2877,14 @@ def _JoinVersion(v):
Embree support: {buildEmbree}
PRMan support: {buildPrman}
Vulkan support: {enableVulkan}
+"""
+
+if context.enableVulkan and context.useVuklanSDK:
+ summaryMsg += """\
+ Vulkan SDK: {useVuklanSDK}
+"""
+
+summaryMsg += """\
UsdImaging {buildUsdImaging}
usdview: {buildUsdview}
MaterialX support {buildMaterialX}
@@ -2866,6 +2975,7 @@ def FormatBuildArguments(buildArgs):
buildExamples=("On" if context.buildExamples else "Off"),
buildTutorials=("On" if context.buildTutorials else "Off"),
enableVulkan=("On" if context.enableVulkan else "Off"),
+ useVuklanSDK = context.useVuklanSDK,
buildTools=("On" if context.buildTools else "Off"),
buildUsdValidation=("On" if context.buildUsdValidation else "Off"),
buildAlembic=("On" if context.buildAlembic else "Off"),
diff --git a/cmake/defaults/Packages.cmake b/cmake/defaults/Packages.cmake
index 87425464620..aa8824692b9 100644
--- a/cmake/defaults/Packages.cmake
+++ b/cmake/defaults/Packages.cmake
@@ -199,22 +199,56 @@ if (PXR_BUILD_IMAGING)
endif()
if (PXR_ENABLE_VULKAN_SUPPORT)
message(STATUS "Enabling experimental feature Vulkan support")
- if (EXISTS $ENV{VULKAN_SDK})
- find_package(Vulkan REQUIRED COMPONENTS shaderc_combined)
- list(APPEND VULKAN_LIBS Vulkan::Vulkan Vulkan::shaderc_combined)
-
- # Find the OS specific libs we need
- if (UNIX AND NOT APPLE)
- find_package(X11 REQUIRED)
- list(APPEND VULKAN_LIBS ${X11_LIBRARIES})
- elseif (WIN32)
- # No extra libs required
- endif()
- add_definitions(-DPXR_VULKAN_SUPPORT_ENABLED)
+ # We use BUILD_LOCAL_INTERFACE so that the Vulkan dependencies remain
+ # internal only. Except for the headers, which are publicly accessible
+ # from hgiVulkan.
+ if (DEFINED ENV{VULKAN_SDK})
+ message(STATUS "Using Vulkan components from: \"$ENV{VULKAN_SDK}\"")
+ set(PXR_USING_VULKAN_SDK ON) # for pxrConfig.cmake
+
+ # Not using usd_build.py: find from the Vulkan SDK
+ find_package(Vulkan MODULE REQUIRED COMPONENTS shaderc_combined)
+
+ list(APPEND VULKAN_LIBS Vulkan::Headers)
+ # The SDK uniquely places the "vk_mem_alloc.h" header inside a "vma"
+ # subdirectory. This means we would need to use "#include <vma/vk_mem_alloc.h>"
+ # only for the SDK build. Instead of forcing non-SDK users to create
+ # this path, we'll add a another include directory for the SDK build.
+ # That way "#include <vk_mem_alloc.h>" should work for everyone.
+ target_include_directories(Vulkan::Headers INTERFACE
+ "${Vulkan_INCLUDE_DIR}/vma")
+
+ list(APPEND VULKAN_LIBS $<BUILD_LOCAL_INTERFACE:Vulkan::Vulkan>)
+ list(APPEND VULKAN_LIBS $<BUILD_LOCAL_INTERFACE:Vulkan::shaderc_combined>)
else()
- message(FATAL_ERROR "VULKAN_SDK not valid")
+ message(STATUS "Using locally built Vulkan components")
+ set(PXR_USING_VULKAN_SDK OFF) # for pxrConfig.cmake
+
+ # Using usd_build.py: find individual components
+ find_package(VulkanHeaders CONFIG REQUIRED)
+ list(APPEND VULKAN_LIBS Vulkan::Headers)
+
+ find_package(VulkanUtilityLibraries CONFIG REQUIRED)
+ list(APPEND VULKAN_LIBS Vulkan::UtilityHeaders)
+
+ find_package(VulkanLoader CONFIG REQUIRED)
+ list(APPEND VULKAN_LIBS $<BUILD_LOCAL_INTERFACE:Vulkan::Loader>)
+
+ find_package(VulkanMemoryAllocator CONFIG REQUIRED)
+ list(APPEND VULKAN_LIBS GPUOpen::VulkanMemoryAllocator)
+
+ find_package(ShaderC MODULE REQUIRED)
+ list(APPEND VULKAN_LIBS $<BUILD_LOCAL_INTERFACE:shaderc_combined>)
+ endif()
+
+ # Find the OS specific libs we need
+ if (UNIX AND NOT APPLE)
+ find_package(X11 REQUIRED)
+ list(APPEND VULKAN_LIBS $<BUILD_LOCAL_INTERFACE:X11::X11>)
endif()
+
+ add_definitions(-DPXR_VULKAN_SUPPORT_ENABLED)
endif()
# --Opensubdiv
set(OPENSUBDIV_USE_GPU ${PXR_BUILD_GPU_SUPPORT})
diff --git a/cmake/modules/FindShaderC.cmake b/cmake/modules/FindShaderC.cmake
new file mode 100644
index 00000000000..4dffb19bcc3
--- /dev/null
+++ b/cmake/modules/FindShaderC.cmake
@@ -0,0 +1,41 @@
+include(FindPackageHandleStandardArgs)
+
+find_path(shaderc_INCLUDE_DIR "shaderc/shaderc.h")
+find_library(shaderc_combined_LIBRARY "shaderc_combined")
+find_library(shaderc_combined_DEBUG_LIBRARY "shaderc_combinedd")
+
+set(shaderc_combined_release_or_debug "${shaderc_combined_LIBRARY}")
+if (NOT shaderc_combined_release_or_debug)
+ set(shaderc_combined_release_or_debug "${shaderc_combined_DEBUG_LIBRARY}")
+endif()
+
+find_package_handle_standard_args(ShaderC DEFAULT_MSG
+ shaderc_combined_release_or_debug
+ shaderc_INCLUDE_DIR)
+
+if (ShaderC_FOUND)
+ add_library(shaderc_combined STATIC IMPORTED)
+ target_include_directories(shaderc_combined INTERFACE "${shaderc_INCLUDE_DIR}")
+
+ if (shaderc_combined_LIBRARY AND NOT shaderc_combined_DEBUG_LIBRARY)
+ # Only one un-suffixed lib found: ambiguous configuration,
+ # so import using the generic IMPORTED_LOCATION.
+ set_target_properties(shaderc_combined PROPERTIES
+ IMPORTED_LOCATION ${shaderc_combined_LIBRARY})
+ else()
+ # We found a lib with a debug suffix so we can disambiguate.
+ set(found_configurations)
+ if (shaderc_combined_LIBRARY)
+ set_target_properties(shaderc_combined PROPERTIES
+ IMPORTED_LOCATION_RELEASE "${shaderc_combined_LIBRARY}")
+ list(APPEND found_configurations Release)
+ endif()
+ if (shaderc_combined_DEBUG_LIBRARY)
+ set_target_properties(shaderc_combined PROPERTIES
+ IMPORTED_LOCATION_DEBUG "${shaderc_combined_DEBUG_LIBRARY}")
+ list(APPEND found_configurations Debug)
+ endif()
+ set_target_properties(shaderc_combined PROPERTIES
+ IMPORTED_CONFIGURATIONS "${found_configurations}")
+ endif()
+endif()
diff --git a/pxr/imaging/hdSt/codeGen.cpp b/pxr/imaging/hdSt/codeGen.cpp
index c0178ec3b17..21991a22d7f 100644
--- a/pxr/imaging/hdSt/codeGen.cpp
+++ b/pxr/imaging/hdSt/codeGen.cpp
@@ -5324,8 +5324,8 @@ HdSt_CodeGen::_GenerateElementPrimvar()
// Don't need to codegen element primvars for frustum culling as they're
// unneeded. Including them can cause errors in Hgi backends like Vulkan,
// which needs the resource layout made in HgiVulkanResourceBindings to
- // match the one generated by SPIRV-Reflect in HgiVulkanGraphicsPipeline
- // when creating the VkPipelineLayout.
+ // match the one generated in HgiVulkanGraphicsPipeline when creating the
+ // VkPipelineLayout.
if (_geometricShader->IsFrustumCullingPass()) {
return;
}
@@ -6981,4 +6981,3 @@ HdSt_CodeGen::_GetFallbackScalarSwizzleString(TfToken const &returnType,
}
PXR_NAMESPACE_CLOSE_SCOPE
-
diff --git a/pxr/imaging/hgiVulkan/CMakeLists.txt b/pxr/imaging/hgiVulkan/CMakeLists.txt
index e98893d3f0f..772c3edb640 100644
--- a/pxr/imaging/hgiVulkan/CMakeLists.txt
+++ b/pxr/imaging/hgiVulkan/CMakeLists.txt
@@ -41,7 +41,6 @@ pxr_library(hgiVulkan
shaderProgram
shaderSection
texture
- vk_mem_alloc
PUBLIC_HEADERS
api.h
diff --git a/pxr/imaging/hgiVulkan/device.cpp b/pxr/imaging/hgiVulkan/device.cpp
index a1c44143a95..28fb8d91bfc 100644
--- a/pxr/imaging/hgiVulkan/device.cpp
+++ b/pxr/imaging/hgiVulkan/device.cpp
@@ -11,10 +11,12 @@
#include "pxr/imaging/hgiVulkan/hgi.h"
#include "pxr/imaging/hgiVulkan/instance.h"
#include "pxr/imaging/hgiVulkan/pipelineCache.h"
-#include "pxr/imaging/hgiVulkan/vk_mem_alloc.h"
#include "pxr/base/tf/diagnostic.h"
+#define VMA_IMPLEMENTATION
+#include <vk_mem_alloc.h>
+
PXR_NAMESPACE_OPEN_SCOPE
@@ -179,11 +181,9 @@ HgiVulkanDevice::HgiVulkanDevice(HgiVulkanInstance* instance)
// Allow certain buffers/images to have dedicated memory allocations to
// improve performance on some GPUs.
- bool dedicatedAllocations = false;
if (IsSupportedExtension(VK_KHR_GET_MEMORY_REQUIREMENTS_2_EXTENSION_NAME)
&& IsSupportedExtension(VK_KHR_DEDICATED_ALLOCATION_EXTENSION_NAME))
{
- dedicatedAllocations = true;
extensions.push_back(VK_KHR_GET_MEMORY_REQUIREMENTS_2_EXTENSION_NAME);
extensions.push_back(VK_KHR_DEDICATED_ALLOCATION_EXTENSION_NAME);
}
@@ -400,9 +400,16 @@ HgiVulkanDevice::HgiVulkanDevice(HgiVulkanInstance* instance)
allocatorInfo.instance = instance->GetVulkanInstance();
allocatorInfo.physicalDevice = _vkPhysicalDevice;
allocatorInfo.device = _vkDevice;
- if (dedicatedAllocations) {
- allocatorInfo.flags |=VMA_ALLOCATOR_CREATE_KHR_DEDICATED_ALLOCATION_BIT;
- }
+
+ // Enable to use Vulkan 1.3 at runtime
+ // With Vulkan 1.3, VMA would be able to apply more optimizations.
+ allocatorInfo.vulkanApiVersion = VK_API_VERSION_1_3;
+
+ // VMA will fill the other pointers itself.
+ VmaVulkanFunctions vmaVulkanFunctions{};
+ vmaVulkanFunctions.vkGetInstanceProcAddr = &vkGetInstanceProcAddr;
+ vmaVulkanFunctions.vkGetDeviceProcAddr = &vkGetDeviceProcAddr;
+ allocatorInfo.pVulkanFunctions = &vmaVulkanFunctions;
if (supportsMemExtension) {
allocatorInfo.flags |= VMA_ALLOCATOR_CREATE_EXT_MEMORY_BUDGET_BIT;
diff --git a/pxr/imaging/hgiVulkan/diagnostic.cpp b/pxr/imaging/hgiVulkan/diagnostic.cpp
index f2e69ba6b34..e4a6ee0601c 100644
--- a/pxr/imaging/hgiVulkan/diagnostic.cpp
+++ b/pxr/imaging/hgiVulkan/diagnostic.cpp
@@ -300,4 +300,4 @@ HgiVulkanResultString(VkResult result)
return string_VkResult(result);
}
-PXR_NAMESPACE_CLOSE_SCOPE
\ No newline at end of file
+PXR_NAMESPACE_CLOSE_SCOPE
diff --git a/pxr/imaging/hgiVulkan/resourceBindings.cpp b/pxr/imaging/hgiVulkan/resourceBindings.cpp
index df363d2461a..a1061a99d2f 100644
--- a/pxr/imaging/hgiVulkan/resourceBindings.cpp
+++ b/pxr/imaging/hgiVulkan/resourceBindings.cpp
@@ -98,8 +98,8 @@ HgiVulkanResourceBindings::HgiVulkanResourceBindings(
uint32_t textureBindIndexStart = 0;
// XXX We need to overspecify the stage usage here so we can match the
- // VkDescriptorSetLayout that is created with spirv-reflect for the
- // graphics and compute pipelines.
+ // VkDescriptorSetLayout that is created for the graphics and compute
+ // pipelines.
VkShaderStageFlags const bufferShaderStageFlags =
HgiVulkanConversions::GetShaderStages(
HgiShaderStageVertex | HgiShaderStageTessellationControl |
@@ -406,4 +406,4 @@ HgiVulkanResourceBindings::GetInflightBits()
return _inflightBits;
}
-PXR_NAMESPACE_CLOSE_SCOPE
\ No newline at end of file
+PXR_NAMESPACE_CLOSE_SCOPE
diff --git a/pxr/imaging/hgiVulkan/sampler.cpp b/pxr/imaging/hgiVulkan/sampler.cpp
index 707cb98e6..947a7e9b4 100644
--- a/pxr/imaging/hgiVulkan/sampler.cpp
+++ b/pxr/imaging/hgiVulkan/sampler.cpp
@@ -13,7 +13,7 @@
#include "pxr/imaging/hgiVulkan/diagnostic.h"
#include <algorithm>
-#include <float.h>
+#include <cfloat>
PXR_NAMESPACE_OPEN_SCOPE
diff --git a/pxr/imaging/hgiVulkan/vk_mem_alloc.cpp b/pxr/imaging/hgiVulkan/vk_mem_alloc.cpp
deleted file mode 100644
index 8f47ddc85f4..00000000000
--- a/pxr/imaging/hgiVulkan/vk_mem_alloc.cpp
+++ /dev/null
@@ -1,10 +0,0 @@
-//
-// Copyright 2023 Pixar
-//
-// Licensed under the terms set forth in the LICENSE.txt file available at
-// https://openusd.org/license.
-//
-#include "pxr/imaging/hgiVulkan/vk_mem_alloc.h"
-
-#define VMA_IMPLEMENTATION
-#include <vma/vk_mem_alloc.h>
diff --git a/pxr/imaging/hgiVulkan/vk_mem_alloc.h b/pxr/imaging/hgiVulkan/vk_mem_alloc.h
deleted file mode 100644
index 48f5fceff2e..00000000000
--- a/pxr/imaging/hgiVulkan/vk_mem_alloc.h
+++ /dev/null
@@ -1,15 +0,0 @@
-//
-// Copyright 2023 Pixar
-//
-// Licensed under the terms set forth in the LICENSE.txt file available at
-// https://openusd.org/license.
-//
-#ifndef PXR_IMAGING_HGIVULKAN_VK_MEM_ALLOC_H
-#define PXR_IMAGING_HGIVULKAN_VK_MEM_ALLOC_H
-
-// This is an implementation of VMA (Vulkan Memory Allocator) included
-// from the Vulkan SDK.
-
-#include <vma/vk_mem_alloc.h>
-
-#endif
diff --git a/pxr/imaging/hgiVulkan/vulkan.h b/pxr/imaging/hgiVulkan/vulkan.h
index 2e8f590646c..70b539211ad 100644
--- a/pxr/imaging/hgiVulkan/vulkan.h
+++ b/pxr/imaging/hgiVulkan/vulkan.h
@@ -35,7 +35,11 @@
#define VK_EXTERNAL_MEMORY_HANDLE_AUTO 0
#endif
-#include "pxr/imaging/hgiVulkan/vk_mem_alloc.h"
+#define VMA_STATIC_VULKAN_FUNCTIONS 1
+// Allow dynamic fetching too. This is a fallback for anything that doesn't
+// have a prototype.
+#define VMA_DYNAMIC_VULKAN_FUNCTIONS 1
+#include <vk_mem_alloc.h>
// Use the default allocator (nullptr)
inline VkAllocationCallbacks*
diff --git a/pxr/pxrConfig.cmake.in b/pxr/pxrConfig.cmake.in
index b83cf3d7309..d59d9a5070f 100644
--- a/pxr/pxrConfig.cmake.in
+++ b/pxr/pxrConfig.cmake.in
@@ -115,6 +115,32 @@ if(NOT "@PXR_WORK_IMPL_PACKAGE@" STREQUAL "")
find_dependency(@PXR_WORK_IMPL_PACKAGE@)
endif()
+if(@PXR_ENABLE_VULKAN_SUPPORT@)
+ if(@PXR_USING_VULKAN_SDK@)
+ if(NOT DEFINED Vulkan_DIR AND NOT [[@Vulkan_DIR@]] STREQUAL "")
+ set(Vulkan_DIR [[@Vulkan_DIR@]])
+ endif()
+ find_dependency(Vulkan MODULE)
+ if(Vulkan_FOUND)
+ target_include_directories(Vulkan::Headers INTERFACE
+ "${Vulkan_INCLUDE_DIR}/vma")
+ endif()
+ else()
+ if (NOT DEFINED VulkanHeaders_DIR AND NOT [[@VulkanHeaders_DIR@]] STREQUAL "")
+ set(VulkanHeaders_DIR [[@VulkanHeaders_DIR@]])
+ endif()
+ if (NOT DEFINED VulkanUtilityLibraries_DIR AND NOT [[@VulkanUtilityLibraries_DIR@]] STREQUAL "")
+ set(VulkanUtilityLibraries_DIR [[@VulkanUtilityLibraries_DIR@]])
+ endif()
+ if (NOT DEFINED VulkanMemoryAllocator_DIR AND NOT [[@VulkanMemoryAllocator_DIR@]] STREQUAL "")
+ set(VulkanMemoryAllocator_DIR [[@VulkanMemoryAllocator_DIR@]])
+ endif()
+ find_dependency(VulkanHeaders CONFIG)
+ find_dependency(VulkanUtilityLibraries CONFIG)
+ find_dependency(VulkanMemoryAllocator CONFIG)
+ endif()
+endif()
+
include("${PXR_CMAKE_DIR}/cmake/pxrTargets.cmake")
if (TARGET usd_ms)
set(libs "usd_ms")

View File

@@ -0,0 +1,21 @@
--- a/cmake/defaults/Packages.cmake 2025-08-20 13:06:07.093053300 -0700
+++ b/cmake/defaults/Packages.cmake 2025-08-20 13:47:11.656614900 -0700
@@ -20,18 +20,6 @@
find_package(Threads REQUIRED)
set(PXR_THREAD_LIBS "${CMAKE_THREAD_LIBS_INIT}")
-if(PXR_ENABLE_OPENVDB_SUPPORT)
- # Find Boost package before getting any boost specific components as we need to
- # disable boost-provided cmake config, based on the boost version found.
- find_package(Boost REQUIRED)
- # If a user explicitly sets Boost_NO_BOOST_CMAKE to On, following will
- # disable the use of boost provided cmake config.
- option(Boost_NO_BOOST_CMAKE "Disable boost-provided cmake config" OFF)
- if (Boost_NO_BOOST_CMAKE)
- message(STATUS "Disabling boost-provided cmake config")
- endif()
-endif()
-
if(PXR_ENABLE_PYTHON_SUPPORT)
# 1--Python.
macro(setup_python_package package)

View File

@@ -0,0 +1,22 @@
diff --git a/pxr/imaging/hdSt/renderDelegate.cpp b/pxr/imaging/hdSt/renderDelegate.cpp
index d430b824c..2cae24678 100644
--- a/pxr/imaging/hdSt/renderDelegate.cpp
+++ b/pxr/imaging/hdSt/renderDelegate.cpp
@@ -567,13 +567,10 @@ bool
HdStRenderDelegate::IsSupported(
HdRendererCreateArgs const& rendererCreateArgs)
{
- if (rendererCreateArgs.hgi) {
- return rendererCreateArgs.hgi->IsBackendSupported();
- }
-
- // If invalid Hgi instance is provided, check support for platform default
- // Hgi.
- return Hgi::IsSupported();
+ // BLENDER: This doesn't take into account the backend, and fails for Vulkan
+ // because it defaults to OpenGL. Instead assume Blender already succeeded
+ // creating a relevant GPU device before using Storm.
+ return true;
}
TfTokenVector

View File

@@ -0,0 +1,32 @@
commit aedfa981065793673eaade6645490aedb043df59
Author: Jeroen Bakker <jeroen@blender.org>
Date: Mon Dec 22 13:39:27 2025 +0100
HgiVulkan: Incorrect Surface Check
The current code only checks if the base surface extension is available,
but doesn't check if the platform specific surface extension is
available. Resulting in the `_hasPresentation` to be set in cases where it
shouldn't.
Detected when trying to render via SSH using Vulkan.
See https://projects.blender.org/blender/blender/issues/149631 for
information.
Revert instance changes
diff --git a/pxr/imaging/hgiVulkan/device.cpp b/pxr/imaging/hgiVulkan/device.cpp
index 4d6c3ec05..6900849a7 100644
--- a/pxr/imaging/hgiVulkan/device.cpp
+++ b/pxr/imaging/hgiVulkan/device.cpp
@@ -62,6 +62,10 @@ _SupportsPresentation(
physicalDevice, familyIndex);
#elif defined(VK_USE_PLATFORM_XLIB_KHR)
Display* dsp = XOpenDisplay(nullptr);
+ // Allow headless rendering
+ if (dsp == nullptr) {
+ return true;
+ }
VisualID visualID = XVisualIDFromVisual(
DefaultVisual(dsp, DefaultScreen(dsp)));
return vkGetPhysicalDeviceXlibPresentationSupportKHR(

View File

@@ -0,0 +1,11 @@
diff -Naur orig/configure external_vpx/configure
--- orig/configure 2022-07-06 09:22:04 -0600
+++ external_vpx/configure 2022-07-06 09:24:12 -0600
@@ -270,7 +270,6 @@
HAVE_LIST="
${ARCH_EXT_LIST}
vpx_ports
- pthread_h
unistd_h
"
EXPERIMENT_LIST="

View File

@@ -0,0 +1,15 @@
diff --git a/configure b/configure
index 6f95e2314..e677e36f4 100644
--- a/configure
+++ b/configure
@@ -606,9 +606,9 @@ if [[ $host_os = mingw* || $host_os = msys* || $host_os = cygwin* ]]; then
if cc_check '' -Qdiag-error:10006,10157 ; then
CHECK_CFLAGS="$CHECK_CFLAGS -Qdiag-error:10006,10157"
fi
- elif [[ "$cc_base" = cl || "$cc_base" = cl[\ .]* ]]; then
+ elif [[ "$cc_base" = cl || "$cc_base" = cl[\ .]* || "$cc_base" = clang-cl || "$cc_base" = clang-cl[\ .]* ]]; then
# Standard Microsoft Visual Studio
compiler=CL
compiler_style=MS
CFLAGS="$CFLAGS -nologo -GS- -DHAVE_STRING_H -I\$(SRCPATH)/extras"
cpp_check '' '' '_MSC_VER > 1800 || (_MSC_VER == 1800 && _MSC_FULL_VER >= 180030324)' || die "Microsoft Visual Studio support requires Visual Studio 2013 Update 2 or newer"

View File

@@ -0,0 +1,15 @@
diff --git a/source/CMakeLists.txt b/source/CMakeLists.txt
index ab5ddfe..50e9a05 100755
--- a/source/CMakeLists.txt
--- b/source/CMakeLists.txt
@@ -478,6 +478,10 @@ if(ARM64)
endif()
endif(ARM64)
+if(APPLE)
+ list(APPEND ASM_FLAGS -isysroot ${CMAKE_OSX_SYSROOT} -mmacosx-version-min=${CMAKE_OSX_DEPLOYMENT_TARGET})
+endif()
+
option(WARNINGS_AS_ERRORS "Stop compiles on first warning" OFF)
if(WARNINGS_AS_ERRORS)
if(GCC)

View File

@@ -0,0 +1,49 @@
diff --git a/source/CMakeLists.txt b/source/CMakeLists.txt
index c74db2179..bb8fb3c29 100755
--- a/source/CMakeLists.txt
+++ b/source/CMakeLists.txt
@@ -378,7 +378,7 @@ if(GCC)
endif()
endif()
endif(ENABLE_AGGRESSIVE_CHECKS)
- execute_process(COMMAND ${CMAKE_CXX_COMPILER} -dumpversion OUTPUT_VARIABLE CC_VERSION)
+ #execute_process(COMMAND ${CMAKE_CXX_COMPILER} -dumpversion OUTPUT_VARIABLE CC_VERSION)
endif(GCC)
find_package(Nasm)
diff --git a/source/dynamicHDR10/CMakeLists.txt b/source/dynamicHDR10/CMakeLists.txt
index 22fb79d44..ad0f3a7a8 100644
--- a/source/dynamicHDR10/CMakeLists.txt
+++ b/source/dynamicHDR10/CMakeLists.txt
@@ -140,7 +140,7 @@ if(GCC)
endif()
endif()
endif(ENABLE_AGGRESSIVE_CHECKS)
- execute_process(COMMAND ${CMAKE_CXX_COMPILER} -dumpversion OUTPUT_VARIABLE CC_VERSION)
+ #execute_process(COMMAND ${CMAKE_CXX_COMPILER} -dumpversion OUTPUT_VARIABLE CC_VERSION)
endif(GCC)
# Build options
diff --git a/source/common/cpu.cpp b/source/common/cpu.cpp
index ae0907890..4d4c7dd97 100644
--- a/source/common/cpu.cpp
+++ b/source/common/cpu.cpp
@@ -61,6 +61,10 @@ static void sigill_handler(int sig)
#endif // if X265_ARCH_ARM
+#if X265_ARCH_ARM64
+#include "aarch64/cpu.h"
+#endif // if X265_ARCH_ARM64
+
namespace X265_NS {
static bool enable512 = false;
const cpu_name_t cpu_names[] =
@@ -390,7 +394,6 @@ uint32_t cpu_detect(bool benableavx512)
}
#elif X265_ARCH_ARM64
-#include "aarch64/cpu.h"
uint32_t cpu_detect(bool benableavx512)
{

View File

@@ -0,0 +1,13 @@
diff --git a/zconf.h.cmakein b/zconf.h.cmakein
index 247ba24..e5c16e6 100644
--- a/zconf.h.cmakein
+++ b/zconf.h.cmakein
@@ -439,7 +439,7 @@ typedef uLong FAR uLongf;
typedef unsigned long z_crc_t;
#endif
-#ifdef HAVE_UNISTD_H /* may be set to #if 1 by ./configure */
+#if defined(HAVE_UNISTD_H) && HAVE_UNISTD_H /* may be set to #if 1 by ./configure */
# define Z_HAVE_UNISTD_H
#endif