You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When OSL encounters a runtime error, it reports this via the ErrorHandler given to the ShadingSystem. Because we are not providing an error handler, the default is to print an error to the terminal but otherwise continue. Instead, we need to catch the error and turn it into an exception that halts Gaffer's current computation.
OSL's ErrorHandler class isn't given any access to per-shade state, and we use a single ShadingSystem (and therefore ErrorHandler) for all OSL expressions. We'll need to create an error handler that delegates to a per-thread stack of handlers that we can push and pop to direct the errors appropriately. Something like this :
Description
When OSL encounters a runtime error, it reports this via the ErrorHandler given to the ShadingSystem. Because we are not providing an error handler, the default is to print an error to the terminal but otherwise continue. Instead, we need to catch the error and turn it into an exception that halts Gaffer's current computation.
Steps to reproduce
This unit test shows the problem.
Implementation notes
OSL's ErrorHandler class isn't given any access to per-shade state, and we use a single ShadingSystem (and therefore ErrorHandler) for all OSL expressions. We'll need to create an error handler that delegates to a per-thread stack of handlers that we can push and pop to direct the errors appropriately. Something like this :
The text was updated successfully, but these errors were encountered: