Compare commits

...
23 Commits
Author SHA1 Message Date
Larry Gritz 89ba4196a5 Stage for v1.13.8.0
Signed-off-by: Larry Gritz <lg@larrygritz.com>
2024-04-01 11:43:55 -07:00
Larry Gritz 060c89d007 cleanup: Change long-deprecated OIIO macro to new one (#1788)
Signed-off-by: Larry Gritz <lg@larrygritz.com>
2024-04-01 11:08:40 -07:00
sfriedmapixar b86f0b94bb fix: Print closure missing error message at compile time instead of run time. (#1781)
Prevent complications on the GPU by printing error messages at compile time instead of generating code to print them at runtime when a closure doesn't exist.

---------

Signed-off-by: Stephen Friedman <sfriedma@pixar.com>
2024-04-01 11:08:31 -07:00
sfriedmapixar e9a78a2824 fix: calculatenormal needs fliphandedness (#1783)
* Have OSL indicate when it needs fliphandedness in shader globals.

* Add testsuite test to check that calculatenormal() triggers a globals_needed flipHandedness value.

---------

Signed-off-by: Stephen Friedman <sfriedma@pixar.com>
2024-04-01 11:07:57 -07:00
Larry Gritz 2c7c4f2f36 ci: Allow triggering CI workflow from web (#1779)
Signed-off-by: Larry Gritz <lg@larrygritz.com>
2024-03-07 21:28:06 -08:00
Larry Gritz 54f36c42bb ci: Fix broken Macos-13 CI (#1780)
Signed-off-by: Larry Gritz <lg@larrygritz.com>
2024-03-07 21:27:58 -08:00
Alex Wells 5eac061c6e fix(batched): codegen bug for compref with varying index (#1776)
Fix bug in batched codegen of compref when the index is varying.
The loadvalue was left to defaulted to uniform load, which we can't store into a varying/wide result.
Fixed similar bug in getmessage, and added check for spline knotcount to be uniform (although varying support could be added).

This bug exposed a missed optimization in BatchedAnalyser where a early out (return) needs to change the conditional to be varying to support masking.  However no check was being done to see if the loop control existed higher in the callstack.  So now the execution scope tracks loop nesting depth to see if the current function is really in a loop or not.  This allows the loop control flow to remain uniform (avoiding masking and more complex control flow).

Added nestloop-reg to testsuite to reproduce bug and verify its fixed.

---------

Signed-off-by: Alex M. Wells <alex.m.wells@intel.com>
2024-03-07 21:27:48 -08:00
Larry Gritz b9907e1636 Bump version after release
Signed-off-by: Larry Gritz <lg@larrygritz.com>
2024-03-07 21:27:32 -08:00
Larry Gritz 5e47ef444e Stage for v1.13.7.0
Signed-off-by: Larry Gritz <lg@larrygritz.com>
2024-03-01 14:55:56 -08:00
olegul e94b0fec1e fix: Mute partio error prints (#1774)
Signed-off-by: Ole Gulbrandsen <olecgi@gmail.com>
2024-03-01 13:02:36 -08:00
Larry Gritz ee3403a916 Increase timeout for slow MacOS-13 runner
Signed-off-by: Larry Gritz <lg@larrygritz.com>
2024-02-27 17:51:08 -08:00
Larry Gritz da77f89205 ci: Test with Mac ARM runner (#1770)
Tweak results for ARM tests that have minor numerical differences and
update references.

Set parallel build level to nprocs+2 instead of hard-coding to be
better for the new runners having more cores than they used to.

Speed up macosx build of deps by using unity build of OIIO.

Fix runtest, was clobbering parameters to oiiodiff

Signed-off-by: Larry Gritz <lg@larrygritz.com>
2024-02-27 16:48:58 -08:00
Larry Gritz 5fede29c6e docs: Fix links to RTD docs from github landing page (#1768)
Signed-off-by: Larry Gritz <lg@larrygritz.com>
2024-02-15 13:35:49 -08:00
Larry Gritz 434914e7ee admin: Switch release announcement workflow to jmertic's awesome action (#1766)
Signed-off-by: Larry Gritz <lg@larrygritz.com>
2024-02-15 13:35:43 -08:00
Larry Gritz 726dc3ff0c Stage for release of v1.13.6.1
Signed-off-by: Larry Gritz <lg@larrygritz.com>
2024-02-01 00:22:53 -08:00
Larry Gritz a88d708bc8 admin: git blame ignore for recent formatting change
Signed-off-by: Larry Gritz <lg@larrygritz.com>
2024-02-01 00:20:17 -08:00
Larry Gritz 90d94caecb style: Reformat with clang-format 17 (modified PR 1761)
Signed-off-by: Larry Gritz <lg@larrygritz.com>
2024-02-01 00:18:36 -08:00
Larry Gritz 5da8e8c8bb style: Raise our formatting standard to clang-format 17 (#1761)
We had been using clang-format 14. Bump to 17 as our official
reference standard for formatting.

Moved the clang-format CI test from an aswf container to bare Ubuntu
to make it run faster -- it doesn't need to do a real build, so
there's no point wasting 2 minutes or so downloading a container holding
library dependencies it won't need.

Also fix a duplicate line in .clang-format that newer clang-format
complained about.

Document that it's specifically clang-format 17 that is our formatting
standard

Signed-off-by: Larry Gritz <lg@larrygritz.com>
2024-02-01 00:18:36 -08:00
Tim Grant 9ceac106fa fix: Fix NVPTX TargetMachine leak, etc. (#1763)
* Delete the NVPTX target machine in the LLVM_Util destructor.

* Initalize m_nvptx_target_machine to nullptr.

* Workaround clang/CUDA12 texref issue.

* Remove the unnecessary null check before deleting the NVPTX TargetMachine.

---------

Signed-off-by: Tim Grant <tgrant@nvidia.com>
2024-01-23 10:33:03 -08:00
Larry Gritz 726049ad49 fix(build): Remove unused ustrings (#1764)
A recent change in OIIO master made some of the ustring methods
"trivial", and somehow that makes these variables warn about being
unused, which it did not do before.

Signed-off-by: Larry Gritz <lg@larrygritz.com>
2024-01-18 16:22:28 -08:00
Larry Gritz 710d1154b3 ci: test against LLVM 17 (#1760)
Bump the "bleeding edge" test to LLVM 17, the "stable latest releases"
test to 16.

Cover clang 17 compilation with MacOS-13 build

Signed-off-by: Larry Gritz <lg@larrygritz.com>
2024-01-09 20:28:33 -08:00
Larry Gritz 04645499ab admin: Account for duplicate emails in the .mailmap (#1759)
Signed-off-by: Larry Gritz <lg@larrygritz.com>
2023-12-28 13:22:00 -08:00
Larry Gritz 0d9ab3c495 Stage for v1.13.6.0 (beta 1)
Signed-off-by: Larry Gritz <lg@larrygritz.com>
2023-12-20 12:26:30 -08:00
64 changed files with 670 additions and 715 deletions
-1
View File
@@ -4,7 +4,6 @@
Language: Cpp
BasedOnStyle: WebKit
SpaceBeforeParens: ControlStatements
AccessModifierOffset: -4
AlignAfterOpenBracket: Align
+4
View File
@@ -43,3 +43,7 @@ c1045f2c2845a98e661c7181932a031eb3c76063
# clang-format: the very last piece of the puzzle (#1555)
4ee62cd2ef05543f818f4d95a19efc1d684a7381
5be7c6bd4e7bd2e560cb6be8c06f11985384a87a
# Raise CI formatting standard to clang-format 17
a9ce35135e6c022d538a4a184fee1b5ce908aed8
90d94caecbb97141c9df63abc634be6e8394b6c3
+3 -3
View File
@@ -18,6 +18,6 @@
- [ ] I have updated the documentation, if applicable.
- [ ] I have ensured that the change is tested somewhere in the testsuite (adding new test cases if necessary).
- [ ] My code follows the prevailing code style of this project. If I haven't
already run clang-format before submitting, I definitely will look at the CI
test that runs clang-format and fix anything that it highlights as being
nonconforming.
already run clang-format v17 before submitting, I definitely will look at
the CI test that runs clang-format and fix anything that it highlights as
being nonconforming.
+50 -53
View File
@@ -23,6 +23,8 @@ on:
# Full nightly build, for the main project repo (not for forks)
- cron: "0 6 * * *"
if: github.repository == 'AcademySoftwareFoundation/OpenShadingLanguage'
workflow_dispatch:
# This allows manual triggering of the workflow from the web
permissions: read-all
@@ -217,25 +219,6 @@ jobs:
# texture system adequately and is able to ignore the benign
# "leaks."
# Test formatting. This test entry doesn't do a full build, it
# just runs clang-format on everything, and passes if nothing is
# misformatted. Upon failure, the build artifact will be the full
# source code with the formatting fixed (diffs will also appear in
# the console output).
- desc: "clang-format"
nametag: clang-format
runner: ubuntu-latest
container: aswftesting/ci-osl:2022-clang14
vfxyear: 2022
cxx_std: 17
openimageio_ver: release
python_ver: 3.9
simd: avx2,f16c
batched: b8_AVX2
skip_tests: 1
setenvs: export BUILDTARGET=clang-format
OPENIMAGEIO_CMAKE_FLAGS=-DUSE_PYTHON=0
# Test ABI stability. `abi_check` is the version or commit that we
# believe is the current standard against which we don't want to
# break the ABI. Basically, we will build that version as well as
@@ -255,7 +238,7 @@ jobs:
fmt_ver: 10.1.1
pybind11_ver: v2.10.0
skip_tests: 1
abi_check: 8374278a07d88358a6931dc2492f98ca49b21038
abi_check: 1726df72a9841df93bc74a5184d78cacb44b585d
setenvs: export OSL_CMAKE_FLAGS="-DOSL_BUILD_TESTS=0 -DBUILD_TESTING=OFF -DUSE_QT=0"
OPENIMAGEIO_CMAKE_FLAGS="-DUSE_PYTHON=0"
CMAKE_BUILD_TYPE=RelWithDebInfo
@@ -326,6 +309,7 @@ jobs:
run: |
mkdir -p abi_standard/build
pushd abi_standard
export LD_LIBRARY_PATH="${PWD}/build/lib:${LD_LIBRARY_PATH}"
src/build-scripts/ci-build.bash
popd
- name: Check ABI
@@ -379,7 +363,7 @@ jobs:
setenvs: export LLVM_VERSION=10.0.0
OPENIMAGEIO_CMAKE_FLAGS="-DBUILD_FMT_VERSION=7.0.1"
PUGIXML_VERSION=v1.10
- desc: latest releases gcc11/C++17 llvm15 boost1.71 exr3.2 py3.9 avx2 batch-b16avx512
- desc: latest releases gcc11/C++17 llvm16 boost1.71 exr3.2 py3.9 avx2 batch-b16avx512
nametag: linux-latest-releases
runner: ubuntu-22.04
cxx_compiler: g++-11
@@ -391,11 +375,11 @@ jobs:
python_ver: "3.10"
simd: avx2,f16c
batched: b8_AVX2,b8_AVX512,b16_AVX512
setenvs: export LLVM_VERSION=15.0.6
LLVM_DISTRO_NAME=ubuntu-18.04
setenvs: export LLVM_VERSION=16.0.4
LLVM_DISTRO_NAME=ubuntu-22.04
OPENCOLORIO_VERSION=v2.2.0
PUGIXML_VERSION=v1.13
- desc: bleeding edge gcc12/C++17 llvm16 oiio/ocio/exr/pybind-master boost1.71 py3.10 avx2 batch-b16avx512
- desc: bleeding edge gcc12/C++17 llvm17 oiio/ocio/exr/pybind-master boost1.71 py3.10 avx2 batch-b16avx512
nametag: linux-bleeding-edge
runner: ubuntu-22.04
cxx_compiler: g++-12
@@ -407,7 +391,7 @@ jobs:
python_ver: "3.10"
simd: avx2,f16c
batched: b8_AVX2,b8_AVX512,b16_AVX512
setenvs: export LLVM_VERSION=16.0.4
setenvs: export LLVM_VERSION=17.0.6
LLVM_DISTRO_NAME=ubuntu-22.04
OPENCOLORIO_VERSION=main
PUGIXML_VERSION=master
@@ -428,6 +412,27 @@ jobs:
LLVM_DISTRO_NAME=ubuntu-18.04
OPENCOLORIO_VERSION=v2.1.2
PUGIXML_VERSION=v1.11.4
# Test formatting. This test entry doesn't do a full build, it
# just runs clang-format on everything, and passes if nothing is
# misformatted. Upon failure, the build artifact will be the full
# source code with the formatting fixed (diffs will also appear in
# the console output).
- desc: "clang-format"
nametag: clang-format
runner: ubuntu-latest
container: aswftesting/ci-osl:2022-clang14
cxx_std: 17
extra_artifacts: "src/*.*"
openimageio_ver: release
python_ver: "3.10"
simd: avx2,f16c
batched: b8_AVX2
skip_tests: 1
setenvs: export BUILDTARGET=clang-format
LLVM_VERSION=17.0.6
LLVM_DISTRO_NAME=ubuntu-22.04
OPENIMAGEIO_CMAKE_FLAGS=-DUSE_PYTHON=0
QT_VERSION=0
runs-on: ${{matrix.runner}}
env:
@@ -482,45 +487,37 @@ jobs:
build/*.cmake
build/CMake*
build/testsuite/*/*.*
${{ matrix.extra_artifacts }}
macos:
name: "${{matrix.runner}} appleclang${{matrix.aclang}}/C++${{matrix.cxx_std}} py${{matrix.python_ver}} ${{matrix.desc}}"
name: "${{matrix.runner}} C++${{matrix.cxx_std}} py${{matrix.python_ver}} ${{matrix.desc}}"
strategy:
fail-fast: false
matrix:
include:
# - desc: MacOS-11
# runner: macos-11
# nametag: macos11-py310
# cc_compiler: /usr/local/opt/llvm@14/bin/clang
# cxx_compiler: /usr/local/opt/llvm@14/bin/clang++
# cxx_std: 17
# python_ver: "3.10"
# aclang: 13
# setenvs: export LLVMBREWVER="@14" DO_BREW_UPDATE=1
# OPENIMAGEIO_VERSION=release
# QT_BREW_VERSION="@5"
- desc: MacOS-12
runner: macos-12
nametag: macos12-p310
cc_compiler: /usr/local/opt/llvm@15/bin/clang
cxx_compiler: /usr/local/opt/llvm@15/bin/clang++
cxx_std: 17
python_ver: "3.10"
aclang: 13
setenvs: export LLVMBREWVER="@15" DO_BREW_UPDATE=1
OPENIMAGEIO_VERSION=master
- desc: MacOS-13
- desc: MacOS-13 llvm17
runner: macos-13
nametag: macos13-p311
cc_compiler: /usr/local/opt/llvm@15/bin/clang
cxx_compiler: /usr/local/opt/llvm@15/bin/clang++
cc_compiler: /usr/local/opt/llvm/bin/clang
cxx_compiler: /usr/local/opt/llvm/bin/clang++
cxx_std: 17
openimageio_ver: master
python_ver: "3.11"
aclang: 14
setenvs: export LLVMBREWVER="@15" DO_BREW_UPDATE=1
OPENIMAGEIO_VERSION=master
setenvs: export DO_BREW_UPDATE=1 CTEST_TEST_TIMEOUT=120
- desc: MacOS-14-ARM llvm17
runner: macos-14
nametag: macos14-arm-p311
cc_compiler: clang
cxx_compiler: clang++
Xcc_compiler: /usr/local/opt/llvm/bin/clang
Xcxx_compiler: /usr/local/opt/llvm/bin/clang++
cxx_std: 17
openimageio_ver: master
python_ver: "3.11"
aclang: 15
setenvs: export DO_BREW_UPDATE=1
runs-on: ${{matrix.runner}}
env:
@@ -549,7 +546,7 @@ jobs:
run: |
source src/build-scripts/install_homebrew_deps.bash
if [[ "$OPENIMAGEIO_VERSION" != "" ]] ; then \
OPENIMAGEIO_CMAKE_FLAGS="-DOIIO_BUILD_TESTS=0 -DUSE_OPENGL=0" ; \
OPENIMAGEIO_CMAKE_FLAGS="-DOIIO_BUILD_TESTS=0 -DUSE_OPENGL=0 -DCMAKE_UNITY_BUILD=ON" ; \
source src/build-scripts/build_openimageio.bash ; \
else \
brew install --display-times -q openimageio ; \
+10 -2
View File
@@ -1,3 +1,8 @@
# Copyright Contributors to the Open Shading Language project.
# SPDX-License-Identifier: BSD-3-Clause
# https://github.com/AcademySoftwareFoundation/OpenshadingLanguage
name: Publish Release Notice to ASWF Slack
on:
@@ -14,5 +19,8 @@ jobs:
- name: Notify Slack
id: slack
with:
slack_webhook_url: ${{ secrets.SLACK_WEBHOOK_RELEASES_URL }}
uses: fedecalendino/slack-release-notifier@8329c1c2d20055ff874ce3eaed7021735d17069d # v2.1.0
project_name: "Open Shading Language"
slack_bot_token: ${{ secrets.SLACK_BOT_TOKEN }}
slack_channel: "#release-announcements"
project_logo: "https://artwork.aswf.io/projects/openshadinglanguage/AcronymStack/Shaded/openshadinglanguage-AcronymStack-Shaded.png"
uses: jmertic/slack-release-notifier@main
+47
View File
@@ -0,0 +1,47 @@
# This file establishes email equivalences so we can resolve what look like
# multiple authors, but actually are the same author who has used multiple
# emails over the course of their involvement with the project.
#
# The format is any of the following:
# <CANONICAL-EMAIL> <alternate-email>
# CANONICAL-NAME <CANONICAL-EMAIL> <alternate-email>
# CANONICAL-NAME <CANONICAL-EMAIL> alternate-name <alternate-email>
#
# You can check for duplicates with this command:
# git shortlog -sne --all
# That command (and others) will use this file to collapse the duplicates.
#
# If you see any duplicates we don't account for here, or if you look at your
# own entry here and want a different name or email to be your canonical one
# (we may not have guessed correctly and matched your preferences), please
# file a PR with the edits to this file.
Adam Martinez <amartinez.cg@gmail.com> amartinez-cg <amartinez.cg@gmail.com>
Alejandro Conty <aconty@imageworks.com> aconty <aconty@gmail.com>
Alejandro Conty <aconty@imageworks.com> Alejandro Conty <aconty@gmail.com>
Alex M. Wells <alex.m.wells@intel.com> <alex.m.wells@intel.com>
Alex M. Wells <alex.m.wells@intel.com> <AlexMWells@users.noreply.github.com>
Alex M. Wells <alex.m.wells@intel.com> <awells-np@argon.sea.pixar.com>
Alexis Oblet <alob@mikrosimage.eu> Alexis Oblet <aoblet@users.noreply.github.com>
Brecht Van Lommel <brecht@blender.org> <brecht@solidangle.com>
Brecht Van Lommel <brecht@blender.org> Brecht Van Lommel <brechtvanlommel@gmail.com>
Chris Kulla <ckulla@gmail.com> <ckulla@imageworks.com>
Chris Kulla <ckulla@gmail.com> <fpsunflower@users.noreply.github.com>
Chris Kulla <ckulla@gmail.com> Christopher Kulla <ckulla@gmail.com>
Chris Kulla <ckulla@gmail.com> fpsunflower <ckulla@gmail.com>
Clifford Stein <cstein@imageworks.com> Cliff Stein <clifford.stein@gmail.com>
Clifford Stein <cstein@imageworks.com> cmstein <cstein@imageworks.com>
Declan Russell <declan.russell@autodesk.com> Declan Russell <i7709212@bournemouth.ac.uk>
Derek Haase <derekhaase@gmail.com> Derek Haase <dhaase@imageworks.com>
Esteban Tovagliari <ramenhdr@gmail.com> est77 <ramenhdr@gmail.com>
Henri Fousse <henri.fousse@free.fr> darkhorse64 <henri.fousse@free.fr>
Larry Gritz <lg@imageworks.com> <larrygritz@gmail.com>
Larry Gritz <lg@imageworks.com> <lg@larrygritz.com>
Roman Zulak <marsupial@users.noreply.github.com> <rzulak@imageworks.com>
Roman Zulak <marsupial@users.noreply.github.com> Frederich Munch <marsupial@users.noreply.github.com>
Roman Zulak <marsupial@users.noreply.github.com> marsupial <marsupial@users.noreply.github.com>
Ronan Keryell <Ronan.Keryell@amd.com> Ronan Keryell <Ronan.Keryell@silkan.com>
Steena Monteiro <steena.monteiro@intel.com> steena.monteiro <smonteir@ortce-sklaw.jf.intel.com>
Sven-Hendrik Haase <sh@lutzhaase.com> Sven-Hendrik Haase <svenstaro@gmail.com>
Tim Grant <tgrant@nvidia.com> Tim Grant <87798327+tgrant-nv@users.noreply.github.com>
Tim Grant <tgrant@nvidia.com> timgrant <timgrant@users.noreply.github.com>
+78 -15
View File
@@ -1,20 +1,47 @@
<!-- SPDX-License-Identifier: CC-BY-4.0 -->
<!-- Copyright Contributors to the Open Shading Language Project. -->
Release 1.13 -- October?? 2023 ?? (compared to 1.12)
--------------------------------------------------
### Dependency and standards requirements changes:
* OptiX 6.0 support has been removed. For GPU rendering with OptiX, a minimum
of OptiX 7.0 is required.
Release 1.13.8.0 -- 1 Apr 2024 (compared to 1.13.7.0)
--------------------------------------------------------
- *fix(batched)*: Codegen bug for compref with varying index for batched shading [#1776](https://github.com/AcademySoftwareFoundation/OpenImageIO/pull/1776) (by Alex Wells)
- *fix*: Calculatenormal needs fliphandedness [#1783](https://github.com/AcademySoftwareFoundation/OpenImageIO/pull/1783) (by sfriedmapixar)
- *fix*: Print closure missing error message at compile time instead of run time. [#1781](https://github.com/AcademySoftwareFoundation/OpenImageIO/pull/1781) (by sfriedmapixar)
- *int*: Change long-deprecated OIIO macro to new one [#1788](https://github.com/AcademySoftwareFoundation/OpenImageIO/pull/1788)
- *ci*: Fix broken Macos-13 CI [#1780](https://github.com/AcademySoftwareFoundation/OpenImageIO/pull/1780)
Release 1.13.7.0 -- 1 Mar 2024 (compared to 1.13.6.1)
--------------------------------------------------------
- *fix*: Mute partio error prints [#1774](https://github.com/AcademySoftwareFoundation/OpenImageIO/pull/1774) (by olegul)
- *ci*: Test with Mac ARM runner [#1770](https://github.com/AcademySoftwareFoundation/OpenImageIO/pull/1770)
- *docs*: Fix links to RTD docs from github landing page [#1768](https://github.com/AcademySoftwareFoundation/OpenImageIO/pull/1768)
- *admin*: Switch release announcement workflow to jmertic's awesome action [#1766](https://github.com/AcademySoftwareFoundation/OpenImageIO/pull/1766)
<br>
Release 1.13 -- Feb 1, 2024 (compared to 1.12)
===============================================
- beta 1: December 20, 2023
- release v1.13.6.1: Feb 1, 2024
### New minimum dependencies and compatibility changes:
* For GPU/OptiX mode, OptiX 6.0 support has been removed. For GPU rendering
with OptiX, a minimum of OptiX 7.0 is required, and the Cuda minimum has
been raised to 9.0 [#1737](https://github.com/AcademySoftwareFoundation/OpenImageIO/pull/1737)
* The minimum version OpenImageIO has been raised from 2.2 to 2.4. [#1591](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1591) [#1722](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1722)
(to 2.3 in 1.13.0.3, to 2.4 in 1.13.4.0)
* Raise minimum CMake dependency from 3.12 to 3.15 [#1724](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1724) (1.13.5.0)
* Raise minimum Imath/OpenEXR from 2.3 to 2.4.
* The minimum CMake dependency has been raised from 3.12 to 3.15
[#1724](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1724) (1.13.5.0)
* The minimum Imath/OpenEXR has been raised from 2.3 to 2.4. (Note: OSL 1.13
is probably the last major release family that will support Imath/OpenEXR
2.x.)
### OSL Language and oslc compiler:
* There have been no substantive changes to the OSL language in this release.
### API changes, new options, new ShadingSystem features (for renderer writers):
### ⛰️ API changes, new options, new ShadingSystem features (for renderer writers):
* A new `shadingStateUniform` pointer field was added to ShaderGlobals for
planned future expansion and improved GPU support. #1585 (1.13.1.0)
* Adding relaxed type-equivalency to ReParameter() [#1639](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1639) (by cmstein) (1.13.2.1)
@@ -40,7 +67,8 @@ Release 1.13 -- October?? 2023 ?? (compared to 1.12)
* Rs fmt specification - Journaling Algorithm for error, warning, fprintf
[#1702](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1702) (by Steena Monteiro) [#1711](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1711) [#1715](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1715) (1.13.5.0)
### SIMD batched shading mode
### 🚀 SIMD batched shading mode
* Fix some array overruns (asymptomatic, but still potentially buggy) in
common_ancestor_between. #1577 (1.13.0.2)
* Fix issue with closure keyword parameters. #1620 (1.13.2.0/1.12.8.0)
@@ -48,8 +76,11 @@ Release 1.13 -- October?? 2023 ?? (compared to 1.12)
(1.13.2.0/1.12.8.0)
* Fix support for closures with array types. #1630 (1.13.2.0/1.12.8.0)
* Fix bug with masked wide llvm_gen_closure() [#1637](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1637) (by danieldresser-ie) (1.13.2.1)
* Fix Force LLVM Boolean [#1717](https://github.com/AcademySoftwareFoundation/OpenImageIO/pull/1717) (by Alex Wells)
* Batched pointcloud if "index" is not passed [#1753](https://github.com/AcademySoftwareFoundation/OpenImageIO/pull/1753) (by Alex Wells)
### 🚀 OptiX GPU rendering
### OptiX GPU rendering
* OptiX 6.0 support has been removed. For GPU rendering with OptiX, a minimum
of OptiX 7.0 is required.
* Big overhaul/simplification of how strings are represented on the GPU: the
@@ -80,8 +111,10 @@ Release 1.13 -- October?? 2023 ?? (compared to 1.12)
* OptiX PTX pipeline overhaul [#1680](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1680) (by Tim Grant) (1.13.5.0)
* Perf: Don't insert redundant run layer calls inside a basic block
[#1665](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1665) [#1669](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1669) [#1672](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1672) (by Chris Hellmuth) (1.13.4.0)
* Fix NVPTX TargetMachine leak, etc. [#1763](https://github.com/AcademySoftwareFoundation/OpenImageIO/pull/1763) (by Tim Grant)
### 🐛/🔧 Internals: fixes, improvements, and developer concerns
### 🐛 Fixes and other improvements (internals)
* Fix memory leak in oslc ASTvariable_declaration. #1576 (1.13.0.2)
* Fix memory leaks in LPE code in error conditions. #1593 #1594 (1.13.0.3)
* Fix mismatched strides when calling OCIO for transformc with derivs [#1646](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1646) (1.13.4.0)
@@ -98,8 +131,6 @@ Release 1.13 -- October?? 2023 ?? (compared to 1.12)
* oslc: Add missing `fmod()` variants [#1643](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1643) (1.13.4.0)
* Simple constant folding of binary expressions now happen on the oslc side
[#1653](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1653) (1.13.4.0)
### 🔧 Internals and developer concerns
* platform.h:
* New `OSL_ALLOCA` macro to allocate on the stack. #1589 (1.13.0.3)
* Define OSL::bitcast utility. #1610 (1.13.2.0)
@@ -115,8 +146,12 @@ Release 1.13 -- October?? 2023 ?? (compared to 1.12)
* Give ShadingSystemImpl a handy use_optix() method [#1682](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1682) (1.13.4.0)
* Fix default fmt logic changing in latest openimageio release [#1725](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1725) (1.13.5.0)
* The recently added SS::find_symloc can have const args [#1723](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1723) (1.13.5.0)
* SymOverrideInfo bitfields should be the same type [#1745](https://github.com/AcademySoftwareFoundation/OpenImageIO/pull/1745)
* Fix wrong offset of MxSheen param [#1751](https://github.com/AcademySoftwareFoundation/OpenImageIO/pull/1751) (by Rasmus Bonnedal)
* Make get_texture_info robust to empty shaderglobals param [#1731](https://github.com/AcademySoftwareFoundation/OpenImageIO/pull/1731)
### 🏗 Build/test/CI and platform ports
* CMake build system and scripts:
* The version number is now a cache variable, and so can be overridden at
build time using `-DOSL_VERSION=...`. Use with extreme caution! #1579
@@ -127,8 +162,9 @@ Release 1.13 -- October?? 2023 ?? (compared to 1.12)
* Fix incorrect CMake variable name to control symbol visibility
[#1681](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1681) (1.13.4.0)
* Change cmake option `USE_OPTIX` -> `OSL_USE_OPTIX` [#1668](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1668) (1.13.4.0)
* Fix duplicate osl lexing symbols when building as static libraries
* Fix duplicate osl lexing symbols when building as static libraries
[#1709](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1709) (by Brecht Van Lommel) (1.13.5.0)
* Better cmake verbose behavior [#1752](https://github.com/AcademySoftwareFoundation/OpenImageIO/pull/1752)
* Dependency version support:
* Fix some issues that came up with the new icx 2022.0 compiler. #1601
(1.13.1.0)
@@ -140,6 +176,12 @@ Release 1.13 -- October?? 2023 ?? (compared to 1.12)
* Qt6 compatibility [#1655](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1655) (1.13.4.0)
* Fix warnings about Qt compilation and enums [#1661](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1661) (1.13.4.0)
* Changes to support fmt 10.0 [#1691](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1691) (1.13.5.0)
* Raise OpenEXR minimum to 2.4 [#1734](https://github.com/AcademySoftwareFoundation/OpenImageIO/pull/1734)
* Fix Partio build errors on pointcloud functions for MSVC [#1757](https://github.com/AcademySoftwareFoundation/OpenImageIO/pull/1757) (by Alex Wells)
* Bump Cuda minimum to 9.0 [#1737](https://github.com/AcademySoftwareFoundation/OpenImageIO/pull/1737)
* LLVM 16 and 17 support: LLVM opaque pointers support [#1728](https://github.com/AcademySoftwareFoundation/OpenImageIO/pull/1728),
LLVM new pass manager support [#1729](https://github.com/AcademySoftwareFoundation/OpenImageIO/pull/1729),
finish LLVM 16 and 17 support [#1730](https://github.com/AcademySoftwareFoundation/OpenImageIO/pull/1730) (all by Brecht Van Lommel)
* Testing and Continuous integration (CI) systems:
* Dynamic analysis using address and leak sanitizers. #1581 (1.13.0.3)
* `testshade --help` now prints TextureSystem options and all hardware
@@ -158,20 +200,41 @@ Release 1.13 -- October?? 2023 ?? (compared to 1.12)
[#1660](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1660) (by Massimo Paladin) (1.13.4.0)
* *ci*: Simplify build_llvm.bash script [#1703](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1703) (1.13.5.0)
* Test interactive parameter initialization in optix testrender [#1687](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1687) (by Chris Hellmuth) (1.13.5.0)
* Fix GPU job not actually enabling OptiX [#1738](https://github.com/AcademySoftwareFoundation/OpenImageIO/pull/1738) (by Brecht Van Lommel)
* Fix python-oslquery test failure on macOS [#1739](https://github.com/AcademySoftwareFoundation/OpenImageIO/pull/1739) (by Brecht Van Lommel)
* Disable MacOS-11 CI [#1746](https://github.com/AcademySoftwareFoundation/OpenImageIO/pull/1746)
* Skip analysis and scorecard workflows on push if only docs changed [#1744](https://github.com/AcademySoftwareFoundation/OpenImageIO/pull/1744)
* For clarity, use the term 'runner' instead of 'os' [#1743](https://github.com/AcademySoftwareFoundation/OpenImageIO/pull/1743)
* Test ABI compliance [#1748](https://github.com/AcademySoftwareFoundation/OpenImageIO/pull/1748)
* Fix tests passing when test commands fail [#1733](https://github.com/AcademySoftwareFoundation/OpenImageIO/pull/1733) (by Brecht Van Lommel)
* *ci*: Test against LLVM 17 [#1760](https://github.com/AcademySoftwareFoundation/OpenImageIO/pull/1760)
* Platform support:
* Include `immintrin.h` only when needed. #1605 (1.13.1.0)
* Changed snprintf formatting to satisfy some compilers.
[#1640](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1640) (by pellerington) (1.13.4.0)
* Fix some windows GPU build errors [#1638](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1638) (by Declan Russell) (1.13.4.0)
* Fix for Apple clang 14+ warnings [#1697](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1697) (1.13.5.0)
* Fix struct align/pack for MSVC [#1754](https://github.com/AcademySoftwareFoundation/OpenImageIO/pull/1754) (by Rasmus Bonnedal)
* Refactor icc/icx specific pragma macros [#1756](https://github.com/AcademySoftwareFoundation/OpenImageIO/pull/1756) (by Alex Wells)
### 📚 Documentation
* First stab at ReadTheDocs -- new [Experimental OSL Documentation on
ReadTheDocs](https://open-shading-language.readthedocs.io/)
is still a little rough, but eventually will be our primary documentation.
[#1736](https://github.com/AcademySoftwareFoundation/OpenImageIO/pull/1736)
* `doc/RELEASING.md` documents our release process and versioning policies.
#1572 (1.13.0.2)
* Improve documentation of `trace` function [#1671](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1671) (by AidanWelch) (1.13.4.0)
* Update CONTRIBUTING [#1689](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1689) (1.13.5.0)
* Update logos [#1705](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1705), Move logos and add an icon-only logo [#1707](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1707) (1.13.5.0)
### 🏢 Project Administration
* Alert slack "release-announcements" channel upon OSL release [#1740](https://github.com/AcademySoftwareFoundation/OpenImageIO/pull/1740) [#1749](https://github.com/AcademySoftwareFoundation/OpenImageIO/pull/1749)
* Update pull request template [#1741](https://github.com/AcademySoftwareFoundation/OpenImageIO/pull/1741)
* Account for duplicate emails in the .mailmap [#1759](https://github.com/AcademySoftwareFoundation/OpenImageIO/pull/1759)
---
---
+3 -3
View File
@@ -4,7 +4,7 @@
cmake_minimum_required (VERSION 3.15)
set (OSL_VERSION "1.13.5.0")
set (OSL_VERSION "1.13.8.0")
set (OSL_VERSION_OVERRIDE "" CACHE STRING
"Version override (use with caution)!")
mark_as_advanced (OSL_VERSION_OVERRIDE)
@@ -18,12 +18,12 @@ project (OSL VERSION ${OSL_VERSION}
set (PROJ_NAME ${PROJECT_NAME}) # short name
string (TOLOWER ${PROJ_NAME} PROJ_NAME_LOWER) # short name lower case
string (TOUPPER ${PROJ_NAME} PROJ_NAME_UPPER) # short name upper case
set (PROJECT_VERSION_RELEASE_TYPE "dev" CACHE STRING
set (PROJECT_VERSION_RELEASE_TYPE "" CACHE STRING
"Build type, for example: dev, beta2, RC1 (empty string for normal release)")
set (${PROJECT_NAME}_VERSION_RELEASE_TYPE ${PROJECT_VERSION_RELEASE_TYPE})
set (PROJECT_AUTHORS "Contributors to the Open Shading Language project")
option (${PROJECT_NAME}_SUPPORTED_RELEASE
"Set ON for supported release branch, OFF for master" OFF)
"Set ON for supported release branch, OFF for master" ON)
if (${PROJECT_NAME}_SUPPORTED_RELEASE)
set (${PROJECT_NAME}_DEV_RELEASE OFF)
else ()
+4 -3
View File
@@ -115,7 +115,8 @@ own repository on GitHub, and then clone it to get a repository on your
local machine.
2. Edit, compile, and test your changes. Run clang-format (see the
instructions on coding style below).
instructions on coding style below). Our current formatting standard,
as checked by our CI, uses clang-format 17.0.
3. Push your changes to your fork (each unrelated pull request to a separate
"topic branch", please).
@@ -170,14 +171,14 @@ file in which it appears.
#### Formatting
We use [clang-format](https://clang.llvm.org/docs/ClangFormat.html)
We use [clang-format](https://clang.llvm.org/docs/ClangFormat.html) v17
to uniformly format our source code prior to PR submission. Make sure that
clang-format is installed on your local machine, and just run
make clang-format
and it will automatically reformat your code according to the configuration
file found in the `.clang-format` file at the root directory of the OIIO
file found in the `.clang-format` file at the root directory of the OSL
source code checkout.
One of the CI test matrix entries runs clang-format and fails if any
+8 -8
View File
@@ -16,7 +16,7 @@ NEW or CHANGED dependencies since the last major release are **bold**.
* A suitable C++14 or C++17 compiler to build OSL itself, which may be any of:
- GCC 6.1 or newer (tested through gcc 12.1)
- Clang 3.4 or newer (tested through clang 16)
- Clang 3.4 or newer (tested through clang 17)
- Microsoft Visual Studio 2017 or newer
- Intel C++ compiler icc version 17 or newer or LLVM-based icx compiler
version 2022 or newer.
@@ -40,16 +40,15 @@ NEW or CHANGED dependencies since the last major release are **bold**.
$OpenImageIO_ROOT/lib to be in your LD_LIBRARY_PATH (or
DYLD_LIBRARY_PATH on OS X).
* [LLVM](http://www.llvm.org) 9, 10, 11, 12, 13, 14, or 15, including
clang libraries. LLVM 16 doesn't work yet, we need to make changes
on the OSL side to be compatible.
* [LLVM](http://www.llvm.org) 9, 10, 11, 12, 13, 14, 15, 16, or 17, including
clang libraries.
* (optional) For GPU rendering on NVIDIA GPUs:
* [OptiX](https://developer.nvidia.com/rtx/ray-tracing/optix) 7.0 or higher.
* [Cuda](https://developer.nvidia.com/cuda-downloads) 9.0 or higher. It is
recommended that you use 11.0 or higher.
* [Boost](https://www.boost.org) 1.55 or newer (tested through boost 1.82)
* [Boost](https://www.boost.org) 1.55 or newer (tested through boost 1.84)
* [Ilmbase or Imath](https://github.com/AcademySoftwareFoundation/Imath) 2.4
or newer (recommended: 3.1 or higher; tested through 3.2)
NOTE: It is likely that 1.13 is the last release that will support
@@ -65,12 +64,13 @@ NEW or CHANGED dependencies since the last major release are **bold**.
be operative.
* (optional) Python: If you are building the Python bindings or running the
testsuite:
* Python >= 2.7 (tested against 2.7, 3.7, 3.8, 3.9, 3.10)
* Python >= 2.7 (tested against 2.7, 3.7, 3.8, 3.9, 3.10, 3.11)
NOTE: It is likely that 1.13 is the last release that will support
Python 2.7.
* pybind11 >= 2.4.2 (Tested through 2.10)
* pybind11 >= 2.4.2 (Tested through 2.11. Note that pybind11 v2.10+ does
not support Python < 3.6.)
* NumPy
* (optional) Qt5 >= 5.6 or Qt6 (tested Qt5 through 5.15 and Qt6 through 6.4).
* (optional) Qt5 >= 5.6 or Qt6 (tested Qt5 through 5.15 and Qt6 through 6.6).
If not found at build time, the `osltoy` application will be disabled.
+27 -15
View File
@@ -9,7 +9,7 @@
[![Build Status](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/workflows/CI/badge.svg)](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/actions)
[![License](https://img.shields.io/badge/license-BSD%203--Clause-blue.svg?style=flat-square)](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/LICENSE.md)
[![CII Best Practices](https://bestpractices.coreinfrastructure.org/projects/3061/badge)](https://bestpractices.coreinfrastructure.org/projects/3061)
[![Documentation Status](https://readthedocs.org/projects/open-shading-language/badge/?version=main)](https://open-shading-language.readthedocs.io/en/main/?badge=main)
Introduction
@@ -452,7 +452,18 @@ The OSL language specification can be found at
distribution) or in the share/doc/OSL/osl-languagespec.pdf file of an
installed binary distribution.
For those interested in learning to program in OSL, there is the
[Experimental OSL Documentation on ReadTheDocs](https://open-shading-language.readthedocs.io/)
This will be the future documentation. It's probably as complete as the PDF,
but it needs some proofreading, so the PDF is still considered the
authoritative source for now. But some time soon, the old PDF specification
will be deprecated in favor of
this online documentation.
<!-- is the best place to start if you are interested in how to use OSL,
its APIs. -->
There is also a [PDF
version](https://readthedocs.org/projects/open-shading-language/downloads/pdf/latest/).
For those interested in learning to program shaders in OSL, there is the
[Siggraph 2022 Educator's Forum](https://dl.acm.org/doi/proceedings/10.1145/3532724)
[OSL Shaders for RenderMan](https://dl.acm.org/doi/abs/10.1145/3532724.3535604) course,
which uses RenderMan in the examples and
@@ -515,19 +526,20 @@ The current project leadership is documented in the
Many people have contributed features, bug fixes, and other changes to OSL
over the years: Steve Agland, Shane Ambler, Martijn Berger, Farchad
Bidgolirad, Nicholas Bishop, Solomon Boulos, Stefan Bruens, Stefan Büttner,
Matthaus G. Chajdas, Clark Chen, Alejandro Conty, Damien Courtois, Dieter De
Baets, Thomas Dinges, Daniel Dresser, Mads Drøschler, Peter Ellerington, Luke
Emrose, Louis Feng, Mark Final, Henri Fousse, Stephen Friedman, Syoyo Fujita,
Tim Grant, Larry Gritz, Nicolas Guiard, Euan Haahr, Derek Haase, Sven-Hendrik
Haase, John Haddon, Niklas Harrysson, Daniel Heckenberg, Chris Hellmuth,
Adrien Herubel, Dan Horák, Thiago Ize, Matt Johnson, Ronan Keryell, Chris
Kulla, Elvic Liang, Max Liani, Adam Martinez, John Mertic, Bastien Montagne,
Steena Monteiro, Patrick Mours, Alexis Oblet, Erich Ocean, Mikko Ohtamaa, Jino
Park, Alexei Pawlow, Jay Reynolds, Declan Russell, Benoit Ruiz, Patrick
Scheibe, Alex Schworer, Jonathan Scruggs, Sergey Sharybin, Mark Sisson, Sandip
Shukla, Cliff Stein, Stephan Steinbach, Luya Tshimbalanga, Esteban Tovagliari,
Brecht Van Lommel, Alexander von Knorring, Alex Wells, Roman Zulak. (Listed
Bidgolirad, Nicholas Bishop, Curtis Black, Rasmus Bonnedal, Solomon Boulos,
Stefan Bruens, Stefan Büttner, Matthaus G. Chajdas, Clark Chen, Alejandro
Conty, Damien Courtois, Dieter De Baets, Thomas Dinges, Daniel Dresser, Mads
Drøschler, Peter Ellerington, Luke Emrose, Louis Feng, Mark Final, Henri
Fousse, Stephen Friedman, Syoyo Fujita, Tim Grant, Larry Gritz, Nicolas
Guiard, Euan Haahr, Derek Haase, Sven-Hendrik Haase, John Haddon, Niklas
Harrysson, Daniel Heckenberg, Chris Hellmuth, Adrien Herubel, Dan Horák,
Thiago Ize, Matt Johnson, Ronan Keryell, Chris Kulla, Elvic Liang, Max Liani,
Adam Martinez, John Mertic, Bastien Montagne, Steena Monteiro, Patrick Mours,
Alexis Oblet, Erich Ocean, Mikko Ohtamaa, Jino Park, Alexei Pawlow, Jay
Reynolds, Declan Russell, Benoit Ruiz, Patrick Scheibe, Alex Schworer,
Jonathan Scruggs, Sergey Sharybin, Mark Sisson, Sandip Shukla, Cliff Stein,
Stephan Steinbach, Luya Tshimbalanga, Esteban Tovagliari, Brecht Van Lommel,
Alexander von Knorring, Aidan Welch, Alex Wells, Roman Zulak. (Listed
alphabetically; if we've left anybody out, it is inadvertent, please let us
know.)
+19 -5
View File
@@ -39,11 +39,6 @@ export CMAKE_GENERATOR=${CMAKE_GENERATOR:=Ninja}
export CMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE:=Release}
export CMAKE_CXX_STANDARD=${CMAKE_CXX_STANDARD:=11}
export PARALLEL=${PARALLEL:=4}
export PAR_MAKEFLAGS=-j${PARALLEL}
export CMAKE_BUILD_PARALLEL_LEVEL=${CMAKE_BUILD_PARALLEL_LEVEL:=${PARALLEL}}
export CTEST_PARALLEL_LEVEL=${CTEST_PARALLEL_LEVEL:=${PARALLEL}}
export LOCAL_DEPS_DIR=${LOCAL_DEPS_DIR:=$HOME/ext}
export CMAKE_PREFIX_PATH=${LOCAL_DEPS_DIR}/dist:${CMAKE_PREFIX_PATH}
export LD_LIBRARY_PATH=${LOCAL_DEPS_DIR}/dist/lib:$LD_LIBRARY_PATH
@@ -52,6 +47,25 @@ export DYLD_LIBRARY_PATH=${LOCAL_DEPS_DIR}/dist/lib:$DYLD_LIBRARY_PATH
export TESTSUITE_CLEANUP_ON_SUCCESS=${TESTSUITE_CLEANUP_ON_SUCCESS:=1}
# Parallel builds
if [[ `uname -s` == "Linux" ]] ; then
echo "procs: " `nproc`
head -40 /proc/cpuinfo
export PARALLEL=${PARALLEL:=$((2 + `nproc`))}
elif [[ "${RUNNER_OS}" == "macOS" ]] ; then
echo "procs: " `sysctl -n hw.ncpu`
sysctl machdep.cpu.features
export PARALLEL=${PARALLEL:=$((2 + `sysctl -n hw.ncpu`))}
elif [[ "${RUNNER_OS}" == "Windows" ]] ; then
# Presumably Windows
export PARALLEL=${PARALLEL:=$((2 + ${NUMBER_OF_PROCESSORS}))}
else
export PARALLEL=${PARALLEL:=6}
fi
export PAR_MAKEFLAGS=-j${PARALLEL}
export CMAKE_BUILD_PARALLEL_LEVEL=${CMAKE_BUILD_PARALLEL_LEVEL:=${PARALLEL}}
export CTEST_PARALLEL_LEVEL=${CTEST_PARALLEL_LEVEL:=${PARALLEL}}
mkdir -p build dist
echo "HOME = $HOME"
+18 -20
View File
@@ -19,9 +19,9 @@ if [[ `which brew` == "" ]] ; then
exit 1
fi
set -ex
# set -ex
if [[ "$DO_BREW_UPDATE" != "" ]] ; then
if [[ "${DO_BREW_UPDATE:=0}" != "0" ]] ; then
brew update >/dev/null
fi
echo ""
@@ -31,42 +31,40 @@ brew list --versions
brew install --display-times -q gcc ccache cmake ninja boost || true
brew link --overwrite gcc
brew install --display-times -q python@${PYTHON_VERSION} || true
# brew unlink python@2.7 || true
# brew unlink python@3.8 || true
# brew unlink python@3.9 || true
brew unlink python@3.10 || true
brew link --overwrite --force python@${PYTHON_VERSION} || true
brew upgrade --display-times -q cmake || true
brew install --display-times -q imath openexr
#brew upgrade --display-times -q cmake || true
brew install --display-times -q imath openexr opencolorio || true
#brew install --display-times -q freetype
brew install --display-times -q --overwrite --force opencolorio || true
brew install --display-times -q partio pugixml
brew install --display-times -q partio pugixml || true
brew install --display-times -q pybind11 numpy || true
brew install --display-times -q tbb || true
brew install --display-times -q openvdb || true
brew install --display-times -q flex bison
brew install --display-times -q fmt
brew install --display-times -q llvm${LLVMBREWVER}
brew install --display-times -q qt${QT_BREW_VERSION}
if [[ "${USE_QT}" != "0" ]] ; then
brew install --display-times -q qt${QT_VERSION}
fi
echo ""
echo "After brew installs:"
brew list --versions
# Needed on some systems
if [[ $PYTHON_VERSION != "2.7" ]] ; then
pip3 install numpy
else
pip install numpy
fi
pip${PYTHON_VERSION} install numpy || true
# Set up paths. These will only affect the caller if this script is
# run with 'source' rather than in a separate shell.
export PATH=/usr/local/opt/qt5/bin:$PATH
export PATH=/usr/local/opt/python/libexec/bin:$PATH
export PYTHONPATH=/usr/local/lib/python${PYTHON_VERSION}/site-packages:$PYTHONPATH
# export PATH=/usr/local/opt/llvm${LLVMBREWVER}/bin:$PATH
export LLVM_DIRECTORY=/usr/local/opt/llvm${LLVMBREWVER}
export LLVM_ROOT=/usr/local/opt/llvm${LLVMBREWVER}
export PATH=/usr/local/opt/flex/bin:/usr/local/opt/bison/bin:$PATH
export PATH=${HOMEBREW_PREFIX}/opt/qt5/bin:$PATH
export PATH=${HOMEBREW_PREFIX}/opt/python/libexec/bin:$PATH
export PYTHONPATH=${HOMEBREW_PREFIX}/lib/python${PYTHON_VERSION}/site-packages:$PYTHONPATH
# export PATH=${HOMEBREW_PREFIX}/opt/llvm${LLVMBREWVER}/bin:$PATH
export LLVM_DIRECTORY=${HOMEBREW_PREFIX}/opt/llvm${LLVMBREWVER}
export LLVM_ROOT=${HOMEBREW_PREFIX}/opt/llvm${LLVMBREWVER}
export PATH=${HOMEBREW_PREFIX}/opt/flex/bin:${HOMEBREW_PREFIX}/opt/bison/bin:$PATH
# Save the env for use by other stages
src/build-scripts/save-env.bash
+11 -1
View File
@@ -138,6 +138,16 @@ function ( MAKE_CUDA_BITCODE src suffix generated_bc extra_clang_args )
set (CLANG_FTZ_FLAG "-fcuda-flush-denormals-to-zero")
endif ()
if ("${CUDA_VERSION}" VERSION_GREATER_EQUAL "12.0")
# The textureReference API was removed in CUDA 12.0, but it's still referenced
# in the clang headers, so compilation will fail with 12.0 and newer toolkits
# due to the missing definitions.
#
# We don't actually require any of the clang CUDA texture intrinsics, so we can
# side-step the issue by preventing them from being included by the preprocessor.
set (CUDA_TEXREF_FIX "-D__CLANG_CUDA_TEXTURE_INTRINSICS_H__")
endif()
list (TRANSFORM IMATH_INCLUDES PREPEND -I
OUTPUT_VARIABLE ALL_IMATH_INCLUDES)
list (TRANSFORM OPENEXR_INCLUDES PREPEND -I
@@ -158,7 +168,7 @@ function ( MAKE_CUDA_BITCODE src suffix generated_bc extra_clang_args )
${ALL_IMATH_INCLUDES}
${ALL_OPENEXR_INCLUDES}
"-I${Boost_INCLUDE_DIRS}"
${LLVM_COMPILE_FLAGS} ${CUDA_LIB_FLAGS} ${CLANG_MSVC_FIX}
${LLVM_COMPILE_FLAGS} ${CUDA_LIB_FLAGS} ${CLANG_MSVC_FIX} ${CUDA_TEXREF_FIX}
-D__CUDACC__ -DOSL_COMPILING_TO_BITCODE=1 -DNDEBUG -DOIIO_NO_SSE -D__CUDADEVRT_INTERNAL__
--language=cuda --cuda-device-only --cuda-gpu-arch=${CUDA_TARGET_ARCH}
-Wno-deprecated-register -Wno-format-security
+1
View File
@@ -289,6 +289,7 @@ macro (osl_add_all_tests)
metadata-braces min-reg miscmath missing-shader
mix-reg
named-components
nestedloop-reg
noise noise-cell
noise-gabor noise-gabor2d-filter noise-gabor3d-filter
noise-gabor-reg
+5 -20
View File
@@ -32,36 +32,21 @@ public:
#ifdef __CUDA_ARCH__
/// On device, act as a pointer. None of these things are allowed on the
/// host.
T* operator->() const
{
return m_ptr;
}
T& operator*() const
{
return *m_ptr;
}
T* operator->() const { return m_ptr; }
T& operator*() const { return *m_ptr; }
#endif
/// Extract the raw device-side pointer. Use with caution! On the host,
/// this will not point to valid memory.
T* d_get() const
{
return m_ptr;
}
T* d_get() const { return m_ptr; }
/// Evaluate as bool is a null pointer check.
operator bool() const noexcept
{
return m_ptr != nullptr;
}
operator bool() const noexcept { return m_ptr != nullptr; }
/// Reset the pointer to `dptr`, which must be a device-side raw pointer,
/// or null. Since this device_ptr is non-owning, any previous value is
/// simply overwritten.
void reset(T* dptr = nullptr)
{
m_ptr = dptr;
}
void reset(T* dptr = nullptr) { m_ptr = dptr; }
private:
T* m_ptr = nullptr; // underlying pointer, initializes to null
+2 -8
View File
@@ -53,10 +53,7 @@ struct DeviceString {
// In OptiX 7 we can't return the string's contents. Make this a compile
// time error.
#ifndef __CUDA_ARCH__
OSL_HOSTDEVICE const char* c_str() const
{
return m_chars;
}
OSL_HOSTDEVICE const char* c_str() const { return m_chars; }
#endif
OSL_HOSTDEVICE bool operator==(const DeviceString& other) const
@@ -81,10 +78,7 @@ struct DeviceString {
return hash() != other;
}
OSL_HOSTDEVICE operator size_t() const
{
return hash();
}
OSL_HOSTDEVICE operator size_t() const { return hash(); }
#endif
};
+9 -36
View File
@@ -171,22 +171,13 @@ public:
}
OSL_FORCEINLINE ValueType value() const
{
return m_value;
}
OSL_FORCEINLINE ValueType value() const { return m_value; }
// count number of active bits
OSL_FORCEINLINE int count() const
{
return OSL::popcount(m_value);
}
OSL_FORCEINLINE int count() const { return OSL::popcount(m_value); }
// NOTE: undefined result if no bits are on
OSL_FORCEINLINE int first_on() const
{
return OSL::countr_zero(m_value);
}
OSL_FORCEINLINE int first_on() const { return OSL::countr_zero(m_value); }
OSL_FORCEINLINE Mask invert() const
{
@@ -239,10 +230,7 @@ public:
return (m_value != static_cast<ValueType>(0));
}
OSL_FORCEINLINE bool any_off() const
{
return (m_value < valid_bits);
}
OSL_FORCEINLINE bool any_off() const { return (m_value < valid_bits); }
OSL_FORCEINLINE bool any_off(const Mask& mask) const
{
@@ -257,39 +245,27 @@ public:
// So really only set_on or set_off is required
// Choose to not provide a generic set(int lane, bool flag)
OSL_FORCEINLINE void set_on(int lane)
{
m_value |= (1 << lane);
}
OSL_FORCEINLINE void set_on(int lane) { m_value |= (1 << lane); }
OSL_FORCEINLINE void set_on_if(int lane, bool cond)
{
m_value |= (cond << lane);
}
OSL_FORCEINLINE void set_all_on()
{
m_value = valid_bits;
}
OSL_FORCEINLINE void set_all_on() { m_value = valid_bits; }
OSL_FORCEINLINE void set_count_on(int count)
{
m_value = valid_bits >> (width - count);
}
OSL_FORCEINLINE void set_off(int lane)
{
m_value &= (~(1 << lane));
}
OSL_FORCEINLINE void set_off(int lane) { m_value &= (~(1 << lane)); }
OSL_FORCEINLINE void set_off_if(int lane, bool cond)
{
m_value &= (~(cond << lane));
}
OSL_FORCEINLINE void set_all_off()
{
m_value = static_cast<ValueType>(0);
}
OSL_FORCEINLINE void set_all_off() { m_value = static_cast<ValueType>(0); }
OSL_FORCEINLINE bool operator==(const Mask& other) const
{
@@ -323,10 +299,7 @@ public:
return Mask(m_value | other.m_value);
}
OSL_FORCEINLINE Mask operator~() const
{
return invert();
}
OSL_FORCEINLINE Mask operator~() const { return invert(); }
template<int MinOccupancyT, int MaxOccupancyT = width, typename FunctorT>
+2 -8
View File
@@ -109,14 +109,8 @@ OSL_ALIGNAS(16) ClosureComponent : public ClosureColor
Vec3 w; ///< Weight of this component
/// Handy method for getting the parameter memory as a void*.
OSL_HOSTDEVICE void* data()
{
return (char*)(this + 1);
}
OSL_HOSTDEVICE const void* data() const
{
return (const char*)(this + 1);
}
OSL_HOSTDEVICE void* data() { return (char*)(this + 1); }
OSL_HOSTDEVICE const void* data() const { return (const char*)(this + 1); }
/// Handy methods for extracting the underlying parameters as a struct
template<typename T> OSL_HOSTDEVICE const T* as() const
+1 -2
View File
@@ -19,8 +19,7 @@ struct ShaderGlobals;
class ShaderGroup;
// Tags for polymorphic dispatch
template<int SimdWidthT> class WidthOf {
};
template<int SimdWidthT> class WidthOf {};
/// Opaque pointer to whatever the renderer uses to represent a
+13 -25
View File
@@ -299,16 +299,13 @@ public:
// Specializations
template<int WidthT>
struct Block<float, WidthT> : public BlockOfBuiltin<float, WidthT> {
};
struct Block<float, WidthT> : public BlockOfBuiltin<float, WidthT> {};
template<int WidthT>
struct Block<int, WidthT> : public BlockOfBuiltin<int, WidthT> {
};
struct Block<int, WidthT> : public BlockOfBuiltin<int, WidthT> {};
template<typename DataT, int WidthT>
struct Block<DataT*, WidthT> : public BlockOfBuiltin<DataT*, WidthT> {
};
struct Block<DataT*, WidthT> : public BlockOfBuiltin<DataT*, WidthT> {};
// Vec4 isn't used by external interfaces, but some internal
@@ -2283,15 +2280,9 @@ template<typename DataT, int WidthT> struct MaskedLaneProxy {
// visibility to end user whose IDE
// might display these methods vs. free
// functions
OSL_FORCEINLINE bool is_on() const
{
return m_mask.is_on(m_lane);
}
OSL_FORCEINLINE bool is_on() const { return m_mask.is_on(m_lane); }
OSL_FORCEINLINE bool is_off() const
{
return m_mask.is_off(m_lane);
}
OSL_FORCEINLINE bool is_off() const { return m_mask.is_off(m_lane); }
private:
Block<DataT, WidthT>& m_ref_wide_data;
@@ -2353,15 +2344,9 @@ struct MaskedArrayLaneProxy {
// visibility to end user whose IDE
// might display these methods vs. free
// functions
OSL_FORCEINLINE bool is_on() const
{
return m_mask.is_on(m_lane);
}
OSL_FORCEINLINE bool is_on() const { return m_mask.is_on(m_lane); }
OSL_FORCEINLINE bool is_off() const
{
return m_mask.is_off(m_lane);
}
OSL_FORCEINLINE bool is_off() const { return m_mask.is_off(m_lane); }
OSL_FORCEINLINE MaskedLaneProxy<DataT, WidthT>
operator[](int array_index) const
@@ -2726,7 +2711,8 @@ struct MaskedDeriv : public Masked<DataT, WidthT> {
template<typename FirstT, typename... ListT,
std::enable_if_t<std::is_same<typename std::decay<FirstT>::type,
MaskedDeriv>::value,
bool> = true>
bool>
= true>
OSL_FORCEINLINE MaskedDeriv(FirstT&& first, ListT&&... argList)
: Masked<DataT, WidthT>(std::forward<FirstT>(first),
std::forward<ListT>(argList)...)
@@ -2737,7 +2723,8 @@ struct MaskedDeriv : public Masked<DataT, WidthT> {
template<typename FirstT, typename... ListT,
std::enable_if_t<!std::is_same<typename std::decay<FirstT>::type,
MaskedDeriv>::value,
bool> = true>
bool>
= true>
OSL_FORCEINLINE MaskedDeriv(FirstT&& first, ListT&&... argList)
: Masked<DataT, WidthT>(std::forward<FirstT>(first),
std::forward<ListT>(argList)...,
@@ -3188,7 +3175,8 @@ template<typename DataT, int DerivIndexT> struct RefDeriv : public Ref<DataT> {
template<typename FirstT, typename... ListT,
std::enable_if_t<!std::is_same<typename std::decay<FirstT>::type,
RefDeriv>::value,
bool> = true>
bool>
= true>
explicit OSL_FORCEINLINE RefDeriv(FirstT&& first, ListT&&... argList)
: Ref<DataT>(std::forward<FirstT>(first),
std::forward<ListT>(argList)...,
+58 -230
View File
@@ -647,133 +647,55 @@ public:
}
void dataoffset(int d)
{
m_dataoffset = d;
}
int dataoffset() const
{
return m_dataoffset;
}
void dataoffset(int d) { m_dataoffset = d; }
int dataoffset() const { return m_dataoffset; }
void wide_dataoffset(int d)
{
m_wide_dataoffset = d;
}
int wide_dataoffset() const
{
return m_wide_dataoffset;
}
void wide_dataoffset(int d) { m_wide_dataoffset = d; }
int wide_dataoffset() const { return m_wide_dataoffset; }
SymArena arena() const
{
return static_cast<SymArena>(m_arena);
}
SymArena arena() const { return static_cast<SymArena>(m_arena); }
void initializers(int d)
{
m_initializers = d;
}
int initializers() const
{
return m_initializers;
}
void initializers(int d) { m_initializers = d; }
int initializers() const { return m_initializers; }
bool has_derivs() const
{
return m_has_derivs;
}
void has_derivs(bool new_derivs)
{
m_has_derivs = new_derivs;
}
int size() const
{
return m_size;
}
void size(size_t newsize)
{
m_size = (int)newsize;
}
bool has_derivs() const { return m_has_derivs; }
void has_derivs(bool new_derivs) { m_has_derivs = new_derivs; }
int size() const { return m_size; }
void size(size_t newsize) { m_size = (int)newsize; }
/// Return the size for each point, including derivs.
///
int derivsize() const
{
return m_has_derivs ? 3 * m_size : m_size;
}
int derivsize() const { return m_has_derivs ? 3 * m_size : m_size; }
bool connected() const
{
return valuesource() == ConnectedVal;
}
bool connected_down() const
{
return m_connected_down;
}
void connected_down(bool c)
{
m_connected_down = c;
}
bool connected() const { return valuesource() == ConnectedVal; }
bool connected_down() const { return m_connected_down; }
void connected_down(bool c) { m_connected_down = c; }
/// Where did the symbol's value come from?
///
enum ValueSource { DefaultVal, InstanceVal, GeomVal, ConnectedVal };
ValueSource valuesource() const
{
return (ValueSource)m_valuesource;
}
void valuesource(ValueSource v)
{
m_valuesource = v;
}
ValueSource valuesource() const { return (ValueSource)m_valuesource; }
void valuesource(ValueSource v) { m_valuesource = v; }
const char* valuesourcename() const;
static const char* valuesourcename(ValueSource v);
int fieldid() const
{
return m_fieldid;
}
void fieldid(int id)
{
m_fieldid = id;
}
int fieldid() const { return m_fieldid; }
void fieldid(int id) { m_fieldid = id; }
int layer() const
{
return m_layer;
}
void layer(int id)
{
m_layer = id;
}
int layer() const { return m_layer; }
void layer(int id) { m_layer = id; }
int initbegin() const
{
return m_initbegin;
}
void initbegin(int i)
{
m_initbegin = i;
}
int initend() const
{
return m_initend;
}
void initend(int i)
{
m_initend = i;
}
int initbegin() const { return m_initbegin; }
void initbegin(int i) { m_initbegin = i; }
int initend() const { return m_initend; }
void initend(int i) { m_initend = i; }
void set_initrange(int b = 0, int e = 0)
{
m_initbegin = b;
m_initend = e;
}
bool has_init_ops() const
{
return m_initbegin != m_initend;
}
bool has_init_ops() const { return m_initbegin != m_initend; }
/// Clear read/write usage info.
///
@@ -817,42 +739,15 @@ public:
}
}
int firstread() const
{
return m_firstread;
}
int lastread() const
{
return m_lastread;
}
int firstwrite() const
{
return m_firstwrite;
}
int lastwrite() const
{
return m_lastwrite;
}
int firstuse() const
{
return std::min(firstread(), firstwrite());
}
int lastuse() const
{
return std::max(lastread(), lastwrite());
}
bool everread() const
{
return lastread() >= 0;
}
bool everwritten() const
{
return lastwrite() >= 0;
}
bool everused() const
{
return everread() || everwritten();
}
int firstread() const { return m_firstread; }
int lastread() const { return m_lastread; }
int firstwrite() const { return m_firstwrite; }
int lastwrite() const { return m_lastwrite; }
int firstuse() const { return std::min(firstread(), firstwrite()); }
int lastuse() const { return std::max(lastread(), lastwrite()); }
bool everread() const { return lastread() >= 0; }
bool everwritten() const { return lastwrite() >= 0; }
bool everused() const { return everread() || everwritten(); }
// everused_in_group is an even more stringent test -- not only must
// the symbol not be used within the shader but it also must not be
// used elsewhere in the group, by being connected to something downstream
@@ -873,14 +768,8 @@ public:
m_lastwrite = last;
}
bool initialized() const
{
return m_initialized;
}
void initialized(bool init)
{
m_initialized = init;
}
bool initialized() const { return m_initialized; }
void initialized(bool init) { m_initialized = init; }
bool lockgeom() const
{
@@ -889,76 +778,34 @@ public:
return !m_interpolated && !m_interactive;
}
bool interpolated() const
{
return m_interpolated;
}
void interpolated(bool val)
{
m_interpolated = val;
}
bool interpolated() const { return m_interpolated; }
void interpolated(bool val) { m_interpolated = val; }
bool interactive() const
{
return m_interactive;
}
void interactive(bool val)
{
m_interactive = val;
}
bool interactive() const { return m_interactive; }
void interactive(bool val) { m_interactive = val; }
bool noninteractive() const
{
return m_noninteractive;
}
void noninteractive(bool val)
{
m_noninteractive = val;
}
bool noninteractive() const { return m_noninteractive; }
void noninteractive(bool val) { m_noninteractive = val; }
bool allowconnect() const
{
return m_allowconnect;
}
void allowconnect(bool val)
{
m_allowconnect = val;
}
bool allowconnect() const { return m_allowconnect; }
void allowconnect(bool val) { m_allowconnect = val; }
int arraylen() const
{
return m_typespec.arraylength();
}
int arraylen() const { return m_typespec.arraylength(); }
void arraylen(int len)
{
m_typespec.make_array(len);
m_size = m_typespec.simpletype().size();
}
bool renderer_output() const
{
return m_renderer_output;
}
void renderer_output(bool v)
{
m_renderer_output = v;
}
bool renderer_output() const { return m_renderer_output; }
void renderer_output(bool v) { m_renderer_output = v; }
// When not uniform a symbol will have a varying value under batched
// execution and must use a Wide data type to hold different values
// for each data lane executing
bool is_uniform() const
{
return m_is_uniform;
}
bool is_varying() const
{
return (m_is_uniform == 0);
}
void make_varying()
{
m_is_uniform = false;
}
bool is_uniform() const { return m_is_uniform; }
bool is_varying() const { return (m_is_uniform == 0); }
void make_varying() { m_is_uniform = false; }
// Results of a compare_op and other ops with logically boolean
// results under certain conditions could be forced to be represented
@@ -972,32 +819,14 @@ public:
// The value of forced_llvm_bool() is currently only respected during
// batched execution. Forced bools should not be coalesced with regular
// ints, only other forced bools.
bool forced_llvm_bool() const
{
return m_forced_llvm_bool;
}
void forced_llvm_bool(bool v)
{
m_forced_llvm_bool = v;
}
bool forced_llvm_bool() const { return m_forced_llvm_bool; }
void forced_llvm_bool(bool v) { m_forced_llvm_bool = v; }
bool readonly() const
{
return m_readonly;
}
void readonly(bool v)
{
m_readonly = v;
}
bool readonly() const { return m_readonly; }
void readonly(bool v) { m_readonly = v; }
bool is_constant() const
{
return symtype() == SymTypeConst;
}
bool is_temp() const
{
return symtype() == SymTypeTemp;
}
bool is_constant() const { return symtype() == SymTypeConst; }
bool is_temp() const { return symtype() == SymTypeTemp; }
// Retrieve the const float value (must be a const float!)
float get_float(int index = 0) const
@@ -1332,7 +1161,6 @@ OSL_NAMESPACE_EXIT
// Supply a fmtlib compatible custom formatter for TypeSpec.
#if FMT_VERSION >= 100000
FMT_BEGIN_NAMESPACE
template<> struct formatter<OSL::pvt::TypeSpec> : ostream_formatter {
};
template<> struct formatter<OSL::pvt::TypeSpec> : ostream_formatter {};
FMT_END_NAMESPACE
#endif
+11 -44
View File
@@ -304,20 +304,14 @@ public:
/// Return the ShaderGlobals pointer.
///
llvm::Value* sg_ptr() const
{
return m_llvm_shaderglobals_ptr;
}
llvm::Value* sg_ptr() const { return m_llvm_shaderglobals_ptr; }
llvm::Type* llvm_type_closure_component();
llvm::Type* llvm_type_closure_component_ptr();
/// Return the ShaderGlobals pointer cast as a void*.
///
llvm::Value* sg_void_ptr()
{
return ll.void_ptr(m_llvm_shaderglobals_ptr);
}
llvm::Value* sg_void_ptr() { return ll.void_ptr(m_llvm_shaderglobals_ptr); }
/// Cast the pointer variable specified by val to a pointer to the
/// basic type comprising `type`.
@@ -343,10 +337,7 @@ public:
/// Return the group data pointer.
///
llvm::Value* groupdata_ptr() const
{
return m_llvm_groupdata_ptr;
}
llvm::Value* groupdata_ptr() const { return m_llvm_groupdata_ptr; }
/// Return the group data pointer cast as a void*.
///
@@ -364,22 +355,13 @@ public:
TypeDesc type = TypeDesc::UNKNOWN);
/// Return the userdata base pointer.
llvm::Value* userdata_base_ptr() const
{
return m_llvm_userdata_base_ptr;
}
llvm::Value* userdata_base_ptr() const { return m_llvm_userdata_base_ptr; }
/// Return the output base pointer.
llvm::Value* output_base_ptr() const
{
return m_llvm_output_base_ptr;
}
llvm::Value* output_base_ptr() const { return m_llvm_output_base_ptr; }
/// Return the shade index
llvm::Value* shadeindex() const
{
return m_llvm_shadeindex;
}
llvm::Value* shadeindex() const { return m_llvm_shadeindex; }
// For a symloc, compute the llvm::Value of the pointer to its true,
// offset location from the base pointer for shade index `sindex`
@@ -507,10 +489,7 @@ public:
/// Return the basic block of the exit for the whole instance.
///
bool llvm_has_exit_instance_block() const
{
return m_exit_instance_block;
}
bool llvm_has_exit_instance_block() const { return m_exit_instance_block; }
/// Return the basic block of the exit for the whole instance.
///
@@ -531,10 +510,7 @@ public:
/// Print debugging line for the op
void llvm_generate_debug_op_printf(const Opcode& op);
llvm::Function* layer_func() const
{
return ll.current_function();
}
llvm::Function* layer_func() const { return ll.current_function(); }
/// Call this when JITing a texture-like call, to track how many.
void generated_texture_call(bool handle)
@@ -544,10 +520,7 @@ public:
shadingsys().m_stat_tex_calls_as_handles += 1;
}
void increment_useparam_ops()
{
shadingsys().m_stat_useparam_ops++;
}
void increment_useparam_ops() { shadingsys().m_stat_useparam_ops++; }
/// Return the mapping from symbol names to GlobalVariables.
std::map<std::string, llvm::GlobalVariable*>& get_const_map()
@@ -556,16 +529,10 @@ public:
}
/// Return whether or not we are compiling for an OptiX-based renderer.
bool use_optix()
{
return m_use_optix;
}
bool use_optix() { return m_use_optix; }
/// Return if we should compile against free function versions of Renderer Service.
bool use_rs_bitcode()
{
return m_use_rs_bitcode;
}
bool use_rs_bitcode() { return m_use_rs_bitcode; }
/// Return the userdata index for the given Symbol. Return -1 if the Symbol
/// is not an input parameter or is constant and therefore doesn't have an
+64 -20
View File
@@ -838,11 +838,12 @@ private:
std::vector<Position> m_function_stack;
std::vector<Position> m_before_if_block_stack;
std::vector<Position> m_after_if_block_stack;
std::vector<int> m_loop_depth_stack;
public:
OSL_FORCEINLINE FunctionTreeTracker() : m_top_of_stack(end_pos())
{
push_function_call();
push_function_call(0);
}
FunctionTreeTracker(const FunctionTreeTracker&) = delete;
@@ -977,11 +978,12 @@ public:
OSL_FORCEINLINE Iterator end() const { return Iterator(*this, end_pos()); }
OSL_FORCEINLINE void push_function_call()
OSL_FORCEINLINE void push_function_call(int loop_depth_at_function)
{
OSL_DEV_ONLY(std::cout << "DependencyTreeTracker push_function_call"
<< std::endl);
m_function_stack.push_back(m_top_of_stack);
m_loop_depth_stack.push_back(loop_depth_at_function);
}
OSL_FORCEINLINE void push_if_block()
@@ -1062,7 +1064,16 @@ public:
OSL_FORCEINLINE Position top_pos() const { return m_top_of_stack; }
OSL_FORCEINLINE void pop_function_call()
OSL_FORCEINLINE int loop_depth_at_start_of_call()
{
if (m_loop_depth_stack.empty()) {
return 0;
} else {
return m_loop_depth_stack.back();
}
}
OSL_FORCEINLINE void pop_function_call(int loop_depth_at_function)
{
OSL_DEV_ONLY(std::cout << "DependencyTreeTracker pop_function_call"
<< std::endl);
@@ -1090,6 +1101,9 @@ public:
process_exit(early_out.dtt_pos);
}
}
OSL_ASSERT(m_loop_depth_stack.back() == loop_depth_at_function);
m_loop_depth_stack.pop_back();
}
};
@@ -1182,15 +1196,9 @@ public:
}
#ifdef OSL_DEV
OSL_FORCEINLINE int op_num() const
{
return m_op_num;
}
OSL_FORCEINLINE int op_num() const { return m_op_num; }
OSL_FORCEINLINE int loop_op_index() const
{
return m_loop_op_index;
}
OSL_FORCEINLINE int loop_op_index() const { return m_loop_op_index; }
#endif
};
@@ -1220,8 +1228,11 @@ class LoopStack {
std::vector<LoopInfo> m_loop_info_by_depth;
bool is_inside_loop() const { return depth() != 0; }
public:
bool is_inside_loop() const { return !m_loop_info_by_depth.empty(); }
int depth() const { return m_loop_info_by_depth.size(); }
int current_loop_op_index() const
{
@@ -1609,7 +1620,7 @@ struct Analyzer {
OSL_NOINLINE void make_loops_control_flow_depend_on_early_out_conditions()
{
// Need change the loop control flow which is dependent upon
// Need to change the loop control flow which is dependent upon
// a conditional. By making a circular dependency between the this
// [return|exit|break|continue] operation and the conditionals value,
// any varying values in the conditional controlling
@@ -1992,9 +2003,11 @@ struct Analyzer {
// as the current block, there was no conditionals involved
OSL_DEV_ONLY(std::cout << " FUNCTION CALL BLOCK BEGIN"
<< std::endl);
m_execution_scope_stack.push_function_call();
m_execution_scope_stack.push_function_call(
m_loop_stack.depth());
discover_symbols_between(op_index + 1, opcode.jump(0));
m_execution_scope_stack.pop_function_call();
m_execution_scope_stack.pop_function_call(
m_loop_stack.depth());
OSL_DEV_ONLY(std::cout << " FUNCTION CALL BLOCK END"
<< std::endl);
@@ -2026,12 +2039,16 @@ struct Analyzer {
m_execution_scope_stack.process_return(
m_conditional_symbol_stack.top_pos());
// The return will need change the loop control flow which is dependent upon
// IF AND ONLY IF, the current loop control exists inside
// the current function, because the return should only early
// out of those loops, not any higher in the call stack.
// The return will need to change the loop control flow which is dependent upon
// a conditional. By making a circular dependency between the return operation
// and the conditionals value, any varying values in the conditional controlling
// the return should flow back to the loop control variable, which might need to
// be varying so allow lanes to terminate the loop independently
if (m_loop_stack.is_inside_loop()) {
if (m_loop_stack.depth()
> m_execution_scope_stack.loop_depth_at_start_of_call()) {
make_loops_control_flow_depend_on_early_out_conditions();
}
}
@@ -2043,12 +2060,18 @@ struct Analyzer {
m_execution_scope_stack.process_exit(
m_conditional_symbol_stack.top_pos());
// The exit will need change the loop control flow which is dependent upon
// IF AND ONLY IF, the current loop control exists inside
// the current function, because the return should only early
// out of those loops, not any higher in the call stack.
// A different mechanism will look for early outs when
// unwinding up the callstack.
// The exit will need to change the loop control flow which is dependent upon
// a conditional. By making a circular dependency between the exit operation
// and the conditionals value, any varying values in the conditional controlling
// the exit should flow back to the loop control variable, which might need to
// be varying so allow lanes to terminate the loop independently
if (m_loop_stack.is_inside_loop()) {
if (m_loop_stack.depth()
> m_execution_scope_stack.loop_depth_at_start_of_call()) {
make_loops_control_flow_depend_on_early_out_conditions();
}
}
@@ -2101,6 +2124,10 @@ struct Analyzer {
|| symbol_to_be_varying->typespec().is_closure()
|| symbol_to_be_varying->connected()
|| symbol_to_be_varying->connected_down());
OSL_DEV_ONLY(std::cout << "<<<< make_varying symbol: "
<< symbol_to_be_varying->unmangled().c_str()
<< " force=" << force << std::endl);
symbol_to_be_varying->make_varying();
auto range = m_symbols_dependent_upon.equal_range(
symbol_to_be_varying);
@@ -2113,6 +2140,9 @@ struct Analyzer {
recursively_mark_varying(dependent_symbol);
}
};
OSL_DEV_ONLY(std::cout << ">>>> end make_varying symbol: "
<< symbol_to_be_varying->unmangled().c_str()
<< std::endl);
}
};
@@ -2599,7 +2629,7 @@ struct Analyzer {
#endif
const auto& early_out = *earlyOutIter;
auto begin_dep_iter = m_conditional_symbol_stack.begin_at(
early_out.dtt_pos);
early_out.dtt_pos);
auto end_dep_iter = m_conditional_symbol_stack.end();
const Opcode& opcode = m_opcodes[op_index];
@@ -2645,6 +2675,8 @@ struct Analyzer {
OSL_NOINLINE void push_varying_of_shader_globals()
{
OSL_DEV_ONLY(std::cout << "push_varying_of_shader_globals begin"
<< std::endl);
for (auto&& s : inst()->symbols()) {
if (s.symtype() == SymTypeGlobal) {
// TODO: now that symbol has is_uniform()
@@ -2665,10 +2697,14 @@ struct Analyzer {
// so force their dependents to get marked
recursively_mark_varying(sym_ptr, true /*force*/);
}
OSL_DEV_ONLY(std::cout << "push_varying_of_shader_globals end"
<< std::endl);
}
OSL_NOINLINE void make_renderer_outputs_varying()
{
OSL_DEV_ONLY(std::cout << "make_renderer_outputs_varying begin"
<< std::endl);
// Mark all output parameters as varying to catch
// output parameters written to by uniform variables,
// as nothing would have made them varying, however as
@@ -2685,10 +2721,14 @@ struct Analyzer {
}
}
}
OSL_DEV_ONLY(std::cout << "make_renderer_outputs_varying end"
<< std::endl);
}
OSL_NOINLINE void make_interpolated_parameters_varying()
{
OSL_DEV_ONLY(std::cout << "make_interpolated_parameters_varying begin"
<< std::endl);
// Mark all interpolated parameters as varying,
// As we expect interpolated data, get_userdata will
// only provide varying values, so we must mark
@@ -2700,10 +2740,13 @@ struct Analyzer {
recursively_mark_varying(&s);
}
}
OSL_DEV_ONLY(std::cout << "make_interpolated_parameters_varying end"
<< std::endl);
}
OSL_NOINLINE void make_closures_varying()
{
OSL_DEV_ONLY(std::cout << "make_closures_varying begin" << std::endl);
// We assume that closures are always stored as varying pointers
FOREACH_SYM(Symbol & s, inst())
{
@@ -2713,6 +2756,7 @@ struct Analyzer {
recursively_mark_varying(&s);
}
}
OSL_DEV_ONLY(std::cout << "make_closures_varying end" << std::endl);
}
OSL_NOINLINE void push_varying_of_upstream_connections()
+1 -1
View File
@@ -381,7 +381,7 @@ BatchedBackendLLVM::llvm_zero_derivs(const Symbol& sym, llvm::Value* count)
llvm::Value* post_condition_mask = ll.op_and(condition_mask,
pre_condition_mask);
llvm::Value* cond_val = ll.test_if_mask_is_non_zero(
post_condition_mask);
post_condition_mask);
// Jump to either LoopBody or AfterLoop
ll.op_branch(cond_val, body_block, after_block);
+27 -11
View File
@@ -2287,7 +2287,8 @@ LLVMGEN(llvm_gen_compref)
bool op_is_uniform = Result.is_uniform();
llvm::Value* c = rop.llvm_load_value(Index);
llvm::Value* c = rop.llvm_load_value(Index, /*deriv=*/0, /*component=*/0,
TypeDesc::UNKNOWN, Index.is_uniform());
if (Index.is_uniform()) {
if (rop.inst()->master()->range_checking()) {
@@ -3250,9 +3251,8 @@ LLVMGEN(llvm_gen_construct_triple)
// Do the transformation in-place, if called for
if (using_space) {
ustring from, to; // N.B. initialize to empty strings
if (Space.is_constant()) {
from = Space.get_string();
ustring from = Space.get_string();
if (from == Strings::common
|| from == rop.shadingsys().commonspace_synonym())
return true; // no transformation necessary
@@ -4271,7 +4271,7 @@ llvm_batched_texture_options(BatchedBackendLLVM& rop, int opnum,
llvm::Value* wide_const_fone_value = rop.ll.wide_constant(1.0f);
llvm::Value* const_zero_value = rop.ll.constant(0);
llvm::Value* wrap_default_value = rop.ll.constant(
static_cast<int>(Tex::Wrap::Default));
static_cast<int>(Tex::Wrap::Default));
llvm::Value* sblur = wide_const_fzero_value;
llvm::Value* tblur = wide_const_fzero_value;
@@ -4290,7 +4290,7 @@ llvm_batched_texture_options(BatchedBackendLLVM& rop, int opnum,
llvm::Value* twrap = wrap_default_value;
llvm::Value* rwrap = wrap_default_value;
llvm::Value* mipmode = rop.ll.constant(
static_cast<int>(Tex::MipMode::Default));
static_cast<int>(Tex::MipMode::Default));
llvm::Value* interpmode = rop.ll.constant(
static_cast<int>(Tex::InterpMode::SmartBicubic));
llvm::Value* anisotropic = rop.ll.constant(32);
@@ -6758,13 +6758,18 @@ LLVMGEN(llvm_gen_getmessage)
rop.ll.call_function(rop.build_name(FuncSpec("getmessage").mask()),
args);
} else {
llvm::Value* nameVal = rop.llvm_load_value(Name);
llvm::Value* nameVal
= rop.llvm_load_value(Name, /*deriv=*/0, /*component=*/0,
TypeDesc::UNKNOWN, nameVal_is_uniform);
if (nameVal_is_uniform) {
args[nameArgumentIndex] = nameVal;
}
llvm::Value* sourceVal = has_source ? rop.llvm_load_value(Source)
: rop.ll.constant(ustring());
llvm::Value* sourceVal
= has_source
? rop.llvm_load_value(Source, /*deriv=*/0, /*component=*/0,
TypeDesc::UNKNOWN, sourceVal_is_uniform)
: rop.ll.constant(ustring());
if (sourceVal_is_uniform) {
args[sourceArgumentIndex] = sourceVal;
}
@@ -7002,6 +7007,16 @@ LLVMGEN(llvm_gen_spline)
&& (!has_knot_count
|| (has_knot_count && Knot_count.typespec().is_int())));
if (has_knot_count && !Knot_count.is_uniform()) {
// TODO: varying knot count support could be added below as we already
// have a loop to handle varying spline basis. Just need to add tests
// to exercise and verify functions properly, until then...
rop.shadingcontext()->errorfmt(
"spline nknots parameter is varying, batched code gen requires a constant or uniform nknots, called from ({}:{})",
op.sourcefile(), op.sourceline());
return false;
}
bool op_is_uniform = Spline.is_uniform() && Value.is_uniform()
&& Knots.is_uniform();
@@ -7052,7 +7067,8 @@ LLVMGEN(llvm_gen_spline)
args.push_back(rop.llvm_void_ptr(Value)); // make things easy
args.push_back(rop.llvm_void_ptr(Knots));
if (has_knot_count)
args.push_back(rop.llvm_load_value(Knot_count));
args.push_back(rop.llvm_load_value(
Knot_count)); // TODO: add support for varying Knot_count
else
args.push_back(rop.ll.constant((int)Knots.typespec().arraylength()));
args.push_back(rop.ll.constant((int)Knots.typespec().arraylength()));
@@ -7094,7 +7110,7 @@ LLVMGEN(llvm_gen_spline)
leadLane);
args[splineNameArgumentIndex] = scalar_splineName;
lanesMatchingSplineName = rop.ll.op_lanes_that_match_masked(
scalar_splineName, splineNameVal, remainingMask);
scalar_splineName, splineNameVal, remainingMask);
OSL_ASSERT(lanesMatchingSplineName);
//rop.llvm_print_mask("lanesMatchingSplineName", lanesMatchingSplineName);
@@ -7340,7 +7356,7 @@ LLVMGEN(llvm_gen_closure)
llvm::Value* dest_base = rop.ll.offset_ptr(mem_void_ptr, p.offset);
llvm::Type* dest_type = rop.ll.llvm_type(
static_cast<const TypeSpec&>(p.type).simpletype());
static_cast<const TypeSpec&>(p.type).simpletype());
dest_base = rop.ll.ptr_to_cast(dest_base, dest_type);
if (num_elements > 1) {
+2 -3
View File
@@ -59,7 +59,6 @@ static ustring op_xor("xor");
static ustring u_distance("distance");
static ustring u_index("index");
static ustring u__empty; // empty/default ustring
@@ -3831,11 +3830,11 @@ LLVMGEN(llvm_gen_closure)
const ClosureRegistry::ClosureEntry* clentry
= rop.shadingsys().find_closure(closure_name);
if (!clentry) {
rop.llvm_gen_error(fmtformat(
rop.shadingcontext()->errorfmt(
"Closure '{}' is not supported by the current renderer, called from {}:{} in shader \"{}\", layer {} \"{}\", group \"{}\"",
closure_name, op.sourcefile(), op.sourceline(),
rop.inst()->shadername(), rop.layer(), rop.inst()->layername(),
rop.group().name()));
rop.group().name());
return false;
}
+19 -20
View File
@@ -359,10 +359,7 @@ public:
{
mm->registerEHFrames(Addr, LoadAddr, Size);
}
void deregisterEHFrames() override
{
mm->deregisterEHFrames();
}
void deregisterEHFrames() override { mm->deregisterEHFrames(); }
uint64_t getSymbolAddress(const std::string& Name) override
{
@@ -431,6 +428,7 @@ LLVM_Util::LLVM_Util(const PerThreadInfo& per_thread_info, int debuglevel,
, m_llvm_func_passes(NULL)
, m_new_pass_manager(NULL)
, m_llvm_exec(NULL)
, m_nvptx_target_machine(nullptr)
, m_vector_width(vector_width)
, m_llvm_type_native_mask(nullptr)
, mVTuneNotifier(nullptr)
@@ -585,6 +583,7 @@ LLVM_Util::~LLVM_Util()
delete m_new_pass_manager;
delete m_builder;
delete m_llvm_debug_builder;
delete m_nvptx_target_machine;
module(NULL);
// DO NOT delete m_llvm_jitmm; // just the dummy wrapper around the real MM
}
@@ -775,17 +774,17 @@ LLVM_Util::debug_push_inlined_function(OIIO::ustring function_name,
llvm::DINode::FlagPrototyped | llvm::DINode::FlagNoReturn);
llvm::DISubprogram* function = nullptr;
function = m_llvm_debug_builder->createFunction(
mDebugCU, // Scope
function_name.c_str(), // Name
// We are inlined function so not sure supplying a linkage name
// makes sense
/*function_name.c_str()*/ llvm::StringRef(), // Linkage Name
file, // File
static_cast<unsigned int>(sourceline), // Line Number
mSubTypeForInlinedFunction, // subroutine type
method_scope_line, // Scope Line,
fnFlags,
llvm::DISubprogram::toSPFlags(true /*isLocalToUnit*/,
mDebugCU, // Scope
function_name.c_str(), // Name
// We are inlined function so not sure supplying a linkage name
// makes sense
/*function_name.c_str()*/ llvm::StringRef(), // Linkage Name
file, // File
static_cast<unsigned int>(sourceline), // Line Number
mSubTypeForInlinedFunction, // subroutine type
method_scope_line, // Scope Line,
fnFlags,
llvm::DISubprogram::toSPFlags(true /*isLocalToUnit*/,
true /*isDefinition*/,
true /*false*/ /*isOptimized*/));
@@ -4666,8 +4665,8 @@ LLVM_Util::op_gather(llvm::Type* src_type, llvm::Value* src_ptr,
llvm::Value* unmasked_value = wide_constant(0.0f);
llvm::Value* args[] = {
unmasked_value, void_ptr(src_ptr), wide_index, int_mask,
constant(4) // not sure why the scale
unmasked_value, void_ptr(src_ptr), wide_index, int_mask,
constant(4) // not sure why the scale
};
return builder().CreateCall(func_avx512_gather_ps,
toArrayRef(args));
@@ -5602,9 +5601,9 @@ LLVM_Util::apply_return_to(llvm::Value* existing_mask)
OSL_ASSERT(masked_function_context().return_count > 0);
llvm::Value* loc_of_return_mask = masked_function_context().location_of_mask;
llvm::Value* rs_mask = op_load_mask(loc_of_return_mask);
llvm::Value* result = builder().CreateSelect(rs_mask, existing_mask,
rs_mask);
llvm::Value* rs_mask = op_load_mask(loc_of_return_mask);
llvm::Value* result = builder().CreateSelect(rs_mask, existing_mask,
rs_mask);
return result;
}
+1 -1
View File
@@ -538,7 +538,7 @@ ColorSystem::lookup_blackbody_rgb(float T /*Kelvin*/) const
constexpr int stride = sizeof(Color3) / sizeof(float);
int sti = stride * ti;
Color3 rgb = OIIO::lerp(
// Have all gathers use the same indices by having different base registers
// Have all gathers use the same indices by having different base registers
// for each of the 6 components
Color3((blackbody_components + 0)[sti], (blackbody_components + 1)[sti],
(blackbody_components + 2)[sti]),
+28 -112
View File
@@ -805,10 +805,7 @@ public:
}
#endif
void clear_symlocs()
{
m_symlocs.clear();
}
void clear_symlocs() { m_symlocs.clear(); }
void add_symlocs(cspan<SymLocationDesc> symlocs)
{
for (auto& s : symlocs)
@@ -1518,10 +1515,7 @@ public:
typedef std::vector<SymOverrideInfo> SymOverrideInfoVec;
static_assert(sizeof(SymOverrideInfo) == 8, "SymOverrideInfo size");
SymOverrideInfo* instoverride(int i)
{
return &m_instoverrides[i];
}
SymOverrideInfo* instoverride(int i) { return &m_instoverrides[i]; }
const SymOverrideInfo* instoverride(int i) const
{
return &m_instoverrides[i];
@@ -1838,19 +1832,10 @@ public:
}
#endif
// Is this shader group equivalent to ret void?
bool does_nothing() const
{
return m_does_nothing;
}
void does_nothing(bool new_val)
{
m_does_nothing = new_val;
}
bool does_nothing() const { return m_does_nothing; }
void does_nothing(bool new_val) { m_does_nothing = new_val; }
long long int executions() const
{
return m_executions;
}
long long int executions() const { return m_executions; }
void start_running()
{
@@ -1859,25 +1844,13 @@ public:
#endif
}
void name(ustring name)
{
m_name = name;
}
ustring name() const
{
return m_name;
}
void name(ustring name) { m_name = name; }
ustring name() const { return m_name; }
std::string serialize() const;
void lock() const
{
m_mutex.lock();
}
void unlock() const
{
m_mutex.unlock();
}
void lock() const { m_mutex.lock(); }
void unlock() const { m_mutex.unlock(); }
// Find which layer index corresponds to the layer name. Return -1 if
// not found.
@@ -1889,10 +1862,7 @@ public:
/// Return a unique ID of this group.
///
int id() const
{
return m_id;
}
int id() const { return m_id; }
/// Mark all layers as not entry points and set m_num_entry_layers to 0.
void clear_entry_layers();
@@ -1906,15 +1876,9 @@ public:
mark_entry_layer(find_layer(layername));
}
int num_entry_layers() const
{
return m_num_entry_layers;
}
int num_entry_layers() const { return m_num_entry_layers; }
bool is_last_layer(int layer) const
{
return layer == nlayers() - 1;
}
bool is_last_layer(int layer) const { return layer == nlayers() - 1; }
/// Is the given layer an entry point? It is if explicitly tagged as
/// such, or if no layers are so tagged then the last layer is the one
@@ -1925,10 +1889,7 @@ public:
: is_last_layer(layer);
}
int raytype_queries() const
{
return m_raytype_queries;
}
int raytype_queries() const { return m_raytype_queries; }
/// Optionally set which ray types are known to be on or off (0 means
/// not known at optimize time).
@@ -1937,19 +1898,10 @@ public:
m_raytypes_on = raytypes_on;
m_raytypes_off = raytypes_off;
}
int raytypes_on() const
{
return m_raytypes_on;
}
int raytypes_off() const
{
return m_raytypes_off;
}
int raytypes_on() const { return m_raytypes_on; }
int raytypes_off() const { return m_raytypes_off; }
void clear_symlocs()
{
m_symlocs.clear();
}
void clear_symlocs() { m_symlocs.clear(); }
void add_symlocs(cspan<SymLocationDesc> symlocs)
{
for (auto& s : symlocs) {
@@ -1989,10 +1941,7 @@ public:
// live with the group and copy the initial data.
void setup_interactive_arena(cspan<uint8_t> paramblock);
uint8_t* interactive_arena_ptr()
{
return m_interactive_arena.get();
}
uint8_t* interactive_arena_ptr() { return m_interactive_arena.get(); }
device_ptr<uint8_t>& device_interactive_arena()
{
@@ -2331,25 +2280,13 @@ public:
/// Return a pointer to the shading group for this context.
///
ShaderGroup* group()
{
return m_group;
}
const ShaderGroup* group() const
{
return m_group;
}
void group(ShaderGroup* grp)
{
m_group = grp;
}
ShaderGroup* group() { return m_group; }
const ShaderGroup* group() const { return m_group; }
void group(ShaderGroup* grp) { m_group = grp; }
/// Return a reference to the MessageList containing messages.
///
MessageList& messages()
{
return m_messages;
}
MessageList& messages() { return m_messages; }
#if OSL_USE_BATCHED
BatchedMessageBuffer& batched_messages_buffer()
{
@@ -2376,10 +2313,7 @@ public:
int array_lookup, int index, TypeDesc attr_type,
void* attr_dest);
PerThreadInfo* thread_info() const
{
return m_threadinfo;
}
PerThreadInfo* thread_info() const { return m_threadinfo; }
TextureSystem::Perthread* texture_thread_info() const
{
@@ -2399,20 +2333,11 @@ public:
return thread_info()->llvm_thread_info;
}
TextureOpt* texture_options_ptr()
{
return &m_textureopt;
}
TextureOpt* texture_options_ptr() { return &m_textureopt; }
RendererServices::NoiseOpt* noise_options_ptr()
{
return &m_noiseopt;
}
RendererServices::NoiseOpt* noise_options_ptr() { return &m_noiseopt; }
RendererServices::TraceOpt* trace_options_ptr()
{
return &m_traceopt;
}
RendererServices::TraceOpt* trace_options_ptr() { return &m_traceopt; }
void* alloc_scratch(size_t size, size_t align = 1)
{
@@ -2423,15 +2348,9 @@ public:
bool ocio_transform(StringParam fromspace, StringParam tospace,
const Color& C, Color& Cout);
void incr_layers_executed()
{
++m_stat_layers_executed;
}
void incr_layers_executed() { ++m_stat_layers_executed; }
void incr_get_userdata_calls()
{
++m_stat_get_userdata_calls;
}
void incr_get_userdata_calls() { ++m_stat_get_userdata_calls; }
// Clear the stats we record per-execution in this context (unlocked)
void clear_runtime_stats()
@@ -2581,10 +2500,7 @@ private:
// When interpreting symbol addresses we need to know if the
// wide data offsets should be used
int batch_size_executed;
bool execution_is_batched() const
{
return batch_size_executed != 0;
}
bool execution_is_batched() const { return batch_size_executed != 0; }
};
+8 -1
View File
@@ -3,6 +3,7 @@
// https://github.com/AcademySoftwareFoundation/OpenShadingLanguage
#include <cstdarg>
#include <sstream>
#include "pointcloud.h"
@@ -29,7 +30,13 @@ PointCloud::get(ustringhash filename, bool write)
// Not found. Create a new one.
Partio::ParticlesDataMutable* partio_cloud = nullptr;
if (!write) {
partio_cloud = Partio::read(filename.c_str(), false);
// Mute Partio error prints: by default Partio::read sends errors directly
// to std::err, but in most cases we want errors to go via errorfmt so the
// renderer can recognize the message as an error, as we do in
// pointcloud_search and pointcloud_get.
std::stringstream m_errorStream;
partio_cloud = Partio::read(filename.c_str(), false, m_errorStream);
if (!partio_cloud)
return nullptr;
} else {
+4
View File
@@ -42,6 +42,8 @@ static ustring u_setmessage("setmessage");
static ustring u_getmessage("getmessage");
static ustring u_getattribute("getattribute");
static ustring u_backfacing("backfacing");
static ustring u_calculatenormal("calculatenormal");
static ustring u_flipHandedness("flipHandedness");
static ustring u_N("N");
static ustring u_I("I");
@@ -3352,6 +3354,8 @@ RuntimeOptimizer::run()
} else if (op.opname() == u_backfacing) {
m_globals_needed.insert(u_N);
m_globals_needed.insert(u_I);
} else if (op.opname() == u_calculatenormal) {
m_globals_needed.insert(u_flipHandedness);
} else if (op.opname() == u_getattribute) {
Symbol* sym1 = opargsym(op, 1);
OSL_DASSERT(sym1 && sym1->typespec().is_string());
+4 -4
View File
@@ -74,8 +74,8 @@ __OSL_MASKED_OP3(dict_find, Wi, Wi, Ws)(void* bsg_, void* wout, void* wnodeID,
int nodeID = wNID[lane];
ustring query = wQ[lane];
wOut[lane] = bsg->uniform.context->dict_find(
nullptr /*causes errors be reported through ShadingContext*/,
nodeID, query);
nullptr /*causes errors be reported through ShadingContext*/,
nodeID, query);
});
}
@@ -109,8 +109,8 @@ __OSL_MASKED_OP3(dict_find, Wi, Ws, Ws)(void* bsg_, void* wout,
ustring dictionary = wD[lane];
ustring query = wQ[lane];
wOut[lane] = bsg->uniform.context->dict_find(
nullptr /*causes errors be reported through ShadingContext*/,
dictionary, query);
nullptr /*causes errors be reported through ShadingContext*/,
dictionary, query);
});
}
+2 -2
View File
@@ -300,8 +300,8 @@ splineinverse_search(const MatrixT& M, R_T& result, X_T& xval, KArrayT knots,
// We can NOT use the low and high knot values,
// so will need to extract 2 more knot values
// to detect if we are increasing
K_T k1 = knots[1]; // knots is proxy, must export to local
K_T k2 = knots[knot_count - 2];
K_T k1 = knots[1]; // knots is proxy, must export to local
K_T k2 = knots[knot_count - 2];
increasing = k1 < k2;
}
+2 -2
View File
@@ -112,8 +112,8 @@ default_texture(BatchedRendererServices* bsr, ustring filename,
float dsdy = wdsdy[lane];
float dtdy = wdtdy[lane];
retVal = bsr->texturesys()->texture(
texture_handle, texture_thread_info, opt, ws[lane], wt[lane], dsdx,
dtdx, dsdy, dtdy, 4, (float*)&result_simd,
texture_handle, texture_thread_info, opt, ws[lane], wt[lane], dsdx,
dtdx, dsdy, dtdy, 4, (float*)&result_simd,
has_derivs ? (float*)&dresultds_simd : NULL,
has_derivs ? (float*)&dresultdt_simd : NULL);
+12 -12
View File
@@ -563,16 +563,16 @@ scalar_gabor3(const Dual2<Vec3>& P, const sfm::GaborUniformParams& gup,
// to better enable SROA (Scalar Replacement of Aggregates) optimizations
if (seed == 0) {
result.val().x = resultPart.val();
result.dx().x = resultPart.dx();
result.dy().x = resultPart.dy();
result.dx().x = resultPart.dx();
result.dy().x = resultPart.dy();
} else if (seed == 1) {
result.val().y = resultPart.val();
result.dx().y = resultPart.dx();
result.dy().y = resultPart.dy();
result.dx().y = resultPart.dx();
result.dy().y = resultPart.dy();
} else {
result.val().z = resultPart.val();
result.dx().z = resultPart.dx();
result.dy().z = resultPart.dy();
result.dx().z = resultPart.dx();
result.dy().z = resultPart.dy();
}
}
#endif
@@ -646,16 +646,16 @@ scalar_pgabor3(const Dual2<Vec3>& P, const Vec3& Pperiod,
// to better enable SROA (Scalar Replacement of Aggregates) optimizations
if (seed == 0) {
result.val().x = resultPart.val();
result.dx().x = resultPart.dx();
result.dy().x = resultPart.dy();
result.dx().x = resultPart.dx();
result.dy().x = resultPart.dy();
} else if (seed == 1) {
result.val().y = resultPart.val();
result.dx().y = resultPart.dx();
result.dy().y = resultPart.dy();
result.dx().y = resultPart.dx();
result.dy().y = resultPart.dy();
} else {
result.val().z = resultPart.val();
result.dx().z = resultPart.dx();
result.dy().z = resultPart.dy();
result.dx().z = resultPart.dx();
result.dy().z = resultPart.dy();
}
}
#endif
+1 -1
View File
@@ -798,7 +798,7 @@ OSLToyMainWindow::osl_do_rerender(float /*frametime*/)
float start = timer();
renderer()->set_time(start);
renderer()->render_image();
OIIO_UNUSED_OK float rendertime = timer() - start;
OIIO_MAYBE_UNUSED float rendertime = timer() - start;
renderView->update(renderer()->framebuffer());
+2 -2
View File
@@ -445,7 +445,7 @@ OptixRaytracer::make_optix_materials()
quad_hitgroup_desc.hitgroup.moduleCH = wrapper_module;
quad_hitgroup_desc.hitgroup.entryFunctionNameCH
= "__closesthit__closest_hit_osl";
quad_hitgroup_desc.hitgroup.moduleAH = wrapper_module;
quad_hitgroup_desc.hitgroup.moduleAH = wrapper_module;
quad_hitgroup_desc.hitgroup.entryFunctionNameAH = "__anyhit__any_hit_shadow";
quad_hitgroup_desc.hitgroup.moduleIS = quad_module;
quad_hitgroup_desc.hitgroup.entryFunctionNameIS = "__intersection__quad";
@@ -494,7 +494,7 @@ OptixRaytracer::make_optix_materials()
sphere_hitgroup_desc.hitgroup.moduleAH = wrapper_module;
sphere_hitgroup_desc.hitgroup.entryFunctionNameAH
= "__anyhit__any_hit_shadow";
sphere_hitgroup_desc.hitgroup.moduleIS = sphere_module;
sphere_hitgroup_desc.hitgroup.moduleIS = sphere_module;
sphere_hitgroup_desc.hitgroup.entryFunctionNameIS = "__intersection__sphere";
OptixProgramGroup sphere_hitgroup;
create_optix_pg(&sphere_hitgroup_desc, 1, &program_options,
+1 -1
View File
@@ -1646,7 +1646,7 @@ process_bsdf_closure(const OSL::ShaderGlobals& sg, ShadingResult& result,
}
case MX_CONDUCTOR_ID: {
const MxConductorParams& params = *comp->as<MxConductorParams>();
ok = result.bsdf.add_bsdf<
ok = result.bsdf.add_bsdf<
MxMicrofacet<MxConductorParams, GGXDist, false>>(cw, params,
1.0f);
break;
+2 -2
View File
@@ -35,8 +35,8 @@ struct BSDF {
BSDF() {}
virtual Color3 get_albedo(const Vec3& /*wo*/) const { return Color3(1); }
virtual Sample eval(const Vec3& wo, const Vec3& wi) const = 0;
virtual Sample sample(const Vec3& wo, float rx, float ry,
float rz) const = 0;
virtual Sample sample(const Vec3& wo, float rx, float ry, float rz) const
= 0;
};
/// Represents a weighted sum of BSDFS
+1 -1
View File
@@ -57,7 +57,7 @@ static std::string scenefile, imagefile;
static std::string shaderpath;
static bool shadingsys_options_set = false;
static bool use_optix = OIIO::Strutil::stoi(
OIIO::Sysutil::getenv("TESTSHADE_OPTIX"));
OIIO::Sysutil::getenv("TESTSHADE_OPTIX"));
static bool optix_no_inline = false;
static bool optix_no_inline_layer_funcs = false;
static bool optix_no_merge_layer_funcs = false;
+1 -1
View File
@@ -87,7 +87,7 @@ static bool userdata_isconnected = false;
static bool print_outputs = false;
static bool output_placement = true;
static bool use_optix = OIIO::Strutil::stoi(
OIIO::Sysutil::getenv("TESTSHADE_OPTIX"));
OIIO::Sysutil::getenv("TESTSHADE_OPTIX"));
static bool optix_no_inline = false;
static bool optix_no_inline_layer_funcs = false;
static bool optix_no_merge_layer_funcs = false;
+1 -1
View File
@@ -20,7 +20,7 @@ testing with spaces:
color ("hsl", 0, 0, 0.5) = 0.5 0.5 0.5
color ("hsl", 0.5, 1, 0.1) = 0 0.2 0.2
color ("YIQ", 0.5, 0.25, 0.25) = 0.8939 0.270375 0.649225
color ("XYZ", 0.25, 0.5, 0.25) = -0.0831534 0.705882 0.176283
color ("XYZ", 0.25, 0.5, 0.25) = -0.08315 0.7059 0.1763
luminance(0.5 0.75 0.75) = 0.696873
luminance(0.5 0.5 0.5) = 0.5
+1 -1
View File
@@ -20,7 +20,7 @@ testing with spaces:
color ("hsl", 0, 0, 0.5) = 0.5 0.5 0.5
color ("hsl", 0.5, 1, 0.1) = 0 0.2 0.2
color ("YIQ", 0.5, 0.25, 0.25) = 0.8939 0.270375 0.649225
color ("XYZ", 0.25, 0.5, 0.25) = -0.0831534 0.705883 0.176283
color ("XYZ", 0.25, 0.5, 0.25) = -0.08315 0.7059 0.1763
luminance(0.5 0.75 0.75) = 0.696873
luminance(0.5 0.5 0.5) = 0.5
+1 -1
View File
@@ -63,7 +63,7 @@ test (color cparam = color (.1, .7, .2),
printf (" color (\"YIQ\", %g, %g, %g) = %g\n",
pretty(Y), pretty(I), pretty(Q), pretty(color("YIQ", Y,I,Q)));
float x = 0.25, y = 0.5, z = 0.25;
printf (" color (\"XYZ\", %g, %g, %g) = %g\n",
printf (" color (\"XYZ\", %0.4g, %0.4g, %0.4g) = %0.4g\n",
pretty(x), pretty(y), pretty(z), pretty(color("XYZ",x,y,z)));
}
@@ -0,0 +1,9 @@
// Copyright Contributors to the Open Shading Language project.
// SPDX-License-Identifier: BSD-3-Clause
// https://github.com/AcademySoftwareFoundation/OpenShadingLanguage
shader printcalculatenormal ()
{
normal n2 = calculatenormal(P+1);
printf ("calculatenormal = %f", n2);
}
+1
View File
@@ -1 +1,2 @@
Need 2 globals: I N
Need 2 globals: P flipHandedness
+1
View File
@@ -5,6 +5,7 @@
# https://github.com/AcademySoftwareFoundation/OpenShadingLanguage
command += testshade("-g 2 2 -debug printbackfacing")
command += testshade("-g 2 2 -debug printcalculatenormal")
# debug output is very verbose, use regexp to filter down to
# only the line we're interested in testing
+17
View File
@@ -0,0 +1,17 @@
#!/usr/bin/env python
# Copyright Contributors to the Open Shading Language project.
# SPDX-License-Identifier: BSD-3-Clause
# https://github.com/AcademySoftwareFoundation/OpenShadingLanguage
###############################
#
###############################
command += testshade("-t 1 -g 32 32 -od uint8 test -o cout out.tif ")
outputs.append ("out.tif")
# expect a few LSB failures
failthresh = 0.008
failpercent = 3
+39
View File
@@ -0,0 +1,39 @@
// Copyright Contributors to the Open Shading Language project.
// SPDX-License-Identifier: BSD-3-Clause
// https://github.com/AcademySoftwareFoundation/OpenShadingLanguage
float limit_early_return(float channel) {
if (channel > 1.0) {
//exit();
return 1.0;
}
return channel;
}
float limit_single_return(float channel) {
float result = channel;
if (channel > 1.0) {
result = 1.0;
}
return result;
}
color soft_clip(color in_color)
{
color result;
for (int i=0; i < 3; ++i)
{
#if 1
result[i] = limit_early_return(in_color[i]);
#else
result[i] = limit_single_return(in_color[i]);
#endif
}
return result;
}
shader test (output color cout = 0)
{
color pixel = 2*P;
cout = soft_clip(pixel);
}
+2
View File
@@ -6,5 +6,7 @@
failthresh = 0.01
failpercent = 1
hardfail = 0.11
outputs = [ "out.exr" ]
command = testrender("-r 320 240 -aa 4 scene.xml out.exr")
+4
View File
@@ -4,6 +4,10 @@
# SPDX-License-Identifier: BSD-3-Clause
# https://github.com/AcademySoftwareFoundation/OpenShadingLanguage
failthresh = 0.01
failpercent = 0.5
hardfail = 0.035
outputs = [ "out.exr" ]
command = testrender("-r 256 256 -aa 4 --llvm_opt 13 bumptest.xml out.exr")
Binary file not shown.
@@ -6,5 +6,7 @@
failthresh = 0.01
failpercent = 1
hardfail = 0.016
outputs = [ "out.exr" ]
command = testrender("-r 320 240 -aa 4 scene.xml out.exr")
@@ -6,7 +6,7 @@
failthresh = 0.02
failpercent = 1
hardfail = 0.022
hardfail = 0.037
outputs = [ "out.exr" ]
command = testrender("-v -r 320 240 -aa 8 scene.xml out.exr")
+3 -1
View File
@@ -4,7 +4,9 @@
# SPDX-License-Identifier: BSD-3-Clause
# https://github.com/AcademySoftwareFoundation/OpenShadingLanguage
failthresh = 0.01
failthresh = 0.034
failpercent = 1
idiff_program = "idiff"
outputs = [ "out.exr" ]
command = testrender("-r 320 240 -aa 4 scene.xml out.exr")
+4 -1
View File
@@ -4,7 +4,10 @@
# SPDX-License-Identifier: BSD-3-Clause
# https://github.com/AcademySoftwareFoundation/OpenShadingLanguage
failthresh = 0.01
failthresh = 0.013
failpercent = 1
allowfailures = 3
idiff_program = "idiff"
outputs = [ "out.exr" ]
command = testrender("-r 320 240 -aa 8 scene.xml out.exr")
Binary file not shown.
+3
View File
@@ -6,5 +6,8 @@
failthresh = 0.01
failpercent = 1
allowfailures = 3
idiff_program = "idiff"
outputs = [ "out.exr" ]
command = testrender("-r 320 240 -aa 4 scene.xml out.exr")
+15 -10
View File
@@ -84,6 +84,8 @@ failureok = 0
failthresh = 0.004
hardfail = 0.01
failpercent = 0.02
failrelative = 0.001
allowfailures = 0
idiff_program = "oiiotool"
idiff_postfilecmd = ""
skip_diff = int(os.environ.get("OSL_TESTSUITE_SKIP_DIFF", "0"))
@@ -91,7 +93,7 @@ skip_diff = int(os.environ.get("OSL_TESTSUITE_SKIP_DIFF", "0"))
filter_re = None
cleanup_on_success = False
if int(os.getenv('TESTSUITE_CLEANUP_ON_SUCCESS', '0')) :
cleanup_on_success = True;
cleanup_on_success = True
oslcargs = "-Wall"
image_extensions = [ ".tif", ".tx", ".exr", ".jpg", ".png", ".rla",
@@ -215,7 +217,7 @@ def oiiotool (args, silent=False) :
if not silent :
oiiotool_cmd += redirect
oiiotool_cmd += " ;\n"
return oiiotool_cmd;
return oiiotool_cmd
# Construct a command that runs maketx, appending console output
# to the file "out.txt".
@@ -226,18 +228,21 @@ def maketx (args) :
# the file "out.txt". We allow a small number of pixels to have up to
# 1 LSB (8 bit) error, it's very hard to make different platforms and
# compilers always match to every last floating point bit.
def oiiodiff (fileA, fileB, extraargs="", silent=True, concat=True,
diffprogram=idiff_program, postfilecmd=idiff_postfilecmd) :
command = (oiio_app(diffprogram) + "-a"
+ " -fail " + str(failthresh)
def oiiodiff (fileA, fileB, extraargs="", silent=True, concat=True) :
threshargs = (" -fail " + str(failthresh)
+ " -failpercent " + str(failpercent)
+ " -hardfail " + str(hardfail)
+ " -warn " + str(2*failthresh)
+ " -warnpercent " + str(failpercent)
+ " -warnpercent " + str(failpercent))
if idiff_program == "idiff" :
threshargs += (" -failrelative " + str(failrelative)
+ " -allowfailures " + str(allowfailures))
command = (oiio_app(idiff_program) + "-a"
+ " " + threshargs
+ " " + extraargs
+ " " + make_relpath(fileA,tmpdir) + postfilecmd
+ " " + make_relpath(fileB,tmpdir) + postfilecmd
+ (" --diff" if diffprogram == "oiiotool" else ""))
+ " " + make_relpath(fileA,tmpdir) + idiff_postfilecmd
+ " " + make_relpath(fileB,tmpdir) + idiff_postfilecmd
+ (" --diff" if idiff_program == "oiiotool" else ""))
if not silent :
command += redirect
if concat: