Glsl: Avoid use of global object pool

Also, use the opportunity to re-organize and clean up a bit.

Change-Id: I09d5635f48d98b450ffd1eb1a0e003a288cf6804
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
hjk
2018-02-02 15:34:20 +01:00
parent 4e494debff
commit acd63756dc
3 changed files with 76 additions and 121 deletions

View File

@@ -208,14 +208,14 @@ void GlslEditorWidget::updateDocumentNow()
Scope *globalScope = new Namespace();
doc->_globalScope = globalScope;
const GlslEditorPlugin::InitFile *file = GlslEditorPlugin::shaderInit(variant);
sem.translationUnit(file->ast, globalScope, file->engine);
sem.translationUnit(file->ast(), globalScope, file->engine());
if (variant & Lexer::Variant_VertexShader) {
file = GlslEditorPlugin::vertexShaderInit(variant);
sem.translationUnit(file->ast, globalScope, file->engine);
sem.translationUnit(file->ast(), globalScope, file->engine());
}
if (variant & Lexer::Variant_FragmentShader) {
file = GlslEditorPlugin::fragmentShaderInit(variant);
sem.translationUnit(file->ast, globalScope, file->engine);
sem.translationUnit(file->ast(), globalScope, file->engine());
}
sem.translationUnit(ast, globalScope, doc->_engine);