Expose the left-handed matrix creation APIs#88930
Conversation
|
Note regarding the This serves as a reminder for when your PR is modifying a ref *.cs file and adding/modifying public APIs, please make sure the API implementation in the src *.cs file is documented with triple slash comments, so the PR reviewers can sign off that change. |
|
Tagging subscribers to this area: @dotnet/area-system-numerics Issue DetailsThis resolves #80332
|
| expected.M11 = 0.979457f; | ||
| expected.M12 = -0.0928267762f; | ||
| expected.M13 = 0.179017f; |
There was a problem hiding this comment.
There's no change in these values, they've just been simplified to the shortest roundtrippable string for consistency
| /// | width / 2 | 0 | 0 | 0 | | ||
| /// | 0 | -height / 2 | 0 | 0 | | ||
| /// | 0 | 0 | maxDepth - minDepth | 0 | | ||
| /// | 0 | 0 | minDepth - maxDepth | 0 | |
There was a problem hiding this comment.
This is a minor bug fix to the new API. It was creating a left-handed viewport.
| } | ||
|
|
||
| [MethodImpl(MethodImplOptions.AggressiveInlining)] | ||
| public static Impl CreateLookToLeftHanded(in Vector3 cameraPosition, in Vector3 cameraDirection, in Vector3 cameraUpVector) |
There was a problem hiding this comment.
why can't this just pass negative cameraDirection to the one above? Presumably this will be optimized anyway and perf should be the same since they're inlined?
There was a problem hiding this comment.
(similar question to other methods)
There was a problem hiding this comment.
This one in particular could, but that adds a hidden additional cost that the JIT can't currently optimize away. For the others the algorithms are not simply negating a single input.
There was a problem hiding this comment.
is there an issue against JIT to improve this? is this cost high enough to justify code duplication?
There was a problem hiding this comment.
is there an issue against JIT to improve this
There are many issues tracking the broader issues that impact this space. It's not really limited to just one thing.
is this cost high enough to justify code duplication?
This is a known perf oriented type and the amount of code duplication is not significant. We have (ignoring the formatting done to help improve readability, around 8-11 lines of pretty simple code here.
This resolves #80332