Skip to content

Commit 7e144e9

Browse files
Merge pull request #2462 from KhronosGroup/coopmat-type-fix
GLSL: Deal more gracefully with coopmat types.
2 parents cb71abe + 23b3cb5 commit 7e144e9

File tree

5 files changed

+207
-144
lines changed

5 files changed

+207
-144
lines changed

reference/opt/shaders/comp/cooperative-matrix.vk.nocompat.comp.vk

Lines changed: 60 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -30,68 +30,68 @@ shared uint blah[512];
3030

3131
void main()
3232
{
33-
uint _549 = 256u * gl_WorkGroupID.x;
34-
coopmat<float, Scope, Rows, Columns, gl_MatrixUseA> _554;
35-
coopMatLoad(_554, ssbo32.data, _549, 16u, Layout);
36-
uint _558 = 512u * gl_WorkGroupID.x;
37-
coopmat<float, Scope, Rows, Columns, gl_MatrixUseA> _563;
38-
coopMatLoad(_563, ssbo16.data, _558, 32u, Layout);
39-
coopmat<float, Scope, Rows, Columns, gl_MatrixUseB> _572;
40-
coopMatLoad(_572, ssbo32.data, _549, 16u, Layout);
41-
coopmat<float, Scope, Rows, Columns, gl_MatrixUseB> _581;
42-
coopMatLoad(_581, ssbo16.data, _558, 32u, Layout);
43-
coopmat<float, Scope, Rows, Columns, gl_MatrixUseAccumulator> _590;
44-
coopMatLoad(_590, ssbo32.data, _549, 16u, Layout);
45-
coopmat<float, Scope, Rows, Columns, gl_MatrixUseAccumulator> _599;
46-
coopMatLoad(_599, ssbo16.data, _558, 32u, Layout);
47-
uint _613 = 128u * gl_WorkGroupID.x;
48-
coopmat<float16_t, Scope, Rows, Columns, gl_MatrixUseA> _618;
49-
coopMatLoad(_618, ssbo32.data, _613, 8u, Layout);
50-
coopmat<float16_t, Scope, Rows, Columns, gl_MatrixUseA> _627;
51-
coopMatLoad(_627, ssbo16.data, _549, 16u, Layout);
52-
coopmat<float16_t, Scope, Rows, Columns, gl_MatrixUseB> _636;
53-
coopMatLoad(_636, ssbo32.data, _613, 8u, Layout);
54-
coopmat<float16_t, Scope, Rows, Columns, gl_MatrixUseB> _645;
55-
coopMatLoad(_645, ssbo16.data, _549, 16u, Layout);
56-
coopmat<float16_t, Scope, Rows, Columns, gl_MatrixUseAccumulator> _654;
57-
coopMatLoad(_654, ssbo32.data, _613, 8u, Layout);
58-
coopmat<float16_t, Scope, Rows, Columns, gl_MatrixUseAccumulator> _663;
59-
coopMatLoad(_663, ssbo16.data, _549, 16u, Layout);
60-
coopMatStore(coopmat<float, Scope, Rows, Columns, gl_MatrixUseA>(100.0), ssbo32.data, _613, 0u, Layout);
61-
coopMatStore(coopmat<uint, Scope, Rows, Columns, gl_MatrixUseA>(100u), ssbo32.data, _613, 0u, Layout);
62-
coopMatStore(coopmat<int, Scope, Rows, Columns, gl_MatrixUseA>(-100), ssbo32.data, _613, 0u, Layout);
63-
coopMatStore(coopmat<float16_t, Scope, Rows, Columns, gl_MatrixUseA>(float16_t(100.0)), ssbo32.data, _613, 0u, Layout);
64-
coopMatStore(coopmat<int16_t, Scope, Rows, Columns, gl_MatrixUseA>(-100s), ssbo32.data, _613, 0u, Layout);
65-
coopMatStore(coopmat<uint16_t, Scope, Rows, Columns, gl_MatrixUseA>(100us), ssbo32.data, _613, 0u, Layout);
66-
coopmat<float, Scope, Rows, Columns, gl_MatrixUseA> _761 = coopmat<float, Scope, Rows, Columns, gl_MatrixUseA>(100.0);
67-
for (int _944 = 0; _944 < int(uint(coopmat<float, Scope, Rows, Columns, gl_MatrixUseA>(0).length())); )
33+
uint _562 = 256u * gl_WorkGroupID.x;
34+
coopmat<float, Scope, Rows, Columns, gl_MatrixUseA> _567;
35+
coopMatLoad(_567, ssbo32.data, _562, 16u, gl_CooperativeMatrixLayoutColumnMajor);
36+
uint _571 = 512u * gl_WorkGroupID.x;
37+
coopmat<float, Scope, Rows, Columns, gl_MatrixUseA> _576;
38+
coopMatLoad(_576, ssbo16.data, _571, 32u, gl_CooperativeMatrixLayoutRowMajor);
39+
coopmat<float, Scope, Rows, Columns, gl_MatrixUseB> _585;
40+
coopMatLoad(_585, ssbo32.data, _562, 16u, int(Layout));
41+
coopmat<float, Scope, Rows, Columns, gl_MatrixUseB> _594;
42+
coopMatLoad(_594, ssbo16.data, _571, 32u, int(Layout));
43+
coopmat<float, Scope, Rows, Columns, gl_MatrixUseAccumulator> _603;
44+
coopMatLoad(_603, ssbo32.data, _562, 16u, int(Layout));
45+
coopmat<float, Scope, Rows, Columns, gl_MatrixUseAccumulator> _612;
46+
coopMatLoad(_612, ssbo16.data, _571, 32u, int(Layout));
47+
uint _626 = 128u * gl_WorkGroupID.x;
48+
coopmat<float16_t, Scope, Rows, Columns, gl_MatrixUseA> _631;
49+
coopMatLoad(_631, ssbo32.data, _626, 8u, int(Layout));
50+
coopmat<float16_t, Scope, Rows, Columns, gl_MatrixUseA> _640;
51+
coopMatLoad(_640, ssbo16.data, _562, 16u, int(Layout));
52+
coopmat<float16_t, Scope, Rows, Columns, gl_MatrixUseB> _649;
53+
coopMatLoad(_649, ssbo32.data, _626, 8u, int(Layout));
54+
coopmat<float16_t, Scope, Rows, Columns, gl_MatrixUseB> _658;
55+
coopMatLoad(_658, ssbo16.data, _562, 16u, int(Layout));
56+
coopmat<float16_t, Scope, Rows, Columns, gl_MatrixUseAccumulator> _667;
57+
coopMatLoad(_667, ssbo32.data, _626, 8u, int(Layout));
58+
coopmat<float16_t, Scope, Rows, Columns, gl_MatrixUseAccumulator> _676;
59+
coopMatLoad(_676, ssbo16.data, _562, 16u, int(Layout));
60+
coopMatStore(coopmat<float, Scope, Rows, Columns, gl_MatrixUseA>(100.0), ssbo32.data, _626, 0u, gl_CooperativeMatrixLayoutColumnMajor);
61+
coopMatStore(coopmat<uint, Scope, Rows, Columns, gl_MatrixUseA>(100u), ssbo32.data, _626, 0u, gl_CooperativeMatrixLayoutRowMajor);
62+
coopMatStore(coopmat<int, Scope, Rows, Columns, gl_MatrixUseA>(-100), ssbo32.data, _626, 0u, int(Layout));
63+
coopMatStore(coopmat<float16_t, Scope, Rows, Columns, gl_MatrixUseA>(float16_t(100.0)), ssbo32.data, _626, 0u, int(Layout));
64+
coopMatStore(coopmat<int16_t, Scope, Rows, Columns, gl_MatrixUseA>(-100s), ssbo32.data, _626, 0u, int(Layout));
65+
coopMatStore(coopmat<uint16_t, Scope, Rows, Columns, gl_MatrixUseA>(100us), ssbo32.data, _626, 0u, int(Layout));
66+
coopmat<float, Scope, Rows, Columns, gl_MatrixUseA> _774 = coopmat<float, Scope, Rows, Columns, gl_MatrixUseA>(100.0);
67+
for (int _960 = 0; _960 < int(uint(coopmat<float, Scope, Rows, Columns, gl_MatrixUseA>(0).length())); )
6868
{
69-
_761[_944] += 50.0;
70-
_944++;
69+
_774[_960] += 50.0;
70+
_960++;
7171
continue;
7272
}
73-
coopMatStore(_761, ssbo32.data, 0u, 16u, Layout);
74-
coopMatStore(coopmat<uint, Scope, Rows, Columns, gl_MatrixUseA>(gl_WorkGroupID.x), ssbo32.data, 0u, 16u, Layout);
75-
coopmat<float, Scope, Rows, Columns, gl_MatrixUseA> _806;
76-
coopMatLoad(_806, ssbo32.data, _549, 16u, Layout);
77-
coopmat<float, Scope, Rows, Columns, gl_MatrixUseB> _815;
78-
coopMatLoad(_815, ssbo32.data, _549, 16u, Layout);
79-
coopmat<float, Scope, Rows, Columns, gl_MatrixUseAccumulator> _824;
80-
coopMatLoad(_824, ssbo32.data, _549, 16u, Layout);
81-
coopmat<uint, Scope, Rows, Columns, gl_MatrixUseA> _857;
82-
coopMatLoad(_857, ssbo32.data, _549, 16u, Layout);
83-
coopmat<uint, Scope, Rows, Columns, gl_MatrixUseB> _866;
84-
coopMatLoad(_866, ssbo32.data, _549, 16u, Layout);
85-
coopmat<uint, Scope, Rows, Columns, gl_MatrixUseAccumulator> _875;
86-
coopMatLoad(_875, ssbo32.data, _549, 16u, Layout);
87-
coopmat<int, Scope, Rows, Columns, gl_MatrixUseA> _895;
88-
coopMatLoad(_895, ssbo32.data, _549, 16u, Layout);
89-
coopmat<int, Scope, Rows, Columns, gl_MatrixUseB> _904;
90-
coopMatLoad(_904, ssbo32.data, _549, 16u, Layout);
91-
coopmat<int, Scope, Rows, Columns, gl_MatrixUseAccumulator> _913;
92-
coopMatLoad(_913, ssbo32.data, _549, 16u, Layout);
93-
coopmat<float, Scope, Rows, Columns, gl_MatrixUseA> _923;
94-
coopMatLoad(_923, blah, 0u, 16u, Layout);
95-
coopMatStore(_923, blah, 0u, 16u, Layout);
73+
coopMatStore(_774, ssbo32.data, 0u, 16u, int(Layout));
74+
coopMatStore(coopmat<uint, Scope, Rows, Columns, gl_MatrixUseA>(gl_WorkGroupID.x), ssbo32.data, 0u, 16u, int(Layout));
75+
coopmat<float, Scope, Rows, Columns, gl_MatrixUseA> _819;
76+
coopMatLoad(_819, ssbo32.data, _562, 16u, int(Layout));
77+
coopmat<float, Scope, Rows, Columns, gl_MatrixUseB> _828;
78+
coopMatLoad(_828, ssbo32.data, _562, 16u, int(Layout));
79+
coopmat<float, Scope, Rows, Columns, gl_MatrixUseAccumulator> _837;
80+
coopMatLoad(_837, ssbo32.data, _562, 16u, int(Layout));
81+
coopmat<uint, Scope, Rows, Columns, gl_MatrixUseA> _870;
82+
coopMatLoad(_870, ssbo32.data, _562, 16u, int(Layout));
83+
coopmat<uint, Scope, Rows, Columns, gl_MatrixUseB> _879;
84+
coopMatLoad(_879, ssbo32.data, _562, 16u, int(Layout));
85+
coopmat<uint, Scope, Rows, Columns, gl_MatrixUseAccumulator> _888;
86+
coopMatLoad(_888, ssbo32.data, _562, 16u, int(Layout));
87+
coopmat<int, Scope, Rows, Columns, gl_MatrixUseA> _908;
88+
coopMatLoad(_908, ssbo32.data, _562, 16u, int(Layout));
89+
coopmat<int, Scope, Rows, Columns, gl_MatrixUseB> _917;
90+
coopMatLoad(_917, ssbo32.data, _562, 16u, int(Layout));
91+
coopmat<int, Scope, Rows, Columns, gl_MatrixUseAccumulator> _926;
92+
coopMatLoad(_926, ssbo32.data, _562, 16u, int(Layout));
93+
coopmat<float, Scope, Rows, Columns, gl_MatrixUseA> _936;
94+
coopMatLoad(_936, blah, 0u, 16u, int(Layout));
95+
coopMatStore(_936, blah, 0u, 16u, int(Layout));
9696
}
9797

reference/shaders-no-opt/asm/comp/cooperative-matrix-insert-extract.vk.nocompat.asm.comp.vk

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ void main()
1717
coopmat<float, Scope, Rows, Columns, gl_MatrixUseA> _33 = coopmat<float, Scope, Rows, Columns, gl_MatrixUseA>(50.0);
1818
coopmat<float, Scope, Rows, Columns, gl_MatrixUseA> _36 = _33;
1919
_36[1] = _33[1] + 50.0;
20-
coopMatStore(_36, ssbo32.data, 0u, 16u, Layout);
21-
coopMatStore(_33, ssbo32.data, 0u, 16u, Layout);
20+
coopMatStore(_36, ssbo32.data, 0u, 16u, int(Layout));
21+
coopMatStore(_33, ssbo32.data, 0u, 16u, int(Layout));
2222
}
2323

0 commit comments

Comments
 (0)