OpenShadingLanguage icon indicating copy to clipboard operation
OpenShadingLanguage copied to clipboard

Array of struct not allowed as parameters

Open ld-kerley opened this issue 10 months ago • 0 comments

Problem

Posting this as a result of this comment made by Larry.

Not sure this is really a problem, but Larry thought it might be.

Currently this generates a compile error.

struct textureresource
{
    string filename;
    string colorspace;
};

shader test_shader
(
    textureresource files[2] = {{"",""},{"",""}},
    output float out = 0
)
{}

generates the following compile error.

> oslc test.osl
test.osl:9: error: array of struct are not allowed as parameters
FAILED test.osl

Steps to Reproduce

  1. compile code above.

Versions

  • OSL branch/version: 1.13.8
  • OS: macOS
  • C++ compiler:
  • LLVM version: 17.0.6
  • OIIO version: 2.5.9.0

ld-kerley avatar Dec 20 '24 02:12 ld-kerley