Ver Fonte

Support static const field with initializer (#520)

* Support static const field of struct.
* Revert "Revert "Add nodup attribute for barrier.""

This reverts commit e435f63b027f1e530206bb95e1dae80d576ee545.
Xiang Li há 8 anos atrás
pai
commit
eb0894c913

+ 1 - 1
lib/HLSL/DxilOperations.cpp

@@ -155,7 +155,7 @@ const OP::OpCodeProperty OP::m_OpCodeProps[(unsigned)OP::OpCode::NumOpCodes] = {
   // Synchronization                                                                                                        void,     h,     f,     d,    i1,    i8,   i16,   i32,   i64  function attribute
   {  OC::AtomicBinOp,             "AtomicBinOp",              OCC::AtomicBinOp,              "atomicBinOp",                false, false, false, false, false, false, false,  true, false, Attribute::None,     },
   {  OC::AtomicCompareExchange,   "AtomicCompareExchange",    OCC::AtomicCompareExchange,    "atomicCompareExchange",      false, false, false, false, false, false, false,  true, false, Attribute::None,     },
-  {  OC::Barrier,                 "Barrier",                  OCC::Barrier,                  "barrier",                     true, false, false, false, false, false, false, false, false, Attribute::None,     },
+  {  OC::Barrier,                 "Barrier",                  OCC::Barrier,                  "barrier",                     true, false, false, false, false, false, false, false, false, Attribute::NoDuplicate, },
 
   // Pixel shader                                                                                                           void,     h,     f,     d,    i1,    i8,   i16,   i32,   i64  function attribute
   {  OC::CalculateLOD,            "CalculateLOD",             OCC::CalculateLOD,             "calculateLOD",               false, false,  true, false, false, false, false, false, false, Attribute::ReadOnly, },

+ 5 - 1
tools/clang/lib/Parse/ParseDeclCXX.cpp

@@ -2573,7 +2573,11 @@ void Parser::ParseCXXClassMemberDeclaration(AccessSpecifier AS,
     InClassInitStyle HasInClassInit = ICIS_NoInit;
     bool HasStaticInitializer = false;
     if (Tok.isOneOf(tok::equal, tok::l_brace) && PureSpecLoc.isInvalid()) {
-      Diag(Tok, diag::err_hlsl_unsupported_member_default); // HLSL Change
+      // HLSL Change Begin - only allow member default for static const.
+      if (DS.getStorageClassSpec() != DeclSpec::SCS_static ||
+          !(DS.getTypeQualifiers() & Qualifiers::Const))
+        Diag(Tok, diag::err_hlsl_unsupported_member_default);
+      // HLSL Change End
       if (BitfieldSize.get()) {
         Diag(Tok, diag::err_bitfield_member_init);
         SkipUntil(tok::comma, StopAtSemi | StopBeforeMatch);

+ 2 - 2
tools/clang/lib/Sema/SemaHLSL.cpp

@@ -10524,7 +10524,7 @@ bool Sema::DiagnoseHLSLDecl(Declarator &D, DeclContext *DC,
   }
 
   if (isStatic) {
-    if (!(isLocalVar || isGlobal || isFunction || isMethod)) {
+    if (!(isLocalVar || isGlobal || isFunction || isMethod || isField)) {
       Diag(D.getLocStart(), diag::err_hlsl_varmodifierna) << "'static'"
                                                           << declarationType;
       result = false;
@@ -10540,7 +10540,7 @@ bool Sema::DiagnoseHLSLDecl(Declarator &D, DeclContext *DC,
   }
 
   if (isConst) {
-    if (isField) {
+    if (isField && !isStatic) {
       Diag(D.getLocStart(), diag::err_hlsl_varmodifierna) << "'const'"
                                                           << declarationType;
       result = false;

+ 1 - 0
tools/clang/test/CodeGenHLSL/barrier.hlsl

@@ -53,6 +53,7 @@
 // CHECK: i32 2
 // CHECK: barrier
 // CHECK: i32 4
+// CHECK: noduplicate
 
 groupshared column_major float2x2 dataC[8*8];
 

+ 16 - 0
tools/clang/test/CodeGenHLSL/shader-compat-suite/static_const_field.hlsl

@@ -0,0 +1,16 @@
+// RUN: %dxc -T lib_6_1 %s | FileCheck %s
+
+// Make sure static const field works.
+
+// CHECK: float 6.000000e+00
+
+struct X {
+
+static const uint A = 6 ;
+
+};
+
+
+float test() {
+  return X::A ;
+}

+ 18 - 18
tools/clang/test/HLSL/varmods-syntax.hlsl

@@ -339,13 +339,13 @@ struct s_storage_mods {
     // GENERATED_CODE:BEGIN
     groupshared extern float2 f_gro_ext;                    /* expected-error {{'groupshared' is not a valid modifier for a field}} expected-error {{storage class specified for a member declaration}} expected-warning {{'groupshared' attribute only applies to variables}} fxc-error {{X3006: 'f_gro_ext': struct/class members cannot be declared 'extern'}} fxc-error {{X3010: 'f_gro_ext': struct/class members cannot be declared 'groupshared'}} */
     extern static float2 f_ext_sta;                         /* expected-error {{cannot combine with previous 'extern' declaration specifier}} expected-error {{storage class specified for a member declaration}} fxc-error {{X3006: 'f_ext_sta': struct/class members cannot be declared 'extern'}} */
-    static uniform float2 f_sta_uni;                        /* expected-error {{'static' and 'uniform' cannot be used together for a field}} expected-error {{'static' is not a valid modifier for a field}} expected-error {{'uniform' is not a valid modifier for a field}} fxc-error {{X3047: 'f_sta_uni': struct/class members cannot be declared 'uniform'}} */
+    static uniform float2 f_sta_uni;                        /* expected-error {{'static' and 'uniform' cannot be used together for a field}} expected-error {{'uniform' is not a valid modifier for a field}} fxc-error {{X3047: 'f_sta_uni': struct/class members cannot be declared 'uniform'}} */
     groupshared float2 f_gro;                               /* expected-error {{'groupshared' is not a valid modifier for a field}} expected-warning {{'groupshared' attribute only applies to variables}} fxc-error {{X3010: 'f_gro': struct/class members cannot be declared 'groupshared'}} */
     groupshared precise float2 f_gro_pre;                   /* expected-error {{'groupshared' is not a valid modifier for a field}} expected-warning {{'groupshared' attribute only applies to variables}} fxc-error {{X3010: 'f_gro_pre': struct/class members cannot be declared 'groupshared'}} */
-    groupshared precise static float2 f_gro_pre_sta;        /* expected-error {{'groupshared' is not a valid modifier for a field}} expected-error {{'static' is not a valid modifier for a field}} fxc-error {{X3010: 'f_gro_pre_sta': struct/class members cannot be declared 'groupshared'}} */
-    groupshared precise static volatile float2 f_gro_pre_sta_vol;    /* expected-error {{'groupshared' is not a valid modifier for a field}} expected-error {{'static' is not a valid modifier for a field}} expected-error {{'volatile' is not a valid modifier for a field}} fxc-error {{X3008: 'f_gro_pre_sta_vol': struct/class members cannot be declared 'volatile'}} fxc-error {{X3010: 'f_gro_pre_sta_vol': struct/class members cannot be declared 'groupshared'}} */
-    groupshared precise static volatile const float2 f_gro_pre_sta_vol_con;    /* expected-error {{'const' is not a valid modifier for a field}} expected-error {{'groupshared' is not a valid modifier for a field}} expected-error {{'static' is not a valid modifier for a field}} expected-error {{'volatile' is not a valid modifier for a field}} fxc-error {{X3008: 'f_gro_pre_sta_vol_con': struct/class members cannot be declared 'volatile'}} fxc-error {{X3010: 'f_gro_pre_sta_vol_con': struct/class members cannot be declared 'groupshared'}} */
-    groupshared precise static const float2 f_gro_pre_sta_con;    /* expected-error {{'const' is not a valid modifier for a field}} expected-error {{'groupshared' is not a valid modifier for a field}} expected-error {{'static' is not a valid modifier for a field}} fxc-error {{X3010: 'f_gro_pre_sta_con': struct/class members cannot be declared 'groupshared'}} */
+    groupshared precise static float2 f_gro_pre_sta;        /* expected-error {{'groupshared' is not a valid modifier for a field}} fxc-error {{X3010: 'f_gro_pre_sta': struct/class members cannot be declared 'groupshared'}} */
+    groupshared precise static volatile float2 f_gro_pre_sta_vol;    /* expected-error {{'groupshared' is not a valid modifier for a field}} expected-error {{'volatile' is not a valid modifier for a field}} fxc-error {{X3008: 'f_gro_pre_sta_vol': struct/class members cannot be declared 'volatile'}} fxc-error {{X3010: 'f_gro_pre_sta_vol': struct/class members cannot be declared 'groupshared'}} */
+    groupshared precise static volatile const float2 f_gro_pre_sta_vol_con;    /* expected-error {{'groupshared' is not a valid modifier for a field}} expected-error {{'volatile' is not a valid modifier for a field}} fxc-error {{X3008: 'f_gro_pre_sta_vol_con': struct/class members cannot be declared 'volatile'}} fxc-error {{X3010: 'f_gro_pre_sta_vol_con': struct/class members cannot be declared 'groupshared'}} */
+    groupshared precise static const float2 f_gro_pre_sta_con;    /* expected-error {{'groupshared' is not a valid modifier for a field}} fxc-error {{X3010: 'f_gro_pre_sta_con': struct/class members cannot be declared 'groupshared'}} */
     groupshared precise uniform float2 f_gro_pre_uni;       /* expected-error {{'groupshared' is not a valid modifier for a field}} expected-error {{'uniform' is not a valid modifier for a field}} expected-warning {{'groupshared' attribute only applies to variables}} expected-warning {{'uniform' attribute only applies to varibales and parameters}} fxc-error {{X3010: 'f_gro_pre_uni': struct/class members cannot be declared 'groupshared'}} fxc-error {{X3047: 'f_gro_pre_uni': struct/class members cannot be declared 'uniform'}} */
     groupshared precise uniform volatile float2 f_gro_pre_uni_vol;    /* expected-error {{'groupshared' is not a valid modifier for a field}} expected-error {{'uniform' is not a valid modifier for a field}} expected-error {{'volatile' is not a valid modifier for a field}} expected-warning {{'groupshared' attribute only applies to variables}} expected-warning {{'uniform' attribute only applies to varibales and parameters}} fxc-error {{X3008: 'f_gro_pre_uni_vol': struct/class members cannot be declared 'volatile'}} fxc-error {{X3010: 'f_gro_pre_uni_vol': struct/class members cannot be declared 'groupshared'}} fxc-error {{X3047: 'f_gro_pre_uni_vol': struct/class members cannot be declared 'uniform'}} */
     groupshared precise uniform volatile const float2 f_gro_pre_uni_vol_con;    /* expected-error {{'const' is not a valid modifier for a field}} expected-error {{'groupshared' is not a valid modifier for a field}} expected-error {{'uniform' is not a valid modifier for a field}} expected-error {{'volatile' is not a valid modifier for a field}} expected-warning {{'groupshared' attribute only applies to variables}} expected-warning {{'uniform' attribute only applies to varibales and parameters}} fxc-error {{X3008: 'f_gro_pre_uni_vol_con': struct/class members cannot be declared 'volatile'}} fxc-error {{X3010: 'f_gro_pre_uni_vol_con': struct/class members cannot be declared 'groupshared'}} fxc-error {{X3035: 'f_gro_pre_uni_vol_con': struct/class members cannot be declared 'const'}} fxc-error {{X3047: 'f_gro_pre_uni_vol_con': struct/class members cannot be declared 'uniform'}} */
@@ -353,10 +353,10 @@ struct s_storage_mods {
     groupshared precise volatile float2 f_gro_pre_vol;             /* expected-error {{'groupshared' is not a valid modifier for a field}} expected-error {{'volatile' is not a valid modifier for a field}} expected-warning {{'groupshared' attribute only applies to variables}} fxc-error {{X3008: 'f_gro_pre_vol': struct/class members cannot be declared 'volatile'}} fxc-error {{X3010: 'f_gro_pre_vol': struct/class members cannot be declared 'groupshared'}} */
     groupshared precise volatile const float2 f_gro_pre_vol_con;   /* expected-error {{'const' is not a valid modifier for a field}} expected-error {{'groupshared' is not a valid modifier for a field}} expected-error {{'volatile' is not a valid modifier for a field}} expected-warning {{'groupshared' attribute only applies to variables}} fxc-error {{X3008: 'f_gro_pre_vol_con': struct/class members cannot be declared 'volatile'}} fxc-error {{X3010: 'f_gro_pre_vol_con': struct/class members cannot be declared 'groupshared'}} fxc-error {{X3035: 'f_gro_pre_vol_con': struct/class members cannot be declared 'const'}} */
     groupshared precise const float2 f_gro_pre_con;         /* expected-error {{'const' is not a valid modifier for a field}} expected-error {{'groupshared' is not a valid modifier for a field}} expected-warning {{'groupshared' attribute only applies to variables}} fxc-error {{X3010: 'f_gro_pre_con': struct/class members cannot be declared 'groupshared'}} fxc-error {{X3035: 'f_gro_pre_con': struct/class members cannot be declared 'const'}} */
-    groupshared static float2 f_gro_sta;                    /* expected-error {{'groupshared' is not a valid modifier for a field}} expected-error {{'static' is not a valid modifier for a field}} fxc-error {{X3010: 'f_gro_sta': struct/class members cannot be declared 'groupshared'}} */
-    groupshared static volatile float2 f_gro_sta_vol;       /* expected-error {{'groupshared' is not a valid modifier for a field}} expected-error {{'static' is not a valid modifier for a field}} expected-error {{'volatile' is not a valid modifier for a field}} fxc-error {{X3008: 'f_gro_sta_vol': struct/class members cannot be declared 'volatile'}} fxc-error {{X3010: 'f_gro_sta_vol': struct/class members cannot be declared 'groupshared'}} */
-    groupshared static volatile const float2 f_gro_sta_vol_con;    /* expected-error {{'const' is not a valid modifier for a field}} expected-error {{'groupshared' is not a valid modifier for a field}} expected-error {{'static' is not a valid modifier for a field}} expected-error {{'volatile' is not a valid modifier for a field}} fxc-error {{X3008: 'f_gro_sta_vol_con': struct/class members cannot be declared 'volatile'}} fxc-error {{X3010: 'f_gro_sta_vol_con': struct/class members cannot be declared 'groupshared'}} */
-    groupshared static const float2 f_gro_sta_con;          /* expected-error {{'const' is not a valid modifier for a field}} expected-error {{'groupshared' is not a valid modifier for a field}} expected-error {{'static' is not a valid modifier for a field}} fxc-error {{X3010: 'f_gro_sta_con': struct/class members cannot be declared 'groupshared'}} */
+    groupshared static float2 f_gro_sta;                    /* expected-error {{'groupshared' is not a valid modifier for a field}} fxc-error {{X3010: 'f_gro_sta': struct/class members cannot be declared 'groupshared'}} */
+    groupshared static volatile float2 f_gro_sta_vol;       /* expected-error {{'groupshared' is not a valid modifier for a field}} expected-error {{'volatile' is not a valid modifier for a field}} fxc-error {{X3008: 'f_gro_sta_vol': struct/class members cannot be declared 'volatile'}} fxc-error {{X3010: 'f_gro_sta_vol': struct/class members cannot be declared 'groupshared'}} */
+    groupshared static volatile const float2 f_gro_sta_vol_con;    /* expected-error {{'groupshared' is not a valid modifier for a field}} expected-error {{'volatile' is not a valid modifier for a field}} fxc-error {{X3008: 'f_gro_sta_vol_con': struct/class members cannot be declared 'volatile'}} fxc-error {{X3010: 'f_gro_sta_vol_con': struct/class members cannot be declared 'groupshared'}} */
+    groupshared static const float2 f_gro_sta_con;          /* expected-error {{'groupshared' is not a valid modifier for a field}} fxc-error {{X3010: 'f_gro_sta_con': struct/class members cannot be declared 'groupshared'}} */
     groupshared uniform float2 f_gro_uni;                   /* expected-error {{'groupshared' is not a valid modifier for a field}} expected-error {{'uniform' is not a valid modifier for a field}} expected-warning {{'groupshared' attribute only applies to variables}} expected-warning {{'uniform' attribute only applies to varibales and parameters}} fxc-error {{X3010: 'f_gro_uni': struct/class members cannot be declared 'groupshared'}} fxc-error {{X3047: 'f_gro_uni': struct/class members cannot be declared 'uniform'}} */
     groupshared uniform volatile float2 f_gro_uni_vol;      /* expected-error {{'groupshared' is not a valid modifier for a field}} expected-error {{'uniform' is not a valid modifier for a field}} expected-error {{'volatile' is not a valid modifier for a field}} expected-warning {{'groupshared' attribute only applies to variables}} expected-warning {{'uniform' attribute only applies to varibales and parameters}} fxc-error {{X3008: 'f_gro_uni_vol': struct/class members cannot be declared 'volatile'}} fxc-error {{X3010: 'f_gro_uni_vol': struct/class members cannot be declared 'groupshared'}} fxc-error {{X3047: 'f_gro_uni_vol': struct/class members cannot be declared 'uniform'}} */
     groupshared uniform volatile const float2 f_gro_uni_vol_con;    /* expected-error {{'const' is not a valid modifier for a field}} expected-error {{'groupshared' is not a valid modifier for a field}} expected-error {{'uniform' is not a valid modifier for a field}} expected-error {{'volatile' is not a valid modifier for a field}} expected-warning {{'groupshared' attribute only applies to variables}} expected-warning {{'uniform' attribute only applies to varibales and parameters}} fxc-error {{X3008: 'f_gro_uni_vol_con': struct/class members cannot be declared 'volatile'}} fxc-error {{X3010: 'f_gro_uni_vol_con': struct/class members cannot be declared 'groupshared'}} fxc-error {{X3035: 'f_gro_uni_vol_con': struct/class members cannot be declared 'const'}} fxc-error {{X3047: 'f_gro_uni_vol_con': struct/class members cannot be declared 'uniform'}} */
@@ -381,10 +381,10 @@ struct s_storage_mods {
     extern volatile const float2 f_ext_vol_con;             /* expected-error {{'const' is not a valid modifier for a field}} expected-error {{'volatile' is not a valid modifier for a field}} expected-error {{storage class specified for a member declaration}} fxc-error {{X3006: 'f_ext_vol_con': struct/class members cannot be declared 'extern'}} fxc-error {{X3008: 'f_ext_vol_con': struct/class members cannot be declared 'volatile'}} fxc-error {{X3035: 'f_ext_vol_con': struct/class members cannot be declared 'const'}} */
     extern const float2 f_ext_con;                          /* expected-error {{'const' is not a valid modifier for a field}} expected-error {{storage class specified for a member declaration}} fxc-error {{X3006: 'f_ext_con': struct/class members cannot be declared 'extern'}} fxc-error {{X3035: 'f_ext_con': struct/class members cannot be declared 'const'}} */
     precise float2 f_pre;
-    precise static float2 f_pre_sta;                        /* expected-error {{'static' is not a valid modifier for a field}} fxc-error {{X3103: 's_storage_mods::f_pre_sta': variable declared but not defined}} */
-    precise static volatile float2 f_pre_sta_vol;           /* expected-error {{'static' is not a valid modifier for a field}} expected-error {{'volatile' is not a valid modifier for a field}} fxc-error {{X3008: 'f_pre_sta_vol': struct/class members cannot be declared 'volatile'}} */
-    precise static volatile const float2 f_pre_sta_vol_con; /* expected-error {{'const' is not a valid modifier for a field}} expected-error {{'static' is not a valid modifier for a field}} expected-error {{'volatile' is not a valid modifier for a field}} fxc-error {{X3008: 'f_pre_sta_vol_con': struct/class members cannot be declared 'volatile'}} */
-    precise static const float2 f_pre_sta_con;              /* expected-error {{'const' is not a valid modifier for a field}} expected-error {{'static' is not a valid modifier for a field}} fxc-error {{X3103: 's_storage_mods::f_pre_sta_con': variable declared but not defined}} */
+    precise static float2 f_pre_sta;                        /* fxc-error {{X3103: 's_storage_mods::f_pre_sta': variable declared but not defined}} */
+    precise static volatile float2 f_pre_sta_vol;           /* expected-error {{'volatile' is not a valid modifier for a field}} fxc-error {{X3008: 'f_pre_sta_vol': struct/class members cannot be declared 'volatile'}} */
+    precise static volatile const float2 f_pre_sta_vol_con; /* expected-error {{'volatile' is not a valid modifier for a field}} fxc-error {{X3008: 'f_pre_sta_vol_con': struct/class members cannot be declared 'volatile'}} */
+    precise static const float2 f_pre_sta_con;              /* fxc-error {{X3103: 's_storage_mods::f_pre_sta_con': variable declared but not defined}} */
     precise uniform float2 f_pre_uni;                       /* expected-error {{'uniform' is not a valid modifier for a field}} expected-warning {{'uniform' attribute only applies to varibales and parameters}} fxc-error {{X3047: 'f_pre_uni': struct/class members cannot be declared 'uniform'}} */
     precise uniform volatile float2 f_pre_uni_vol;          /* expected-error {{'uniform' is not a valid modifier for a field}} expected-error {{'volatile' is not a valid modifier for a field}} expected-warning {{'uniform' attribute only applies to varibales and parameters}} fxc-error {{X3008: 'f_pre_uni_vol': struct/class members cannot be declared 'volatile'}} fxc-error {{X3047: 'f_pre_uni_vol': struct/class members cannot be declared 'uniform'}} */
     precise uniform volatile const float2 f_pre_uni_vol_con;    /* expected-error {{'const' is not a valid modifier for a field}} expected-error {{'uniform' is not a valid modifier for a field}} expected-error {{'volatile' is not a valid modifier for a field}} expected-warning {{'uniform' attribute only applies to varibales and parameters}} fxc-error {{X3008: 'f_pre_uni_vol_con': struct/class members cannot be declared 'volatile'}} fxc-error {{X3035: 'f_pre_uni_vol_con': struct/class members cannot be declared 'const'}} fxc-error {{X3047: 'f_pre_uni_vol_con': struct/class members cannot be declared 'uniform'}} */
@@ -392,10 +392,10 @@ struct s_storage_mods {
     precise volatile float2 f_pre_vol;                      /* expected-error {{'volatile' is not a valid modifier for a field}} fxc-error {{X3008: 'f_pre_vol': struct/class members cannot be declared 'volatile'}} */
     precise volatile const float2 f_pre_vol_con;            /* expected-error {{'const' is not a valid modifier for a field}} expected-error {{'volatile' is not a valid modifier for a field}} fxc-error {{X3008: 'f_pre_vol_con': struct/class members cannot be declared 'volatile'}} fxc-error {{X3035: 'f_pre_vol_con': struct/class members cannot be declared 'const'}} */
     precise const float2 f_pre_con;                         /* expected-error {{'const' is not a valid modifier for a field}} fxc-error {{X3035: 'f_pre_con': struct/class members cannot be declared 'const'}} */
-    static float2 f_sta;                                    /* expected-error {{'static' is not a valid modifier for a field}} fxc-error {{X3103: 's_storage_mods::f_sta': variable declared but not defined}} */
-    static volatile float2 f_sta_vol;                       /* expected-error {{'static' is not a valid modifier for a field}} expected-error {{'volatile' is not a valid modifier for a field}} fxc-error {{X3008: 'f_sta_vol': struct/class members cannot be declared 'volatile'}} */
-    static volatile const float2 f_sta_vol_con;             /* expected-error {{'const' is not a valid modifier for a field}} expected-error {{'static' is not a valid modifier for a field}} expected-error {{'volatile' is not a valid modifier for a field}} fxc-error {{X3008: 'f_sta_vol_con': struct/class members cannot be declared 'volatile'}} */
-    static const float2 f_sta_con;                          /* expected-error {{'const' is not a valid modifier for a field}} expected-error {{'static' is not a valid modifier for a field}} fxc-error {{X3103: 's_storage_mods::f_sta_con': variable declared but not defined}} */
+    static float2 f_sta;                                    /* fxc-error {{X3103: 's_storage_mods::f_sta': variable declared but not defined}} */
+    static volatile float2 f_sta_vol;                       /* expected-error {{'volatile' is not a valid modifier for a field}} fxc-error {{X3008: 'f_sta_vol': struct/class members cannot be declared 'volatile'}} */
+    static volatile const float2 f_sta_vol_con;             /* expected-error {{'volatile' is not a valid modifier for a field}} fxc-error {{X3008: 'f_sta_vol_con': struct/class members cannot be declared 'volatile'}} */
+    static const float2 f_sta_con;                          /* fxc-error {{X3103: 's_storage_mods::f_sta_con': variable declared but not defined}} */
     uniform float2 f_uni;                                   /* expected-error {{'uniform' is not a valid modifier for a field}} expected-warning {{'uniform' attribute only applies to varibales and parameters}} fxc-error {{X3047: 'f_uni': struct/class members cannot be declared 'uniform'}} */
     uniform volatile float2 f_uni_vol;                      /* expected-error {{'uniform' is not a valid modifier for a field}} expected-error {{'volatile' is not a valid modifier for a field}} expected-warning {{'uniform' attribute only applies to varibales and parameters}} fxc-error {{X3008: 'f_uni_vol': struct/class members cannot be declared 'volatile'}} fxc-error {{X3047: 'f_uni_vol': struct/class members cannot be declared 'uniform'}} */
     uniform volatile const float2 f_uni_vol_con;            /* expected-error {{'const' is not a valid modifier for a field}} expected-error {{'uniform' is not a valid modifier for a field}} expected-error {{'volatile' is not a valid modifier for a field}} expected-warning {{'uniform' attribute only applies to varibales and parameters}} fxc-error {{X3008: 'f_uni_vol_con': struct/class members cannot be declared 'volatile'}} fxc-error {{X3035: 'f_uni_vol_con': struct/class members cannot be declared 'const'}} fxc-error {{X3047: 'f_uni_vol_con': struct/class members cannot be declared 'uniform'}} */
@@ -667,7 +667,7 @@ class CTopology
 {
     // Members
     point float4 bar1;                                      /* expected-error {{'point' is not a valid modifier for a field}} expected-warning {{'point' attribute only applies to parameters}} fxc-error {{X3000: syntax error: unexpected token 'point'}} */
-    static point float4 bar2;                               /* expected-error {{'point' is not a valid modifier for a field}} expected-error {{'static' is not a valid modifier for a field}} fxc-error {{X3000: syntax error: unexpected token 'point'}} */
+    static point float4 bar2;                               /* expected-error {{'point' is not a valid modifier for a field}} fxc-error {{X3000: syntax error: unexpected token 'point'}} */
     // Methods
     point float4 foo_point_ret();                           /* expected-error {{'point' is not a valid modifier for a method}} fxc-error {{X3000: syntax error: unexpected token 'point'}} */
     void foo_point(point FooStruct In[1]);

+ 1 - 1
utils/hct/hctdb.py

@@ -761,7 +761,7 @@ class db_dxil(object):
         next_op_idx += 1
 
         # Synchronization.
-        self.add_dxil_op("Barrier", next_op_idx, "Barrier", "inserts a memory barrier in the shader", "v", "", [
+        self.add_dxil_op("Barrier", next_op_idx, "Barrier", "inserts a memory barrier in the shader", "v", "nd", [
             retvoid_param,
             db_dxil_param(2, "i32", "barrierMode", "a mask of DXIL::BarrierMode values", is_const=True)])
         next_op_idx += 1

+ 1 - 1
utils/hct/hctdb_instrhelp.py

@@ -361,7 +361,7 @@ class db_oload_gen:
         f = lambda i,c : "true," if i.oload_types.find(c) >= 0 else "false,"
         lower_exceptions = { "CBufferLoad" : "cbufferLoad", "CBufferLoadLegacy" : "cbufferLoadLegacy", "GSInstanceID" : "gsInstanceID" }
         lower_fn = lambda t: lower_exceptions[t] if t in lower_exceptions else t[:1].lower() + t[1:]
-        attr_dict = { "": "None", "ro": "ReadOnly", "rn": "ReadNone" }
+        attr_dict = { "": "None", "ro": "ReadOnly", "rn": "ReadNone", "nd": "NoDuplicate" }
         attr_fn = lambda i : "Attribute::" + attr_dict[i.fn_attr] + ","
         for i in self.instrs:
             if last_category != i.category: