|
@@ -2202,21 +2202,6 @@ Parser::DeclGroupPtrTy Parser::ParseDeclGroup(ParsingDeclSpec &DS,
|
|
|
return DeclGroupPtrTy();
|
|
|
}
|
|
|
|
|
|
- // HLSL changes begin
|
|
|
- // Initialize the default matrix orientation.
|
|
|
- // TODO: Take into account global matrix orientation when initializing default
|
|
|
- // matrix orientation. That would also mean adding an accessor method to read
|
|
|
- // default matrix orientation and use it in all applicable places.
|
|
|
- if (!Parser::Actions.PackMatrixRowMajorPragmaOn &&
|
|
|
- !Parser::Actions.PackMatrixColMajorPragmaOn) {
|
|
|
- DS.SetDefaultMatrixOrientation(true);
|
|
|
- } else if (Parser::Actions.PackMatrixRowMajorPragmaOn) {
|
|
|
- DS.SetDefaultMatrixOrientation(false);
|
|
|
- } else if (Parser::Actions.PackMatrixColMajorPragmaOn) {
|
|
|
- DS.SetDefaultMatrixOrientation(true);
|
|
|
- }
|
|
|
- // HLSL changes end
|
|
|
-
|
|
|
// HLSL Change Starts: change global variables that will be in constant buffer to be constant by default
|
|
|
// Global variables that are groupshared, static, or typedef
|
|
|
// will not be part of constant buffer and therefore should not be const by default.
|
|
@@ -3493,6 +3478,13 @@ void Parser::ParseDeclarationSpecifiers(DeclSpec &DS,
|
|
|
if (DS.hasTypeSpecifier() && DS.hasTagDefinition())
|
|
|
goto DoneWithDeclSpec;
|
|
|
|
|
|
+ // HLSL Change Starts
|
|
|
+ // Remember the current state of the default matrix orientation,
|
|
|
+ // since it can change between any two tokens with #pragma pack_matrix
|
|
|
+ if (Parser::Actions.HasDefaultMatrixPack)
|
|
|
+ DS.SetDefaultMatrixPackRowMajor(Parser::Actions.DefaultMatrixPackRowMajor);
|
|
|
+ // HLSL Change Ends
|
|
|
+
|
|
|
if (Tok.getAnnotationValue()) {
|
|
|
ParsedType T = getTypeAnnotation(Tok);
|
|
|
isInvalid = DS.SetTypeSpecType(DeclSpec::TST_typename, Loc, PrevSpec,
|
|
@@ -3603,12 +3595,20 @@ void Parser::ParseDeclarationSpecifiers(DeclSpec &DS,
|
|
|
Actions.isCurrentClassName(*Tok.getIdentifierInfo(), getCurScope()) &&
|
|
|
isConstructorDeclarator(/*Unqualified*/true))
|
|
|
goto DoneWithDeclSpec;
|
|
|
- // HLSL Change start - modify TypeRep for unsigned vectors/matrix
|
|
|
+
|
|
|
+ // HLSL Change Starts
|
|
|
+ // Modify TypeRep for unsigned vectors/matrix
|
|
|
QualType qt = TypeRep.get();
|
|
|
QualType newType = ApplyTypeSpecSignToParsedType(&Actions, qt, DS.getTypeSpecSign(), Loc);
|
|
|
isInvalid = DS.SetTypeSpecType(DeclSpec::TST_typename, Loc, PrevSpec,
|
|
|
DiagID, ParsedType::make(newType), Policy);
|
|
|
- // HLSL Change end
|
|
|
+
|
|
|
+ // Remember the current state of the default matrix orientation,
|
|
|
+ // since it can change between any two tokens with #pragma pack_matrix
|
|
|
+ if (Parser::Actions.HasDefaultMatrixPack)
|
|
|
+ DS.SetDefaultMatrixPackRowMajor(Parser::Actions.DefaultMatrixPackRowMajor);
|
|
|
+ // HLSL Change Ends
|
|
|
+
|
|
|
if (isInvalid)
|
|
|
break;
|
|
|
|