Skip to content

Commit 40801e3

Browse files
authored
Merge pull request KhronosGroup#2050 from ShchchowAMD/built_in_MaxVector
Add builtin constants gl_MaxFragmentUniformVectors and gl_MaxVertexUniformVectors.
2 parents 8db9ecc + ac6b7cf commit 40801e3

3 files changed

Lines changed: 21 additions & 0 deletions

File tree

Test/410.vert

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,5 @@ in dmat4 dm4;
66

77
void main()
88
{
9+
int test = gl_MaxFragmentUniformVectors;
910
}

Test/baseResults/410.vert.out

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,12 @@ Shader version: 410
33
0:? Sequence
44
0:7 Function Definition: main( ( global void)
55
0:7 Function Parameters:
6+
0:9 Sequence
7+
0:9 Sequence
8+
0:9 move second child to first child ( temp int)
9+
0:9 'test' ( temp int)
10+
0:9 Constant:
11+
0:9 16 (const int)
612
0:? Linker Objects
713
0:? 'd' ( in double)
814
0:? 'd3' ( in 3-component vector of double)
@@ -18,6 +24,12 @@ Shader version: 410
1824
0:? Sequence
1925
0:7 Function Definition: main( ( global void)
2026
0:7 Function Parameters:
27+
0:9 Sequence
28+
0:9 Sequence
29+
0:9 move second child to first child ( temp int)
30+
0:9 'test' ( temp int)
31+
0:9 Constant:
32+
0:9 16 (const int)
2133
0:? Linker Objects
2234
0:? 'd' ( in double)
2335
0:? 'd3' ( in 3-component vector of double)

glslang/MachineIndependent/Initialize.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6627,6 +6627,14 @@ void TBuiltIns::initialize(const TBuiltInResource &resources, int version, EProf
66276627
} else {
66286628
// non-ES profile
66296629

6630+
if (version > 400) {
6631+
snprintf(builtInConstant, maxSize, "const int gl_MaxVertexUniformVectors = %d;", resources.maxVertexUniformVectors);
6632+
s.append(builtInConstant);
6633+
6634+
snprintf(builtInConstant, maxSize, "const int gl_MaxFragmentUniformVectors = %d;", resources.maxFragmentUniformVectors);
6635+
s.append(builtInConstant);
6636+
}
6637+
66306638
snprintf(builtInConstant, maxSize, "const int gl_MaxVertexAttribs = %d;", resources.maxVertexAttribs);
66316639
s.append(builtInConstant);
66326640

0 commit comments

Comments
 (0)