mirror of
https://github.com/KhronosGroup/glslang
synced 2024-11-08 11:30:06 +00:00
Only output explicit extension directives in preprocessing.
Preprocessing output shouldn't contain extensions enabled as dependencies.
This commit is contained in:
parent
222457054e
commit
1d2996db68
@ -1,6 +1,6 @@
|
||||
#version 310 es
|
||||
|
||||
#extension GL_OES_texture_3D : enable
|
||||
#extension GL_EXT_geometry_shader : enable
|
||||
#extension GL_EXT_frag_depth : disable
|
||||
#extension GL_EXT_gpu_shader5 : require
|
||||
#extension GL_EXT_shader_texture_image_samples : warn
|
||||
|
@ -1,6 +1,6 @@
|
||||
#version 310 es
|
||||
|
||||
#extension GL_OES_texture_3D: enable
|
||||
#extension GL_EXT_geometry_shader: enable
|
||||
#extension GL_EXT_frag_depth: disable
|
||||
#extension GL_EXT_gpu_shader5: require
|
||||
#extension GL_EXT_shader_texture_image_samples: warn
|
||||
|
@ -5333,4 +5333,11 @@ void TParseContext::notifyLineDirective(int curLineNo, int newLineNo, bool hasSo
|
||||
}
|
||||
}
|
||||
|
||||
void TParseContext::notifyExtensionDirective(int line, const char* extension, const char* behavior)
|
||||
{
|
||||
if (extensionCallback) {
|
||||
extensionCallback(line, extension, behavior);
|
||||
}
|
||||
}
|
||||
|
||||
} // end namespace glslang
|
||||
|
@ -222,6 +222,7 @@ public:
|
||||
void notifyVersion(int line, int version, const char* type_string);
|
||||
void notifyErrorDirective(int line, const char* error_message);
|
||||
void notifyLineDirective(int curLineNo, int newLineNo, bool hasSource, int sourceNum);
|
||||
void notifyExtensionDirective(int line, const char* extension, const char* behavior);
|
||||
|
||||
// The following are implemented in Versions.cpp to localize version/profile/stage/extensions control
|
||||
void initializeExtensionBehavior();
|
||||
|
@ -475,9 +475,6 @@ bool TParseContext::extensionsTurnedOn(int numExtensions, const char* const exte
|
||||
//
|
||||
void TParseContext::updateExtensionBehavior(int line, const char* extension, const char* behaviorString)
|
||||
{
|
||||
if (extensionCallback)
|
||||
extensionCallback(line, extension, behaviorString);
|
||||
|
||||
// Translate from text string of extension's behavior to an enum.
|
||||
TExtensionBehavior behavior = EBhDisable;
|
||||
if (! strcmp("require", behaviorString))
|
||||
|
@ -773,6 +773,7 @@ int TPpContext::CPPextension(TPpToken* ppToken)
|
||||
}
|
||||
|
||||
parseContext.updateExtensionBehavior(line, extensionName, ppToken->name);
|
||||
parseContext.notifyExtensionDirective(line, extensionName, ppToken->name);
|
||||
|
||||
token = scanToken(ppToken);
|
||||
if (token == '\n')
|
||||
|
Loading…
Reference in New Issue
Block a user