Browse Source

[spirv] Type lowering pass properly annotates majorness.

The EmitVisitor shouldn't concern itself with whether it flip majorness.
It has been properly annotated by the type lowering pass.
Ehsan Nasiri 6 years ago
parent
commit
657d617fec
1 changed files with 3 additions and 10 deletions
  1. 3 10
      tools/clang/lib/SPIRV/EmitVisitor.cpp

+ 3 - 10
tools/clang/lib/SPIRV/EmitVisitor.cpp

@@ -1689,17 +1689,10 @@ void EmitTypeHandler::getLayoutDecorations(const StructType *structType,
         decs->push_back(
             DecorationInfo(spv::Decoration::MatrixStride, {stride}, index));
 
-        // We need to swap the RowMajor and ColMajor decorations since HLSL
-        // matrices are conceptually row-major while SPIR-V are conceptually
-        // column-major.
-        if (matType->isRowMajorMat()) {
-          decs->push_back(DecorationInfo(spv::Decoration::ColMajor, {}, index));
-        } else {
-          // If the source code has neither row_major nor column_major
-          // annotated, it should be treated as column_major since that's the
-          // default.
+        if (matType->isRowMajorMat())
           decs->push_back(DecorationInfo(spv::Decoration::RowMajor, {}, index));
-        }
+        else
+          decs->push_back(DecorationInfo(spv::Decoration::ColMajor, {}, index));
       }
     }