[all-commits] [llvm/llvm-project] 72c2f7: [HLSL][CBuffer][Matrix] Honor row_major/column_maj...

Farzon Lotfi via All-commits all-commits at lists.llvm.org
Thu Jun 4 15:06:44 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 72c2f7e0552ed468bbfb06f651b221f5c7b4b0bf
      https://github.com/llvm/llvm-project/commit/72c2f7e0552ed468bbfb06f651b221f5c7b4b0bf
  Author: Farzon Lotfi <farzonlotfi at microsoft.com>
  Date:   2026-06-04 (Thu, 04 Jun 2026)

  Changed paths:
    M clang/lib/CodeGen/HLSLBufferLayoutBuilder.cpp
    M clang/lib/CodeGen/HLSLBufferLayoutBuilder.h
    M clang/lib/Sema/SemaHLSL.cpp
    A clang/test/CodeGenHLSL/cbuffer-matrix-layout-keyword.hlsl

  Log Message:
  -----------
  [HLSL][CBuffer][Matrix] Honor row_major/column_major keyword in cbuffer layout (#201671)

fixes #201668

A per-declaration `row_major`/`column_major` keyword on a cbuffer matrix
was being dropped when building the cbuffer layout, so the layout struct
and the buffer-layout copy fell back to the translation-unit
`-fmatrix-memory-layout=`

Needed to fix the desugar in two places:
* HLSLBufferLayoutBuilder::layOutMatrix took a `const ConstantMatrixType
*` and called ConvertTypeForMem(QualType(MT, 0)), discarding the sugar.
It now takes the sugared QualType.
* SemaHLSL's host-layout struct construction called
getUnqualifiedDesugaredType() on each field, erasing the orientation
attribute. A getHostLayoutFieldType() helper now keeps the sugared type
for constant matrices while desugaring everything else.



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