[all-commits] [llvm/llvm-project] 9cd1e4: [HLSL] Layout Initalizer list in Column order via ...

Farzon Lotfi via All-commits all-commits at lists.llvm.org
Tue Nov 4 19:22:47 PST 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 9cd1e4067873ac9d4348bae9de32a34575d1d64f
      https://github.com/llvm/llvm-project/commit/9cd1e4067873ac9d4348bae9de32a34575d1d64f
  Author: Farzon Lotfi <farzonlotfi at microsoft.com>
  Date:   2025-11-04 (Tue, 04 Nov 2025)

  Changed paths:
    M clang/lib/Sema/SemaInit.cpp
    M clang/test/AST/HLSL/matrix-constructors.hlsl
    M clang/test/AST/HLSL/matrix-general-initializer.hlsl
    A clang/test/CodeGenHLSL/BasicFeatures/MatrixConstructor.hlsl

  Log Message:
  -----------
  [HLSL] Layout Initalizer list in Column order via index conversion (#166277)

fixes #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. <cheung.deric at gmail.com>
Co-authored-by: Helena Kotas <hekotas at microsoft.com>



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list