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
20 changed files with 414 additions and 3 deletions
|
|
@ -1221,7 +1221,7 @@ void TBuiltIns::initialize(int version, EProfile profile)
|
|||
"vec4 gl_Position;" // needs qualifier fixed later
|
||||
"float gl_PointSize;" // needs qualifier fixed later
|
||||
"float gl_ClipDistance[];"
|
||||
);
|
||||
);
|
||||
if (IncludeLegacy(version, profile))
|
||||
stageBuiltins[EShLangVertex].append(
|
||||
"vec4 gl_ClipVertex;" // needs qualifier fixed later
|
||||
|
|
@ -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");
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue