Non-Functional: Whitespace, comments, replace accidentally deleted comment.

- fixed ParseHelper.cpp newlines (crlf -> lf)
- removed trailing white space in most source files
- fix some spelling issues
- extra blank lines
- tabs to spaces
- replace #include comment about no location
This commit is contained in:
John Kessenich 2017-01-06 00:34:48 -07:00
parent 3dd32293f4
commit ecba76fe73
60 changed files with 755 additions and 806 deletions

View file

@ -37,7 +37,7 @@
//
// Help manage multiple profiles, versions, extensions etc.
//
// These don't return error codes, as the presumption is parsing will
// These don't return error codes, as the presumption is parsing will
// always continue as if the tested feature were enabled, and thus there
// is no error recovery needed.
//
@ -47,25 +47,25 @@
//
// To add a new hypothetical "Feature F" to the front end, where an extension
// "XXX_extension_X" can be used to enable the feature, do the following.
//
//
// OVERVIEW: Specific features are what are error-checked for, not
// extensions: A specific Feature F might be enabled by an extension, or a
// extensions: A specific Feature F might be enabled by an extension, or a
// particular version in a particular profile, or a stage, or combinations, etc.
//
// The basic mechanism is to use the following to "declare" all the things that
//
// The basic mechanism is to use the following to "declare" all the things that
// enable/disable Feature F, in a code path that implements Feature F:
//
//
// requireProfile()
// profileRequires()
// requireStage()
// checkDeprecated()
// requireNotRemoved()
// requireExtensions()
//
// Typically, only the first two calls are needed. They go into a code path that
// implements Feature F, and will log the proper error/warning messages. Parsing
//
// Typically, only the first two calls are needed. They go into a code path that
// implements Feature F, and will log the proper error/warning messages. Parsing
// will then always continue as if the tested feature was enabled.
//
//
// There is typically no if-testing or conditional parsing, just insertion of the calls above.
// However, if symbols specific to the extension are added (step 5), they will
// only be added under tests that the minimum version and profile are present.
@ -73,10 +73,10 @@
// 1) Add a symbol name for the extension string at the bottom of Versions.h:
//
// const char* const XXX_extension_X = "XXX_extension_X";
//
//
// 2) Add extension initialization to TParseVersions::initializeExtensionBehavior(),
// the first function below:
//
//
// extensionBehavior[XXX_extension_X] = EBhDisable;
//
// 3) Add any preprocessor directives etc. in the next function, TParseVersions::getPreamble():
@ -84,50 +84,50 @@
// "#define XXX_extension_X 1\n"
//
// The new-line is important, as that ends preprocess tokens.
//
//
// 4) Insert a profile check in the feature's path (unless all profiles support the feature,
// for some version level). That is, call requireProfile() to constrain the profiles, e.g.:
//
//
// // ... in a path specific to Feature F...
// requireProfile(loc,
// ECoreProfile | ECompatibilityProfile,
// "Feature F");
//
//
// 5) For each profile that supports the feature, insert version/extension checks:
//
//
// The mostly likely scenario is that Feature F can only be used with a
// particular profile if XXX_extension_X is present or the version is
// high enough that the core specification already incorporated it.
//
//
// // following the requireProfile() call...
// profileRequires(loc,
// profileRequires(loc,
// ECoreProfile | ECompatibilityProfile,
// 420, // 0 if no version incorporated the feature into the core spec.
// XXX_extension_X, // can be a list of extensions that all add the feature
// "Feature F Description");
//
//
// This allows the feature if either A) one of the extensions is enabled or
// B) the version is high enough. If no version yet incorporates the feature
// into core, pass in 0.
//
//
// This can be called multiple times, if different profiles support the
// feature starting at different version numbers or with different
// feature starting at different version numbers or with different
// extensions.
//
//
// This must be called for each profile allowed by the initial call to requireProfile().
//
//
// Profiles are all masks, which can be "or"-ed together.
//
//
// ENoProfile
// ECoreProfile
// ECompatibilityProfile
// EEsProfile
//
//
// The ENoProfile profile is only for desktop, before profiles showed up in version 150;
// All other #version with no profile default to either es or core, and so have profiles.
//
//
// You can select all but a particular profile using ~. The following basically means "desktop":
//
//
// ~EEsProfile
//
// 6) If built-in symbols are added by the extension, add them in Initialize.cpp: Their use
@ -155,7 +155,7 @@ void TParseVersions::initializeExtensionBehavior()
extensionBehavior[E_GL_EXT_frag_depth] = EBhDisable;
extensionBehavior[E_GL_OES_EGL_image_external] = EBhDisable;
extensionBehavior[E_GL_EXT_shader_texture_lod] = EBhDisable;
extensionBehavior[E_GL_ARB_texture_rectangle] = EBhDisable;
extensionBehavior[E_GL_3DL_array_objects] = EBhDisable;
extensionBehavior[E_GL_ARB_shading_language_420pack] = EBhDisable;
@ -195,7 +195,7 @@ void TParseVersions::initializeExtensionBehavior()
extensionBehavior[E_GL_AMD_gpu_shader_half_float] = EBhDisable;
#endif
#ifdef NV_EXTENSIONS
#ifdef NV_EXTENSIONS
extensionBehavior[E_GL_NV_sample_mask_override_coverage] = EBhDisable;
extensionBehavior[E_SPV_NV_geometry_shader_passthrough] = EBhDisable;
#endif
@ -234,7 +234,7 @@ void TParseVersions::initializeExtensionBehavior()
void TParseVersions::getPreamble(std::string& preamble)
{
if (profile == EEsProfile) {
preamble =
preamble =
"#define GL_ES 1\n"
"#define GL_FRAGMENT_PRECISION_HIGH 1\n"
"#define GL_OES_texture_3D 1\n"
@ -273,7 +273,7 @@ void TParseVersions::getPreamble(std::string& preamble)
"#define GL_EXT_shader_non_constant_global_initializers 1\n"
;
} else {
preamble =
preamble =
"#define GL_FRAGMENT_PRECISION_HIGH 1\n"
"#define GL_ARB_texture_rectangle 1\n"
"#define GL_ARB_shading_language_420pack 1\n"
@ -308,7 +308,7 @@ void TParseVersions::getPreamble(std::string& preamble)
"#define GL_AMD_gpu_shader_half_float 1\n"
#endif
#ifdef NV_EXTENSIONS
#ifdef NV_EXTENSIONS
"#define GL_NV_sample_mask_override_coverage 1\n"
"#define GL_NV_geometry_shader_passthrough 1\n"
#endif
@ -316,7 +316,7 @@ void TParseVersions::getPreamble(std::string& preamble)
}
// #line and #include
preamble +=
preamble +=
"#define GL_GOOGLE_cpp_style_line_directive 1\n"
"#define GL_GOOGLE_include_directive 1\n"
;
@ -343,7 +343,7 @@ void TParseVersions::getPreamble(std::string& preamble)
//
// When to use requireProfile():
//
// Use if only some profiles support a feature. However, if within a profile the feature
// Use if only some profiles support a feature. However, if within a profile the feature
// is version or extension specific, follow this call with calls to profileRequires().
//
// Operation: If the current profile is not one of the profileMask,
@ -358,7 +358,7 @@ void TParseVersions::requireProfile(const TSourceLoc& loc, int profileMask, cons
//
// Map from stage enum to externally readable text name.
//
const char* StageName(EShLanguage stage)
const char* StageName(EShLanguage stage)
{
switch(stage) {
case EShLangVertex: return "vertex";
@ -383,7 +383,7 @@ const char* StageName(EShLanguage stage)
// Operation: Will issue warnings/errors based on the current profile, version, and extension
// behaviors. It only checks extensions when the current profile is one of the profileMask.
//
// A minVersion of 0 means no version of the profileMask support this in core,
// A minVersion of 0 means no version of the profileMask support this in core,
// the extension must be present.
//
@ -421,7 +421,7 @@ void TParseVersions::profileRequires(const TSourceLoc& loc, int profileMask, int
//
// When to use requireStage()
//
// If only some stages support a feature.
// If only some stages support a feature.
//
// Operation: If the current stage is not present, give an error message.
//
@ -663,7 +663,7 @@ void TParseVersions::updateExtensionBehavior(const char* extension, TExtensionBe
// Call for any operation needing full GLSL integer data-type support.
void TParseVersions::fullIntegerCheck(const TSourceLoc& loc, const char* op)
{
profileRequires(loc, ENoProfile, 130, nullptr, op);
profileRequires(loc, ENoProfile, 130, nullptr, op);
profileRequires(loc, EEsProfile, 300, nullptr, op);
}