Commit 9cd1e40
[HLSL] Layout Initalizer list in Column order via index conversion (llvm#166277)
fixes llvm#165663
The bug was that we were using the initalizer lists index to populate
the matrix. This meant that [0..n] would coorelate to [0..n] indicies of
the flattened matrix. Hence why we were seeing the Row-major order: [ 0
1 2 3 4 5 ]. To fix this we can simply converted these indicies to the
Column-major order: [ 0 3 1 4 2 5 ].
The net effect of this is the layout of the matrix is now correct and we
don't need to change the MatrixSubscriptExpr indexing scheme.
---------
Co-authored-by: Deric C. <[email protected]>
Co-authored-by: Helena Kotas <[email protected]>1 parent a2977de commit 9cd1e40
File tree
4 files changed
+198
-101
lines changed- clang
- lib/Sema
- test
- AST/HLSL
- CodeGenHLSL/BasicFeatures
4 files changed
+198
-101
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1897 | 1897 | | |
1898 | 1898 | | |
1899 | 1899 | | |
| 1900 | + | |
| 1901 | + | |
| 1902 | + | |
| 1903 | + | |
| 1904 | + | |
| 1905 | + | |
| 1906 | + | |
| 1907 | + | |
1900 | 1908 | | |
1901 | | - | |
1902 | 1909 | | |
1903 | | - | |
| 1910 | + | |
1904 | 1911 | | |
1905 | 1912 | | |
1906 | 1913 | | |
1907 | | - | |
| 1914 | + | |
1908 | 1915 | | |
1909 | | - | |
1910 | | - | |
| 1916 | + | |
| 1917 | + | |
| 1918 | + | |
| 1919 | + | |
1911 | 1920 | | |
1912 | | - | |
| 1921 | + | |
1913 | 1922 | | |
1914 | | - | |
1915 | | - | |
1916 | | - | |
1917 | | - | |
1918 | | - | |
1919 | | - | |
1920 | 1923 | | |
1921 | 1924 | | |
1922 | 1925 | | |
| |||
0 commit comments