Page MenuHome

Update to OSL 1.4.0
Closed, ResolvedPublicTO DO

Description

Hi,
just a todo item for OSL 1.4.0.

Larry made a beta release, it would be great if we could check this and see if it runs fine with Cycles, so we can still report compile errors or bugs before they tag the official release. https://github.com/imageworks/OpenShadingLanguage/releases/tag/Release-1.4.0beta

I Will check this on Windows this week and report any possible problems here.

Event Timeline

Thomas Dinges (dingto) raised the priority of this task from to Normal.
Thomas Dinges (dingto) updated the task description. (Show Details)
Thomas Dinges (dingto) edited a custom field.

Ok, of course this doesn't work out of the box. Tested on Windows x64.

Changes to build config were needed:

  1. CMakeLists has been moved 1 level up, so the line needs to be:

cmake -G "NMake Makefiles" ..\..\ ^

  1. USE_TBB flag is deprecated and can be removed
  1. We need to pass "USING_OIIO_PUGI=ON" somehow, and probably "USE_EXTERNAL_PUGIXML=OFF", although the latter seems to be off by default.

Otherwise we get namespace errors src\liboslexec\dictionary.cpp

  1. Time to let msvc 2008 die...missing math defines in src\liboslexec\constfold.c.

The issue is, msvc 2008 doesn't know functions like "expm1f". So we either work around here and submit a patch upstream to use alternatives, or we update to vc2012 finally.

OIIO does contain a windows version of expm1f, it's used in llvm_ops.cpp, so should work in constfold.cpp as well, it's not clear to me why it doesn't work here.

I don't mind moving to vc2012 though.

Ah I see, llvm_ops.cpp has a #ifdef _WIN32 block with OIIO math lines, will try to add that for constfold.cpp too.

Ok I got it to compile now, added the #ifdef _WIN32 math block to constfold.cpp and also had to comment/remove the ASSERT_MSG from llvm_instance.cpp.
I think those 2 things should be pushed upstream.

Runtime wise, it works fine (no crashes or wrong renders) and I see a nice performance increase. Depends on the scene but it looks nice:

Cornell Box: From 54s to 48s.
Color Ramp: From 1.30 min to 1.08 min.

That's a pretty great performance improvement.

Feel free to commit these libraries. I can look over the patches, or you can create a pull request yourself, whatever you prefer.

I'd like to update together with a new OIIO (and new OpenEXR maybe), as suggested by Dalai.
He needs the new OIIO libs for the .psd support on Windows, so better to do it together.

I will doublecheck the OSL changes and create a diff, want to double check this PUGIXML thing. Still not entirely sure if it's just a issue in our build.bat or the actual code.

Thomas Dinges (dingto) changed the task status from Unknown Status to Resolved.Dec 6 2013, 5:43 PM
Thomas Dinges (dingto) claimed this task.

Commited new libs for x64 and x86 now (msvc 2008).
I also added the .patch file, it's a minor change, so no big deal. Would be nice to get those upstream nevertheless.

What bothers me more is a problem with a OIIO include. OpenImageIO\tinyformat. Line 273/274 cause errors on OSL lib compilation, I commented those during the compilation to fix it. Maybe this can be fixed upstream too, I am not sure what the exact issue here is , compiler complained about "DummyType".

Thanks for your advice on this Brecht, closing now. :)