[Webkit-unassigned] [Bug 199215] [WHLSL] Matrix indexing should match HLSL [row][column], but MSL uses [column][row]
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Wed Jul 3 18:29:23 PDT 2019
https://bugs.webkit.org/show_bug.cgi?id=199215
--- Comment #5 from Justin Fan <justin_fan at apple.com> ---
For Metal Shading Language:
There is no difference between supplying [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16] as a buffer to a shader and telling it to treat it as a float4x4, or using the float4x4() constructor with those values. Result[0] is [1, 2, 3, 4].
If you put [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32] in a buffer, and tell the shader that it's two float4x4s next to each other, the results of buffer1[0] * buffer1[1] are:
538
612
686
760
650
740
830
920
762
868
974
1080
874
996
1118
1240
Thus, the two matrices are
[1 5 9 13] [17 21 25 29]
[2 6 10 14] * [18 22 26 30]
[3 7 11 15] [19 23 27 31]
[4 8 12 16] [20 24 28 32]
and buffer1[0][0] is [1, 2, 3, 4].
This makes sense, as MSL docs imply matrices are built AND stored as Arrays Of Columns Vectors.
Thus the difference remains: HLSL (and thus WHLSL) indexes matrices as Arrays of Row Vectors.
--
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20190704/08565f7c/attachment.html>
More information about the webkit-unassigned
mailing list