Unity-Technologies / Unity-Technologies/Unity.Mathematics
float3x4 in cg and float3x4 in unity math behave differently
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 1.4k
- Forks
- 159
- PR merge metrics
- No merged PRs in 30d
Description
Consider:
float3x4 a = new float3x4();
a[2][3] = 1;
In unity math, this causes an error.
Error in unity: ArgumentException: index must be between[0...2]
In cg, there is no error.
I may be missing something, but a float4x3 array in unity seems to have the behavior of a float3x4 in cg.
In cg:
float4x3 a;
a[2][3] = 1;
will cause:
Shader error in 'Gen18.compute': array index out of bounds at kernel SolveSpringPairs at Gen18.compute(240) (on d3d11)
Whereas in Unity:
float4x3 a = new float4x3();
a[2][3] = 1;
causes no error.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the float3x4 and float4x3 indexing snippets from the issue and inspect the corresponding Unity.Mathematics matrix indexers. Compare their behavior with the reported Cg semantics; done means the intended indexing behavior is established and the inconsistent result is corrected or documented with a regression test.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp, unity
- Domain
- game-dev
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100