Update to OSL 1.4.0 #37527

Closed
opened 2013-11-18 22:09:33 +01:00 by Thomas Dinges · 10 comments

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.

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.
Author
Owner

Changed status to: 'Open'

Changed status to: 'Open'
Author
Owner

Added subscribers: @ThomasDinges, @brecht

Added subscribers: @ThomasDinges, @brecht
Author
Owner

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" ....\ ^

  2. USE_TBB flag is deprecated and can be removed

  3. 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

  4. 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.

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" ..\..\ ^ 2) USE_TBB flag is deprecated and can be removed 3) 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 4) 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.

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.
Author
Owner

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

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

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.

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.

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.
Author
Owner

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.

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.
Author
Owner

Changed status from 'Open' to: 'Resolved'

Changed status from 'Open' to: 'Resolved'
Thomas Dinges self-assigned this 2013-12-06 17:43:16 +01:00
Author
Owner

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. :)

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. :)
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#37527
No description provided.