Fixes #591
@@ -1416,7 +1416,9 @@ Parser::TryAnnotateName(bool IsAddressOfOperand,
if (TryAnnotateTypeOrScopeTokenAfterScopeSpec(EnteringContext, false, SS,
!WasScopeAnnotation))
return ANK_Error;
- return ANK_Unresolved;
+ // HLSL Change Starts - allow implicitly annotated templates
+ return (Tok.isNot(tok::annot_typename) || SS.isInvalid()) ? ANK_Unresolved : ANK_Success;
+ // HLSL Change End
}
IdentifierInfo *Name = Tok.getIdentifierInfo();
@@ -0,0 +1,15 @@
+// RUN: %dxc -E main -T cs_6_0 %s | FileCheck %s
+
+// CHECK: %class.StructuredBuffer = type { %class.matrix.float.4.4 }
+StructuredBuffer<matrix> buf1;
+// Should be equivalent to:
+// StructuredBuffer<matrix<float, 4, 4> > buf1;
+RWBuffer<float4> buf2;
+[RootSignature("DescriptorTable(SRV(t0), UAV(u0))")]
+[numthreads(8, 8, 1)]
+void main(uint3 tid : SV_DispatchThreadID) {
+ buf2[tid.x] = buf1[tid.x][tid.y];
+}