Implement cull distances for GLSL 4.5 (but not as an extension yet, just a 4.5 feature).
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@27714 e7fa87d3-cd2b-0410-9028-fcbf551c1848
This commit is contained in:
parent
13fd6c9dd7
commit
699684180f
@ -197,6 +197,8 @@ const char* DefaultConfig =
|
||||
"MaxAtomicCounterBufferSize 16384\n"
|
||||
"MaxTransformFeedbackBuffers 4\n"
|
||||
"MaxTransformFeedbackInterleavedComponents 64\n"
|
||||
"MaxCullDistances 8\n"
|
||||
"MaxCombinedClipAndCullDistances 8\n"
|
||||
|
||||
"nonInductiveForLoops 1\n"
|
||||
"whileLoops 1\n"
|
||||
@ -401,6 +403,10 @@ void ProcessConfigFile()
|
||||
Resources.maxTransformFeedbackBuffers = value;
|
||||
else if (strcmp(token, "MaxTransformFeedbackInterleavedComponents") == 0)
|
||||
Resources.maxTransformFeedbackInterleavedComponents = value;
|
||||
else if (strcmp(token, "MaxCullDistances") == 0)
|
||||
Resources.maxCullDistances = value;
|
||||
else if (strcmp(token, "MaxCombinedClipAndCullDistances") == 0)
|
||||
Resources.maxCombinedClipAndCullDistances = value;
|
||||
|
||||
else if (strcmp(token, "nonInductiveForLoops") == 0)
|
||||
Resources.limits.nonInductiveForLoops = (value != 0);
|
||||
|
||||
1
Test/450.comp
Normal file
1
Test/450.comp
Normal file
@ -0,0 +1 @@
|
||||
#version 450 core
|
||||
@ -14,4 +14,7 @@ void main()
|
||||
v3 = dFdyFine(in3);
|
||||
float f = dFdx(in1) + dFdxFine(in1) + dFdxCoarse(in1);
|
||||
v4 = fwidthCoarse(in4) + fwidthFine(in4);
|
||||
|
||||
float cull = gl_CullDistance[2];
|
||||
float consts = gl_MaxCullDistances + gl_MaxCombinedClipAndCullDistances;
|
||||
}
|
||||
|
||||
14
Test/450.geom
Normal file
14
Test/450.geom
Normal file
@ -0,0 +1,14 @@
|
||||
#version 450 core
|
||||
|
||||
in gl_PerVertex {
|
||||
float gl_CullDistance[3];
|
||||
} gl_in[];
|
||||
|
||||
out gl_PerVertex {
|
||||
float gl_CullDistance[3];
|
||||
};
|
||||
|
||||
void main()
|
||||
{
|
||||
gl_CullDistance[2] = gl_in[1].gl_CullDistance[2];
|
||||
}
|
||||
14
Test/450.tesc
Normal file
14
Test/450.tesc
Normal file
@ -0,0 +1,14 @@
|
||||
#version 450 core
|
||||
|
||||
in gl_PerVertex {
|
||||
float gl_CullDistance[3];
|
||||
} gl_in[gl_MaxPatchVertices];
|
||||
|
||||
out gl_PerVertex {
|
||||
float gl_CullDistance[3];
|
||||
} gl_out[];
|
||||
|
||||
void main()
|
||||
{
|
||||
gl_out[0].gl_CullDistance[2] = gl_in[1].gl_CullDistance[2];
|
||||
}
|
||||
14
Test/450.tese
Normal file
14
Test/450.tese
Normal file
@ -0,0 +1,14 @@
|
||||
#version 450 core
|
||||
|
||||
in gl_PerVertex {
|
||||
float gl_CullDistance[3];
|
||||
} gl_in[gl_MaxPatchVertices];
|
||||
|
||||
out gl_PerVertex {
|
||||
float gl_CullDistance[3];
|
||||
};
|
||||
|
||||
void main()
|
||||
{
|
||||
gl_CullDistance[2] = gl_in[1].gl_CullDistance[2];
|
||||
}
|
||||
10
Test/450.vert
Normal file
10
Test/450.vert
Normal file
@ -0,0 +1,10 @@
|
||||
#version 450 core
|
||||
|
||||
out gl_PerVertex {
|
||||
float gl_CullDistance[3];
|
||||
};
|
||||
|
||||
void main()
|
||||
{
|
||||
gl_CullDistance[2] = 4.5;
|
||||
}
|
||||
18
Test/baseResults/450.comp.out
Normal file
18
Test/baseResults/450.comp.out
Normal file
@ -0,0 +1,18 @@
|
||||
450.comp
|
||||
Warning, version 450 is not yet complete; most version-specific features are present, but some are missing.
|
||||
|
||||
Shader version: 450
|
||||
local_size = (1, 1, 1)
|
||||
0:? Sequence
|
||||
0:? Linker Objects
|
||||
|
||||
|
||||
Linked compute stage:
|
||||
|
||||
ERROR: Linking compute stage: Missing entry point: Each stage requires one "void main()" entry point
|
||||
|
||||
Shader version: 450
|
||||
local_size = (1, 1, 1)
|
||||
0:? Sequence
|
||||
0:? Linker Objects
|
||||
|
||||
@ -47,11 +47,24 @@ Shader version: 450
|
||||
0:16 'in4' (smooth in 4-component vector of float)
|
||||
0:16 fwidthFine (4-component vector of float)
|
||||
0:16 'in4' (smooth in 4-component vector of float)
|
||||
0:18 Sequence
|
||||
0:18 move second child to first child (float)
|
||||
0:18 'cull' (float)
|
||||
0:18 direct index (smooth float)
|
||||
0:18 'gl_CullDistance' (smooth in implicitly-sized array of float)
|
||||
0:18 Constant:
|
||||
0:18 2 (const int)
|
||||
0:19 Sequence
|
||||
0:19 move second child to first child (float)
|
||||
0:19 'consts' (float)
|
||||
0:19 Constant:
|
||||
0:19 16.000000
|
||||
0:? Linker Objects
|
||||
0:? 'in1' (smooth in float)
|
||||
0:? 'in2' (smooth in 2-component vector of float)
|
||||
0:? 'in3' (smooth in 3-component vector of float)
|
||||
0:? 'in4' (smooth in 4-component vector of float)
|
||||
0:? 'gl_CullDistance' (smooth in implicitly-sized array of float)
|
||||
|
||||
|
||||
Linked fragment stage:
|
||||
@ -103,9 +116,22 @@ Shader version: 450
|
||||
0:16 'in4' (smooth in 4-component vector of float)
|
||||
0:16 fwidthFine (4-component vector of float)
|
||||
0:16 'in4' (smooth in 4-component vector of float)
|
||||
0:18 Sequence
|
||||
0:18 move second child to first child (float)
|
||||
0:18 'cull' (float)
|
||||
0:18 direct index (smooth float)
|
||||
0:18 'gl_CullDistance' (smooth in 3-element array of float)
|
||||
0:18 Constant:
|
||||
0:18 2 (const int)
|
||||
0:19 Sequence
|
||||
0:19 move second child to first child (float)
|
||||
0:19 'consts' (float)
|
||||
0:19 Constant:
|
||||
0:19 16.000000
|
||||
0:? Linker Objects
|
||||
0:? 'in1' (smooth in float)
|
||||
0:? 'in2' (smooth in 2-component vector of float)
|
||||
0:? 'in3' (smooth in 3-component vector of float)
|
||||
0:? 'in4' (smooth in 4-component vector of float)
|
||||
0:? 'gl_CullDistance' (smooth in 3-element array of float)
|
||||
|
||||
|
||||
72
Test/baseResults/450.geom.out
Normal file
72
Test/baseResults/450.geom.out
Normal file
@ -0,0 +1,72 @@
|
||||
450.geom
|
||||
Warning, version 450 is not yet complete; most version-specific features are present, but some are missing.
|
||||
|
||||
Shader version: 450
|
||||
invocations = 0
|
||||
max_vertices = 0
|
||||
input primitive = none
|
||||
output primitive = none
|
||||
0:? Sequence
|
||||
0:11 Function Definition: main( (void)
|
||||
0:11 Function Parameters:
|
||||
0:13 Sequence
|
||||
0:13 move second child to first child (float)
|
||||
0:13 direct index (layout(stream=0 ) float)
|
||||
0:13 gl_CullDistance: direct index for structure (layout(stream=0 ) out implicitly-sized array of float)
|
||||
0:13 'anon@0' (layout(stream=0 ) out block{layout(stream=0 ) out implicitly-sized array of float gl_CullDistance})
|
||||
0:13 Constant:
|
||||
0:13 3 (const uint)
|
||||
0:13 Constant:
|
||||
0:13 2 (const int)
|
||||
0:13 direct index (float)
|
||||
0:13 gl_CullDistance: direct index for structure (in implicitly-sized array of float)
|
||||
0:13 direct index (block{in implicitly-sized array of float gl_CullDistance})
|
||||
0:13 'gl_in' (in implicitly-sized array of block{in implicitly-sized array of float gl_CullDistance})
|
||||
0:13 Constant:
|
||||
0:13 1 (const int)
|
||||
0:13 Constant:
|
||||
0:13 0 (const int)
|
||||
0:13 Constant:
|
||||
0:13 2 (const int)
|
||||
0:? Linker Objects
|
||||
0:? 'gl_in' (in implicitly-sized array of block{in implicitly-sized array of float gl_CullDistance})
|
||||
0:? 'anon@0' (layout(stream=0 ) out block{layout(stream=0 ) out implicitly-sized array of float gl_CullDistance})
|
||||
|
||||
|
||||
Linked geometry stage:
|
||||
|
||||
ERROR: Linking geometry stage: At least one shader must specify an input layout primitive
|
||||
ERROR: Linking geometry stage: At least one shader must specify an output layout primitive
|
||||
ERROR: Linking geometry stage: At least one shader must specify a layout(max_vertices = value)
|
||||
|
||||
Shader version: 450
|
||||
invocations = 0
|
||||
max_vertices = 0
|
||||
input primitive = none
|
||||
output primitive = none
|
||||
0:? Sequence
|
||||
0:11 Function Definition: main( (void)
|
||||
0:11 Function Parameters:
|
||||
0:13 Sequence
|
||||
0:13 move second child to first child (float)
|
||||
0:13 direct index (layout(stream=0 ) float)
|
||||
0:13 gl_CullDistance: direct index for structure (layout(stream=0 ) out 3-element array of float)
|
||||
0:13 'anon@0' (layout(stream=0 ) out block{layout(stream=0 ) out 3-element array of float gl_CullDistance})
|
||||
0:13 Constant:
|
||||
0:13 3 (const uint)
|
||||
0:13 Constant:
|
||||
0:13 2 (const int)
|
||||
0:13 direct index (float)
|
||||
0:13 gl_CullDistance: direct index for structure (in 1-element array of float)
|
||||
0:13 direct index (block{in 1-element array of float gl_CullDistance})
|
||||
0:13 'gl_in' (in 2-element array of block{in 1-element array of float gl_CullDistance})
|
||||
0:13 Constant:
|
||||
0:13 1 (const int)
|
||||
0:13 Constant:
|
||||
0:13 0 (const int)
|
||||
0:13 Constant:
|
||||
0:13 2 (const int)
|
||||
0:? Linker Objects
|
||||
0:? 'gl_in' (in 2-element array of block{in 1-element array of float gl_CullDistance})
|
||||
0:? 'anon@0' (layout(stream=0 ) out block{layout(stream=0 ) out 3-element array of float gl_CullDistance})
|
||||
|
||||
70
Test/baseResults/450.tesc.out
Normal file
70
Test/baseResults/450.tesc.out
Normal file
@ -0,0 +1,70 @@
|
||||
450.tesc
|
||||
Warning, version 450 is not yet complete; most version-specific features are present, but some are missing.
|
||||
|
||||
Shader version: 450
|
||||
vertices = 0
|
||||
0:? Sequence
|
||||
0:11 Function Definition: main( (void)
|
||||
0:11 Function Parameters:
|
||||
0:13 Sequence
|
||||
0:13 move second child to first child (float)
|
||||
0:13 direct index (float)
|
||||
0:13 gl_CullDistance: direct index for structure (out implicitly-sized array of float)
|
||||
0:13 direct index (block{out implicitly-sized array of float gl_CullDistance})
|
||||
0:13 'gl_out' (out implicitly-sized array of block{out implicitly-sized array of float gl_CullDistance})
|
||||
0:13 Constant:
|
||||
0:13 0 (const int)
|
||||
0:13 Constant:
|
||||
0:13 0 (const int)
|
||||
0:13 Constant:
|
||||
0:13 2 (const int)
|
||||
0:13 direct index (float)
|
||||
0:13 gl_CullDistance: direct index for structure (in implicitly-sized array of float)
|
||||
0:13 direct index (block{in implicitly-sized array of float gl_CullDistance})
|
||||
0:13 'gl_in' (in 32-element array of block{in implicitly-sized array of float gl_CullDistance})
|
||||
0:13 Constant:
|
||||
0:13 1 (const int)
|
||||
0:13 Constant:
|
||||
0:13 0 (const int)
|
||||
0:13 Constant:
|
||||
0:13 2 (const int)
|
||||
0:? Linker Objects
|
||||
0:? 'gl_in' (in 32-element array of block{in implicitly-sized array of float gl_CullDistance})
|
||||
0:? 'gl_out' (out implicitly-sized array of block{out implicitly-sized array of float gl_CullDistance})
|
||||
|
||||
|
||||
Linked tessellation control stage:
|
||||
|
||||
ERROR: Linking tessellation control stage: At least one shader must specify an output layout(vertices=...)
|
||||
|
||||
Shader version: 450
|
||||
vertices = 0
|
||||
0:? Sequence
|
||||
0:11 Function Definition: main( (void)
|
||||
0:11 Function Parameters:
|
||||
0:13 Sequence
|
||||
0:13 move second child to first child (float)
|
||||
0:13 direct index (float)
|
||||
0:13 gl_CullDistance: direct index for structure (out 1-element array of float)
|
||||
0:13 direct index (block{out 1-element array of float gl_CullDistance})
|
||||
0:13 'gl_out' (out 1-element array of block{out 1-element array of float gl_CullDistance})
|
||||
0:13 Constant:
|
||||
0:13 0 (const int)
|
||||
0:13 Constant:
|
||||
0:13 0 (const int)
|
||||
0:13 Constant:
|
||||
0:13 2 (const int)
|
||||
0:13 direct index (float)
|
||||
0:13 gl_CullDistance: direct index for structure (in 1-element array of float)
|
||||
0:13 direct index (block{in 1-element array of float gl_CullDistance})
|
||||
0:13 'gl_in' (in 32-element array of block{in 1-element array of float gl_CullDistance})
|
||||
0:13 Constant:
|
||||
0:13 1 (const int)
|
||||
0:13 Constant:
|
||||
0:13 0 (const int)
|
||||
0:13 Constant:
|
||||
0:13 2 (const int)
|
||||
0:? Linker Objects
|
||||
0:? 'gl_in' (in 32-element array of block{in 1-element array of float gl_CullDistance})
|
||||
0:? 'gl_out' (out 1-element array of block{out 1-element array of float gl_CullDistance})
|
||||
|
||||
68
Test/baseResults/450.tese.out
Normal file
68
Test/baseResults/450.tese.out
Normal file
@ -0,0 +1,68 @@
|
||||
450.tese
|
||||
Warning, version 450 is not yet complete; most version-specific features are present, but some are missing.
|
||||
|
||||
Shader version: 450
|
||||
input primitive = none
|
||||
vertex spacing = none
|
||||
triangle order = none
|
||||
0:? Sequence
|
||||
0:11 Function Definition: main( (void)
|
||||
0:11 Function Parameters:
|
||||
0:13 Sequence
|
||||
0:13 move second child to first child (float)
|
||||
0:13 direct index (float)
|
||||
0:13 gl_CullDistance: direct index for structure (out implicitly-sized array of float)
|
||||
0:13 'anon@0' (out block{out implicitly-sized array of float gl_CullDistance})
|
||||
0:13 Constant:
|
||||
0:13 3 (const uint)
|
||||
0:13 Constant:
|
||||
0:13 2 (const int)
|
||||
0:13 direct index (float)
|
||||
0:13 gl_CullDistance: direct index for structure (in implicitly-sized array of float)
|
||||
0:13 direct index (block{in implicitly-sized array of float gl_CullDistance})
|
||||
0:13 'gl_in' (in 32-element array of block{in implicitly-sized array of float gl_CullDistance})
|
||||
0:13 Constant:
|
||||
0:13 1 (const int)
|
||||
0:13 Constant:
|
||||
0:13 0 (const int)
|
||||
0:13 Constant:
|
||||
0:13 2 (const int)
|
||||
0:? Linker Objects
|
||||
0:? 'gl_in' (in 32-element array of block{in implicitly-sized array of float gl_CullDistance})
|
||||
0:? 'anon@0' (out block{out implicitly-sized array of float gl_CullDistance})
|
||||
|
||||
|
||||
Linked tessellation evaluation stage:
|
||||
|
||||
ERROR: Linking tessellation evaluation stage: At least one shader must specify an input layout primitive
|
||||
|
||||
Shader version: 450
|
||||
input primitive = none
|
||||
vertex spacing = equal_spacing
|
||||
triangle order = ccw
|
||||
0:? Sequence
|
||||
0:11 Function Definition: main( (void)
|
||||
0:11 Function Parameters:
|
||||
0:13 Sequence
|
||||
0:13 move second child to first child (float)
|
||||
0:13 direct index (float)
|
||||
0:13 gl_CullDistance: direct index for structure (out 3-element array of float)
|
||||
0:13 'anon@0' (out block{out 3-element array of float gl_CullDistance})
|
||||
0:13 Constant:
|
||||
0:13 3 (const uint)
|
||||
0:13 Constant:
|
||||
0:13 2 (const int)
|
||||
0:13 direct index (float)
|
||||
0:13 gl_CullDistance: direct index for structure (in 1-element array of float)
|
||||
0:13 direct index (block{in 1-element array of float gl_CullDistance})
|
||||
0:13 'gl_in' (in 32-element array of block{in 1-element array of float gl_CullDistance})
|
||||
0:13 Constant:
|
||||
0:13 1 (const int)
|
||||
0:13 Constant:
|
||||
0:13 0 (const int)
|
||||
0:13 Constant:
|
||||
0:13 2 (const int)
|
||||
0:? Linker Objects
|
||||
0:? 'gl_in' (in 32-element array of block{in 1-element array of float gl_CullDistance})
|
||||
0:? 'anon@0' (out block{out 3-element array of float gl_CullDistance})
|
||||
|
||||
47
Test/baseResults/450.vert.out
Normal file
47
Test/baseResults/450.vert.out
Normal file
@ -0,0 +1,47 @@
|
||||
450.vert
|
||||
Warning, version 450 is not yet complete; most version-specific features are present, but some are missing.
|
||||
|
||||
Shader version: 450
|
||||
0:? Sequence
|
||||
0:7 Function Definition: main( (void)
|
||||
0:7 Function Parameters:
|
||||
0:9 Sequence
|
||||
0:9 move second child to first child (float)
|
||||
0:9 direct index (float)
|
||||
0:9 gl_CullDistance: direct index for structure (out implicitly-sized array of float)
|
||||
0:9 'anon@0' (out block{out implicitly-sized array of float gl_CullDistance})
|
||||
0:9 Constant:
|
||||
0:9 10 (const uint)
|
||||
0:9 Constant:
|
||||
0:9 2 (const int)
|
||||
0:9 Constant:
|
||||
0:9 4.500000
|
||||
0:? Linker Objects
|
||||
0:? 'anon@0' (out block{out implicitly-sized array of float gl_CullDistance})
|
||||
0:? 'gl_VertexID' (gl_VertexId int)
|
||||
0:? 'gl_InstanceID' (gl_InstanceId int)
|
||||
|
||||
|
||||
Linked vertex stage:
|
||||
|
||||
|
||||
Shader version: 450
|
||||
0:? Sequence
|
||||
0:7 Function Definition: main( (void)
|
||||
0:7 Function Parameters:
|
||||
0:9 Sequence
|
||||
0:9 move second child to first child (float)
|
||||
0:9 direct index (float)
|
||||
0:9 gl_CullDistance: direct index for structure (out 3-element array of float)
|
||||
0:9 'anon@0' (out block{out 3-element array of float gl_CullDistance})
|
||||
0:9 Constant:
|
||||
0:9 10 (const uint)
|
||||
0:9 Constant:
|
||||
0:9 2 (const int)
|
||||
0:9 Constant:
|
||||
0:9 4.500000
|
||||
0:? Linker Objects
|
||||
0:? 'anon@0' (out block{out 3-element array of float gl_CullDistance})
|
||||
0:? 'gl_VertexID' (gl_VertexId int)
|
||||
0:? 'gl_InstanceID' (gl_InstanceId int)
|
||||
|
||||
@ -78,6 +78,8 @@ MaxCombinedAtomicCounterBuffers 1
|
||||
MaxAtomicCounterBufferSize 16384
|
||||
MaxTransformFeedbackBuffers 4
|
||||
MaxTransformFeedbackInterleavedComponents 64
|
||||
MaxCullDistances 8
|
||||
MaxCombinedClipAndCullDistances 8
|
||||
nonInductiveForLoops 1
|
||||
whileLoops 1
|
||||
doWhileLoops 1
|
||||
|
||||
@ -71,7 +71,12 @@ numeral.frag
|
||||
430.comp
|
||||
440.vert
|
||||
440.frag
|
||||
450.vert
|
||||
450.geom
|
||||
450.tesc
|
||||
450.tese
|
||||
450.frag
|
||||
450.comp
|
||||
dce.frag
|
||||
atomic_uint.frag
|
||||
../../LunarGLASS/test/aggOps.frag
|
||||
|
||||
@ -130,6 +130,8 @@ struct TBuiltInResource {
|
||||
int maxAtomicCounterBufferSize;
|
||||
int maxTransformFeedbackBuffers;
|
||||
int maxTransformFeedbackInterleavedComponents;
|
||||
int maxCullDistances;
|
||||
int maxCombinedClipAndCullDistances;
|
||||
|
||||
TLimits limits;
|
||||
};
|
||||
|
||||
@ -1232,6 +1232,10 @@ void TBuiltIns::initialize(int version, EProfile profile)
|
||||
"vec4 gl_TexCoord[];"
|
||||
"float gl_FogFragCoord;"
|
||||
);
|
||||
if (version >= 450)
|
||||
stageBuiltins[EShLangVertex].append(
|
||||
"float gl_CullDistance[];"
|
||||
);
|
||||
stageBuiltins[EShLangVertex].append(
|
||||
"};"
|
||||
"\n");
|
||||
@ -1285,6 +1289,10 @@ void TBuiltIns::initialize(int version, EProfile profile)
|
||||
"vec4 gl_TexCoord[];"
|
||||
"float gl_FogFragCoord;"
|
||||
);
|
||||
if (version >= 450)
|
||||
stageBuiltins[EShLangGeometry].append(
|
||||
"float gl_CullDistance[];"
|
||||
);
|
||||
stageBuiltins[EShLangGeometry].append(
|
||||
"} gl_in[];"
|
||||
|
||||
@ -1304,6 +1312,10 @@ void TBuiltIns::initialize(int version, EProfile profile)
|
||||
"vec4 gl_TexCoord[];"
|
||||
"float gl_FogFragCoord;"
|
||||
);
|
||||
if (version >= 450)
|
||||
stageBuiltins[EShLangGeometry].append(
|
||||
"float gl_CullDistance[];"
|
||||
);
|
||||
stageBuiltins[EShLangGeometry].append(
|
||||
"};"
|
||||
|
||||
@ -1356,6 +1368,10 @@ void TBuiltIns::initialize(int version, EProfile profile)
|
||||
"vec4 gl_TexCoord[];"
|
||||
"float gl_FogFragCoord;"
|
||||
);
|
||||
if (version >= 450)
|
||||
stageBuiltins[EShLangTessControl].append(
|
||||
"float gl_CullDistance[];"
|
||||
);
|
||||
stageBuiltins[EShLangTessControl].append(
|
||||
"} gl_out[];"
|
||||
|
||||
@ -1397,6 +1413,10 @@ void TBuiltIns::initialize(int version, EProfile profile)
|
||||
"vec4 gl_TexCoord[];"
|
||||
"float gl_FogFragCoord;"
|
||||
);
|
||||
if (version >= 450)
|
||||
stageBuiltins[EShLangTessEvaluation].append(
|
||||
"float gl_CullDistance[];"
|
||||
);
|
||||
stageBuiltins[EShLangTessEvaluation].append(
|
||||
"};"
|
||||
"\n");
|
||||
@ -1477,6 +1497,7 @@ void TBuiltIns::initialize(int version, EProfile profile)
|
||||
|
||||
if (version >= 450)
|
||||
stageBuiltins[EShLangFragment].append(
|
||||
"in float gl_CullDistance[];"
|
||||
"bool gl_HelperInvocation;" // needs qualifier fixed later
|
||||
);
|
||||
} else {
|
||||
@ -2200,6 +2221,10 @@ void TBuiltIns::initialize(const TBuiltInResource &resources, int version, EProf
|
||||
"vec4 gl_TexCoord[];"
|
||||
"float gl_FogFragCoord;"
|
||||
);
|
||||
if (profile != EEsProfile && version >= 450)
|
||||
s.append(
|
||||
"float gl_CullDistance[];"
|
||||
);
|
||||
s.append(
|
||||
"} gl_in[gl_MaxPatchVertices];"
|
||||
"\n");
|
||||
@ -2301,6 +2326,14 @@ void TBuiltIns::initialize(const TBuiltInResource &resources, int version, EProf
|
||||
s.append(builtInConstant);
|
||||
}
|
||||
|
||||
// GL_ARB_cull_distance
|
||||
if (profile != EEsProfile && version >= 450) {
|
||||
snprintf(builtInConstant, maxSize, "const int gl_MaxCullDistances = %d;", resources.maxCullDistances);
|
||||
s.append(builtInConstant);
|
||||
snprintf(builtInConstant, maxSize, "const int gl_MaxCombinedClipAndCullDistances = %d;", resources.maxCombinedClipAndCullDistances);
|
||||
s.append(builtInConstant);
|
||||
}
|
||||
|
||||
s.append("\n");
|
||||
}
|
||||
|
||||
|
||||
@ -2559,6 +2559,7 @@ TSymbol* TParseContext::redeclareBuiltinVariable(TSourceLoc loc, const TString&
|
||||
//
|
||||
// Either redeclare the requested block, or give an error message why it can't be done.
|
||||
//
|
||||
// TODO: functionality: explicitly sizing members of redeclared blocks is not giving them an explicit size
|
||||
void TParseContext::redeclareBuiltinBlock(TSourceLoc loc, TTypeList& newTypeList, const TString& blockName, const TString* instanceName, TArraySizes* arraySizes)
|
||||
{
|
||||
const char* feature = "built-in block redeclaration";
|
||||
|
||||
@ -169,6 +169,7 @@ void TParseContext::initializeExtensionBehavior()
|
||||
extensionBehavior[GL_ARB_shader_image_load_store] = EBhDisable;
|
||||
extensionBehavior[GL_ARB_shader_atomic_counters] = EBhDisable;
|
||||
extensionBehavior[GL_ARB_derivative_control] = EBhDisable;
|
||||
// extensionBehavior[GL_ARB_cull_distance] = EBhDisable; // present for 4.5, but need extension control over block members
|
||||
}
|
||||
|
||||
// Get code that is not part of a shared symbol table, is specific to this shader,
|
||||
@ -184,7 +185,8 @@ const char* TParseContext::getPreamble()
|
||||
"#define GL_OES_standard_derivatives 1\n"
|
||||
"#define GL_EXT_frag_depth 1\n"
|
||||
"#define GL_OES_EGL_image_external 1\n"
|
||||
"#define GL_EXT_shader_texture_lod 1\n";
|
||||
"#define GL_EXT_shader_texture_lod 1\n"
|
||||
;
|
||||
} else {
|
||||
return
|
||||
"#define GL_ES 1\n"
|
||||
@ -192,7 +194,8 @@ const char* TParseContext::getPreamble()
|
||||
"#define GL_OES_standard_derivatives 1\n"
|
||||
"#define GL_EXT_frag_depth 1\n"
|
||||
"#define GL_OES_EGL_image_external 1\n"
|
||||
"#define GL_EXT_shader_texture_lod 1\n";
|
||||
"#define GL_EXT_shader_texture_lod 1\n"
|
||||
;
|
||||
}
|
||||
} else {
|
||||
return
|
||||
@ -210,6 +213,7 @@ const char* TParseContext::getPreamble()
|
||||
"#define GL_ARB_shader_image_load_store 1\n"
|
||||
"#define GL_ARB_shader_atomic_counters 1\n"
|
||||
"#define GL_ARB_derivative_control 1\n"
|
||||
// "#define GL_ARB_cull_distance 1\n" // present for 4.5, but need extension control over block members
|
||||
;
|
||||
}
|
||||
}
|
||||
|
||||
@ -93,6 +93,7 @@ const char* const GL_ARB_explicit_attrib_location = "GL_ARB_explicit_attrib_loca
|
||||
const char* const GL_ARB_shader_image_load_store = "GL_ARB_shader_image_load_store";
|
||||
const char* const GL_ARB_shader_atomic_counters = "GL_ARB_shader_atomic_counters";
|
||||
const char* const GL_ARB_derivative_control = "GL_ARB_derivative_control";
|
||||
//const char* const GL_ARB_cull_distance = "GL_ARB_cull_distance"; // present for 4.5, but need extension control over block members
|
||||
|
||||
} // end namespace glslang
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user