Date   

Upcoming Events #cal-summary

osl-dev@lists.aswf.io Calendar <osl-dev@...>
 

Open Shading Language discussion list Upcoming Events

OSL TSC meeting ( every other week )

When:
Thursday, September 16, 2021, 2:00pm to 3:00pm
(GMT-07:00) America/Los Angeles

Where:
https://zoom.us/j/100511909

Organizer: Chris Kulla ckulla@...

Details:

Every other week meeting of the OSL TSC.

Meeting Agenda / Notes: https://docs.google.com/document/d/1yf0bG6eoE2EvKZBNZX3nskdTvu99ADTDTNOknCDJd1I/

Confirm this meeting invite is still valid by finding the meeting at https://lists.aswf.io/calendar.

Join Zoom Meeting https://zoom.us/j/100511909

Meeting ID: 100 511 909

One tap mobile +16465588656,,100511909# US (New York) +13126266799,,100511909# US (Chicago)

Dial by your location +1 646 558 8656 US (New York) +1 312 626 6799 US (Chicago) +1 669 900 6833 US (San Jose) +1 253 215 8782 US +1 301 715 8592 US +1 346 248 7799 US (Houston) 877 369 0926 US Toll-free 855 880 1246 US Toll-free +1 587 328 1099 Canada +1 647 374 4685 Canada +1 647 558 0588 Canada +1 778 907 2071 Canada +1 438 809 7799 Canada 855 703 8985 Canada Toll-free Meeting ID: 100 511 909 Find your local number: https://zoom.us/u/acBVrM6HWR

View Event


OSL TSC meeting ( every other week )

When:
Thursday, September 30, 2021, 2:00pm to 3:00pm
(GMT-07:00) America/Los Angeles

Where:
https://zoom.us/j/100511909

Organizer: Chris Kulla ckulla@...

Details:

Every other week meeting of the OSL TSC.

Meeting Agenda / Notes: https://docs.google.com/document/d/1yf0bG6eoE2EvKZBNZX3nskdTvu99ADTDTNOknCDJd1I/

Confirm this meeting invite is still valid by finding the meeting at https://lists.aswf.io/calendar.

Join Zoom Meeting https://zoom.us/j/100511909

Meeting ID: 100 511 909

One tap mobile +16465588656,,100511909# US (New York) +13126266799,,100511909# US (Chicago)

Dial by your location +1 646 558 8656 US (New York) +1 312 626 6799 US (Chicago) +1 669 900 6833 US (San Jose) +1 253 215 8782 US +1 301 715 8592 US +1 346 248 7799 US (Houston) 877 369 0926 US Toll-free 855 880 1246 US Toll-free +1 587 328 1099 Canada +1 647 374 4685 Canada +1 647 558 0588 Canada +1 778 907 2071 Canada +1 438 809 7799 Canada 855 703 8985 Canada Toll-free Meeting ID: 100 511 909 Find your local number: https://zoom.us/u/acBVrM6HWR

View Event


Event: OSL TSC meeting ( every other week ) - 09/16/2021 #cal-reminder

osl-dev@lists.aswf.io Calendar <noreply@...>
 

Reminder: OSL TSC meeting ( every other week )

When:
09/16/2021
2:00pm to 3:00pm
(UTC-07:00) America/Los Angeles

Where:
https://zoom.us/j/100511909

Organizer: Chris Kulla ckulla@...

View Event

Description:

Every other week meeting of the OSL TSC.

Meeting Agenda / Notes: https://docs.google.com/document/d/1yf0bG6eoE2EvKZBNZX3nskdTvu99ADTDTNOknCDJd1I/

Confirm this meeting invite is still valid by finding the meeting at https://lists.aswf.io/calendar.

Join Zoom Meeting https://zoom.us/j/100511909

Meeting ID: 100 511 909

One tap mobile +16465588656,,100511909# US (New York) +13126266799,,100511909# US (Chicago)

Dial by your location +1 646 558 8656 US (New York) +1 312 626 6799 US (Chicago) +1 669 900 6833 US (San Jose) +1 253 215 8782 US +1 301 715 8592 US +1 346 248 7799 US (Houston) 877 369 0926 US Toll-free 855 880 1246 US Toll-free +1 587 328 1099 Canada +1 647 374 4685 Canada +1 647 558 0588 Canada +1 778 907 2071 Canada +1 438 809 7799 Canada 855 703 8985 Canada Toll-free Meeting ID: 100 511 909 Find your local number: https://zoom.us/u/acBVrM6HWR


Re: Problem to compile OSL (v1.11.14.2) on ubuntu

Patrick Hodoul
 
Edited

I found a solution by using the ASWF CI build image for OSL.
Refer here for details.


OSL shader language question

Patrick Hodoul
 

Hi,

OCIOv2 now generates an OSL shader program. But I face some irritating syntax changes to accommodate OSL when generating the shader code. To simplify the generation of the code, I would like to write something like:
vector4 res;
color4 color = res;


The idea is to perform some computations with the vector4 'res' variable and another color4 variable representing the input color, and finally store it in the color4 variable (representing the output color) which is passed to the next step in the computation pipeline. Note that the input and output color variables are in fact the same. The example above oversimplifies the code to better highlight the need. I use vector4 by default because of the 'uniform' access to the values i.e. res[x] or res.r, etc and it's close to the GLSL/HLSL syntax.

To make this work, the code recreates the color4 like below. But it will simplify the code to write "color = res;"

color = color4(vector(res.x, res.y, res.z), res.w);
or
color.rgb = color(res.x, res.y, res.z);
color.a = res.w;

Following the really helpful 'operator overloading' idea (that I use a lot) I was wondering if there is a way to implement "color = res;" and also "res = color;"

--
Patrick


Problem to compile OSL (v1.11.14.2) on ubuntu

Patrick Hodoul
 

Hi,

For the OCIOv2 project, I developed a unit test framework to compile and excecute an OSL shader code.
And, I now need to run the OSL unit tests on a Linux platform (I did all my tests on macOS for now).

First of all, I was not able to find the package in apt-get (using the apt-cache search  command). Does the package exists?

Second, I tried to compile OSL on Linux in a docker as it was quite simple on macOS.
Below are my tries to compile OSL:
  • ubuntu 18.04
    • tons of packages to install or manually compile
    • issue with OIIO
      • The installed OIIO is too old i.e. 1.7
      • The OIIO script from OSL fails
      • Manual compilation of OIIO RB-2.0 fails because install pybind11 is too old
      • I stopped my investigations :-(
  • ubuntu 20.04
    • tons of packages to install
    • installed OIIO detected :-)
    • issue with Clang+LLVM
      • the Clang+LLVM script from OSL fails
        • the script is built to run on CI only.
      • apt-get install llvm clang
        • clang is 10.0.0, gcc version 9.3.0
      • cmake -DCMAKE_CXX_STANDARD=14 -DUSE_PYTHON=OFF ../. fails.  :-(
        • /home/devel/osl_1/src/liboslcomp/oslcomp.cpp:24:10: fatal error: clang/Basic/TargetInfo.h: No such file or directory


I'm open to any suggestions, existing docker images, etc.

Thanks,
Patrick


Upcoming Events #cal-summary

osl-dev@lists.aswf.io Calendar <osl-dev@...>
 

Open Shading Language discussion list Upcoming Events

OSL TSC meeting ( every other week )

When:
Thursday, September 16, 2021, 2:00pm to 3:00pm
(GMT-07:00) America/Los Angeles

Where:
https://zoom.us/j/100511909

Organizer: Chris Kulla ckulla@...

Details:

Every other week meeting of the OSL TSC.

Meeting Agenda / Notes: https://docs.google.com/document/d/1yf0bG6eoE2EvKZBNZX3nskdTvu99ADTDTNOknCDJd1I/

Confirm this meeting invite is still valid by finding the meeting at https://lists.aswf.io/calendar.

Join Zoom Meeting https://zoom.us/j/100511909

Meeting ID: 100 511 909

One tap mobile +16465588656,,100511909# US (New York) +13126266799,,100511909# US (Chicago)

Dial by your location +1 646 558 8656 US (New York) +1 312 626 6799 US (Chicago) +1 669 900 6833 US (San Jose) +1 253 215 8782 US +1 301 715 8592 US +1 346 248 7799 US (Houston) 877 369 0926 US Toll-free 855 880 1246 US Toll-free +1 587 328 1099 Canada +1 647 374 4685 Canada +1 647 558 0588 Canada +1 778 907 2071 Canada +1 438 809 7799 Canada 855 703 8985 Canada Toll-free Meeting ID: 100 511 909 Find your local number: https://zoom.us/u/acBVrM6HWR

View Event


OSL TSC meeting ( every other week )

When:
Thursday, September 30, 2021, 2:00pm to 3:00pm
(GMT-07:00) America/Los Angeles

Where:
https://zoom.us/j/100511909

Organizer: Chris Kulla ckulla@...

Details:

Every other week meeting of the OSL TSC.

Meeting Agenda / Notes: https://docs.google.com/document/d/1yf0bG6eoE2EvKZBNZX3nskdTvu99ADTDTNOknCDJd1I/

Confirm this meeting invite is still valid by finding the meeting at https://lists.aswf.io/calendar.

Join Zoom Meeting https://zoom.us/j/100511909

Meeting ID: 100 511 909

One tap mobile +16465588656,,100511909# US (New York) +13126266799,,100511909# US (Chicago)

Dial by your location +1 646 558 8656 US (New York) +1 312 626 6799 US (Chicago) +1 669 900 6833 US (San Jose) +1 253 215 8782 US +1 301 715 8592 US +1 346 248 7799 US (Houston) 877 369 0926 US Toll-free 855 880 1246 US Toll-free +1 587 328 1099 Canada +1 647 374 4685 Canada +1 647 558 0588 Canada +1 778 907 2071 Canada +1 438 809 7799 Canada 855 703 8985 Canada Toll-free Meeting ID: 100 511 909 Find your local number: https://zoom.us/u/acBVrM6HWR

View Event


Re: OCIOv2 with OSL native support, part IV, comment or discussion

Patrick Hodoul
 

Following the discussion during the TSC meeting, the add of some color mgt in the texture() method is a challenging topic (compare to adding color mgt in transformc()) even if the API change could be as simple as adding an extra optional argument to the texture() method. So, I will wait for your feedback.

Anyway the lazy creation of the color system and the improvement of the OCIO exception handling will greatly help.


Re: OCIOv2 with OSL native support, part IV, comment or discussion

Larry Gritz
 

I'm not "justifying" necessarily, I'm just explaining how things came to be in this state.

From the beginning, OSL needed OIIO for its image handling, the TextureSystem, and also a lot of great utility code that OSL needed like ustring and TypeDesc.

Given that OIIO was a hard dependency of OSL, and also that most renderers that needed OSL probably also needed OIIO in its own right (but not the other way around -- most users of OIIO don't also need OSL), we have followed the heuristic that whenever the same functionality was needed by both packages, the easiest way to maintain it is to put it in OIIO and for OSL to use it via OIIO's public APIs, rather than replicate it in both packages (which would create double the code maintenance for developers, as well as lead to possible clashes between the packages).

OIIO already uses only a small portion of OCIO's functionality, and OSL only needs a tiny slice of that, and in fact a strict subset of what OIIO needed to expose in its public APIs for other reasons. So it really did seem much easier to just use those OIIO public APIs related to color, rather than burden OSL with having to find and use OCIO directly, and redundant code between the packages. That also lets OSL use the logic already in OIIO that handles certain common color conversions even when an OCIO config is not available.


  • Why creating a OSL::OCIOColorSystem instance by default?  The code could delay the creation on the first request.
    • Cons - It will introduce a performance hit somewhere else!
    • Pros - It will do nothing if color mgt is never used.

Yeah, I think the idea was to create up front, and avoid any kind of locking during the render.

I think we could probably do it a better way -- like if the ShadingContext also held another pointer to the color system (with the true "owned" pointer still held by the ShadingSystem). During render, it would check the Context first -- no lock needed because the context is not shared between threads -- and only fall back to the ShadingSystem (and locking and creation if needed) if the context had a null colorsystem pointer. This would allow lazy creation, with locking only the first time each thread needed to do an OCIO color operation. Should be straightforward.

  • There is no error handling i.e. OCIO throws an exception if the config is faulty, wrong version, etc. The OSL & OIIO layers must handle OCIO exceptions.
OSL and OIIO are both "no exception" APIs by design.


  • I think it highlights that the color mgt in OSL must be decoupled from OIIO, and only called on explicit demand.

Addressed above. I think we can solve any performance problems without giving up the nice property that all the OCIO logic (and fallbacks for when OCIO is not enabled or when OCIO is there but no config is found) do not need to be duplicated and separately maintained in both projects.


--
Larry Gritz





Now: OSL TSC meeting ( every other week ) - 09/02/2021 #cal-notice

osl-dev@lists.aswf.io Calendar <noreply@...>
 

OSL TSC meeting ( every other week )

When:
09/02/2021
2:00pm to 3:00pm
(UTC-07:00) America/Los Angeles

Where:
https://zoom.us/j/100511909

Organizer: Chris Kulla ckulla@...

View Event

Description:

Every other week meeting of the OSL TSC.

Meeting Agenda / Notes: https://docs.google.com/document/d/1yf0bG6eoE2EvKZBNZX3nskdTvu99ADTDTNOknCDJd1I/

Confirm this meeting invite is still valid by finding the meeting at https://lists.aswf.io/calendar.

Join Zoom Meeting https://zoom.us/j/100511909

Meeting ID: 100 511 909

One tap mobile +16465588656,,100511909# US (New York) +13126266799,,100511909# US (Chicago)

Dial by your location +1 646 558 8656 US (New York) +1 312 626 6799 US (Chicago) +1 669 900 6833 US (San Jose) +1 253 215 8782 US +1 301 715 8592 US +1 346 248 7799 US (Houston) 877 369 0926 US Toll-free 855 880 1246 US Toll-free +1 587 328 1099 Canada +1 647 374 4685 Canada +1 647 558 0588 Canada +1 778 907 2071 Canada +1 438 809 7799 Canada 855 703 8985 Canada Toll-free Meeting ID: 100 511 909 Find your local number: https://zoom.us/u/acBVrM6HWR


Event: OSL TSC meeting ( every other week ) - 09/02/2021 #cal-reminder

osl-dev@lists.aswf.io Calendar <noreply@...>
 

Reminder: OSL TSC meeting ( every other week )

When:
09/02/2021
2:00pm to 3:00pm
(UTC-07:00) America/Los Angeles

Where:
https://zoom.us/j/100511909

Organizer: Chris Kulla ckulla@...

View Event

Description:

Every other week meeting of the OSL TSC.

Meeting Agenda / Notes: https://docs.google.com/document/d/1yf0bG6eoE2EvKZBNZX3nskdTvu99ADTDTNOknCDJd1I/

Confirm this meeting invite is still valid by finding the meeting at https://lists.aswf.io/calendar.

Join Zoom Meeting https://zoom.us/j/100511909

Meeting ID: 100 511 909

One tap mobile +16465588656,,100511909# US (New York) +13126266799,,100511909# US (Chicago)

Dial by your location +1 646 558 8656 US (New York) +1 312 626 6799 US (Chicago) +1 669 900 6833 US (San Jose) +1 253 215 8782 US +1 301 715 8592 US +1 346 248 7799 US (Houston) 877 369 0926 US Toll-free 855 880 1246 US Toll-free +1 587 328 1099 Canada +1 647 374 4685 Canada +1 647 558 0588 Canada +1 778 907 2071 Canada +1 438 809 7799 Canada 855 703 8985 Canada Toll-free Meeting ID: 100 511 909 Find your local number: https://zoom.us/u/acBVrM6HWR


Event: OSL TSC meeting ( every other week ) - 09/02/2021 #cal-reminder

osl-dev@lists.aswf.io Calendar <noreply@...>
 

Reminder: OSL TSC meeting ( every other week )

When:
09/02/2021
2:00pm to 3:00pm
(UTC-07:00) America/Los Angeles

Where:
https://zoom.us/j/100511909

Organizer: Chris Kulla ckulla@...

View Event

Description:

Every other week meeting of the OSL TSC.

Meeting Agenda / Notes: https://docs.google.com/document/d/1yf0bG6eoE2EvKZBNZX3nskdTvu99ADTDTNOknCDJd1I/

Confirm this meeting invite is still valid by finding the meeting at https://lists.aswf.io/calendar.

Join Zoom Meeting https://zoom.us/j/100511909

Meeting ID: 100 511 909

One tap mobile +16465588656,,100511909# US (New York) +13126266799,,100511909# US (Chicago)

Dial by your location +1 646 558 8656 US (New York) +1 312 626 6799 US (Chicago) +1 669 900 6833 US (San Jose) +1 253 215 8782 US +1 301 715 8592 US +1 346 248 7799 US (Houston) 877 369 0926 US Toll-free 855 880 1246 US Toll-free +1 587 328 1099 Canada +1 647 374 4685 Canada +1 647 558 0588 Canada +1 778 907 2071 Canada +1 438 809 7799 Canada 855 703 8985 Canada Toll-free Meeting ID: 100 511 909 Find your local number: https://zoom.us/u/acBVrM6HWR


getattribute() call on GPU

Nicolas Guiard
 

Hi,

We are currently trying to make getattribute() calls work on GPU with OptiX 7.3 and OSL 1.11.9.0 but we are facing an issue.
We've implemented the osl_get_attribute() callback in cuda and it's called properly. But as soon as we try to access the content of the attribute type, we get an illegal memory access.

Here's the implementation of osl_get_attribute for our test:
__device__
int osl_get_attribute(void *sg_, int dest_derivs, void *obj_name_, void *attr_name_, int array_lookup, int index, const void *attr_type, void *attr_dest)
{
    float *f = reinterpret_cast<float *>(attr_dest);
    if (attr_type == nullptr) {
        f[0] = 0.5f;
        f[1] = 0.5f;
        f[2] = 0.5f;
        return 1;
    }
    const OSL::TypeDesc& type = *(const OSL::TypeDesc *)attr_type;
    f[0] = type.basetype;
    f[1] = type.aggregate;
    f[2] = type.vecsemantics;

    return 1;
}

If we remove the lines in bold red and replace them by the following ones, it works just fine:
    f[0] = 1.0f;
    f[1] = 0.5f;
    f[2] = 0.0f;

In our test, we have a simple shader doing this:
surface attrtest()
{
    color c;
    getattribute("foo", c);
    Ci = c * emission();
}

And here's the generated PTX code:
//
// Generated by LLVM NVPTX Back-End
//
.version 5.0
.target sm_35
.address_size 64
// .globl __direct_callable__group_unnamed_group_3_3_init
.extern .func  (.param .b32 func_retval0) osl_get_attribute
(
.param .b64 osl_get_attribute_param_0,
.param .b32 osl_get_attribute_param_1,
.param .b64 osl_get_attribute_param_2,
.param .b64 osl_get_attribute_param_3,
.param .b32 osl_get_attribute_param_4,
.param .b32 osl_get_attribute_param_5,
.param .b64 osl_get_attribute_param_6,
.param .b64 osl_get_attribute_param_7
)
;
.extern .func  (.param .b64 func_retval0) osl_allocate_weighted_closure_component
(
.param .b64 osl_allocate_weighted_closure_component_param_0,
.param .b32 osl_allocate_weighted_closure_component_param_1,
.param .b32 osl_allocate_weighted_closure_component_param_2,
.param .b64 osl_allocate_weighted_closure_component_param_3
)
;
.extern .global .align 8 .u64 ds_555c6f602f9383e3_0003;
.visible .func __direct_callable__group_unnamed_group_3_3_init(
.param .b64 __direct_callable__group_unnamed_group_3_3_init_param_0,
.param .b64 __direct_callable__group_unnamed_group_3_3_init_param_1
)
{

ret;
}
// .globl __direct_callable__unnamed_group_3_build___project_scene_attrtest_4
.visible .func __direct_callable__unnamed_group_3_build___project_scene_attrtest_4(
.param .b64 __direct_callable__unnamed_group_3_build___project_scene_attrtest_4_param_0,
.param .b64 __direct_callable__unnamed_group_3_build___project_scene_attrtest_4_param_1
)
{
.local .align 8 .b8 __local_depot1[16];
.reg .b64 %SP;
.reg .b64 %SPL;
.reg .pred %p<2>;
.reg .b16 %rs<2>;
.reg .b32 %r<6>;
.reg .b64 %rd<8>;
mov.u64 %SPL, __local_depot1;
cvta.local.u64 %SP, %SPL;
ld.param.u64 %rd2, [__direct_callable__unnamed_group_3_build___project_scene_attrtest_4_param_0];
ld.global.u64 %rd3, [ds_555c6f602f9383e3_0003];
mov.u64 %rd4, 0;
mov.u32 %r1, 0;
mov.u64 %rd5, 140457662007856;
add.u64 %rd6, %SP, 0;
{ // callseq 0, 0
.reg .b32 temp_param_reg;
.param .b64 param0;
st.param.b64 [param0+0], %rd2;
.param .b32 param1;
st.param.b32 [param1+0], %r1;
.param .b64 param2;
st.param.b64 [param2+0], %rd4;
.param .b64 param3;
st.param.b64 [param3+0], %rd3;
.param .b32 param4;
st.param.b32 [param4+0], %r1;
.param .b32 param5;
st.param.b32 [param5+0], %r2;
.param .b64 param6;
st.param.b64 [param6+0], %rd5;
.param .b64 param7;
st.param.b64 [param7+0], %rd6;
.param .b32 retval0;
call.uni (retval0),
osl_get_attribute,
(
param0,
param1,
param2,
param3,
param4,
param5,
param6,
param7
);
ld.param.b32 %r3, [retval0+0];
} // callseq 0
mov.u32 %r5, 1;
{ // callseq 1, 0
.reg .b32 temp_param_reg;
.param .b64 param0;
st.param.b64 [param0+0], %rd2;
.param .b32 param1;
st.param.b32 [param1+0], %r5;
.param .b32 param2;
st.param.b32 [param2+0], %r5;
.param .b64 param3;
st.param.b64 [param3+0], %rd6;
.param .b64 retval0;
call.uni (retval0),
osl_allocate_weighted_closure_component,
(
param0,
param1,
param2,
param3
);
ld.param.b64 %rd7, [retval0+0];
} // callseq 1
setp.eq.s64 %p1, %rd7, 0;
@%p1 bra LBB1_2;
mov.u16 %rs1, 0;
st.u8 [%rd7+16], %rs1;
LBB1_2:
st.u64 [%rd2+272], %rd7;
ret;
}

As we can see in bold red in the generated code, the address of the type is a constant value and this value changes at each execution. Is there something we are not configuring properly or is it a bug?

Thanks in advance for any help on this!

Cheers

Face
Nicolas Guiard
Head of R&D
Phone+33 972 452 846
Isotropix
LinkedIn YouTube Facebook Twitter

This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed.


Release: OSL 1.11.15.0

Larry Gritz
 

Happy monthly release day!

We have tagged "v1.11.15.0" and moved the "release" branch marker to that position. This is the latest supported production release of OSL. It guarantees API, ABI, and link back-compatibility compared to prior releases in the 1.11 family. Release notes are below:


Release 1.11.15.0 -- 1 Sep 2021 (compared to 1.11.14.2)
-------------------------------------------------------
* Changes for compatibility with OpenImageIO 2.3. #1393 #1388
* Fix potential crashes (or at least undefined behavior) due to missing
virtual destructor of internal Symbol type. #1397

--
Larry Gritz
lg@...


Re: OCIOv2 with OSL native support, part III

Larry Gritz
 

On Aug 31, 2021, at 10:29 AM, Patrick Hodoul <patrick.hodoul@...> wrote:

Does the tag 'v1.11.14.2' represent the last official version?

Yes, and also there is a branch called "release" that at all times points to the latest supported release. (We move the branch marker whenever we tag releases.)


What about the input parameter which is also a color4 ?
Should I have two input parameters (like for the output parameter)?

Yes, exactly. From the point of view of a program using the ShadingSystem API), a struct is really just one variable for each field of the struct.

--
Larry Gritz





Re: OCIOv2 with OSL native support, part III

Patrick Hodoul
 

Thanks for the fast answers.

First, please note that the SymLocation stuff is very hot off the presses, and only is present in OSL master, not yet in any officially supported release.
Does the tag 'v1.11.14.2' represent the last official version?

But anyway, a color4 is not a real type (yet), it's a struct, so the implementation underneath is that there are two variables: "color4 mycolor" really just gets turned into "color mycolor.rgb" and "float mycolor.a". You can from the C++ side treat them as the two individual variables.
What about the input parameter which is also a color4 ?
Should I have two input parameters (like for the output parameter)?

--
Patrick


OCIOv2 with OSL native support, part IV, comment or discussion

Patrick Hodoul
 
Edited

Hi,

The post is not a question but a comment on the current implementation in OSL of the color mgt support.  I faced a problem when developing the OSL unit test framework for OCIO, and I want to share what I found, some comments and perhaps a potential solution.

When run the OCIOv2 OSL unit test, it crashes if the OCIO env. variable is defined.

The problem originates from:
-> my main program creates "OSL::ShadingSystem"
---> creating "OSL::ShadingSystemImpl"
------> creating "OSL::OCIOColorSystem"
---------> creating "OIIO::ColorConfig" which load the config pointed by the OCIO env. variable

The problem is that OIIO is embedding OCIOv1 which cannot read an OCIOv2 config. That's the perfect example to illustrate Larry concerns about cyclic dependencies. I would also say that having an hidden dependency is problematic.

My comments are:
  • Why creating a OSL::OCIOColorSystem instance by default?  The code could delay the creation on the first request.
    • Cons - It will introduce a performance hit somewhere else!
    • Pros - It will do nothing if color mgt is never used.
  • There is no error handling i.e. OCIO throws an exception if the config is faulty, wrong version, etc. The OSL & OIIO layers must handle OCIO exceptions.
  • I think it highlights that the color mgt in OSL must be decoupled from OIIO, and only called on explicit demand.

Hoping it will help to improve OSL and / or OIIO and ultimately the OCIOv2 unit test framework :)
Patrick


Re: OCIOv2 with OSL native support, part III

Larry Gritz
 

First, please note that the SymLocation stuff is very hot off the presses, and only is present in OSL master, not yet in any officially supported release.

It may be better to use the older find_symbol/symbol_address approach -- which you can see commented out in master's osldeformer example. That will work for released versions of OSL.

But anyway, a color4 is not a real type (yet), it's a struct, so the implementation underneath is that there are two variables: "color4 mycolor" really just gets turned into "color mycolor.rgb" and "float mycolor.a". You can from the C++ side treat them as the two individual variables.


On Aug 31, 2021, at 6:48 AM, Patrick Hodoul <patrick.hodoul@...> wrote:

HI,

That's again the OCIOv2 generating an OSL shader code related topic. Now I currently implement the corresponding OSL unit test framework in OCIO, and unfortunately I face some execution problems.

To have some context, the OSL shader declaration is:
shader OSL_OCIOMain(color4 inColor = {color(0), 1}, output color4 outColor = {color(0), 1})

And my framework mainly copies & pastes the [osl]/testsuite/example-deformer/osldeformer.cpp unit test.

The output parameter declaration is causing some trouble. The code snippet is:
<...>
OSL::SymLocationDesc outputs("layer1.outColor", OIIO::TypeFloat4, false,
                                 OSL::SymArena::Outputs,
                                 0 /* output arena offset of "out" */,
                                 sizeof(OSL::Vec4) /* point to point stride */);
    shadsys->add_symlocs(mygroup.get(), outputs);
<...>
    shadsys->optimize_group(mygroup.get(), ctx);
    const OSL::ShaderSymbol * outsym
        = shadsys->find_symbol(*mygroup.get(), OSL::ustring("layer1"), OSL::ustring("outColor"));
When the unit test runs, "shadsys->optimize_group()" generates the following outputs (from llvm_instance.cpp:1138):

No output copy for struct vector4 outColor because of type mismatch vs symloc=float4

There is a mismatch between the OSL C++ declaration and the OSL shader declaration (structure vs. type). As I used the 'color4' for the input and output variables of the shader, I found nothing equivalent in OSL C++ & OIIO C++ types so, I switched to OIIO::TypeFloat4 and OSL::Vec4. But that's clearly not the right choice.

What should be the declared types (for C++ OSL & OIIO) to match the shader 'color4' type (which is a structure containing a color and a float) ?

Thanks,
Patrick <UnitTestOSL.cpp>

--
Larry Gritz





OCIOv2 with OSL native support, part III

Patrick Hodoul
 

HI,

That's again the OCIOv2 generating an OSL shader code related topic. Now I currently implement the corresponding OSL unit test framework in OCIO, and unfortunately I face some execution problems.

To have some context, the OSL shader declaration is:
shader OSL_OCIOMain(color4 inColor = {color(0), 1}, output color4 outColor = {color(0), 1})

And my framework mainly copies & pastes the [osl]/testsuite/example-deformer/osldeformer.cpp unit test.

The output parameter declaration is causing some trouble. The code snippet is:
<...>
OSL::SymLocationDesc outputs("layer1.outColor", OIIO::TypeFloat4, false,
                                 OSL::SymArena::Outputs,
                                 0 /* output arena offset of "out" */,
                                 sizeof(OSL::Vec4) /* point to point stride */);
    shadsys->add_symlocs(mygroup.get(), outputs);
<...>
    shadsys->optimize_group(mygroup.get(), ctx);
    const OSL::ShaderSymbol * outsym
        = shadsys->find_symbol(*mygroup.get(), OSL::ustring("layer1"), OSL::ustring("outColor"));
When the unit test runs, "shadsys->optimize_group()" generates the following outputs (from llvm_instance.cpp:1138):

No output copy for struct vector4 outColor because of type mismatch vs symloc=float4

There is a mismatch between the OSL C++ declaration and the OSL shader declaration (structure vs. type). As I used the 'color4' for the input and output variables of the shader, I found nothing equivalent in OSL C++ & OIIO C++ types so, I switched to OIIO::TypeFloat4 and OSL::Vec4. But that's clearly not the right choice.

What should be the declared types (for C++ OSL & OIIO) to match the shader 'color4' type (which is a structure containing a color and a float) ?

Thanks,
Patrick


Event: OSL TSC meeting ( every other week ) - 09/02/2021 #cal-reminder

osl-dev@lists.aswf.io Calendar <noreply@...>
 

Reminder: OSL TSC meeting ( every other week )

When:
09/02/2021
2:00pm to 3:00pm
(UTC-07:00) America/Los Angeles

Where:
https://zoom.us/j/100511909

Organizer: Chris Kulla ckulla@...

View Event

Description:

Every other week meeting of the OSL TSC.

Meeting Agenda / Notes: https://docs.google.com/document/d/1yf0bG6eoE2EvKZBNZX3nskdTvu99ADTDTNOknCDJd1I/

Confirm this meeting invite is still valid by finding the meeting at https://lists.aswf.io/calendar.

Join Zoom Meeting https://zoom.us/j/100511909

Meeting ID: 100 511 909

One tap mobile +16465588656,,100511909# US (New York) +13126266799,,100511909# US (Chicago)

Dial by your location +1 646 558 8656 US (New York) +1 312 626 6799 US (Chicago) +1 669 900 6833 US (San Jose) +1 253 215 8782 US +1 301 715 8592 US +1 346 248 7799 US (Houston) 877 369 0926 US Toll-free 855 880 1246 US Toll-free +1 587 328 1099 Canada +1 647 374 4685 Canada +1 647 558 0588 Canada +1 778 907 2071 Canada +1 438 809 7799 Canada 855 703 8985 Canada Toll-free Meeting ID: 100 511 909 Find your local number: https://zoom.us/u/acBVrM6HWR


Upcoming Events #cal-summary

osl-dev@lists.aswf.io Calendar <osl-dev@...>
 

Open Shading Language discussion list Upcoming Events

OSL TSC meeting ( every other week )

When:
Thursday, September 2, 2021, 2:00pm to 3:00pm
(GMT-07:00) America/Los Angeles

Where:
https://zoom.us/j/100511909

Organizer: Chris Kulla ckulla@...

Details:

Every other week meeting of the OSL TSC.

Meeting Agenda / Notes: https://docs.google.com/document/d/1yf0bG6eoE2EvKZBNZX3nskdTvu99ADTDTNOknCDJd1I/

Confirm this meeting invite is still valid by finding the meeting at https://lists.aswf.io/calendar.

Join Zoom Meeting https://zoom.us/j/100511909

Meeting ID: 100 511 909

One tap mobile +16465588656,,100511909# US (New York) +13126266799,,100511909# US (Chicago)

Dial by your location +1 646 558 8656 US (New York) +1 312 626 6799 US (Chicago) +1 669 900 6833 US (San Jose) +1 253 215 8782 US +1 301 715 8592 US +1 346 248 7799 US (Houston) 877 369 0926 US Toll-free 855 880 1246 US Toll-free +1 587 328 1099 Canada +1 647 374 4685 Canada +1 647 558 0588 Canada +1 778 907 2071 Canada +1 438 809 7799 Canada 855 703 8985 Canada Toll-free Meeting ID: 100 511 909 Find your local number: https://zoom.us/u/acBVrM6HWR

View Event


OSL TSC meeting ( every other week )

When:
Thursday, September 16, 2021, 2:00pm to 3:00pm
(GMT-07:00) America/Los Angeles

Where:
https://zoom.us/j/100511909

Organizer: Chris Kulla ckulla@...

Details:

Every other week meeting of the OSL TSC.

Meeting Agenda / Notes: https://docs.google.com/document/d/1yf0bG6eoE2EvKZBNZX3nskdTvu99ADTDTNOknCDJd1I/

Confirm this meeting invite is still valid by finding the meeting at https://lists.aswf.io/calendar.

Join Zoom Meeting https://zoom.us/j/100511909

Meeting ID: 100 511 909

One tap mobile +16465588656,,100511909# US (New York) +13126266799,,100511909# US (Chicago)

Dial by your location +1 646 558 8656 US (New York) +1 312 626 6799 US (Chicago) +1 669 900 6833 US (San Jose) +1 253 215 8782 US +1 301 715 8592 US +1 346 248 7799 US (Houston) 877 369 0926 US Toll-free 855 880 1246 US Toll-free +1 587 328 1099 Canada +1 647 374 4685 Canada +1 647 558 0588 Canada +1 778 907 2071 Canada +1 438 809 7799 Canada 855 703 8985 Canada Toll-free Meeting ID: 100 511 909 Find your local number: https://zoom.us/u/acBVrM6HWR

View Event


OSL TSC meeting ( every other week )

When:
Thursday, September 30, 2021, 2:00pm to 3:00pm
(GMT-07:00) America/Los Angeles

Where:
https://zoom.us/j/100511909

Organizer: Chris Kulla ckulla@...

Details:

Every other week meeting of the OSL TSC.

Meeting Agenda / Notes: https://docs.google.com/document/d/1yf0bG6eoE2EvKZBNZX3nskdTvu99ADTDTNOknCDJd1I/

Confirm this meeting invite is still valid by finding the meeting at https://lists.aswf.io/calendar.

Join Zoom Meeting https://zoom.us/j/100511909

Meeting ID: 100 511 909

One tap mobile +16465588656,,100511909# US (New York) +13126266799,,100511909# US (Chicago)

Dial by your location +1 646 558 8656 US (New York) +1 312 626 6799 US (Chicago) +1 669 900 6833 US (San Jose) +1 253 215 8782 US +1 301 715 8592 US +1 346 248 7799 US (Houston) 877 369 0926 US Toll-free 855 880 1246 US Toll-free +1 587 328 1099 Canada +1 647 374 4685 Canada +1 647 558 0588 Canada +1 778 907 2071 Canada +1 438 809 7799 Canada 855 703 8985 Canada Toll-free Meeting ID: 100 511 909 Find your local number: https://zoom.us/u/acBVrM6HWR

View Event

261 - 280 of 5010