Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This refactors the way we handle LLVM code generation for spatial transformations -- the point/vector/normal constructor with optional space name, and the transform() function itself.
The driving motivation here is the addition of a new RendererServices function that allows a renderer (that supports the feature, it's optional) to have nonlinear transformations, i.e. those that cannot be expressed with a 4x4 matrix. Our code generation is smart enough to query the renderer about whether nonlinear transformations are supported at all, and in the particular cases of compile-time-known space names, and in those situations will not generate unnecessary code that checks for them at shader execution time. Renderers that do not have any nonlinear transformations do not need to change -- the default implementation of RendererServices::transform_points is simply to say "none supported".
(For the curious, we do have a particular case for our volumetric fluid simulation tools where the local-to-world transformations are not describable by a 4x4 matrix!)
In the process, the new code is more carefull with some optimizations, such as not generating needless matrix multiplies when the space names are "common" or the approved synonym thereof.
Also we have modified the implementation so that unknown coordinate system names will trigger an appropriate error message, which had been requested by the Shading department.
Also opportunistically fix a problem with certain debug output and constant string variables containing escape sequences. (I'll keep that a separate commit when I merge.)