AcademySoftwareFoundation / OpenShadingLanguage

Advanced shading language for production GI renderers

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Varying Closure Keyword Parameters Not Being Correctly Evaluated During Batched Execution

danieldresser-ie opened this issue · comments

Problem

It appears that closure parameters declared with CLOSURE_*_KEYPARAM don't work correctly with varying inputs in batched execution.

I've now got a pretty simple repro, and I've tested with the recently released 1.12.7.0, so I think this is probably a legit issue:

badBatch.osl

shader badBatch()
{
    Ci = diffuse( N, "label", format( "%f", u ) );
    printf( " Ci = %s", Ci );
}

Testing

> oslc badBatch.osl && testshade -g 2 1 badBatch
Ci = (1, 1, 1) * diffuse ((0, 0, 1), "label", "0.000000") Ci = (1, 1, 1) * diffuse ((0, 0, 1), "label", "1.000000")
> oslc badBatch.osl && testshade -batched -g 2 1 badBatch
Ci = (1, 1, 1) * diffuse ((0, 0, 1), "label", "0.000000") Ci = (1, 1, 1) * diffuse ((0, 0, 1), "label", "0.000000")

Passing the -batched flag causing the second shading point to incorrectly get the same value for "label" as the first shading point.

Versions

  • OSL branch/version: 1.12.7.0 ( first noticed in 1.12.6.2 )
  • OS: CentOS 7.9
  • C++ compiler: gcc-9.3.1
  • LLVM version: 13.0.0
  • OIIO version: 2.3.11.0

I believe this was closed by #1620