Skip to content

Commit

Permalink
Bump minimum OIIO version to 2.0 (#1038)
Browse files Browse the repository at this point in the history
  • Loading branch information
lgritz committed Jul 8, 2019
1 parent ae65c11 commit 1fd6847
Show file tree
Hide file tree
Showing 10 changed files with 10 additions and 44 deletions.
8 changes: 4 additions & 4 deletions .travis.yml
Expand Up @@ -148,7 +148,7 @@ matrix:
- libboost-thread1.55
- libboost-wave1.55
env: WHICHGCC=4.8 USE_CPP=11 LLVM_VERSION=6.0.1 USE_SIMD=sse4.2 OIIOBRANCH=release
- name: "Older things: OIIO 1.9, llvm 5, boost 1.55"
- name: "Older things: OIIO 2.0, llvm 5, boost 1.55"
os: linux
compiler: gcc
addons:
Expand All @@ -163,7 +163,7 @@ matrix:
- libboost-system1.55
- libboost-thread1.55
- libboost-wave1.55
env: WHICHGCC=4.8 USE_CPP=11 LLVM_VERSION=5.0.0 USE_SIMD=sse4.2 OIIOBRANCH=RB-1.9
env: WHICHGCC=4.8 USE_CPP=11 LLVM_VERSION=5.0.0 USE_SIMD=sse4.2 OIIOBRANCH=RB-2.0
if: branch =~ /(master|RB|travis)/ OR type = pull_request
- name: "gcc7, llvm7, C++14"
os: linux
Expand Down Expand Up @@ -214,7 +214,7 @@ matrix:
- libboost-thread1.55
- libboost-wave1.55
env: DEBUG=1 LLVM_VERSION=7.0.0 OIIOBRANCH=master
- name: "Oldest everything: LLVM 5, OIIO 1.8, no simd"
- name: "Oldest everything: LLVM 5, OIIO 2.0, no simd"
os: linux
compiler: gcc
addons:
Expand All @@ -229,7 +229,7 @@ matrix:
- libboost-system1.55
- libboost-thread1.55
- libboost-wave1.55
env: USE_SIMD=0 LLVM_VERSION=5.0.0 OIIOBRANCH=RB-1.8
env: USE_SIMD=0 LLVM_VERSION=5.0.0 OIIOBRANCH=RB-2.0
if: branch =~ /(master|RB|travis)/ OR type = pull_request

notifications:
Expand Down
2 changes: 1 addition & 1 deletion INSTALL.md
Expand Up @@ -20,7 +20,7 @@ NEW or CHANGED dependencies since the last major release are **bold**.
OSL should compile also properly with C++14 or C++17, but they are not
required.

* **[OpenImageIO](http://openimageio.org) 1.8.5 or newer**
* **[OpenImageIO](http://openimageio.org) 2.0 or newer**

OSL uses OIIO both for its texture mapping functionality as well as
numerous utility classes. If you are integrating OSL into an existing
Expand Down
2 changes: 1 addition & 1 deletion src/cmake/externalpackages.cmake
Expand Up @@ -57,7 +57,7 @@ endif ()

set (OIIO_LIBNAME_SUFFIX "" CACHE STRING
"Optional name appended to OIIO libraries that are built")
find_package (OpenImageIO 1.8.5 REQUIRED)
find_package (OpenImageIO 2.0 REQUIRED)
include_directories ("${OPENIMAGEIO_INCLUDE_DIR}")
link_directories ("${OPENIMAGEIO_LIBRARY_DIRS}")
message (STATUS "Using OpenImageIO ${OPENIMAGEIO_VERSION}")
Expand Down
17 changes: 3 additions & 14 deletions src/include/OSL/oslconfig.h
Expand Up @@ -104,13 +104,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <OpenImageIO/typedesc.h>
#include <OpenImageIO/ustring.h>
#include <OpenImageIO/platform.h>

// Make sure we can use OIIO::cspan
#if OIIO_VERSION >= 10904
# include <OpenImageIO/span.h>
#else
# include <OpenImageIO/array_view.h>
#endif
#include <OpenImageIO/span.h>

// If we're using an old version of OIIO prior to the introduction of
// Strutil::sprintf, define it ourselves to be a synonym for format.
Expand Down Expand Up @@ -166,13 +160,8 @@ using OIIO::TypeDesc;
using OIIO::ustring;
using OIIO::ustringHash;
using OIIO::string_view;

// Make sure we can use OIIO::cspan
#if OIIO_VERSION >= 10904
using OIIO::cspan;
#else
template<typename T> using cspan = OIIO::array_view<const T>;
#endif
using OIIO::span;
using OIIO::cspan;


// In C++20 (and some compilers before that), __has_cpp_attribute can
Expand Down
4 changes: 1 addition & 3 deletions src/include/OSL/oslexec.h
Expand Up @@ -36,9 +36,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

#include <OpenImageIO/refcnt.h>
#include <OpenImageIO/ustring.h>
#if OPENIMAGEIO_VERSION <= 10902
#include <OpenImageIO/imagebufalgo_util.h>
#endif


OSL_NAMESPACE_ENTER

Expand Down
5 changes: 0 additions & 5 deletions src/liboslexec/dual_test.cpp
Expand Up @@ -37,11 +37,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

using namespace OSL;

// Fix namespace problem with OIIO unit tests in older versions.
#if OIIO_VERSION < 10901
using namespace OIIO;
#endif

typedef Dual<float,1> Dualf;
typedef Dual2<float> Dual2f;

Expand Down
6 changes: 0 additions & 6 deletions src/liboslnoise/oslnoise_test.cpp
Expand Up @@ -174,7 +174,6 @@ test_perlin ()
OIIO_CHECK_EQUAL_THRESH (vs4, vresults_4d[i], eps);
}

#if OPENIMAGEIO_VERSION >= 10904
// Make sure the right thing happens at integer cell boundaries.
// Perlin noise should be continuous everywhere.
OIIO_CHECK_EQUAL_APPROX (noise( 0.9999f), noise( 1.0f));
Expand All @@ -185,7 +184,6 @@ test_perlin ()
OIIO_CHECK_EQUAL_APPROX (noise(-0.9999f), noise(-1.0f));
Strutil::printf ("noise around -1: %g %g %g\n",
noise(-0.9999f), noise(-1.0f), noise(-1.0001f));
#endif

if (make_images) {
MAKE_IMAGE (noise);
Expand Down Expand Up @@ -262,7 +260,6 @@ test_cell ()
OIIO_CHECK_EQUAL_THRESH (vs4, vresults_4d[i], eps);
}

#if OPENIMAGEIO_VERSION >= 10904
// Make sure the right thing happens at integer cell boundaries
OIIO_CHECK_EQUAL (cellnoise( 1.0001f), cellnoise( 1.0f));
OIIO_CHECK_NE (cellnoise( 0.9999f), cellnoise( 1.0f));
Expand All @@ -272,7 +269,6 @@ test_cell ()
OIIO_CHECK_EQUAL (cellnoise(-0.0001f), cellnoise(-1.0f));
OIIO_CHECK_EQUAL (cellnoise(-0.9999f), cellnoise(-1.0f));
OIIO_CHECK_EQUAL (cellnoise(-1.0001f), cellnoise(-2.0f));
#endif

if (make_images) {
MAKE_IMAGE (cellnoise);
Expand Down Expand Up @@ -350,7 +346,6 @@ test_hash ()
OIIO_CHECK_EQUAL_THRESH (vs4, vresults_4d[i], eps);
}

#if OPENIMAGEIO_VERSION >= 10904
// Make sure the right thing happens at integer cell boundaries.
// hashnoise should be discontinuous everywhere!
OIIO_CHECK_NE (hashnoise( 0.9999f), hashnoise( 1.0f));
Expand All @@ -359,7 +354,6 @@ test_hash ()
OIIO_CHECK_NE (hashnoise( 0.0001f), hashnoise( 0.0f));
OIIO_CHECK_NE (hashnoise(-1.0001f), hashnoise(-1.0f));
OIIO_CHECK_NE (hashnoise(-0.9999f), hashnoise(-1.0f));
#endif

if (make_images) {
MAKE_IMAGE (hashnoise);
Expand Down
6 changes: 0 additions & 6 deletions src/osltoy/osltoyapp.cpp
Expand Up @@ -1123,13 +1123,7 @@ OSLToyMainWindow::set_param_diddle (ParamRec *param, int diddle)
void
OSLToyMainWindow::set_param_instance_value (ParamRec *param)
{
#if OPENIMAGEIO_VERSION >= 10903
m_shaderparam_instvalues.remove (param->name);
#else
auto&& found = m_shaderparam_instvalues.find (param->name);
if (found != m_shaderparam_instvalues.end())
m_shaderparam_instvalues.erase (found);
#endif

if (param->type == TypeDesc::INT) {
int v = reinterpret_cast<QSpinBox*>(param->widgets[0])->value();
Expand Down
2 changes: 0 additions & 2 deletions src/osltoy/osltoyrenderer.cpp
Expand Up @@ -127,11 +127,9 @@ OSLToyRenderer::render_image ()
static ustring outputs[] = { ustring("Cout") };
// OIIO::Timer timer;
OIIO::ImageBufAlgo::parallel_image_options popt;
#if OPENIMAGEIO_VERSION > 10902
popt.minitems = 4096;
popt.splitdir = OIIO::Split_Tile;
popt.recursive = true;
#endif
shade_image (*shadingsys(), *shadergroup(), &m_shaderglobals_template,
m_framebuffer, outputs, ShadePixelCenters, OIIO::ROI(), popt);
// std::cout << timer() << "\n";
Expand Down
2 changes: 0 additions & 2 deletions src/testshade/testshade.cpp
Expand Up @@ -1320,7 +1320,6 @@ test_shade (int argc, const char *argv[])
delete shadingsys;
int retcode = EXIT_SUCCESS;

#if OPENIMAGEIO_VERSION >= 10904
// Double check that there were no uncaught errors in the texture
// system and image cache.
std::string err = texturesys->geterror();
Expand All @@ -1334,7 +1333,6 @@ test_shade (int argc, const char *argv[])
std::cout << "ERRORS left in ImageCache:\n" << err << "\n";
retcode = EXIT_FAILURE;
}
#endif

delete rend;

Expand Down

0 comments on commit 1fd6847

Please sign in to comment.