Merge pull request #31 from google/explicit-extension-directive
Only output explicit extension directives in preprocessing.
This commit is contained in:
		
						commit
						96d8042a64
					
				| @ -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 | ||||
|  | ||||
| @ -5352,4 +5352,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…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 John Kessenich
						John Kessenich