File tree Expand file tree Collapse file tree 1 file changed +37
-3
lines changed Expand file tree Collapse file tree 1 file changed +37
-3
lines changed Original file line number Diff line number Diff line change @@ -57,15 +57,49 @@ cbuffer CB2Fail {
5757 // expected-error@-1 {{packoffset overlap between 'f2f', 's2f'}}
5858}
5959
60-
61- #if 0
6260struct S3 {
6361 float3 a;
6462 float b;
6563};
6664
65+ cbuffer CB3Pass {
66+ S3 s3p : packoffset (c0.x);
67+ float f3p : packoffset (c1.x);
68+ }
69+
70+ cbuffer CB3Fail {
71+ S3 s3f : packoffset (c0.x);
72+ float f3f : packoffset (c0.w);
73+ // expected-error@-1 {{packoffset overlap between 'f3f', 's3f'}}
74+ }
75+
6776struct S4 {
6877 float2 a;
6978 float2 b;
7079};
71- #endif
80+
81+ cbuffer CB4Pass {
82+ S4 s4p : packoffset (c0.x);
83+ float f4p : packoffset (c1.x);
84+ }
85+
86+ cbuffer CB4Fail {
87+ S4 s4f : packoffset (c0.x);
88+ float f4f : packoffset (c0.w);
89+ // expected-error@-1 {{packoffset overlap between 'f4f', 's4f'}}
90+ }
91+
92+ struct S5 {
93+ float a[3 ];
94+ };
95+
96+ cbuffer CB5Pass {
97+ S5 s5p : packoffset (c0.x);
98+ float f5p : packoffset (c2.y);
99+ }
100+
101+ cbuffer CB5Fail {
102+ S5 s5f : packoffset (c0.x);
103+ float f5f : packoffset (c2.x);
104+ // expected-error@-1 {{packoffset overlap between 'f5f', 's5f'}}
105+ }
You can’t perform that action at this time.
0 commit comments