Update ANGLE in WebKit
authorachicu@adobe.com <achicu@adobe.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 17 Jul 2012 20:18:16 +0000 (20:18 +0000)
committerachicu@adobe.com <achicu@adobe.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 17 Jul 2012 20:18:16 +0000 (20:18 +0000)
https://bugs.webkit.org/show_bug.cgi?id=89039

Reviewed by Dean Jackson and Mark Rowe.

Update ANGLE to r1170, with the following modifications:

(1) Use Bison 2.3 instead of Bison 2.4.2 to generate ExpressionParser.cpp and
glslang_tab.cpp. I had to modify ExpressionParser.y to make it compatible with Bison
2.3. The changes have been contributed back to ANGLE in r1224.

(2) Continue to recognize QNX as POSIX in ANGLE. This has been contributed back to ANGLE
in r1223.

(3) Rename ANGLE/src/compiler/preprocessor/new/Diagnostic.cpp to DiagnosticBase.cpp.
Rename ANGLE/src/compiler/preprocessor/new/DirectiveHandler.cpp to DirectiveHandlerBase.cpp.

With the introduction of ANGLE's new preprocessor, there were two files named Diagnostic.cpp
in ANGLE under different folders. This caused problems on the QT build when their object
files, both named Diagnostic.o, tried to go in the same folder. Renaming one of them to
DiagnosticBase.cpp avoids this conflict. The same situation occurred with
DirectiveHandler.cpp. I will work on contributing this change back to ANGLE for future
updates.

(4) Add the following lines to glslang.y and ExpressionParser.y:
#define YYENABLE_NLS 0
#define YYLTYPE_IS_TRIVIAL 1

Bison 2.3 doesn't first check that these macros are defined before reading their value,
which causes the QT build to fail.

We work around this issue in the same way in CSSGrammar.y.

I will work on contributing this change back to ANGLE.

Source/ThirdParty/ANGLE:

* ANGLE.xcodeproj/project.pbxproj:
* include/GLES2/gl2ext.h:
* include/GLSLANG/ShaderLang.h:
* src/build_angle.xcodeproj/project.pbxproj:
* src/common/angleutils.h:
* src/common/debug.cpp:
(gl):
(gl::output):
(gl::trace):
(gl::perfActive):
(gl::ScopedPerfEventHelper::ScopedPerfEventHelper):
(gl::ScopedPerfEventHelper::~ScopedPerfEventHelper):
* src/common/version.h:
* src/compiler/BuiltInFunctionEmulator.cpp:
(BuiltInFunctionEmulator::IdentifyFunction):
* src/compiler/BuiltInFunctionEmulator.h:
* src/compiler/Compiler.cpp:
(isWebGLBasedSpec):
(TCompiler::compile):
(TCompiler::rewriteCSSShader):
(TCompiler::enforceTimingRestrictions):
(TCompiler::enforceFragmentShaderTimingRestrictions):
(TCompiler::enforceVertexShaderTimingRestrictions):
* src/compiler/DetectDiscontinuity.cpp: Added.
(sh::DetectLoopDiscontinuity::traverse):
(sh):
(sh::DetectLoopDiscontinuity::visitBranch):
(sh::DetectLoopDiscontinuity::visitAggregate):
(sh::containsLoopDiscontinuity):
(sh::DetectGradientOperation::traverse):
(sh::DetectGradientOperation::visitUnary):
(sh::DetectGradientOperation::visitAggregate):
(sh::containsGradientOperation):
* src/compiler/DetectDiscontinuity.h: Added.
(sh):
(DetectLoopDiscontinuity):
(DetectGradientOperation):
* src/compiler/Diagnostics.cpp: Added.
(TDiagnostics::TDiagnostics):
(TDiagnostics::~TDiagnostics):
(TDiagnostics::writeInfo):
(TDiagnostics::writeDebug):
(TDiagnostics::print):
* src/compiler/Diagnostics.h: Added.
(TDiagnostics):
(TDiagnostics::infoSink):
* src/compiler/DirectiveHandler.cpp: Added.
(getBehavior):
(TDirectiveHandler::TDirectiveHandler):
(TDirectiveHandler::~TDirectiveHandler):
(TDirectiveHandler::handleError):
(TDirectiveHandler::handlePragma):
(TDirectiveHandler::handleExtension):
(TDirectiveHandler::handleVersion):
* src/compiler/DirectiveHandler.h: Added.
(TDirectiveHandler):
(TDirectiveHandler::pragma):
(TDirectiveHandler::extensionBehavior):
* src/compiler/ExtensionBehavior.h:
(getBehaviorString):
* src/compiler/Initialize.cpp:
(BuiltInConstants):
(TBuiltIns::initialize):
(IdentifyBuiltIns):
* src/compiler/InitializeParseContext.cpp: Added.
(InitializeParseContextIndex):
(FreeParseContextIndex):
(InitializeGlobalParseContext):
(FreeParseContext):
(GetGlobalParseContext):
* src/compiler/InitializeParseContext.h:
(TThreadParseContextRec):
* src/compiler/Intermediate.cpp:
(TIntermediate::addSelection):
* src/compiler/MapLongVariableNames.cpp:
* src/compiler/OutputHLSL.cpp:
(sh::str):
(sh::OutputHLSL::OutputHLSL):
(sh::OutputHLSL::~OutputHLSL):
(sh::OutputHLSL::output):
(sh::OutputHLSL::header):
(sh::OutputHLSL::visitBinary):
(sh::OutputHLSL::visitUnary):
(sh::OutputHLSL::visitAggregate):
(sh::OutputHLSL::visitSelection):
(sh::OutputHLSL::visitLoop):
(sh::OutputHLSL::traverseStatements):
(sh):
(sh::OutputHLSL::handleExcessiveLoop):
(sh::OutputHLSL::typeString):
(sh::OutputHLSL::addConstructor):
(sh::OutputHLSL::decorateField):
* src/compiler/OutputHLSL.h:
(sh):
(OutputHLSL):
* src/compiler/ParseHelper.cpp:
(TParseContext::parseVectorFields):
(TParseContext::parseMatrixFields):
(TParseContext::error):
(TParseContext::warning):
(TParseContext::trace):
(TParseContext::assignError):
(TParseContext::unaryOpError):
(TParseContext::binaryOpError):
(TParseContext::precisionErrorCheck):
(TParseContext::lValueErrorCheck):
(TParseContext::constErrorCheck):
(TParseContext::integerErrorCheck):
(TParseContext::globalErrorCheck):
(TParseContext::reservedErrorCheck):
(TParseContext::constructorErrorCheck):
(TParseContext::voidErrorCheck):
(TParseContext::boolErrorCheck):
(TParseContext::samplerErrorCheck):
(TParseContext::structQualifierErrorCheck):
(TParseContext::parameterSamplerErrorCheck):
(TParseContext::arraySizeErrorCheck):
(TParseContext::arrayQualifierErrorCheck):
(TParseContext::arrayTypeErrorCheck):
(TParseContext::arrayErrorCheck):
(TParseContext::arraySetMaxSize):
(TParseContext::nonInitConstErrorCheck):
(TParseContext::nonInitErrorCheck):
(TParseContext::paramErrorCheck):
(TParseContext::extensionErrorCheck):
(TParseContext::supportsExtension):
(TParseContext::handleExtensionDirective):
(TParseContext::handlePragmaDirective):
(TParseContext::findFunction):
(TParseContext::executeInitializer):
(TParseContext::constructBuiltIn):
(TParseContext::constructStruct):
(TParseContext::addConstVectorNode):
(TParseContext::addConstMatrixNode):
(TParseContext::addConstArrayNode):
(TParseContext::addConstStruct):
(TParseContext::enterStructDeclaration):
(TParseContext::structNestingErrorCheck):
(PaParseStrings):
* src/compiler/ParseHelper.h:
(TParseContext::TParseContext):
(TParseContext):
(TParseContext::infoSink):
(TParseContext::extensionBehavior):
(TParseContext::pragma):
* src/compiler/PoolAlloc.cpp:
(TAllocation::checkGuardBlock):
* src/compiler/Pragma.h: Added.
(TPragma):
(TPragma::TPragma):
* src/compiler/RenameFunction.h: Added.
(RenameFunction):
(RenameFunction::RenameFunction):
(RenameFunction::visitAggregate):
* src/compiler/ShHandle.h:
(TCompiler):
* src/compiler/ShaderLang.cpp:
(getVariableInfo):
* src/compiler/SymbolTable.cpp:
(TType::buildMangledName):
* src/compiler/TranslatorHLSL.cpp:
* src/compiler/UnfoldSelect.cpp: Removed.
* src/compiler/UnfoldSelect.h: Removed.
* src/compiler/UnfoldShortCircuit.cpp: Added.
(sh::UnfoldShortCircuit::UnfoldShortCircuit):
(sh):
(sh::UnfoldShortCircuit::traverse):
(sh::UnfoldShortCircuit::visitBinary):
(sh::UnfoldShortCircuit::visitSelection):
(sh::UnfoldShortCircuit::visitLoop):
(sh::UnfoldShortCircuit::getNextTemporaryIndex):
* src/compiler/UnfoldShortCircuit.h: Added.
(sh):
(UnfoldShortCircuit):
* src/compiler/ValidateLimitations.cpp:
* src/compiler/debug.cpp:
* src/compiler/depgraph: Added.
* src/compiler/depgraph/DependencyGraph.cpp: Added.
(TDependencyGraph::TDependencyGraph):
(TDependencyGraph::~TDependencyGraph):
(TDependencyGraph::createArgument):
(TDependencyGraph::createFunctionCall):
(TDependencyGraph::getOrCreateSymbol):
(TDependencyGraph::createSelection):
(TDependencyGraph::createLoop):
(TDependencyGraph::createLogicalOp):
(TGraphLogicalOp::getOpString):
* src/compiler/depgraph/DependencyGraph.h: Added.
(TGraphNode):
(TGraphNode::TGraphNode):
(TGraphNode::~TGraphNode):
(TGraphParentNode):
(TGraphParentNode::TGraphParentNode):
(TGraphParentNode::~TGraphParentNode):
(TGraphParentNode::addDependentNode):
(TGraphArgument):
(TGraphArgument::TGraphArgument):
(TGraphArgument::~TGraphArgument):
(TGraphArgument::getIntermFunctionCall):
(TGraphArgument::getArgumentNumber):
(TGraphFunctionCall):
(TGraphFunctionCall::TGraphFunctionCall):
(TGraphFunctionCall::~TGraphFunctionCall):
(TGraphFunctionCall::getIntermFunctionCall):
(TGraphSymbol):
(TGraphSymbol::TGraphSymbol):
(TGraphSymbol::~TGraphSymbol):
(TGraphSymbol::getIntermSymbol):
(TGraphSelection):
(TGraphSelection::TGraphSelection):
(TGraphSelection::~TGraphSelection):
(TGraphSelection::getIntermSelection):
(TGraphLoop):
(TGraphLoop::TGraphLoop):
(TGraphLoop::~TGraphLoop):
(TGraphLoop::getIntermLoop):
(TGraphLogicalOp):
(TGraphLogicalOp::TGraphLogicalOp):
(TGraphLogicalOp::~TGraphLogicalOp):
(TGraphLogicalOp::getIntermLogicalOp):
(TDependencyGraph):
(TDependencyGraph::begin):
(TDependencyGraph::end):
(TDependencyGraph::beginSamplerSymbols):
(TDependencyGraph::endSamplerSymbols):
(TDependencyGraph::beginUserDefinedFunctionCalls):
(TDependencyGraph::endUserDefinedFunctionCalls):
(TDependencyGraphTraverser):
(TDependencyGraphTraverser::TDependencyGraphTraverser):
(TDependencyGraphTraverser::visitSymbol):
(TDependencyGraphTraverser::visitArgument):
(TDependencyGraphTraverser::visitFunctionCall):
(TDependencyGraphTraverser::visitSelection):
(TDependencyGraphTraverser::visitLoop):
(TDependencyGraphTraverser::visitLogicalOp):
(TDependencyGraphTraverser::getDepth):
(TDependencyGraphTraverser::incrementDepth):
(TDependencyGraphTraverser::decrementDepth):
(TDependencyGraphTraverser::clearVisited):
(TDependencyGraphTraverser::markVisited):
(TDependencyGraphTraverser::isVisited):
* src/compiler/depgraph/DependencyGraphBuilder.cpp: Added.
(TDependencyGraphBuilder::build):
(TDependencyGraphBuilder::visitAggregate):
(TDependencyGraphBuilder::visitFunctionDefinition):
(TDependencyGraphBuilder::visitFunctionCall):
(TDependencyGraphBuilder::visitAggregateChildren):
(TDependencyGraphBuilder::visitSymbol):
(TDependencyGraphBuilder::visitBinary):
(TDependencyGraphBuilder::visitAssignment):
(TDependencyGraphBuilder::visitLogicalOp):
(TDependencyGraphBuilder::visitBinaryChildren):
(TDependencyGraphBuilder::visitSelection):
(TDependencyGraphBuilder::visitLoop):
(TDependencyGraphBuilder::connectMultipleNodesToSingleNode):
* src/compiler/depgraph/DependencyGraphBuilder.h: Added.
(TDependencyGraphBuilder):
(TNodeSetStack):
(TDependencyGraphBuilder::TNodeSetStack::TNodeSetStack):
(TDependencyGraphBuilder::TNodeSetStack::~TNodeSetStack):
(TDependencyGraphBuilder::TNodeSetStack::getTopSet):
(TDependencyGraphBuilder::TNodeSetStack::pushSet):
(TDependencyGraphBuilder::TNodeSetStack::popSet):
(TDependencyGraphBuilder::TNodeSetStack::popSetIntoNext):
(TDependencyGraphBuilder::TNodeSetStack::insertIntoTopSet):
(TDependencyGraphBuilder::TNodeSetStack::clear):
(TNodeSetMaintainer):
(TDependencyGraphBuilder::TNodeSetMaintainer::TNodeSetMaintainer):
(TDependencyGraphBuilder::TNodeSetMaintainer::~TNodeSetMaintainer):
(TNodeSetPropagatingMaintainer):
(TDependencyGraphBuilder::TNodeSetPropagatingMaintainer::TNodeSetPropagatingMaintainer):
(TDependencyGraphBuilder::TNodeSetPropagatingMaintainer::~TNodeSetPropagatingMaintainer):
(TLeftmostSymbolMaintainer):
(TDependencyGraphBuilder::TLeftmostSymbolMaintainer::TLeftmostSymbolMaintainer):
(TDependencyGraphBuilder::TLeftmostSymbolMaintainer::~TLeftmostSymbolMaintainer):
(TDependencyGraphBuilder::TDependencyGraphBuilder):
(TDependencyGraphBuilder::build):
* src/compiler/depgraph/DependencyGraphOutput.cpp: Added.
(TDependencyGraphOutput::outputIndentation):
(TDependencyGraphOutput::visitArgument):
(TDependencyGraphOutput::visitFunctionCall):
(TDependencyGraphOutput::visitSymbol):
(TDependencyGraphOutput::visitSelection):
(TDependencyGraphOutput::visitLoop):
(TDependencyGraphOutput::visitLogicalOp):
(TDependencyGraphOutput::outputAllSpanningTrees):
* src/compiler/depgraph/DependencyGraphOutput.h: Added.
(TDependencyGraphOutput):
(TDependencyGraphOutput::TDependencyGraphOutput):
* src/compiler/depgraph/DependencyGraphTraverse.cpp: Added.
(TGraphNode::traverse):
(TGraphParentNode::traverse):
(TGraphArgument::traverse):
(TGraphFunctionCall::traverse):
(TGraphSymbol::traverse):
(TGraphSelection::traverse):
(TGraphLoop::traverse):
(TGraphLogicalOp::traverse):
* src/compiler/glslang.h:
* src/compiler/glslang.l:
* src/compiler/glslang.y:
* src/compiler/glslang_lex.cpp:
(yy_buffer_state):
(yyguts_t):
(yy_get_previous_state):
(yy_try_NUL_trans):
(input):
(yyensure_buffer_stack):
(yy_scan_bytes):
(yyget_leng):
(string_input):
(yyerror):
(glslang_finalize):
(glslang_scan):
* src/compiler/glslang_tab.cpp:
* src/compiler/intermediate.h:
(TIntermAggregate::TIntermAggregate):
(TIntermAggregate::~TIntermAggregate):
(TIntermAggregate::isUserDefined):
(TIntermAggregate):
(TIntermTraverser::~TIntermTraverser):
* src/compiler/osinclude.h:
* src/compiler/preprocessor/atom.c:
(FindHashLoc):
(PrintAtomTable):
* src/compiler/preprocessor/cpp.c:
(CPPpragma):
(readCPPline):
(PredefineIntMacro):
(MacroExpand):
* src/compiler/preprocessor/cpp.h:
* src/compiler/preprocessor/memory.h:
* src/compiler/preprocessor/new: Added properties allow-tabs, allow-tabs, allow-tabs, allow-tabs, allow-tabs, allow-tabs, allow-tabs, allow-tabs, allow-tabs, allow-tabs, allow-tabs, allow-tabs, allow-tabs, allow-tabs, allow-tabs, allow-tabs, allow-tabs, allow-tabs, allow-tabs, allow-tabs, allow-tabs, allow-tabs, allow-tabs, allow-tabs, allow-tabs, allow-tabs, allow-tabs, allow-tabs and allow-tabs.
* src/compiler/preprocessor/new/Context.cpp: Removed.
* src/compiler/preprocessor/new/Context.h: Removed.
* src/compiler/preprocessor/new/Diagnostics.h: Added.
(pp):
(Diagnostics):
* src/compiler/preprocessor/new/DiagnosticsBase.cpp: Added.
(pp):
(pp::Diagnostics::~Diagnostics):
(pp::Diagnostics::report):
(pp::Diagnostics::severity):
* src/compiler/preprocessor/new/DirectiveHandler.h: Added.
(pp):
(DirectiveHandler):
* src/compiler/preprocessor/new/DirectiveHandlerBase.cpp: Added.
(pp):
(pp::DirectiveHandler::~DirectiveHandler):
* src/compiler/preprocessor/new/DirectiveParser.cpp: Added.
(getDirective):
(isConditionalDirective):
(isEOD):
(skipUntilEOD):
(isMacroNameReserved):
(isMacroPredefined):
(pp):
(DefinedParser):
(pp::DefinedParser::DefinedParser):
(pp::DefinedParser::lex):
(pp::DirectiveParser::DirectiveParser):
(pp::DirectiveParser::lex):
(pp::DirectiveParser::parseDirective):
(pp::DirectiveParser::parseDefine):
(pp::DirectiveParser::parseUndef):
(pp::DirectiveParser::parseIf):
(pp::DirectiveParser::parseIfdef):
(pp::DirectiveParser::parseIfndef):
(pp::DirectiveParser::parseElse):
(pp::DirectiveParser::parseElif):
(pp::DirectiveParser::parseEndif):
(pp::DirectiveParser::parseError):
(pp::DirectiveParser::parsePragma):
(pp::DirectiveParser::parseExtension):
(pp::DirectiveParser::parseVersion):
(pp::DirectiveParser::parseLine):
(pp::DirectiveParser::skipping):
(pp::DirectiveParser::parseConditionalIf):
(pp::DirectiveParser::parseExpressionIf):
(pp::DirectiveParser::parseExpressionIfdef):
* src/compiler/preprocessor/new/DirectiveParser.h: Added.
(pp):
(DirectiveParser):
(ConditionalBlock):
(pp::DirectiveParser::ConditionalBlock::ConditionalBlock):
* src/compiler/preprocessor/new/ExpressionParser.cpp: Added.
(yysyntax_error):
(yylex):
(yyerror):
(pp):
(pp::ExpressionParser::ExpressionParser):
(pp::ExpressionParser::parse):
* src/compiler/preprocessor/new/ExpressionParser.h: Added.
(pp):
(ExpressionParser):
* src/compiler/preprocessor/new/ExpressionParser.y: Added.
* src/compiler/preprocessor/new/Input.cpp: Added property allow-tabs.
(pp::Input::Input):
(pp::Input::read):
* src/compiler/preprocessor/new/Input.h: Added property allow-tabs.
(pp):
(Input):
(pp::Input::count):
(pp::Input::string):
(pp::Input::length):
(Location):
(pp::Input::Location::Location):
(pp::Input::readLoc):
* src/compiler/preprocessor/new/Lexer.cpp: Added.
(pp):
(pp::Lexer::~Lexer):
* src/compiler/preprocessor/new/Lexer.h: Added.
(pp):
(Lexer):
* src/compiler/preprocessor/new/Macro.cpp: Added property allow-tabs.
(pp::Macro::equals):
* src/compiler/preprocessor/new/Macro.h: Added property allow-tabs.
(pp):
(pp::Macro::Macro):
(Macro):
* src/compiler/preprocessor/new/MacroExpander.cpp: Added.
(pp):
(TokenLexer):
(pp::TokenLexer::TokenLexer):
(pp::TokenLexer::lex):
(pp::MacroExpander::MacroExpander):
(pp::MacroExpander::~MacroExpander):
(pp::MacroExpander::lex):
(pp::MacroExpander::getToken):
(pp::MacroExpander::ungetToken):
(pp::MacroExpander::isNextTokenLeftParen):
(pp::MacroExpander::pushMacro):
(pp::MacroExpander::popMacro):
(pp::MacroExpander::expandMacro):
(pp::MacroExpander::collectMacroArgs):
(pp::MacroExpander::replaceMacroParams):
* src/compiler/preprocessor/new/MacroExpander.h: Added.
(pp):
(MacroExpander):
(MacroContext):
(pp::MacroExpander::MacroContext::MacroContext):
(pp::MacroExpander::MacroContext::empty):
(pp::MacroExpander::MacroContext::get):
(pp::MacroExpander::MacroContext::unget):
* src/compiler/preprocessor/new/Preprocessor.cpp: Added property allow-tabs.
(PreprocessorImpl):
(pp::PreprocessorImpl::PreprocessorImpl):
(pp):
(pp::Preprocessor::Preprocessor):
(pp::Preprocessor::~Preprocessor):
(pp::Preprocessor::init):
(pp::Preprocessor::predefineMacro):
(pp::Preprocessor::lex):
* src/compiler/preprocessor/new/Preprocessor.h: Added property allow-tabs.
(pp):
(Preprocessor):
* src/compiler/preprocessor/new/SourceLocation.h: Added.
(pp):
(pp::SourceLocation::SourceLocation):
(SourceLocation):
(pp::SourceLocation::equals):
(pp::operator==):
(pp::operator!=):
* src/compiler/preprocessor/new/Token.cpp: Added property allow-tabs.
(pp::Token::reset):
(pp::Token::equals):
(pp::Token::setAtStartOfLine):
(pp::Token::setHasLeadingSpace):
(pp):
(pp::Token::setExpansionDisabled):
(pp::operator<<):
* src/compiler/preprocessor/new/Token.h: Added property allow-tabs.
(pp::Token::Token):
(Token):
(pp::Token::atStartOfLine):
(pp::Token::hasLeadingSpace):
(pp::Token::expansionDisabled):
(pp::operator==):
(pp):
(pp::operator!=):
* src/compiler/preprocessor/new/Tokenizer.cpp: Added.
(yy_buffer_state):
(yy_trans_info):
(yyguts_t):
(yy_get_previous_state):
(yy_try_NUL_trans):
(input):
(pprestart):
(pp_switch_to_buffer):
(pp_load_buffer_state):
(pp_create_buffer):
(pp_delete_buffer):
(pp_init_buffer):
(pp_flush_buffer):
(pppush_buffer_state):
(pppop_buffer_state):
(ppensure_buffer_stack):
(pp_scan_buffer):
(pp_scan_string):
(pp_scan_bytes):
(yy_fatal_error):
(ppget_extra):
(ppget_lineno):
(ppget_column):
(ppget_in):
(ppget_out):
(ppget_leng):
(ppget_text):
(ppset_extra):
(ppset_lineno):
(ppset_column):
(ppset_in):
(ppset_out):
(ppget_debug):
(ppset_debug):
(ppget_lval):
(ppset_lval):
(ppget_lloc):
(ppset_lloc):
(pplex_init):
(pplex_init_extra):
(yy_init_globals):
(pplex_destroy):
(yy_flex_strncpy):
(yy_flex_strlen):
(ppalloc):
(pprealloc):
(ppfree):
(pp):
(pp::Tokenizer::Tokenizer):
(pp::Tokenizer::~Tokenizer):
(pp::Tokenizer::init):
(pp::Tokenizer::setFileNumber):
(pp::Tokenizer::setLineNumber):
(pp::Tokenizer::lex):
(pp::Tokenizer::initScanner):
(pp::Tokenizer::destroyScanner):
* src/compiler/preprocessor/new/Tokenizer.h: Added.
(pp):
(Tokenizer):
(Context):
* src/compiler/preprocessor/new/Tokenizer.l: Added.
* src/compiler/preprocessor/new/generate_parser.sh: Added property allow-tabs.
* src/compiler/preprocessor/new/pp.l: Removed.
* src/compiler/preprocessor/new/pp.y: Removed.
* src/compiler/preprocessor/new/pp_lex.cpp: Removed.
* src/compiler/preprocessor/new/pp_tab.cpp: Removed.
* src/compiler/preprocessor/new/pp_tab.h: Removed.
* src/compiler/preprocessor/new/pp_utils.h: Added.
* src/compiler/preprocessor/new/preprocessor.vcproj: Added.
* src/compiler/preprocessor/new/stl_utils.h: Removed.
* src/compiler/preprocessor/new/token_type.h: Removed.
* src/compiler/preprocessor/preprocess.h:
* src/compiler/preprocessor/scanner.c:
(InitScannerInput):
* src/compiler/preprocessor/scanner.h:
* src/compiler/preprocessor/symbols.h:
* src/compiler/preprocessor/tokens.c:
(ReadToken):
(DumpTokenStream):
* src/compiler/preprocessor/tokens.h:
* src/compiler/timing: Added.
* src/compiler/timing/RestrictFragmentShaderTiming.cpp: Added.
(RestrictFragmentShaderTiming::RestrictFragmentShaderTiming):
(RestrictFragmentShaderTiming::enforceRestrictions):
(RestrictFragmentShaderTiming::validateUserDefinedFunctionCallUsage):
(RestrictFragmentShaderTiming::beginError):
(RestrictFragmentShaderTiming::isSamplingOp):
(RestrictFragmentShaderTiming::visitArgument):
(RestrictFragmentShaderTiming::visitSelection):
(RestrictFragmentShaderTiming::visitLoop):
(RestrictFragmentShaderTiming::visitLogicalOp):
* src/compiler/timing/RestrictFragmentShaderTiming.h: Added.
(RestrictFragmentShaderTiming):
(RestrictFragmentShaderTiming::numErrors):
* src/compiler/timing/RestrictVertexShaderTiming.cpp: Added.
(RestrictVertexShaderTiming::visitSymbol):
* src/compiler/timing/RestrictVertexShaderTiming.h: Added.
(RestrictVertexShaderTiming):
(RestrictVertexShaderTiming::RestrictVertexShaderTiming):
(RestrictVertexShaderTiming::enforceRestrictions):
(RestrictVertexShaderTiming::numErrors):
* src/libEGL/Display.cpp:
(egl):
(egl::Display::getDepthTextureSupport):
(egl::Display::getTexturePool):
* src/libEGL/Display.h:
(Display):
* src/libEGL/Surface.cpp:
(egl::Surface::Surface):
(egl::Surface::release):
(egl::Surface::resetSwapChain):
(egl::Surface::swapRect):
(egl):
(egl::Surface::swap):
(egl::Surface::postSubBuffer):
* src/libEGL/Surface.h:
(Surface):
* src/libEGL/libEGL.cpp:
* src/libGLESv2/Context.cpp:
(gl::Context::makeCurrent):
(gl::Context::markDxUniformsDirty):
(gl):
(gl::Context::getIntegerv):
(gl::Context::getQueryParameterInfo):
(gl::Context::applyRenderTarget):
(gl::Context::applyState):
(gl::Context::applyShaders):
(gl::Context::applyTextures):
(gl::Context::readPixels):
(gl::Context::clear):
(gl::Context::drawArrays):
(gl::Context::drawElements):
(gl::Context::supportsDepthTextures):
(gl::Context::initExtensionString):
(gl::Context::blitFramebuffer):
(gl::VertexDeclarationCache::applyDeclaration):
* src/libGLESv2/Context.h:
(Context):
* src/libGLESv2/Framebuffer.cpp:
(gl::Framebuffer::~Framebuffer):
(gl):
(gl::Framebuffer::getNullColorbuffer):
(gl::Framebuffer::completeness):
* src/libGLESv2/Framebuffer.h:
(Framebuffer):
* src/libGLESv2/Program.cpp:
(gl):
(gl::AttributeBindings::AttributeBindings):
(gl::AttributeBindings::~AttributeBindings):
(gl::InfoLog::InfoLog):
(gl::InfoLog::~InfoLog):
(gl::InfoLog::getLength):
(gl::InfoLog::getLog):
(gl::InfoLog::appendSanitized):
(gl::InfoLog::append):
(gl::InfoLog::reset):
(gl::Program::Program):
(gl::Program::~Program):
(gl::Program::attachShader):
(gl::Program::detachShader):
(gl::Program::getAttachedShadersCount):
(gl::AttributeBindings::bindAttributeLocation):
(gl::Program::bindAttributeLocation):
(gl::Program::link):
(gl::AttributeBindings::getAttributeBinding):
(gl::Program::unlink):
(gl::Program::getProgramBinary):
(gl::Program::setProgramBinary):
(gl::Program::getInfoLogLength):
(gl::Program::getInfoLog):
(gl::Program::getActiveAttribute):
(gl::Program::getActiveAttributeCount):
(gl::Program::getActiveAttributeMaxLength):
(gl::Program::getActiveUniform):
(gl::Program::getActiveUniformCount):
(gl::Program::getActiveUniformMaxLength):
(gl::Program::validate):
(gl::Program::isValidated):
* src/libGLESv2/Program.h:
(gl):
(AttributeBindings):
(InfoLog):
(Program):
* src/libGLESv2/ProgramBinary.cpp: Added.
(gl::str):
(gl):
(gl::Uniform::Uniform):
(gl::Uniform::~Uniform):
(gl::Uniform::isArray):
(gl::UniformLocation::UniformLocation):
(gl::ProgramBinary::ProgramBinary):
(gl::ProgramBinary::~ProgramBinary):
(gl::ProgramBinary::getPixelShader):
(gl::ProgramBinary::getVertexShader):
(gl::ProgramBinary::getAttributeLocation):
(gl::ProgramBinary::getSemanticIndex):
(gl::ProgramBinary::getUsedSamplerRange):
(gl::ProgramBinary::getSamplerMapping):
(gl::ProgramBinary::getSamplerTextureType):
(gl::ProgramBinary::getUniformLocation):
(gl::ProgramBinary::setUniform1fv):
(gl::ProgramBinary::setUniform2fv):
(gl::ProgramBinary::setUniform3fv):
(gl::ProgramBinary::setUniform4fv):
(gl::transposeMatrix):
(gl::ProgramBinary::setUniformMatrix2fv):
(gl::ProgramBinary::setUniformMatrix3fv):
(gl::ProgramBinary::setUniformMatrix4fv):
(gl::ProgramBinary::setUniform1iv):
(gl::ProgramBinary::setUniform2iv):
(gl::ProgramBinary::setUniform3iv):
(gl::ProgramBinary::setUniform4iv):
(gl::ProgramBinary::getUniformfv):
(gl::ProgramBinary::getUniformiv):
(gl::ProgramBinary::dirtyAllUniforms):
(gl::ProgramBinary::applyUniforms):
(gl::ProgramBinary::compileToBinary):
(gl::ProgramBinary::packVaryings):
(gl::ProgramBinary::linkVaryings):
(gl::ProgramBinary::link):
(gl::ProgramBinary::linkAttributes):
(gl::ProgramBinary::linkUniforms):
(gl::ProgramBinary::defineUniform):
(gl::ProgramBinary::createUniform):
(gl::ProgramBinary::decorateAttribute):
(gl::ProgramBinary::undecorateUniform):
(gl::ProgramBinary::applyUniformnbv):
(gl::ProgramBinary::applyUniformnfv):
(gl::ProgramBinary::applyUniform1iv):
(gl::ProgramBinary::applyUniform2iv):
(gl::ProgramBinary::applyUniform3iv):
(gl::ProgramBinary::applyUniform4iv):
(gl::ProgramBinary::applyUniformniv):
(gl::ProgramBinary::isValidated):
(gl::ProgramBinary::getActiveAttribute):
(gl::ProgramBinary::getActiveAttributeCount):
(gl::ProgramBinary::getActiveAttributeMaxLength):
(gl::ProgramBinary::getActiveUniform):
(gl::ProgramBinary::getActiveUniformCount):
(gl::ProgramBinary::getActiveUniformMaxLength):
(gl::ProgramBinary::validate):
(gl::ProgramBinary::validateSamplers):
(gl::ProgramBinary::getDxDepthRangeLocation):
(gl::ProgramBinary::getDxDepthLocation):
(gl::ProgramBinary::getDxCoordLocation):
(gl::ProgramBinary::getDxHalfPixelSizeLocation):
(gl::ProgramBinary::getDxFrontCCWLocation):
(gl::ProgramBinary::getDxPointsOrLinesLocation):
* src/libGLESv2/ProgramBinary.h: Added.
(gl):
(Uniform):
(gl::Uniform::RegisterInfo::RegisterInfo):
(RegisterInfo):
(gl::Uniform::RegisterInfo::set):
(UniformLocation):
(ProgramBinary):
(Sampler):
* src/libGLESv2/Renderbuffer.cpp:
(gl):
(gl::RenderbufferTexture2D::RenderbufferTexture2D):
(gl::RenderbufferTexture2D::~RenderbufferTexture2D):
(gl::RenderbufferTexture2D::addProxyRef):
(gl::RenderbufferTexture2D::releaseProxy):
(gl::RenderbufferTexture2D::getRenderTarget):
(gl::RenderbufferTexture2D::getDepthStencil):
(gl::RenderbufferTexture2D::getWidth):
(gl::RenderbufferTexture2D::getHeight):
(gl::RenderbufferTexture2D::getInternalFormat):
(gl::RenderbufferTexture2D::getD3DFormat):
(gl::RenderbufferTexture2D::getSamples):
(gl::RenderbufferTexture2D::getSerial):
(gl::RenderbufferTextureCubeMap::RenderbufferTextureCubeMap):
(gl::RenderbufferTextureCubeMap::~RenderbufferTextureCubeMap):
(gl::RenderbufferTextureCubeMap::addProxyRef):
(gl::RenderbufferTextureCubeMap::releaseProxy):
(gl::RenderbufferTextureCubeMap::getRenderTarget):
(gl::RenderbufferTextureCubeMap::getDepthStencil):
(gl::RenderbufferTextureCubeMap::getWidth):
(gl::RenderbufferTextureCubeMap::getHeight):
(gl::RenderbufferTextureCubeMap::getInternalFormat):
(gl::RenderbufferTextureCubeMap::getD3DFormat):
(gl::RenderbufferTextureCubeMap::getSamples):
(gl::RenderbufferTextureCubeMap::getSerial):
(gl::DepthStencilbuffer::getDepthStencil):
* src/libGLESv2/Renderbuffer.h:
(gl):
(RenderbufferTexture2D):
(RenderbufferTextureCubeMap):
* src/libGLESv2/Shader.cpp:
(gl::Shader::getInfoLog):
(gl::Shader::getSourceImpl):
* src/libGLESv2/Shader.h:
(Shader):
(VertexShader):
* src/libGLESv2/Texture.cpp:
(gl::ConvertTextureFormatType):
(gl::IsTextureFormatRenderable):
(gl::GetTextureUsage):
(gl):
(gl::Image::createSurface):
(gl::Image::updateSurface):
(gl::Image::loadData):
(gl::Image::loadAlphaData):
(gl::Image::loadAlphaDataSSE2):
(gl::Image::loadAlphaFloatData):
(gl::Image::loadAlphaHalfFloatData):
(gl::Image::loadLuminanceData):
(gl::Image::loadLuminanceFloatData):
(gl::Image::loadLuminanceHalfFloatData):
(gl::Image::loadLuminanceAlphaData):
(gl::Image::loadLuminanceAlphaFloatData):
(gl::Image::loadLuminanceAlphaHalfFloatData):
(gl::Image::loadRGBUByteData):
(gl::Image::loadRGB565Data):
(gl::Image::loadRGBFloatData):
(gl::Image::loadRGBHalfFloatData):
(gl::Image::loadRGBAUByteDataSSE2):
(gl::Image::loadRGBAUByteData):
(gl::Image::loadRGBA4444Data):
(gl::Image::loadRGBA5551Data):
(gl::Image::loadRGBAFloatData):
(gl::Image::loadRGBAHalfFloatData):
(gl::Image::loadBGRAData):
(gl::Image::loadCompressedData):
(gl::Image::copy):
(gl::TextureStorage::TextureStorage):
(gl::TextureStorage::isRenderTarget):
(gl::TextureStorage::getUsage):
(gl::Texture::setImage):
(gl::Texture::setCompressedImage):
(gl::Texture::subImage):
(gl::Texture::subImageCompressed):
(gl::TextureStorage2D::TextureStorage2D):
(gl::Texture2D::getInternalFormat):
(gl::Texture2D::getD3DFormat):
(gl::Texture2D::copyImage):
(gl::Texture2D::copySubImage):
(gl::Texture2D::storage):
(gl::Texture2D::isSamplerComplete):
(gl::Texture2D::isCompressed):
(gl::Texture2D::isDepth):
(gl::Texture2D::createTexture):
(gl::Texture2D::convertToRenderTarget):
(gl::Texture2D::getRenderbuffer):
(gl::Texture2D::getRenderTarget):
(gl::Texture2D::getDepthStencil):
(gl::TextureStorageCubeMap::TextureStorageCubeMap):
(gl::TextureCubeMap::getWidth):
(gl::TextureCubeMap::getHeight):
(gl::TextureCubeMap::getInternalFormat):
(gl::TextureCubeMap::getD3DFormat):
(gl::TextureCubeMap::isSamplerComplete):
(gl::TextureCubeMap::isCompressed):
(gl::TextureCubeMap::createTexture):
(gl::TextureCubeMap::convertToRenderTarget):
(gl::TextureCubeMap::copyImage):
(gl::TextureCubeMap::copySubImage):
(gl::TextureCubeMap::storage):
(gl::TextureCubeMap::getRenderbuffer):
* src/libGLESv2/Texture.h:
(Image):
(TextureStorage):
(Texture):
(TextureStorage2D):
(Texture2D):
(TextureStorageCubeMap):
(TextureCubeMap):
* src/libGLESv2/VertexDataManager.cpp:
(gl::VertexDataManager::prepareVertexData):
* src/libGLESv2/libGLESv2.cpp:
(checkTextureFormatType):
(validateSubImageParams2D):
(validateSubImageParamsCube):
* src/libGLESv2/libGLESv2.vcproj:
* src/libGLESv2/mathutil.h:
(gl):
* src/libGLESv2/utilities.cpp:
(gl::IsDepthTexture):
(gl):
(gl::ComputePixelSize):
(gl::ExtractFormat):
(gl::ExtractType):
(es2dx::ConvertCubeFace):
(es2dx::ConvertRenderbufferFormat):
(dx2es::GetStencilSize):
(dx2es::GetDepthSize):
(dx2es::IsDepthTextureFormat):
(dx2es):
(dx2es::IsStencilTextureFormat):
(dx2es::ConvertDepthStencilFormat):
* src/libGLESv2/utilities.h:
(gl):
(dx2es):

Source/WebCore:

No new tests. No change in behavior.

* CMakeLists.txt:
* GNUmakefile.list.am:
* Target.pri:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@122870 268f45cc-cd09-0410-ab3c-d52691b4dbfc

134 files changed:
Source/ThirdParty/ANGLE/ANGLE.xcodeproj/project.pbxproj
Source/ThirdParty/ANGLE/ChangeLog
Source/ThirdParty/ANGLE/include/GLES2/gl2ext.h
Source/ThirdParty/ANGLE/include/GLSLANG/ShaderLang.h
Source/ThirdParty/ANGLE/src/build_angle.xcodeproj/project.pbxproj
Source/ThirdParty/ANGLE/src/common/angleutils.h
Source/ThirdParty/ANGLE/src/common/debug.cpp
Source/ThirdParty/ANGLE/src/common/version.h
Source/ThirdParty/ANGLE/src/compiler/BuiltInFunctionEmulator.cpp
Source/ThirdParty/ANGLE/src/compiler/BuiltInFunctionEmulator.h
Source/ThirdParty/ANGLE/src/compiler/Compiler.cpp
Source/ThirdParty/ANGLE/src/compiler/DetectDiscontinuity.cpp [new file with mode: 0644]
Source/ThirdParty/ANGLE/src/compiler/DetectDiscontinuity.h [new file with mode: 0644]
Source/ThirdParty/ANGLE/src/compiler/Diagnostics.cpp [new file with mode: 0644]
Source/ThirdParty/ANGLE/src/compiler/Diagnostics.h [new file with mode: 0644]
Source/ThirdParty/ANGLE/src/compiler/DirectiveHandler.cpp [new file with mode: 0644]
Source/ThirdParty/ANGLE/src/compiler/DirectiveHandler.h [new file with mode: 0644]
Source/ThirdParty/ANGLE/src/compiler/ExtensionBehavior.h
Source/ThirdParty/ANGLE/src/compiler/Initialize.cpp
Source/ThirdParty/ANGLE/src/compiler/InitializeParseContext.cpp [new file with mode: 0644]
Source/ThirdParty/ANGLE/src/compiler/InitializeParseContext.h
Source/ThirdParty/ANGLE/src/compiler/Intermediate.cpp
Source/ThirdParty/ANGLE/src/compiler/MapLongVariableNames.cpp
Source/ThirdParty/ANGLE/src/compiler/OutputHLSL.cpp
Source/ThirdParty/ANGLE/src/compiler/OutputHLSL.h
Source/ThirdParty/ANGLE/src/compiler/ParseHelper.cpp
Source/ThirdParty/ANGLE/src/compiler/ParseHelper.h
Source/ThirdParty/ANGLE/src/compiler/PoolAlloc.cpp
Source/ThirdParty/ANGLE/src/compiler/Pragma.h [new file with mode: 0644]
Source/ThirdParty/ANGLE/src/compiler/RenameFunction.h [new file with mode: 0644]
Source/ThirdParty/ANGLE/src/compiler/ShHandle.h
Source/ThirdParty/ANGLE/src/compiler/ShaderLang.cpp
Source/ThirdParty/ANGLE/src/compiler/SymbolTable.cpp
Source/ThirdParty/ANGLE/src/compiler/TranslatorHLSL.cpp
Source/ThirdParty/ANGLE/src/compiler/UnfoldSelect.cpp [deleted file]
Source/ThirdParty/ANGLE/src/compiler/UnfoldShortCircuit.cpp [new file with mode: 0644]
Source/ThirdParty/ANGLE/src/compiler/UnfoldShortCircuit.h [moved from Source/ThirdParty/ANGLE/src/compiler/UnfoldSelect.h with 53% similarity]
Source/ThirdParty/ANGLE/src/compiler/ValidateLimitations.cpp
Source/ThirdParty/ANGLE/src/compiler/debug.cpp
Source/ThirdParty/ANGLE/src/compiler/depgraph/DependencyGraph.cpp [new file with mode: 0644]
Source/ThirdParty/ANGLE/src/compiler/depgraph/DependencyGraph.h [new file with mode: 0644]
Source/ThirdParty/ANGLE/src/compiler/depgraph/DependencyGraphBuilder.cpp [new file with mode: 0644]
Source/ThirdParty/ANGLE/src/compiler/depgraph/DependencyGraphBuilder.h [new file with mode: 0644]
Source/ThirdParty/ANGLE/src/compiler/depgraph/DependencyGraphOutput.cpp [new file with mode: 0644]
Source/ThirdParty/ANGLE/src/compiler/depgraph/DependencyGraphOutput.h [new file with mode: 0644]
Source/ThirdParty/ANGLE/src/compiler/depgraph/DependencyGraphTraverse.cpp [new file with mode: 0644]
Source/ThirdParty/ANGLE/src/compiler/glslang.h
Source/ThirdParty/ANGLE/src/compiler/glslang.l
Source/ThirdParty/ANGLE/src/compiler/glslang.y
Source/ThirdParty/ANGLE/src/compiler/glslang_lex.cpp
Source/ThirdParty/ANGLE/src/compiler/glslang_tab.cpp
Source/ThirdParty/ANGLE/src/compiler/intermediate.h
Source/ThirdParty/ANGLE/src/compiler/osinclude.h
Source/ThirdParty/ANGLE/src/compiler/preprocessor/atom.c
Source/ThirdParty/ANGLE/src/compiler/preprocessor/cpp.c
Source/ThirdParty/ANGLE/src/compiler/preprocessor/cpp.h
Source/ThirdParty/ANGLE/src/compiler/preprocessor/memory.h
Source/ThirdParty/ANGLE/src/compiler/preprocessor/new/Context.cpp [deleted file]
Source/ThirdParty/ANGLE/src/compiler/preprocessor/new/Context.h [deleted file]
Source/ThirdParty/ANGLE/src/compiler/preprocessor/new/Diagnostics.h [new file with mode: 0644]
Source/ThirdParty/ANGLE/src/compiler/preprocessor/new/DiagnosticsBase.cpp [new file with mode: 0644]
Source/ThirdParty/ANGLE/src/compiler/preprocessor/new/DirectiveHandler.h [new file with mode: 0644]
Source/ThirdParty/ANGLE/src/compiler/preprocessor/new/DirectiveHandlerBase.cpp [new file with mode: 0644]
Source/ThirdParty/ANGLE/src/compiler/preprocessor/new/DirectiveParser.cpp [new file with mode: 0644]
Source/ThirdParty/ANGLE/src/compiler/preprocessor/new/DirectiveParser.h [new file with mode: 0644]
Source/ThirdParty/ANGLE/src/compiler/preprocessor/new/ExpressionParser.cpp [moved from Source/ThirdParty/ANGLE/src/compiler/preprocessor/new/pp_tab.cpp with 56% similarity]
Source/ThirdParty/ANGLE/src/compiler/preprocessor/new/ExpressionParser.h [new file with mode: 0644]
Source/ThirdParty/ANGLE/src/compiler/preprocessor/new/ExpressionParser.y [new file with mode: 0644]
Source/ThirdParty/ANGLE/src/compiler/preprocessor/new/Input.cpp
Source/ThirdParty/ANGLE/src/compiler/preprocessor/new/Input.h
Source/ThirdParty/ANGLE/src/compiler/preprocessor/new/Lexer.cpp [new file with mode: 0644]
Source/ThirdParty/ANGLE/src/compiler/preprocessor/new/Lexer.h [new file with mode: 0644]
Source/ThirdParty/ANGLE/src/compiler/preprocessor/new/Macro.cpp
Source/ThirdParty/ANGLE/src/compiler/preprocessor/new/Macro.h
Source/ThirdParty/ANGLE/src/compiler/preprocessor/new/MacroExpander.cpp [new file with mode: 0644]
Source/ThirdParty/ANGLE/src/compiler/preprocessor/new/MacroExpander.h [new file with mode: 0644]
Source/ThirdParty/ANGLE/src/compiler/preprocessor/new/Preprocessor.cpp
Source/ThirdParty/ANGLE/src/compiler/preprocessor/new/Preprocessor.h
Source/ThirdParty/ANGLE/src/compiler/preprocessor/new/SourceLocation.h [new file with mode: 0644]
Source/ThirdParty/ANGLE/src/compiler/preprocessor/new/Token.cpp
Source/ThirdParty/ANGLE/src/compiler/preprocessor/new/Token.h
Source/ThirdParty/ANGLE/src/compiler/preprocessor/new/Tokenizer.cpp [new file with mode: 0644]
Source/ThirdParty/ANGLE/src/compiler/preprocessor/new/Tokenizer.h [new file with mode: 0644]
Source/ThirdParty/ANGLE/src/compiler/preprocessor/new/Tokenizer.l [new file with mode: 0644]
Source/ThirdParty/ANGLE/src/compiler/preprocessor/new/generate_parser.sh
Source/ThirdParty/ANGLE/src/compiler/preprocessor/new/new_file.cpp [new file with mode: 0644]
Source/ThirdParty/ANGLE/src/compiler/preprocessor/new/new_file2.cpp [new file with mode: 0644]
Source/ThirdParty/ANGLE/src/compiler/preprocessor/new/pp.l [deleted file]
Source/ThirdParty/ANGLE/src/compiler/preprocessor/new/pp.y [deleted file]
Source/ThirdParty/ANGLE/src/compiler/preprocessor/new/pp_lex.cpp [deleted file]
Source/ThirdParty/ANGLE/src/compiler/preprocessor/new/pp_tab.h [deleted file]
Source/ThirdParty/ANGLE/src/compiler/preprocessor/new/pp_utils.h [new file with mode: 0644]
Source/ThirdParty/ANGLE/src/compiler/preprocessor/new/preprocessor.vcproj [new file with mode: 0644]
Source/ThirdParty/ANGLE/src/compiler/preprocessor/new/stl_utils.h [deleted file]
Source/ThirdParty/ANGLE/src/compiler/preprocessor/new/token_type.h [deleted file]
Source/ThirdParty/ANGLE/src/compiler/preprocessor/preprocess.h
Source/ThirdParty/ANGLE/src/compiler/preprocessor/scanner.c
Source/ThirdParty/ANGLE/src/compiler/preprocessor/scanner.h
Source/ThirdParty/ANGLE/src/compiler/preprocessor/symbols.h
Source/ThirdParty/ANGLE/src/compiler/preprocessor/tokens.c
Source/ThirdParty/ANGLE/src/compiler/preprocessor/tokens.h
Source/ThirdParty/ANGLE/src/compiler/timing/RestrictFragmentShaderTiming.cpp [new file with mode: 0644]
Source/ThirdParty/ANGLE/src/compiler/timing/RestrictFragmentShaderTiming.h [new file with mode: 0644]
Source/ThirdParty/ANGLE/src/compiler/timing/RestrictVertexShaderTiming.cpp [new file with mode: 0644]
Source/ThirdParty/ANGLE/src/compiler/timing/RestrictVertexShaderTiming.h [new file with mode: 0644]
Source/ThirdParty/ANGLE/src/libEGL/Display.cpp
Source/ThirdParty/ANGLE/src/libEGL/Display.h
Source/ThirdParty/ANGLE/src/libEGL/Surface.cpp
Source/ThirdParty/ANGLE/src/libEGL/Surface.h
Source/ThirdParty/ANGLE/src/libEGL/libEGL.cpp
Source/ThirdParty/ANGLE/src/libGLESv2/Context.cpp
Source/ThirdParty/ANGLE/src/libGLESv2/Context.h
Source/ThirdParty/ANGLE/src/libGLESv2/Framebuffer.cpp
Source/ThirdParty/ANGLE/src/libGLESv2/Framebuffer.h
Source/ThirdParty/ANGLE/src/libGLESv2/Program.cpp
Source/ThirdParty/ANGLE/src/libGLESv2/Program.h
Source/ThirdParty/ANGLE/src/libGLESv2/ProgramBinary.cpp [new file with mode: 0644]
Source/ThirdParty/ANGLE/src/libGLESv2/ProgramBinary.h [new file with mode: 0644]
Source/ThirdParty/ANGLE/src/libGLESv2/Renderbuffer.cpp
Source/ThirdParty/ANGLE/src/libGLESv2/Renderbuffer.h
Source/ThirdParty/ANGLE/src/libGLESv2/Shader.cpp
Source/ThirdParty/ANGLE/src/libGLESv2/Shader.h
Source/ThirdParty/ANGLE/src/libGLESv2/Texture.cpp
Source/ThirdParty/ANGLE/src/libGLESv2/Texture.h
Source/ThirdParty/ANGLE/src/libGLESv2/VertexDataManager.cpp
Source/ThirdParty/ANGLE/src/libGLESv2/libGLESv2.cpp
Source/ThirdParty/ANGLE/src/libGLESv2/libGLESv2.vcproj
Source/ThirdParty/ANGLE/src/libGLESv2/mathutil.h
Source/ThirdParty/ANGLE/src/libGLESv2/utilities.cpp
Source/ThirdParty/ANGLE/src/libGLESv2/utilities.h
Source/WebCore/CMakeLists.txt
Source/WebCore/ChangeLog
Source/WebCore/GNUmakefile.list.am
Source/WebCore/Target.pri

index a33c5ce..ea3d7c2 100644 (file)
                A0AABE4513AFE94500F2EBD1 /* OutputESSL.h in Headers */ = {isa = PBXBuildFile; fileRef = A0AABE4313AFE94500F2EBD1 /* OutputESSL.h */; };
                A0AABE4813AFE96100F2EBD1 /* TranslatorESSL.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A0AABE4613AFE96100F2EBD1 /* TranslatorESSL.cpp */; };
                A0AABE4913AFE96100F2EBD1 /* TranslatorESSL.h in Headers */ = {isa = PBXBuildFile; fileRef = A0AABE4713AFE96100F2EBD1 /* TranslatorESSL.h */; };
+               A26567BB159C21B100398539 /* Diagnostics.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A26567B0159C21B100398539 /* Diagnostics.cpp */; };
+               A26567BC159C21B100398539 /* Diagnostics.h in Headers */ = {isa = PBXBuildFile; fileRef = A26567B1159C21B100398539 /* Diagnostics.h */; };
+               A26567BD159C21B100398539 /* DirectiveHandler.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A26567B2159C21B100398539 /* DirectiveHandler.cpp */; };
+               A26567BE159C21B100398539 /* DirectiveHandler.h in Headers */ = {isa = PBXBuildFile; fileRef = A26567B3159C21B100398539 /* DirectiveHandler.h */; };
+               A26567BF159C21B100398539 /* InitializeParseContext.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A26567B4159C21B100398539 /* InitializeParseContext.cpp */; };
+               A26567C0159C21B100398539 /* Pragma.h in Headers */ = {isa = PBXBuildFile; fileRef = A26567B5159C21B100398539 /* Pragma.h */; };
+               A26567C1159C21B100398539 /* RenameFunction.h in Headers */ = {isa = PBXBuildFile; fileRef = A26567B6159C21B100398539 /* RenameFunction.h */; };
+               A26567EC159C21CE00398539 /* DiagnosticsBase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A26567C8159C21CE00398539 /* DiagnosticsBase.cpp */; };
+               A26567ED159C21CE00398539 /* Diagnostics.h in Headers */ = {isa = PBXBuildFile; fileRef = A26567C9159C21CE00398539 /* Diagnostics.h */; };
+               A26567EE159C21CE00398539 /* DirectiveHandlerBase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A26567CA159C21CE00398539 /* DirectiveHandlerBase.cpp */; };
+               A26567EF159C21CE00398539 /* DirectiveHandler.h in Headers */ = {isa = PBXBuildFile; fileRef = A26567CB159C21CE00398539 /* DirectiveHandler.h */; };
+               A26567F0159C21CE00398539 /* DirectiveParser.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A26567CC159C21CE00398539 /* DirectiveParser.cpp */; };
+               A26567F1159C21CE00398539 /* DirectiveParser.h in Headers */ = {isa = PBXBuildFile; fileRef = A26567CD159C21CE00398539 /* DirectiveParser.h */; };
+               A26567F2159C21CE00398539 /* ExpressionParser.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A26567CE159C21CE00398539 /* ExpressionParser.cpp */; };
+               A26567F3159C21CE00398539 /* ExpressionParser.h in Headers */ = {isa = PBXBuildFile; fileRef = A26567CF159C21CE00398539 /* ExpressionParser.h */; };
+               A26567F5159C21CE00398539 /* Input.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A26567D2159C21CE00398539 /* Input.cpp */; };
+               A26567F6159C21CE00398539 /* Input.h in Headers */ = {isa = PBXBuildFile; fileRef = A26567D3159C21CE00398539 /* Input.h */; };
+               A26567F7159C21CE00398539 /* Lexer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A26567D4159C21CE00398539 /* Lexer.cpp */; };
+               A26567F8159C21CE00398539 /* Lexer.h in Headers */ = {isa = PBXBuildFile; fileRef = A26567D5159C21CE00398539 /* Lexer.h */; };
+               A26567F9159C21CE00398539 /* Macro.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A26567D6159C21CE00398539 /* Macro.cpp */; };
+               A26567FA159C21CE00398539 /* Macro.h in Headers */ = {isa = PBXBuildFile; fileRef = A26567D7159C21CE00398539 /* Macro.h */; };
+               A26567FB159C21CE00398539 /* MacroExpander.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A26567D8159C21CE00398539 /* MacroExpander.cpp */; };
+               A26567FC159C21CE00398539 /* MacroExpander.h in Headers */ = {isa = PBXBuildFile; fileRef = A26567D9159C21CE00398539 /* MacroExpander.h */; };
+               A2656803159C21CE00398539 /* Preprocessor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A26567E0159C21CE00398539 /* Preprocessor.cpp */; };
+               A2656804159C21CE00398539 /* Preprocessor.h in Headers */ = {isa = PBXBuildFile; fileRef = A26567E1159C21CE00398539 /* Preprocessor.h */; };
+               A2656805159C21CE00398539 /* SourceLocation.h in Headers */ = {isa = PBXBuildFile; fileRef = A26567E2159C21CE00398539 /* SourceLocation.h */; };
+               A2656807159C21CE00398539 /* Token.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A26567E4159C21CE00398539 /* Token.cpp */; };
+               A2656808159C21CE00398539 /* Token.h in Headers */ = {isa = PBXBuildFile; fileRef = A26567E5159C21CE00398539 /* Token.h */; };
+               A265680A159C21CE00398539 /* Tokenizer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A26567E7159C21CE00398539 /* Tokenizer.cpp */; };
+               A265680B159C21CE00398539 /* Tokenizer.h in Headers */ = {isa = PBXBuildFile; fileRef = A26567E8159C21CE00398539 /* Tokenizer.h */; };
+               A265682B159C238800398539 /* pp_utils.h in Headers */ = {isa = PBXBuildFile; fileRef = A265682A159C238800398539 /* pp_utils.h */; };
+               A2656839159C23E100398539 /* DependencyGraph.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A265682D159C23E100398539 /* DependencyGraph.cpp */; };
+               A265683A159C23E100398539 /* DependencyGraph.h in Headers */ = {isa = PBXBuildFile; fileRef = A265682E159C23E100398539 /* DependencyGraph.h */; };
+               A265683B159C23E100398539 /* DependencyGraphBuilder.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A265682F159C23E100398539 /* DependencyGraphBuilder.cpp */; };
+               A265683C159C23E100398539 /* DependencyGraphBuilder.h in Headers */ = {isa = PBXBuildFile; fileRef = A2656830159C23E100398539 /* DependencyGraphBuilder.h */; };
+               A265683D159C23E100398539 /* DependencyGraphOutput.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A2656831159C23E100398539 /* DependencyGraphOutput.cpp */; };
+               A265683E159C23E100398539 /* DependencyGraphOutput.h in Headers */ = {isa = PBXBuildFile; fileRef = A2656832159C23E100398539 /* DependencyGraphOutput.h */; };
+               A265683F159C23E100398539 /* DependencyGraphTraverse.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A2656833159C23E100398539 /* DependencyGraphTraverse.cpp */; };
+               A2656840159C23E100398539 /* RestrictFragmentShaderTiming.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A2656835159C23E100398539 /* RestrictFragmentShaderTiming.cpp */; };
+               A2656841159C23E100398539 /* RestrictFragmentShaderTiming.h in Headers */ = {isa = PBXBuildFile; fileRef = A2656836159C23E100398539 /* RestrictFragmentShaderTiming.h */; };
+               A2656842159C23E100398539 /* RestrictVertexShaderTiming.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A2656837159C23E100398539 /* RestrictVertexShaderTiming.cpp */; };
+               A2656843159C23E100398539 /* RestrictVertexShaderTiming.h in Headers */ = {isa = PBXBuildFile; fileRef = A2656838159C23E100398539 /* RestrictVertexShaderTiming.h */; };
                FB39D2711200F35A00088E69 /* CodeGenGLSL.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FB39D2221200F35A00088E69 /* CodeGenGLSL.cpp */; };
                FB39D2751200F35A00088E69 /* debug.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FB39D2261200F35A00088E69 /* debug.cpp */; };
                FB39D2791200F35A00088E69 /* InfoSink.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FB39D22A1200F35A00088E69 /* InfoSink.cpp */; };
                FB39D2A81200F35A00088E69 /* ShaderLang.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FB39D25A1200F35A00088E69 /* ShaderLang.cpp */; };
                FB39D2AA1200F35A00088E69 /* SymbolTable.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FB39D25C1200F35A00088E69 /* SymbolTable.cpp */; };
                FB39D2AC1200F35A00088E69 /* TranslatorGLSL.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FB39D2681200F35A00088E69 /* TranslatorGLSL.cpp */; };
-               FB39D2B11200F35A00088E69 /* UnfoldSelect.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FB39D26D1200F35A00088E69 /* UnfoldSelect.cpp */; };
                FB39D76E120110FC00088E69 /* ShaderLang.h in Headers */ = {isa = PBXBuildFile; fileRef = FB39D2BF1200F3E600088E69 /* ShaderLang.h */; settings = {ATTRIBUTES = (Public, ); }; };
 /* End PBXBuildFile section */
 
                A0AABE4313AFE94500F2EBD1 /* OutputESSL.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OutputESSL.h; sourceTree = "<group>"; };
                A0AABE4613AFE96100F2EBD1 /* TranslatorESSL.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TranslatorESSL.cpp; sourceTree = "<group>"; };
                A0AABE4713AFE96100F2EBD1 /* TranslatorESSL.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TranslatorESSL.h; sourceTree = "<group>"; };
+               A26567AE159C21B100398539 /* DetectDiscontinuity.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DetectDiscontinuity.cpp; sourceTree = "<group>"; };
+               A26567AF159C21B100398539 /* DetectDiscontinuity.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DetectDiscontinuity.h; sourceTree = "<group>"; };
+               A26567B0159C21B100398539 /* Diagnostics.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Diagnostics.cpp; sourceTree = "<group>"; };
+               A26567B1159C21B100398539 /* Diagnostics.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Diagnostics.h; sourceTree = "<group>"; };
+               A26567B2159C21B100398539 /* DirectiveHandler.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DirectiveHandler.cpp; sourceTree = "<group>"; };
+               A26567B3159C21B100398539 /* DirectiveHandler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DirectiveHandler.h; sourceTree = "<group>"; };
+               A26567B4159C21B100398539 /* InitializeParseContext.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InitializeParseContext.cpp; sourceTree = "<group>"; };
+               A26567B5159C21B100398539 /* Pragma.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Pragma.h; sourceTree = "<group>"; };
+               A26567B6159C21B100398539 /* RenameFunction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RenameFunction.h; sourceTree = "<group>"; };
+               A26567B7159C21B100398539 /* UnfoldShortCircuit.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UnfoldShortCircuit.cpp; sourceTree = "<group>"; };
+               A26567B8159C21B100398539 /* UnfoldShortCircuit.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UnfoldShortCircuit.h; sourceTree = "<group>"; };
+               A26567C8159C21CE00398539 /* DiagnosticsBase.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DiagnosticsBase.cpp; sourceTree = "<group>"; };
+               A26567C9159C21CE00398539 /* Diagnostics.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Diagnostics.h; sourceTree = "<group>"; };
+               A26567CA159C21CE00398539 /* DirectiveHandlerBase.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DirectiveHandlerBase.cpp; sourceTree = "<group>"; };
+               A26567CB159C21CE00398539 /* DirectiveHandler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DirectiveHandler.h; sourceTree = "<group>"; };
+               A26567CC159C21CE00398539 /* DirectiveParser.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DirectiveParser.cpp; sourceTree = "<group>"; };
+               A26567CD159C21CE00398539 /* DirectiveParser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DirectiveParser.h; sourceTree = "<group>"; };
+               A26567CE159C21CE00398539 /* ExpressionParser.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ExpressionParser.cpp; sourceTree = "<group>"; };
+               A26567CF159C21CE00398539 /* ExpressionParser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ExpressionParser.h; sourceTree = "<group>"; };
+               A26567D2159C21CE00398539 /* Input.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Input.cpp; sourceTree = "<group>"; };
+               A26567D3159C21CE00398539 /* Input.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Input.h; sourceTree = "<group>"; };
+               A26567D4159C21CE00398539 /* Lexer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Lexer.cpp; sourceTree = "<group>"; };
+               A26567D5159C21CE00398539 /* Lexer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Lexer.h; sourceTree = "<group>"; };
+               A26567D6159C21CE00398539 /* Macro.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Macro.cpp; sourceTree = "<group>"; };
+               A26567D7159C21CE00398539 /* Macro.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Macro.h; sourceTree = "<group>"; };
+               A26567D8159C21CE00398539 /* MacroExpander.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MacroExpander.cpp; sourceTree = "<group>"; };
+               A26567D9159C21CE00398539 /* MacroExpander.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MacroExpander.h; sourceTree = "<group>"; };
+               A26567E0159C21CE00398539 /* Preprocessor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Preprocessor.cpp; sourceTree = "<group>"; };
+               A26567E1159C21CE00398539 /* Preprocessor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Preprocessor.h; sourceTree = "<group>"; };
+               A26567E2159C21CE00398539 /* SourceLocation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SourceLocation.h; sourceTree = "<group>"; };
+               A26567E4159C21CE00398539 /* Token.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Token.cpp; sourceTree = "<group>"; };
+               A26567E5159C21CE00398539 /* Token.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Token.h; sourceTree = "<group>"; };
+               A26567E7159C21CE00398539 /* Tokenizer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Tokenizer.cpp; sourceTree = "<group>"; };
+               A26567E8159C21CE00398539 /* Tokenizer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Tokenizer.h; sourceTree = "<group>"; };
+               A265682A159C238800398539 /* pp_utils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = pp_utils.h; sourceTree = "<group>"; };
+               A265682D159C23E100398539 /* DependencyGraph.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DependencyGraph.cpp; sourceTree = "<group>"; };
+               A265682E159C23E100398539 /* DependencyGraph.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DependencyGraph.h; sourceTree = "<group>"; };
+               A265682F159C23E100398539 /* DependencyGraphBuilder.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DependencyGraphBuilder.cpp; sourceTree = "<group>"; };
+               A2656830159C23E100398539 /* DependencyGraphBuilder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DependencyGraphBuilder.h; sourceTree = "<group>"; };
+               A2656831159C23E100398539 /* DependencyGraphOutput.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DependencyGraphOutput.cpp; sourceTree = "<group>"; };
+               A2656832159C23E100398539 /* DependencyGraphOutput.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DependencyGraphOutput.h; sourceTree = "<group>"; };
+               A2656833159C23E100398539 /* DependencyGraphTraverse.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DependencyGraphTraverse.cpp; sourceTree = "<group>"; };
+               A2656835159C23E100398539 /* RestrictFragmentShaderTiming.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RestrictFragmentShaderTiming.cpp; sourceTree = "<group>"; };
+               A2656836159C23E100398539 /* RestrictFragmentShaderTiming.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RestrictFragmentShaderTiming.h; sourceTree = "<group>"; };
+               A2656837159C23E100398539 /* RestrictVertexShaderTiming.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RestrictVertexShaderTiming.cpp; sourceTree = "<group>"; };
+               A2656838159C23E100398539 /* RestrictVertexShaderTiming.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RestrictVertexShaderTiming.h; sourceTree = "<group>"; };
                FB39D0D11200F0E300088E69 /* libANGLE.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libANGLE.a; sourceTree = BUILT_PRODUCTS_DIR; };
                FB39D1861200F26200088E69 /* BaseTypes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BaseTypes.h; sourceTree = "<group>"; };
                FB39D1871200F26200088E69 /* CodeGenGLSL.cpp */ = {isa = PBXFileReference; fileEncoding = 4; includeInIndex = 0; lastKnownFileType = sourcecode.cpp.cpp; path = CodeGenGLSL.cpp; sourceTree = "<group>"; };
                FB39D1C01200F26200088E69 /* ShHandle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ShHandle.h; sourceTree = "<group>"; };
                FB39D1C11200F26200088E69 /* SymbolTable.cpp */ = {isa = PBXFileReference; fileEncoding = 4; includeInIndex = 0; lastKnownFileType = sourcecode.cpp.cpp; path = SymbolTable.cpp; sourceTree = "<group>"; };
                FB39D1C21200F26200088E69 /* SymbolTable.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SymbolTable.h; sourceTree = "<group>"; };
-               FB39D1CB1200F26200088E69 /* translator_common.vcproj */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; path = translator_common.vcproj; sourceTree = "<group>"; };
-               FB39D1CC1200F26200088E69 /* translator_hlsl.vcproj */ = {isa = PBXFileReference; explicitFileType = text.xml; fileEncoding = 4; path = translator_hlsl.vcproj; sourceTree = "<group>"; };
                FB39D1CD1200F26200088E69 /* TranslatorGLSL.cpp */ = {isa = PBXFileReference; fileEncoding = 4; includeInIndex = 0; lastKnownFileType = sourcecode.cpp.cpp; path = TranslatorGLSL.cpp; sourceTree = "<group>"; };
                FB39D1CE1200F26200088E69 /* TranslatorGLSL.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TranslatorGLSL.h; sourceTree = "<group>"; };
                FB39D1CF1200F26200088E69 /* TranslatorHLSL.cpp */ = {isa = PBXFileReference; fileEncoding = 4; includeInIndex = 0; lastKnownFileType = sourcecode.cpp.cpp; path = TranslatorHLSL.cpp; sourceTree = "<group>"; };
                FB39D1D01200F26200088E69 /* TranslatorHLSL.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TranslatorHLSL.h; sourceTree = "<group>"; };
                FB39D1D11200F26200088E69 /* Types.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Types.h; sourceTree = "<group>"; };
-               FB39D1D21200F26200088E69 /* UnfoldSelect.cpp */ = {isa = PBXFileReference; fileEncoding = 4; includeInIndex = 0; lastKnownFileType = sourcecode.cpp.cpp; path = UnfoldSelect.cpp; sourceTree = "<group>"; };
-               FB39D1D31200F26200088E69 /* UnfoldSelect.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UnfoldSelect.h; sourceTree = "<group>"; };
                FB39D2211200F35A00088E69 /* BaseTypes.h */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.h; fileEncoding = 4; path = BaseTypes.h; sourceTree = "<group>"; };
                FB39D2221200F35A00088E69 /* CodeGenGLSL.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CodeGenGLSL.cpp; sourceTree = "<group>"; };
                FB39D2241200F35A00088E69 /* Common.h */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.h; fileEncoding = 4; path = Common.h; sourceTree = "<group>"; };
                FB39D2681200F35A00088E69 /* TranslatorGLSL.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TranslatorGLSL.cpp; sourceTree = "<group>"; };
                FB39D2691200F35A00088E69 /* TranslatorGLSL.h */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.h; fileEncoding = 4; path = TranslatorGLSL.h; sourceTree = "<group>"; };
                FB39D26C1200F35A00088E69 /* Types.h */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.h; fileEncoding = 4; path = Types.h; sourceTree = "<group>"; };
-               FB39D26D1200F35A00088E69 /* UnfoldSelect.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UnfoldSelect.cpp; sourceTree = "<group>"; };
-               FB39D26E1200F35A00088E69 /* UnfoldSelect.h */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.h; fileEncoding = 4; path = UnfoldSelect.h; sourceTree = "<group>"; };
                FB39D2BF1200F3E600088E69 /* ShaderLang.h */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.h; fileEncoding = 4; path = ShaderLang.h; sourceTree = "<group>"; };
 /* End PBXFileReference section */
 
                        path = Configurations;
                        sourceTree = "<group>";
                };
+               A26567C5159C21CE00398539 /* new */ = {
+                       isa = PBXGroup;
+                       children = (
+                               A265682A159C238800398539 /* pp_utils.h */,
+                               A26567C8159C21CE00398539 /* DiagnosticsBase.cpp */,
+                               A26567C9159C21CE00398539 /* Diagnostics.h */,
+                               A26567CA159C21CE00398539 /* DirectiveHandlerBase.cpp */,
+                               A26567CB159C21CE00398539 /* DirectiveHandler.h */,
+                               A26567CC159C21CE00398539 /* DirectiveParser.cpp */,
+                               A26567CD159C21CE00398539 /* DirectiveParser.h */,
+                               A26567CE159C21CE00398539 /* ExpressionParser.cpp */,
+                               A26567CF159C21CE00398539 /* ExpressionParser.h */,
+                               A26567D2159C21CE00398539 /* Input.cpp */,
+                               A26567D3159C21CE00398539 /* Input.h */,
+                               A26567D4159C21CE00398539 /* Lexer.cpp */,
+                               A26567D5159C21CE00398539 /* Lexer.h */,
+                               A26567D6159C21CE00398539 /* Macro.cpp */,
+                               A26567D7159C21CE00398539 /* Macro.h */,
+                               A26567D8159C21CE00398539 /* MacroExpander.cpp */,
+                               A26567D9159C21CE00398539 /* MacroExpander.h */,
+                               A26567E0159C21CE00398539 /* Preprocessor.cpp */,
+                               A26567E1159C21CE00398539 /* Preprocessor.h */,
+                               A26567E2159C21CE00398539 /* SourceLocation.h */,
+                               A26567E4159C21CE00398539 /* Token.cpp */,
+                               A26567E5159C21CE00398539 /* Token.h */,
+                               A26567E7159C21CE00398539 /* Tokenizer.cpp */,
+                               A26567E8159C21CE00398539 /* Tokenizer.h */,
+                       );
+                       path = new;
+                       sourceTree = "<group>";
+               };
+               A265682C159C23E100398539 /* depgraph */ = {
+                       isa = PBXGroup;
+                       children = (
+                               A265682D159C23E100398539 /* DependencyGraph.cpp */,
+                               A265682E159C23E100398539 /* DependencyGraph.h */,
+                               A265682F159C23E100398539 /* DependencyGraphBuilder.cpp */,
+                               A2656830159C23E100398539 /* DependencyGraphBuilder.h */,
+                               A2656831159C23E100398539 /* DependencyGraphOutput.cpp */,
+                               A2656832159C23E100398539 /* DependencyGraphOutput.h */,
+                               A2656833159C23E100398539 /* DependencyGraphTraverse.cpp */,
+                       );
+                       path = depgraph;
+                       sourceTree = "<group>";
+               };
+               A2656834159C23E100398539 /* timing */ = {
+                       isa = PBXGroup;
+                       children = (
+                               A2656835159C23E100398539 /* RestrictFragmentShaderTiming.cpp */,
+                               A2656836159C23E100398539 /* RestrictFragmentShaderTiming.h */,
+                               A2656837159C23E100398539 /* RestrictVertexShaderTiming.cpp */,
+                               A2656838159C23E100398539 /* RestrictVertexShaderTiming.h */,
+                       );
+                       path = timing;
+                       sourceTree = "<group>";
+               };
                FB39D06E1200ED9200088E69 = {
                        isa = PBXGroup;
                        children = (
                FB39D0841200EDEB00088E69 /* Source */ = {
                        isa = PBXGroup;
                        children = (
-                               FB39D2BD1200F3E600088E69 /* GLSLANG */,
                                FB39D1851200F26200088E69 /* compiler */,
+                               FB39D2BD1200F3E600088E69 /* GLSLANG */,
                        );
                        name = Source;
                        sourceTree = "<group>";
                                FB39D18A1200F26200088E69 /* ConstantUnion.h */,
                                FB39D18B1200F26200088E69 /* debug.cpp */,
                                FB39D18C1200F26200088E69 /* debug.h */,
+                               A26567AE159C21B100398539 /* DetectDiscontinuity.cpp */,
+                               A26567AF159C21B100398539 /* DetectDiscontinuity.h */,
                                FB39D18F1200F26200088E69 /* InfoSink.cpp */,
                                FB39D1901200F26200088E69 /* InfoSink.h */,
                                FB39D1911200F26200088E69 /* Initialize.cpp */,
                                FB39D1C01200F26200088E69 /* ShHandle.h */,
                                FB39D1C11200F26200088E69 /* SymbolTable.cpp */,
                                FB39D1C21200F26200088E69 /* SymbolTable.h */,
-                               FB39D1CB1200F26200088E69 /* translator_common.vcproj */,
-                               FB39D1CC1200F26200088E69 /* translator_hlsl.vcproj */,
                                FB39D1CD1200F26200088E69 /* TranslatorGLSL.cpp */,
                                FB39D1CE1200F26200088E69 /* TranslatorGLSL.h */,
                                FB39D1CF1200F26200088E69 /* TranslatorHLSL.cpp */,
                                FB39D1D01200F26200088E69 /* TranslatorHLSL.h */,
                                FB39D1D11200F26200088E69 /* Types.h */,
-                               FB39D1D21200F26200088E69 /* UnfoldSelect.cpp */,
-                               FB39D1D31200F26200088E69 /* UnfoldSelect.h */,
+                               A26567B7159C21B100398539 /* UnfoldShortCircuit.cpp */,
+                               A26567B8159C21B100398539 /* UnfoldShortCircuit.h */,
                        );
                        includeInIndex = 0;
                        name = compiler;
                FB39D2201200F35A00088E69 /* compiler */ = {
                        isa = PBXGroup;
                        children = (
-                               A0AABE3213AFE84700F2EBD1 /* OutputGLSLBase.cpp */,
-                               A0AABE3313AFE84700F2EBD1 /* OutputGLSLBase.h */,
-                               A0AABE4613AFE96100F2EBD1 /* TranslatorESSL.cpp */,
-                               A0AABE4713AFE96100F2EBD1 /* TranslatorESSL.h */,
-                               A0AABE4213AFE94500F2EBD1 /* OutputESSL.cpp */,
-                               A0AABE4313AFE94500F2EBD1 /* OutputESSL.h */,
-                               A0AABE2E13AFE83000F2EBD1 /* MapLongVariableNames.cpp */,
-                               A0AABE2F13AFE83000F2EBD1 /* MapLongVariableNames.h */,
-                               A0AABE2A13AFE81000F2EBD1 /* ForLoopUnroll.cpp */,
-                               A0AABE2B13AFE81000F2EBD1 /* ForLoopUnroll.h */,
-                               FB39D2441200F35A00088E69 /* preprocessor */,
                                FB39D2211200F35A00088E69 /* BaseTypes.h */,
                                49951C0514B7AAD70060E96E /* BuiltInFunctionEmulator.cpp */,
                                49951C0614B7AAD80060E96E /* BuiltInFunctionEmulator.h */,
                                FB39D2251200F35A00088E69 /* ConstantUnion.h */,
                                FB39D2261200F35A00088E69 /* debug.cpp */,
                                FB39D2271200F35A00088E69 /* debug.h */,
+                               A265682C159C23E100398539 /* depgraph */,
                                49951C0714B7AAD80060E96E /* DetectRecursion.cpp */,
                                49951C0814B7AAD80060E96E /* DetectRecursion.h */,
+                               A26567B0159C21B100398539 /* Diagnostics.cpp */,
+                               A26567B1159C21B100398539 /* Diagnostics.h */,
+                               A26567B2159C21B100398539 /* DirectiveHandler.cpp */,
+                               A26567B3159C21B100398539 /* DirectiveHandler.h */,
                                90D9B0FA12E11DCB002D4255 /* ExtensionBehavior.h */,
+                               A0AABE2A13AFE81000F2EBD1 /* ForLoopUnroll.cpp */,
+                               A0AABE2B13AFE81000F2EBD1 /* ForLoopUnroll.h */,
+                               90D9B0FE12E11DCB002D4255 /* glslang.h */,
                                90D9B0FB12E11DCB002D4255 /* glslang_lex.cpp */,
                                90D9B0FC12E11DCB002D4255 /* glslang_tab.cpp */,
                                90D9B0FD12E11DCB002D4255 /* glslang_tab.h */,
-                               90D9B0FE12E11DCB002D4255 /* glslang.h */,
                                FB39D22A1200F35A00088E69 /* InfoSink.cpp */,
                                FB39D22B1200F35A00088E69 /* InfoSink.h */,
                                FB39D22C1200F35A00088E69 /* Initialize.cpp */,
                                FB39D22E1200F35A00088E69 /* InitializeDll.cpp */,
                                FB39D22F1200F35A00088E69 /* InitializeDll.h */,
                                FB39D2301200F35A00088E69 /* InitializeGlobals.h */,
+                               A26567B4159C21B100398539 /* InitializeParseContext.cpp */,
                                FB39D2311200F35A00088E69 /* InitializeParseContext.h */,
                                FB39D2321200F35A00088E69 /* Intermediate.cpp */,
                                FB39D2331200F35A00088E69 /* intermediate.h */,
                                FB39D2341200F35A00088E69 /* intermOut.cpp */,
                                FB39D2351200F35A00088E69 /* IntermTraverse.cpp */,
                                FB39D2361200F35A00088E69 /* localintermediate.h */,
+                               A0AABE2E13AFE83000F2EBD1 /* MapLongVariableNames.cpp */,
+                               A0AABE2F13AFE83000F2EBD1 /* MapLongVariableNames.h */,
                                FB39D2371200F35A00088E69 /* MMap.h */,
                                FB39D2381200F35A00088E69 /* osinclude.h */,
                                90D9B0FF12E11DCB002D4255 /* ossource_nspr.cpp */,
                                FB39D2391200F35A00088E69 /* ossource_posix.cpp */,
                                FB39D23A1200F35A00088E69 /* ossource_win.cpp */,
+                               A0AABE4213AFE94500F2EBD1 /* OutputESSL.cpp */,
+                               A0AABE4313AFE94500F2EBD1 /* OutputESSL.h */,
                                FB39D23B1200F35A00088E69 /* OutputGLSL.cpp */,
                                FB39D23C1200F35A00088E69 /* OutputGLSL.h */,
+                               A0AABE3213AFE84700F2EBD1 /* OutputGLSLBase.cpp */,
+                               A0AABE3313AFE84700F2EBD1 /* OutputGLSLBase.h */,
                                FB39D23F1200F35A00088E69 /* parseConst.cpp */,
                                FB39D2401200F35A00088E69 /* ParseHelper.cpp */,
                                FB39D2411200F35A00088E69 /* ParseHelper.h */,
                                FB39D2421200F35A00088E69 /* PoolAlloc.cpp */,
                                FB39D2431200F35A00088E69 /* PoolAlloc.h */,
+                               A26567B5159C21B100398539 /* Pragma.h */,
+                               FB39D2441200F35A00088E69 /* preprocessor */,
                                FB39D2561200F35A00088E69 /* QualifierAlive.cpp */,
                                FB39D2571200F35A00088E69 /* QualifierAlive.h */,
                                FB39D2581200F35A00088E69 /* RemoveTree.cpp */,
                                FB39D2591200F35A00088E69 /* RemoveTree.h */,
+                               A26567B6159C21B100398539 /* RenameFunction.h */,
                                90D9B10012E11DCB002D4255 /* SearchSymbol.cpp */,
                                90D9B10112E11DCB002D4255 /* SearchSymbol.h */,
                                FB39D25A1200F35A00088E69 /* ShaderLang.cpp */,
                                FB39D25B1200F35A00088E69 /* ShHandle.h */,
                                FB39D25C1200F35A00088E69 /* SymbolTable.cpp */,
                                FB39D25D1200F35A00088E69 /* SymbolTable.h */,
+                               A2656834159C23E100398539 /* timing */,
+                               A0AABE4613AFE96100F2EBD1 /* TranslatorESSL.cpp */,
+                               A0AABE4713AFE96100F2EBD1 /* TranslatorESSL.h */,
                                FB39D2681200F35A00088E69 /* TranslatorGLSL.cpp */,
                                FB39D2691200F35A00088E69 /* TranslatorGLSL.h */,
                                FB39D26C1200F35A00088E69 /* Types.h */,
-                               FB39D26D1200F35A00088E69 /* UnfoldSelect.cpp */,
-                               FB39D26E1200F35A00088E69 /* UnfoldSelect.h */,
                                90D9B10B12E11DD6002D4255 /* util.cpp */,
                                90D9B10C12E11DD6002D4255 /* util.h */,
                                90D9B10D12E11DD6002D4255 /* ValidateLimitations.cpp */,
                FB39D2441200F35A00088E69 /* preprocessor */ = {
                        isa = PBXGroup;
                        children = (
+                               A26567C5159C21CE00398539 /* new */,
                                FB39D2451200F35A00088E69 /* atom.c */,
                                FB39D2461200F35A00088E69 /* atom.h */,
                                FB39D2471200F35A00088E69 /* compile.h */,
                                49951C0314B7AAB30060E96E /* length_limits.h in Headers */,
                                49951C0A14B7AAD80060E96E /* BuiltInFunctionEmulator.h in Headers */,
                                49951C0C14B7AAD80060E96E /* DetectRecursion.h in Headers */,
+                               A26567BC159C21B100398539 /* Diagnostics.h in Headers */,
+                               A26567BE159C21B100398539 /* DirectiveHandler.h in Headers */,
+                               A26567C0159C21B100398539 /* Pragma.h in Headers */,
+                               A26567C1159C21B100398539 /* RenameFunction.h in Headers */,
+                               A26567ED159C21CE00398539 /* Diagnostics.h in Headers */,
+                               A26567EF159C21CE00398539 /* DirectiveHandler.h in Headers */,
+                               A26567F1159C21CE00398539 /* DirectiveParser.h in Headers */,
+                               A26567F3159C21CE00398539 /* ExpressionParser.h in Headers */,
+                               A26567F6159C21CE00398539 /* Input.h in Headers */,
+                               A26567F8159C21CE00398539 /* Lexer.h in Headers */,
+                               A26567FA159C21CE00398539 /* Macro.h in Headers */,
+                               A26567FC159C21CE00398539 /* MacroExpander.h in Headers */,
+                               A2656804159C21CE00398539 /* Preprocessor.h in Headers */,
+                               A2656805159C21CE00398539 /* SourceLocation.h in Headers */,
+                               A2656808159C21CE00398539 /* Token.h in Headers */,
+                               A265680B159C21CE00398539 /* Tokenizer.h in Headers */,
+                               A265682B159C238800398539 /* pp_utils.h in Headers */,
+                               A265683A159C23E100398539 /* DependencyGraph.h in Headers */,
+                               A265683C159C23E100398539 /* DependencyGraphBuilder.h in Headers */,
+                               A265683E159C23E100398539 /* DependencyGraphOutput.h in Headers */,
+                               A2656841159C23E100398539 /* RestrictFragmentShaderTiming.h in Headers */,
+                               A2656843159C23E100398539 /* RestrictVertexShaderTiming.h in Headers */,
                        );
                        runOnlyForDeploymentPostprocessing = 0;
                };
                                FB39D2A81200F35A00088E69 /* ShaderLang.cpp in Sources */,
                                FB39D2AA1200F35A00088E69 /* SymbolTable.cpp in Sources */,
                                FB39D2AC1200F35A00088E69 /* TranslatorGLSL.cpp in Sources */,
-                               FB39D2B11200F35A00088E69 /* UnfoldSelect.cpp in Sources */,
                                90D9B10212E11DCB002D4255 /* Compiler.cpp in Sources */,
                                90D9B10412E11DCB002D4255 /* glslang_lex.cpp in Sources */,
                                90D9B10512E11DCB002D4255 /* glslang_tab.cpp in Sources */,
                                A0AABE4813AFE96100F2EBD1 /* TranslatorESSL.cpp in Sources */,
                                49951C0914B7AAD80060E96E /* BuiltInFunctionEmulator.cpp in Sources */,
                                49951C0B14B7AAD80060E96E /* DetectRecursion.cpp in Sources */,
+                               A26567BB159C21B100398539 /* Diagnostics.cpp in Sources */,
+                               A26567BD159C21B100398539 /* DirectiveHandler.cpp in Sources */,
+                               A26567BF159C21B100398539 /* InitializeParseContext.cpp in Sources */,
+                               A26567EC159C21CE00398539 /* DiagnosticsBase.cpp in Sources */,
+                               A26567EE159C21CE00398539 /* DirectiveHandlerBase.cpp in Sources */,
+                               A26567F0159C21CE00398539 /* DirectiveParser.cpp in Sources */,
+                               A26567F2159C21CE00398539 /* ExpressionParser.cpp in Sources */,
+                               A26567F5159C21CE00398539 /* Input.cpp in Sources */,
+                               A26567F7159C21CE00398539 /* Lexer.cpp in Sources */,
+                               A26567F9159C21CE00398539 /* Macro.cpp in Sources */,
+                               A26567FB159C21CE00398539 /* MacroExpander.cpp in Sources */,
+                               A2656803159C21CE00398539 /* Preprocessor.cpp in Sources */,
+                               A2656807159C21CE00398539 /* Token.cpp in Sources */,
+                               A265680A159C21CE00398539 /* Tokenizer.cpp in Sources */,
+                               A2656839159C23E100398539 /* DependencyGraph.cpp in Sources */,
+                               A265683B159C23E100398539 /* DependencyGraphBuilder.cpp in Sources */,
+                               A265683D159C23E100398539 /* DependencyGraphOutput.cpp in Sources */,
+                               A265683F159C23E100398539 /* DependencyGraphTraverse.cpp in Sources */,
+                               A2656840159C23E100398539 /* RestrictFragmentShaderTiming.cpp in Sources */,
+                               A2656842159C23E100398539 /* RestrictVertexShaderTiming.cpp in Sources */,
                        );
                        runOnlyForDeploymentPostprocessing = 0;
                };
index 8636052..d2a8bb3 100644 (file)
@@ -1,3 +1,915 @@
+2012-07-17  Max Vujovic  <mvujovic@adobe.com>
+
+        Update ANGLE in WebKit
+        https://bugs.webkit.org/show_bug.cgi?id=89039
+
+        Reviewed by Dean Jackson and Mark Rowe.
+
+        Update ANGLE to r1170, with the following modifications:
+
+        (1) Use Bison 2.3 instead of Bison 2.4.2 to generate ExpressionParser.cpp and
+        glslang_tab.cpp. I had to modify ExpressionParser.y to make it compatible with Bison
+        2.3. The changes have been contributed back to ANGLE in r1224.
+
+        (2) Continue to recognize QNX as POSIX in ANGLE. This has been contributed back to ANGLE
+        in r1223.
+
+        (3) Rename ANGLE/src/compiler/preprocessor/new/Diagnostic.cpp to DiagnosticBase.cpp.
+        Rename ANGLE/src/compiler/preprocessor/new/DirectiveHandler.cpp to DirectiveHandlerBase.cpp.
+
+        With the introduction of ANGLE's new preprocessor, there were two files named Diagnostic.cpp
+        in ANGLE under different folders. This caused problems on the QT build when their object
+        files, both named Diagnostic.o, tried to go in the same folder. Renaming one of them to
+        DiagnosticBase.cpp avoids this conflict. The same situation occurred with
+        DirectiveHandler.cpp. I will work on contributing this change back to ANGLE for future
+        updates.
+
+        (4) Add the following lines to glslang.y and ExpressionParser.y:
+        #define YYENABLE_NLS 0
+        #define YYLTYPE_IS_TRIVIAL 1
+
+        Bison 2.3 doesn't first check that these macros are defined before reading their value,
+        which causes the QT build to fail.
+
+        We work around this issue in the same way in CSSGrammar.y.
+
+        I will work on contributing this change back to ANGLE.
+
+        * ANGLE.xcodeproj/project.pbxproj:
+        * include/GLES2/gl2ext.h:
+        * include/GLSLANG/ShaderLang.h:
+        * src/build_angle.xcodeproj/project.pbxproj:
+        * src/common/angleutils.h:
+        * src/common/debug.cpp:
+        (gl):
+        (gl::output):
+        (gl::trace):
+        (gl::perfActive):
+        (gl::ScopedPerfEventHelper::ScopedPerfEventHelper):
+        (gl::ScopedPerfEventHelper::~ScopedPerfEventHelper):
+        * src/common/version.h:
+        * src/compiler/BuiltInFunctionEmulator.cpp:
+        (BuiltInFunctionEmulator::IdentifyFunction):
+        * src/compiler/BuiltInFunctionEmulator.h:
+        * src/compiler/Compiler.cpp:
+        (isWebGLBasedSpec):
+        (TCompiler::compile):
+        (TCompiler::rewriteCSSShader):
+        (TCompiler::enforceTimingRestrictions):
+        (TCompiler::enforceFragmentShaderTimingRestrictions):
+        (TCompiler::enforceVertexShaderTimingRestrictions):
+        * src/compiler/DetectDiscontinuity.cpp: Added.
+        (sh::DetectLoopDiscontinuity::traverse):
+        (sh):
+        (sh::DetectLoopDiscontinuity::visitBranch):
+        (sh::DetectLoopDiscontinuity::visitAggregate):
+        (sh::containsLoopDiscontinuity):
+        (sh::DetectGradientOperation::traverse):
+        (sh::DetectGradientOperation::visitUnary):
+        (sh::DetectGradientOperation::visitAggregate):
+        (sh::containsGradientOperation):
+        * src/compiler/DetectDiscontinuity.h: Added.
+        (sh):
+        (DetectLoopDiscontinuity):
+        (DetectGradientOperation):
+        * src/compiler/Diagnostics.cpp: Added.
+        (TDiagnostics::TDiagnostics):
+        (TDiagnostics::~TDiagnostics):
+        (TDiagnostics::writeInfo):
+        (TDiagnostics::writeDebug):
+        (TDiagnostics::print):
+        * src/compiler/Diagnostics.h: Added.
+        (TDiagnostics):
+        (TDiagnostics::infoSink):
+        * src/compiler/DirectiveHandler.cpp: Added.
+        (getBehavior):
+        (TDirectiveHandler::TDirectiveHandler):
+        (TDirectiveHandler::~TDirectiveHandler):
+        (TDirectiveHandler::handleError):
+        (TDirectiveHandler::handlePragma):
+        (TDirectiveHandler::handleExtension):
+        (TDirectiveHandler::handleVersion):
+        * src/compiler/DirectiveHandler.h: Added.
+        (TDirectiveHandler):
+        (TDirectiveHandler::pragma):
+        (TDirectiveHandler::extensionBehavior):
+        * src/compiler/ExtensionBehavior.h:
+        (getBehaviorString):
+        * src/compiler/Initialize.cpp:
+        (BuiltInConstants):
+        (TBuiltIns::initialize):
+        (IdentifyBuiltIns):
+        * src/compiler/InitializeParseContext.cpp: Added.
+        (InitializeParseContextIndex):
+        (FreeParseContextIndex):
+        (InitializeGlobalParseContext):
+        (FreeParseContext):
+        (GetGlobalParseContext):
+        * src/compiler/InitializeParseContext.h:
+        (TThreadParseContextRec):
+        * src/compiler/Intermediate.cpp:
+        (TIntermediate::addSelection):
+        * src/compiler/MapLongVariableNames.cpp:
+        * src/compiler/OutputHLSL.cpp:
+        (sh::str):
+        (sh::OutputHLSL::OutputHLSL):
+        (sh::OutputHLSL::~OutputHLSL):
+        (sh::OutputHLSL::output):
+        (sh::OutputHLSL::header):
+        (sh::OutputHLSL::visitBinary):
+        (sh::OutputHLSL::visitUnary):
+        (sh::OutputHLSL::visitAggregate):
+        (sh::OutputHLSL::visitSelection):
+        (sh::OutputHLSL::visitLoop):
+        (sh::OutputHLSL::traverseStatements):
+        (sh):
+        (sh::OutputHLSL::handleExcessiveLoop):
+        (sh::OutputHLSL::typeString):
+        (sh::OutputHLSL::addConstructor):
+        (sh::OutputHLSL::decorateField):
+        * src/compiler/OutputHLSL.h:
+        (sh):
+        (OutputHLSL):
+        * src/compiler/ParseHelper.cpp:
+        (TParseContext::parseVectorFields):
+        (TParseContext::parseMatrixFields):
+        (TParseContext::error):
+        (TParseContext::warning):
+        (TParseContext::trace):
+        (TParseContext::assignError):
+        (TParseContext::unaryOpError):
+        (TParseContext::binaryOpError):
+        (TParseContext::precisionErrorCheck):
+        (TParseContext::lValueErrorCheck):
+        (TParseContext::constErrorCheck):
+        (TParseContext::integerErrorCheck):
+        (TParseContext::globalErrorCheck):
+        (TParseContext::reservedErrorCheck):
+        (TParseContext::constructorErrorCheck):
+        (TParseContext::voidErrorCheck):
+        (TParseContext::boolErrorCheck):
+        (TParseContext::samplerErrorCheck):
+        (TParseContext::structQualifierErrorCheck):
+        (TParseContext::parameterSamplerErrorCheck):
+        (TParseContext::arraySizeErrorCheck):
+        (TParseContext::arrayQualifierErrorCheck):
+        (TParseContext::arrayTypeErrorCheck):
+        (TParseContext::arrayErrorCheck):
+        (TParseContext::arraySetMaxSize):
+        (TParseContext::nonInitConstErrorCheck):
+        (TParseContext::nonInitErrorCheck):
+        (TParseContext::paramErrorCheck):
+        (TParseContext::extensionErrorCheck):
+        (TParseContext::supportsExtension):
+        (TParseContext::handleExtensionDirective):
+        (TParseContext::handlePragmaDirective):
+        (TParseContext::findFunction):
+        (TParseContext::executeInitializer):
+        (TParseContext::constructBuiltIn):
+        (TParseContext::constructStruct):
+        (TParseContext::addConstVectorNode):
+        (TParseContext::addConstMatrixNode):
+        (TParseContext::addConstArrayNode):
+        (TParseContext::addConstStruct):
+        (TParseContext::enterStructDeclaration):
+        (TParseContext::structNestingErrorCheck):
+        (PaParseStrings):
+        * src/compiler/ParseHelper.h:
+        (TParseContext::TParseContext):
+        (TParseContext):
+        (TParseContext::infoSink):
+        (TParseContext::extensionBehavior):
+        (TParseContext::pragma):
+        * src/compiler/PoolAlloc.cpp:
+        (TAllocation::checkGuardBlock):
+        * src/compiler/Pragma.h: Added.
+        (TPragma):
+        (TPragma::TPragma):
+        * src/compiler/RenameFunction.h: Added.
+        (RenameFunction):
+        (RenameFunction::RenameFunction):
+        (RenameFunction::visitAggregate):
+        * src/compiler/ShHandle.h:
+        (TCompiler):
+        * src/compiler/ShaderLang.cpp:
+        (getVariableInfo):
+        * src/compiler/SymbolTable.cpp:
+        (TType::buildMangledName):
+        * src/compiler/TranslatorHLSL.cpp:
+        * src/compiler/UnfoldSelect.cpp: Removed.
+        * src/compiler/UnfoldSelect.h: Removed.
+        * src/compiler/UnfoldShortCircuit.cpp: Added.
+        (sh::UnfoldShortCircuit::UnfoldShortCircuit):
+        (sh):
+        (sh::UnfoldShortCircuit::traverse):
+        (sh::UnfoldShortCircuit::visitBinary):
+        (sh::UnfoldShortCircuit::visitSelection):
+        (sh::UnfoldShortCircuit::visitLoop):
+        (sh::UnfoldShortCircuit::getNextTemporaryIndex):
+        * src/compiler/UnfoldShortCircuit.h: Added.
+        (sh):
+        (UnfoldShortCircuit):
+        * src/compiler/ValidateLimitations.cpp:
+        * src/compiler/debug.cpp:
+        * src/compiler/depgraph: Added.
+        * src/compiler/depgraph/DependencyGraph.cpp: Added.
+        (TDependencyGraph::TDependencyGraph):
+        (TDependencyGraph::~TDependencyGraph):
+        (TDependencyGraph::createArgument):
+        (TDependencyGraph::createFunctionCall):
+        (TDependencyGraph::getOrCreateSymbol):
+        (TDependencyGraph::createSelection):
+        (TDependencyGraph::createLoop):
+        (TDependencyGraph::createLogicalOp):
+        (TGraphLogicalOp::getOpString):
+        * src/compiler/depgraph/DependencyGraph.h: Added.
+        (TGraphNode):
+        (TGraphNode::TGraphNode):
+        (TGraphNode::~TGraphNode):
+        (TGraphParentNode):
+        (TGraphParentNode::TGraphParentNode):
+        (TGraphParentNode::~TGraphParentNode):
+        (TGraphParentNode::addDependentNode):
+        (TGraphArgument):
+        (TGraphArgument::TGraphArgument):
+        (TGraphArgument::~TGraphArgument):
+        (TGraphArgument::getIntermFunctionCall):
+        (TGraphArgument::getArgumentNumber):
+        (TGraphFunctionCall):
+        (TGraphFunctionCall::TGraphFunctionCall):
+        (TGraphFunctionCall::~TGraphFunctionCall):
+        (TGraphFunctionCall::getIntermFunctionCall):
+        (TGraphSymbol):
+        (TGraphSymbol::TGraphSymbol):
+        (TGraphSymbol::~TGraphSymbol):
+        (TGraphSymbol::getIntermSymbol):
+        (TGraphSelection):
+        (TGraphSelection::TGraphSelection):
+        (TGraphSelection::~TGraphSelection):
+        (TGraphSelection::getIntermSelection):
+        (TGraphLoop):
+        (TGraphLoop::TGraphLoop):
+        (TGraphLoop::~TGraphLoop):
+        (TGraphLoop::getIntermLoop):
+        (TGraphLogicalOp):
+        (TGraphLogicalOp::TGraphLogicalOp):
+        (TGraphLogicalOp::~TGraphLogicalOp):
+        (TGraphLogicalOp::getIntermLogicalOp):
+        (TDependencyGraph):
+        (TDependencyGraph::begin):
+        (TDependencyGraph::end):
+        (TDependencyGraph::beginSamplerSymbols):
+        (TDependencyGraph::endSamplerSymbols):
+        (TDependencyGraph::beginUserDefinedFunctionCalls):
+        (TDependencyGraph::endUserDefinedFunctionCalls):
+        (TDependencyGraphTraverser):
+        (TDependencyGraphTraverser::TDependencyGraphTraverser):
+        (TDependencyGraphTraverser::visitSymbol):
+        (TDependencyGraphTraverser::visitArgument):
+        (TDependencyGraphTraverser::visitFunctionCall):
+        (TDependencyGraphTraverser::visitSelection):
+        (TDependencyGraphTraverser::visitLoop):
+        (TDependencyGraphTraverser::visitLogicalOp):
+        (TDependencyGraphTraverser::getDepth):
+        (TDependencyGraphTraverser::incrementDepth):
+        (TDependencyGraphTraverser::decrementDepth):
+        (TDependencyGraphTraverser::clearVisited):
+        (TDependencyGraphTraverser::markVisited):
+        (TDependencyGraphTraverser::isVisited):
+        * src/compiler/depgraph/DependencyGraphBuilder.cpp: Added.
+        (TDependencyGraphBuilder::build):
+        (TDependencyGraphBuilder::visitAggregate):
+        (TDependencyGraphBuilder::visitFunctionDefinition):
+        (TDependencyGraphBuilder::visitFunctionCall):
+        (TDependencyGraphBuilder::visitAggregateChildren):
+        (TDependencyGraphBuilder::visitSymbol):
+        (TDependencyGraphBuilder::visitBinary):
+        (TDependencyGraphBuilder::visitAssignment):
+        (TDependencyGraphBuilder::visitLogicalOp):
+        (TDependencyGraphBuilder::visitBinaryChildren):
+        (TDependencyGraphBuilder::visitSelection):
+        (TDependencyGraphBuilder::visitLoop):
+        (TDependencyGraphBuilder::connectMultipleNodesToSingleNode):
+        * src/compiler/depgraph/DependencyGraphBuilder.h: Added.
+        (TDependencyGraphBuilder):
+        (TNodeSetStack):
+        (TDependencyGraphBuilder::TNodeSetStack::TNodeSetStack):
+        (TDependencyGraphBuilder::TNodeSetStack::~TNodeSetStack):
+        (TDependencyGraphBuilder::TNodeSetStack::getTopSet):
+        (TDependencyGraphBuilder::TNodeSetStack::pushSet):
+        (TDependencyGraphBuilder::TNodeSetStack::popSet):
+        (TDependencyGraphBuilder::TNodeSetStack::popSetIntoNext):
+        (TDependencyGraphBuilder::TNodeSetStack::insertIntoTopSet):
+        (TDependencyGraphBuilder::TNodeSetStack::clear):
+        (TNodeSetMaintainer):
+        (TDependencyGraphBuilder::TNodeSetMaintainer::TNodeSetMaintainer):
+        (TDependencyGraphBuilder::TNodeSetMaintainer::~TNodeSetMaintainer):
+        (TNodeSetPropagatingMaintainer):
+        (TDependencyGraphBuilder::TNodeSetPropagatingMaintainer::TNodeSetPropagatingMaintainer):
+        (TDependencyGraphBuilder::TNodeSetPropagatingMaintainer::~TNodeSetPropagatingMaintainer):
+        (TLeftmostSymbolMaintainer):
+        (TDependencyGraphBuilder::TLeftmostSymbolMaintainer::TLeftmostSymbolMaintainer):
+        (TDependencyGraphBuilder::TLeftmostSymbolMaintainer::~TLeftmostSymbolMaintainer):
+        (TDependencyGraphBuilder::TDependencyGraphBuilder):
+        (TDependencyGraphBuilder::build):
+        * src/compiler/depgraph/DependencyGraphOutput.cpp: Added.
+        (TDependencyGraphOutput::outputIndentation):
+        (TDependencyGraphOutput::visitArgument):
+        (TDependencyGraphOutput::visitFunctionCall):
+        (TDependencyGraphOutput::visitSymbol):
+        (TDependencyGraphOutput::visitSelection):
+        (TDependencyGraphOutput::visitLoop):
+        (TDependencyGraphOutput::visitLogicalOp):
+        (TDependencyGraphOutput::outputAllSpanningTrees):
+        * src/compiler/depgraph/DependencyGraphOutput.h: Added.
+        (TDependencyGraphOutput):
+        (TDependencyGraphOutput::TDependencyGraphOutput):
+        * src/compiler/depgraph/DependencyGraphTraverse.cpp: Added.
+        (TGraphNode::traverse):
+        (TGraphParentNode::traverse):
+        (TGraphArgument::traverse):
+        (TGraphFunctionCall::traverse):
+        (TGraphSymbol::traverse):
+        (TGraphSelection::traverse):
+        (TGraphLoop::traverse):
+        (TGraphLogicalOp::traverse):
+        * src/compiler/glslang.h:
+        * src/compiler/glslang.l:
+        * src/compiler/glslang.y:
+        * src/compiler/glslang_lex.cpp:
+        (yy_buffer_state):
+        (yyguts_t):
+        (yy_get_previous_state):
+        (yy_try_NUL_trans):
+        (input):
+        (yyensure_buffer_stack):
+        (yy_scan_bytes):
+        (yyget_leng):
+        (string_input):
+        (yyerror):
+        (glslang_finalize):
+        (glslang_scan):
+        * src/compiler/glslang_tab.cpp:
+        * src/compiler/intermediate.h:
+        (TIntermAggregate::TIntermAggregate):
+        (TIntermAggregate::~TIntermAggregate):
+        (TIntermAggregate::isUserDefined):
+        (TIntermAggregate):
+        (TIntermTraverser::~TIntermTraverser):
+        * src/compiler/osinclude.h:
+        * src/compiler/preprocessor/atom.c:
+        (FindHashLoc):
+        (PrintAtomTable):
+        * src/compiler/preprocessor/cpp.c:
+        (CPPpragma):
+        (readCPPline):
+        (PredefineIntMacro):
+        (MacroExpand):
+        * src/compiler/preprocessor/cpp.h:
+        * src/compiler/preprocessor/memory.h:
+        * src/compiler/preprocessor/new: Added properties allow-tabs, allow-tabs, allow-tabs, allow-tabs, allow-tabs, allow-tabs, allow-tabs, allow-tabs, allow-tabs, allow-tabs, allow-tabs, allow-tabs, allow-tabs, allow-tabs, allow-tabs, allow-tabs, allow-tabs, allow-tabs, allow-tabs, allow-tabs, allow-tabs, allow-tabs, allow-tabs, allow-tabs, allow-tabs, allow-tabs, allow-tabs, allow-tabs and allow-tabs.
+        * src/compiler/preprocessor/new/Context.cpp: Removed.
+        * src/compiler/preprocessor/new/Context.h: Removed.
+        * src/compiler/preprocessor/new/Diagnostics.h: Added.
+        (pp):
+        (Diagnostics):
+        * src/compiler/preprocessor/new/DiagnosticsBase.cpp: Added.
+        (pp):
+        (pp::Diagnostics::~Diagnostics):
+        (pp::Diagnostics::report):
+        (pp::Diagnostics::severity):
+        * src/compiler/preprocessor/new/DirectiveHandler.h: Added.
+        (pp):
+        (DirectiveHandler):
+        * src/compiler/preprocessor/new/DirectiveHandlerBase.cpp: Added.
+        (pp):
+        (pp::DirectiveHandler::~DirectiveHandler):
+        * src/compiler/preprocessor/new/DirectiveParser.cpp: Added.
+        (getDirective):
+        (isConditionalDirective):
+        (isEOD):
+        (skipUntilEOD):
+        (isMacroNameReserved):
+        (isMacroPredefined):
+        (pp):
+        (DefinedParser):
+        (pp::DefinedParser::DefinedParser):
+        (pp::DefinedParser::lex):
+        (pp::DirectiveParser::DirectiveParser):
+        (pp::DirectiveParser::lex):
+        (pp::DirectiveParser::parseDirective):
+        (pp::DirectiveParser::parseDefine):
+        (pp::DirectiveParser::parseUndef):
+        (pp::DirectiveParser::parseIf):
+        (pp::DirectiveParser::parseIfdef):
+        (pp::DirectiveParser::parseIfndef):
+        (pp::DirectiveParser::parseElse):
+        (pp::DirectiveParser::parseElif):
+        (pp::DirectiveParser::parseEndif):
+        (pp::DirectiveParser::parseError):
+        (pp::DirectiveParser::parsePragma):
+        (pp::DirectiveParser::parseExtension):
+        (pp::DirectiveParser::parseVersion):
+        (pp::DirectiveParser::parseLine):
+        (pp::DirectiveParser::skipping):
+        (pp::DirectiveParser::parseConditionalIf):
+        (pp::DirectiveParser::parseExpressionIf):
+        (pp::DirectiveParser::parseExpressionIfdef):
+        * src/compiler/preprocessor/new/DirectiveParser.h: Added.
+        (pp):
+        (DirectiveParser):
+        (ConditionalBlock):
+        (pp::DirectiveParser::ConditionalBlock::ConditionalBlock):
+        * src/compiler/preprocessor/new/ExpressionParser.cpp: Added.
+        (yysyntax_error):
+        (yylex):
+        (yyerror):
+        (pp):
+        (pp::ExpressionParser::ExpressionParser):
+        (pp::ExpressionParser::parse):
+        * src/compiler/preprocessor/new/ExpressionParser.h: Added.
+        (pp):
+        (ExpressionParser):
+        * src/compiler/preprocessor/new/ExpressionParser.y: Added.
+        * src/compiler/preprocessor/new/Input.cpp: Added property allow-tabs.
+        (pp::Input::Input):
+        (pp::Input::read):
+        * src/compiler/preprocessor/new/Input.h: Added property allow-tabs.
+        (pp):
+        (Input):
+        (pp::Input::count):
+        (pp::Input::string):
+        (pp::Input::length):
+        (Location):
+        (pp::Input::Location::Location):
+        (pp::Input::readLoc):
+        * src/compiler/preprocessor/new/Lexer.cpp: Added.
+        (pp):
+        (pp::Lexer::~Lexer):
+        * src/compiler/preprocessor/new/Lexer.h: Added.
+        (pp):
+        (Lexer):
+        * src/compiler/preprocessor/new/Macro.cpp: Added property allow-tabs.
+        (pp::Macro::equals):
+        * src/compiler/preprocessor/new/Macro.h: Added property allow-tabs.
+        (pp):
+        (pp::Macro::Macro):
+        (Macro):
+        * src/compiler/preprocessor/new/MacroExpander.cpp: Added.
+        (pp):
+        (TokenLexer):
+        (pp::TokenLexer::TokenLexer):
+        (pp::TokenLexer::lex):
+        (pp::MacroExpander::MacroExpander):
+        (pp::MacroExpander::~MacroExpander):
+        (pp::MacroExpander::lex):
+        (pp::MacroExpander::getToken):
+        (pp::MacroExpander::ungetToken):
+        (pp::MacroExpander::isNextTokenLeftParen):
+        (pp::MacroExpander::pushMacro):
+        (pp::MacroExpander::popMacro):
+        (pp::MacroExpander::expandMacro):
+        (pp::MacroExpander::collectMacroArgs):
+        (pp::MacroExpander::replaceMacroParams):
+        * src/compiler/preprocessor/new/MacroExpander.h: Added.
+        (pp):
+        (MacroExpander):
+        (MacroContext):
+        (pp::MacroExpander::MacroContext::MacroContext):
+        (pp::MacroExpander::MacroContext::empty):
+        (pp::MacroExpander::MacroContext::get):
+        (pp::MacroExpander::MacroContext::unget):
+        * src/compiler/preprocessor/new/Preprocessor.cpp: Added property allow-tabs.
+        (PreprocessorImpl):
+        (pp::PreprocessorImpl::PreprocessorImpl):
+        (pp):
+        (pp::Preprocessor::Preprocessor):
+        (pp::Preprocessor::~Preprocessor):
+        (pp::Preprocessor::init):
+        (pp::Preprocessor::predefineMacro):
+        (pp::Preprocessor::lex):
+        * src/compiler/preprocessor/new/Preprocessor.h: Added property allow-tabs.
+        (pp):
+        (Preprocessor):
+        * src/compiler/preprocessor/new/SourceLocation.h: Added.
+        (pp):
+        (pp::SourceLocation::SourceLocation):
+        (SourceLocation):
+        (pp::SourceLocation::equals):
+        (pp::operator==):
+        (pp::operator!=):
+        * src/compiler/preprocessor/new/Token.cpp: Added property allow-tabs.
+        (pp::Token::reset):
+        (pp::Token::equals):
+        (pp::Token::setAtStartOfLine):
+        (pp::Token::setHasLeadingSpace):
+        (pp):
+        (pp::Token::setExpansionDisabled):
+        (pp::operator<<):
+        * src/compiler/preprocessor/new/Token.h: Added property allow-tabs.
+        (pp::Token::Token):
+        (Token):
+        (pp::Token::atStartOfLine):
+        (pp::Token::hasLeadingSpace):
+        (pp::Token::expansionDisabled):
+        (pp::operator==):
+        (pp):
+        (pp::operator!=):
+        * src/compiler/preprocessor/new/Tokenizer.cpp: Added.
+        (yy_buffer_state):
+        (yy_trans_info):
+        (yyguts_t):
+        (yy_get_previous_state):
+        (yy_try_NUL_trans):
+        (input):
+        (pprestart):
+        (pp_switch_to_buffer):
+        (pp_load_buffer_state):
+        (pp_create_buffer):
+        (pp_delete_buffer):
+        (pp_init_buffer):
+        (pp_flush_buffer):
+        (pppush_buffer_state):
+        (pppop_buffer_state):
+        (ppensure_buffer_stack):
+        (pp_scan_buffer):
+        (pp_scan_string):
+        (pp_scan_bytes):
+        (yy_fatal_error):
+        (ppget_extra):
+        (ppget_lineno):
+        (ppget_column):
+        (ppget_in):
+        (ppget_out):
+        (ppget_leng):
+        (ppget_text):
+        (ppset_extra):
+        (ppset_lineno):
+        (ppset_column):
+        (ppset_in):
+        (ppset_out):
+        (ppget_debug):
+        (ppset_debug):
+        (ppget_lval):
+        (ppset_lval):
+        (ppget_lloc):
+        (ppset_lloc):
+        (pplex_init):
+        (pplex_init_extra):
+        (yy_init_globals):
+        (pplex_destroy):
+        (yy_flex_strncpy):
+        (yy_flex_strlen):
+        (ppalloc):
+        (pprealloc):
+        (ppfree):
+        (pp):
+        (pp::Tokenizer::Tokenizer):
+        (pp::Tokenizer::~Tokenizer):
+        (pp::Tokenizer::init):
+        (pp::Tokenizer::setFileNumber):
+        (pp::Tokenizer::setLineNumber):
+        (pp::Tokenizer::lex):
+        (pp::Tokenizer::initScanner):
+        (pp::Tokenizer::destroyScanner):
+        * src/compiler/preprocessor/new/Tokenizer.h: Added.
+        (pp):
+        (Tokenizer):
+        (Context):
+        * src/compiler/preprocessor/new/Tokenizer.l: Added.
+        * src/compiler/preprocessor/new/generate_parser.sh: Added property allow-tabs.
+        * src/compiler/preprocessor/new/pp.l: Removed.
+        * src/compiler/preprocessor/new/pp.y: Removed.
+        * src/compiler/preprocessor/new/pp_lex.cpp: Removed.
+        * src/compiler/preprocessor/new/pp_tab.cpp: Removed.
+        * src/compiler/preprocessor/new/pp_tab.h: Removed.
+        * src/compiler/preprocessor/new/pp_utils.h: Added.
+        * src/compiler/preprocessor/new/preprocessor.vcproj: Added.
+        * src/compiler/preprocessor/new/stl_utils.h: Removed.
+        * src/compiler/preprocessor/new/token_type.h: Removed.
+        * src/compiler/preprocessor/preprocess.h:
+        * src/compiler/preprocessor/scanner.c:
+        (InitScannerInput):
+        * src/compiler/preprocessor/scanner.h:
+        * src/compiler/preprocessor/symbols.h:
+        * src/compiler/preprocessor/tokens.c:
+        (ReadToken):
+        (DumpTokenStream):
+        * src/compiler/preprocessor/tokens.h:
+        * src/compiler/timing: Added.
+        * src/compiler/timing/RestrictFragmentShaderTiming.cpp: Added.
+        (RestrictFragmentShaderTiming::RestrictFragmentShaderTiming):
+        (RestrictFragmentShaderTiming::enforceRestrictions):
+        (RestrictFragmentShaderTiming::validateUserDefinedFunctionCallUsage):
+        (RestrictFragmentShaderTiming::beginError):
+        (RestrictFragmentShaderTiming::isSamplingOp):
+        (RestrictFragmentShaderTiming::visitArgument):
+        (RestrictFragmentShaderTiming::visitSelection):
+        (RestrictFragmentShaderTiming::visitLoop):
+        (RestrictFragmentShaderTiming::visitLogicalOp):
+        * src/compiler/timing/RestrictFragmentShaderTiming.h: Added.
+        (RestrictFragmentShaderTiming):
+        (RestrictFragmentShaderTiming::numErrors):
+        * src/compiler/timing/RestrictVertexShaderTiming.cpp: Added.
+        (RestrictVertexShaderTiming::visitSymbol):
+        * src/compiler/timing/RestrictVertexShaderTiming.h: Added.
+        (RestrictVertexShaderTiming):
+        (RestrictVertexShaderTiming::RestrictVertexShaderTiming):
+        (RestrictVertexShaderTiming::enforceRestrictions):
+        (RestrictVertexShaderTiming::numErrors):
+        * src/libEGL/Display.cpp:
+        (egl):
+        (egl::Display::getDepthTextureSupport):
+        (egl::Display::getTexturePool):
+        * src/libEGL/Display.h:
+        (Display):
+        * src/libEGL/Surface.cpp:
+        (egl::Surface::Surface):
+        (egl::Surface::release):
+        (egl::Surface::resetSwapChain):
+        (egl::Surface::swapRect):
+        (egl):
+        (egl::Surface::swap):
+        (egl::Surface::postSubBuffer):
+        * src/libEGL/Surface.h:
+        (Surface):
+        * src/libEGL/libEGL.cpp:
+        * src/libGLESv2/Context.cpp:
+        (gl::Context::makeCurrent):
+        (gl::Context::markDxUniformsDirty):
+        (gl):
+        (gl::Context::getIntegerv):
+        (gl::Context::getQueryParameterInfo):
+        (gl::Context::applyRenderTarget):
+        (gl::Context::applyState):
+        (gl::Context::applyShaders):
+        (gl::Context::applyTextures):
+        (gl::Context::readPixels):
+        (gl::Context::clear):
+        (gl::Context::drawArrays):
+        (gl::Context::drawElements):
+        (gl::Context::supportsDepthTextures):
+        (gl::Context::initExtensionString):
+        (gl::Context::blitFramebuffer):
+        (gl::VertexDeclarationCache::applyDeclaration):
+        * src/libGLESv2/Context.h:
+        (Context):
+        * src/libGLESv2/Framebuffer.cpp:
+        (gl::Framebuffer::~Framebuffer):
+        (gl):
+        (gl::Framebuffer::getNullColorbuffer):
+        (gl::Framebuffer::completeness):
+        * src/libGLESv2/Framebuffer.h:
+        (Framebuffer):
+        * src/libGLESv2/Program.cpp:
+        (gl):
+        (gl::AttributeBindings::AttributeBindings):
+        (gl::AttributeBindings::~AttributeBindings):
+        (gl::InfoLog::InfoLog):
+        (gl::InfoLog::~InfoLog):
+        (gl::InfoLog::getLength):
+        (gl::InfoLog::getLog):
+        (gl::InfoLog::appendSanitized):
+        (gl::InfoLog::append):
+        (gl::InfoLog::reset):
+        (gl::Program::Program):
+        (gl::Program::~Program):
+        (gl::Program::attachShader):
+        (gl::Program::detachShader):
+        (gl::Program::getAttachedShadersCount):
+        (gl::AttributeBindings::bindAttributeLocation):
+        (gl::Program::bindAttributeLocation):
+        (gl::Program::link):
+        (gl::AttributeBindings::getAttributeBinding):
+        (gl::Program::unlink):
+        (gl::Program::getProgramBinary):
+        (gl::Program::setProgramBinary):
+        (gl::Program::getInfoLogLength):
+        (gl::Program::getInfoLog):
+        (gl::Program::getActiveAttribute):
+        (gl::Program::getActiveAttributeCount):
+        (gl::Program::getActiveAttributeMaxLength):
+        (gl::Program::getActiveUniform):
+        (gl::Program::getActiveUniformCount):
+        (gl::Program::getActiveUniformMaxLength):
+        (gl::Program::validate):
+        (gl::Program::isValidated):
+        * src/libGLESv2/Program.h:
+        (gl):
+        (AttributeBindings):
+        (InfoLog):
+        (Program):
+        * src/libGLESv2/ProgramBinary.cpp: Added.
+        (gl::str):
+        (gl):
+        (gl::Uniform::Uniform):
+        (gl::Uniform::~Uniform):
+        (gl::Uniform::isArray):
+        (gl::UniformLocation::UniformLocation):
+        (gl::ProgramBinary::ProgramBinary):
+        (gl::ProgramBinary::~ProgramBinary):
+        (gl::ProgramBinary::getPixelShader):
+        (gl::ProgramBinary::getVertexShader):
+        (gl::ProgramBinary::getAttributeLocation):
+        (gl::ProgramBinary::getSemanticIndex):
+        (gl::ProgramBinary::getUsedSamplerRange):
+        (gl::ProgramBinary::getSamplerMapping):
+        (gl::ProgramBinary::getSamplerTextureType):
+        (gl::ProgramBinary::getUniformLocation):
+        (gl::ProgramBinary::setUniform1fv):
+        (gl::ProgramBinary::setUniform2fv):
+        (gl::ProgramBinary::setUniform3fv):
+        (gl::ProgramBinary::setUniform4fv):
+        (gl::transposeMatrix):
+        (gl::ProgramBinary::setUniformMatrix2fv):
+        (gl::ProgramBinary::setUniformMatrix3fv):
+        (gl::ProgramBinary::setUniformMatrix4fv):
+        (gl::ProgramBinary::setUniform1iv):
+        (gl::ProgramBinary::setUniform2iv):
+        (gl::ProgramBinary::setUniform3iv):
+        (gl::ProgramBinary::setUniform4iv):
+        (gl::ProgramBinary::getUniformfv):
+        (gl::ProgramBinary::getUniformiv):
+        (gl::ProgramBinary::dirtyAllUniforms):
+        (gl::ProgramBinary::applyUniforms):
+        (gl::ProgramBinary::compileToBinary):
+        (gl::ProgramBinary::packVaryings):
+        (gl::ProgramBinary::linkVaryings):
+        (gl::ProgramBinary::link):
+        (gl::ProgramBinary::linkAttributes):
+        (gl::ProgramBinary::linkUniforms):
+        (gl::ProgramBinary::defineUniform):
+        (gl::ProgramBinary::createUniform):
+        (gl::ProgramBinary::decorateAttribute):
+        (gl::ProgramBinary::undecorateUniform):
+        (gl::ProgramBinary::applyUniformnbv):
+        (gl::ProgramBinary::applyUniformnfv):
+        (gl::ProgramBinary::applyUniform1iv):
+        (gl::ProgramBinary::applyUniform2iv):
+        (gl::ProgramBinary::applyUniform3iv):
+        (gl::ProgramBinary::applyUniform4iv):
+        (gl::ProgramBinary::applyUniformniv):
+        (gl::ProgramBinary::isValidated):
+        (gl::ProgramBinary::getActiveAttribute):
+        (gl::ProgramBinary::getActiveAttributeCount):
+        (gl::ProgramBinary::getActiveAttributeMaxLength):
+        (gl::ProgramBinary::getActiveUniform):
+        (gl::ProgramBinary::getActiveUniformCount):
+        (gl::ProgramBinary::getActiveUniformMaxLength):
+        (gl::ProgramBinary::validate):
+        (gl::ProgramBinary::validateSamplers):
+        (gl::ProgramBinary::getDxDepthRangeLocation):
+        (gl::ProgramBinary::getDxDepthLocation):
+        (gl::ProgramBinary::getDxCoordLocation):
+        (gl::ProgramBinary::getDxHalfPixelSizeLocation):
+        (gl::ProgramBinary::getDxFrontCCWLocation):
+        (gl::ProgramBinary::getDxPointsOrLinesLocation):
+        * src/libGLESv2/ProgramBinary.h: Added.
+        (gl):
+        (Uniform):
+        (gl::Uniform::RegisterInfo::RegisterInfo):
+        (RegisterInfo):
+        (gl::Uniform::RegisterInfo::set):
+        (UniformLocation):
+        (ProgramBinary):
+        (Sampler):
+        * src/libGLESv2/Renderbuffer.cpp:
+        (gl):
+        (gl::RenderbufferTexture2D::RenderbufferTexture2D):
+        (gl::RenderbufferTexture2D::~RenderbufferTexture2D):
+        (gl::RenderbufferTexture2D::addProxyRef):
+        (gl::RenderbufferTexture2D::releaseProxy):
+        (gl::RenderbufferTexture2D::getRenderTarget):
+        (gl::RenderbufferTexture2D::getDepthStencil):
+        (gl::RenderbufferTexture2D::getWidth):
+        (gl::RenderbufferTexture2D::getHeight):
+        (gl::RenderbufferTexture2D::getInternalFormat):
+        (gl::RenderbufferTexture2D::getD3DFormat):
+        (gl::RenderbufferTexture2D::getSamples):
+        (gl::RenderbufferTexture2D::getSerial):
+        (gl::RenderbufferTextureCubeMap::RenderbufferTextureCubeMap):
+        (gl::RenderbufferTextureCubeMap::~RenderbufferTextureCubeMap):
+        (gl::RenderbufferTextureCubeMap::addProxyRef):
+        (gl::RenderbufferTextureCubeMap::releaseProxy):
+        (gl::RenderbufferTextureCubeMap::getRenderTarget):
+        (gl::RenderbufferTextureCubeMap::getDepthStencil):
+        (gl::RenderbufferTextureCubeMap::getWidth):
+        (gl::RenderbufferTextureCubeMap::getHeight):
+        (gl::RenderbufferTextureCubeMap::getInternalFormat):
+        (gl::RenderbufferTextureCubeMap::getD3DFormat):
+        (gl::RenderbufferTextureCubeMap::getSamples):
+        (gl::RenderbufferTextureCubeMap::getSerial):
+        (gl::DepthStencilbuffer::getDepthStencil):
+        * src/libGLESv2/Renderbuffer.h:
+        (gl):
+        (RenderbufferTexture2D):
+        (RenderbufferTextureCubeMap):
+        * src/libGLESv2/Shader.cpp:
+        (gl::Shader::getInfoLog):
+        (gl::Shader::getSourceImpl):
+        * src/libGLESv2/Shader.h:
+        (Shader):
+        (VertexShader):
+        * src/libGLESv2/Texture.cpp:
+        (gl::ConvertTextureFormatType):
+        (gl::IsTextureFormatRenderable):
+        (gl::GetTextureUsage):
+        (gl):
+        (gl::Image::createSurface):
+        (gl::Image::updateSurface):
+        (gl::Image::loadData):
+        (gl::Image::loadAlphaData):
+        (gl::Image::loadAlphaDataSSE2):
+        (gl::Image::loadAlphaFloatData):
+        (gl::Image::loadAlphaHalfFloatData):
+        (gl::Image::loadLuminanceData):
+        (gl::Image::loadLuminanceFloatData):
+        (gl::Image::loadLuminanceHalfFloatData):
+        (gl::Image::loadLuminanceAlphaData):
+        (gl::Image::loadLuminanceAlphaFloatData):
+        (gl::Image::loadLuminanceAlphaHalfFloatData):
+        (gl::Image::loadRGBUByteData):
+        (gl::Image::loadRGB565Data):
+        (gl::Image::loadRGBFloatData):
+        (gl::Image::loadRGBHalfFloatData):
+        (gl::Image::loadRGBAUByteDataSSE2):
+        (gl::Image::loadRGBAUByteData):
+        (gl::Image::loadRGBA4444Data):
+        (gl::Image::loadRGBA5551Data):
+        (gl::Image::loadRGBAFloatData):
+        (gl::Image::loadRGBAHalfFloatData):
+        (gl::Image::loadBGRAData):
+        (gl::Image::loadCompressedData):
+        (gl::Image::copy):
+        (gl::TextureStorage::TextureStorage):
+        (gl::TextureStorage::isRenderTarget):
+        (gl::TextureStorage::getUsage):
+        (gl::Texture::setImage):
+        (gl::Texture::setCompressedImage):
+        (gl::Texture::subImage):
+        (gl::Texture::subImageCompressed):
+        (gl::TextureStorage2D::TextureStorage2D):
+        (gl::Texture2D::getInternalFormat):
+        (gl::Texture2D::getD3DFormat):
+        (gl::Texture2D::copyImage):
+        (gl::Texture2D::copySubImage):
+        (gl::Texture2D::storage):
+        (gl::Texture2D::isSamplerComplete):
+        (gl::Texture2D::isCompressed):
+        (gl::Texture2D::isDepth):
+        (gl::Texture2D::createTexture):
+        (gl::Texture2D::convertToRenderTarget):
+        (gl::Texture2D::getRenderbuffer):
+        (gl::Texture2D::getRenderTarget):
+        (gl::Texture2D::getDepthStencil):
+        (gl::TextureStorageCubeMap::TextureStorageCubeMap):
+        (gl::TextureCubeMap::getWidth):
+        (gl::TextureCubeMap::getHeight):
+        (gl::TextureCubeMap::getInternalFormat):
+        (gl::TextureCubeMap::getD3DFormat):
+        (gl::TextureCubeMap::isSamplerComplete):
+        (gl::TextureCubeMap::isCompressed):
+        (gl::TextureCubeMap::createTexture):
+        (gl::TextureCubeMap::convertToRenderTarget):
+        (gl::TextureCubeMap::copyImage):
+        (gl::TextureCubeMap::copySubImage):
+        (gl::TextureCubeMap::storage):
+        (gl::TextureCubeMap::getRenderbuffer):
+        * src/libGLESv2/Texture.h:
+        (Image):
+        (TextureStorage):
+        (Texture):
+        (TextureStorage2D):
+        (Texture2D):
+        (TextureStorageCubeMap):
+        (TextureCubeMap):
+        * src/libGLESv2/VertexDataManager.cpp:
+        (gl::VertexDataManager::prepareVertexData):
+        * src/libGLESv2/libGLESv2.cpp:
+        (checkTextureFormatType):
+        (validateSubImageParams2D):
+        (validateSubImageParamsCube):
+        * src/libGLESv2/libGLESv2.vcproj:
+        * src/libGLESv2/mathutil.h:
+        (gl):
+        * src/libGLESv2/utilities.cpp:
+        (gl::IsDepthTexture):
+        (gl):
+        (gl::ComputePixelSize):
+        (gl::ExtractFormat):
+        (gl::ExtractType):
+        (es2dx::ConvertCubeFace):
+        (es2dx::ConvertRenderbufferFormat):
+        (dx2es::GetStencilSize):
+        (dx2es::GetDepthSize):
+        (dx2es::IsDepthTextureFormat):
+        (dx2es):
+        (dx2es::IsStencilTextureFormat):
+        (dx2es::ConvertDepthStencilFormat):
+        * src/libGLESv2/utilities.h:
+        (gl):
+        (dx2es):
+
 2012-07-11  Mark Rowe  <mrowe@apple.com>
 
         <http://webkit.org/b/91024> Build against the latest SDK when targeting older OS X versions.
index a124014..e297fbf 100644 (file)
@@ -238,6 +238,11 @@ typedef void* GLeglImageOES;
 #define GL_VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE                    0x88FE
 #endif
 
+/* GL_ANGLE_program_binary */
+#ifndef GL_ANGLE_program_binary
+#define GL_PROGRAM_BINARY_ANGLE                                 0x93A6
+#endif
+
 /*------------------------------------------------------------------------*
  * APPLE extension tokens
  *------------------------------------------------------------------------*/
@@ -1487,6 +1492,11 @@ typedef void (GL_APIENTRYP PFNGLENDTILINGQCOMPROC) (GLbitfield preserveMask);
 #define GL_VIV_shader_binary 1
 #endif
 
+/* GL_ANGLE_program_binary */
+#ifndef GL_ANGLE_program_binary
+#define GL_ANGLE_program_binary 1
+#endif
+
 #ifdef __cplusplus
 }
 #endif
index a3fc935..9a4a36d 100644 (file)
@@ -34,7 +34,7 @@ extern "C" {
 
 // Version number for shader translation API.
 // It is incremented everytime the API changes.
-#define SH_VERSION 105
+#define SH_VERSION 107
 
 //
 // The names of the following enums have been derived by replacing GL prefix
@@ -49,7 +49,29 @@ typedef enum {
 
 typedef enum {
   SH_GLES2_SPEC = 0x8B40,
-  SH_WEBGL_SPEC = 0x8B41
+  SH_WEBGL_SPEC = 0x8B41,
+
+  // The CSS Shaders spec is a subset of the WebGL spec.
+  //
+  // In both CSS vertex and fragment shaders, ANGLE:
+  // (1) Reserves the "css_" prefix.
+  // (2) Renames the main function to css_main.
+  // (3) Disables the gl_MaxDrawBuffers built-in.
+  //
+  // In CSS fragment shaders, ANGLE:
+  // (1) Disables the gl_FragColor built-in.
+  // (2) Disables the gl_FragData built-in.
+  // (3) Enables the css_MixColor built-in.
+  // (4) Enables the css_ColorMatrix built-in.
+  //
+  // After passing a CSS shader through ANGLE, the browser is expected to append
+  // a new main function to it.
+  // This new main function will call the css_main function.
+  // It may also perform additional operations like varying assignment, texture
+  // access, and gl_FragColor assignment in order to implement the CSS Shaders
+  // blend modes.
+  //
+  SH_CSS_SHADERS_SPEC = 0x8B42
 } ShShaderSpec;
 
 typedef enum {
@@ -104,7 +126,23 @@ typedef enum {
   SH_UNROLL_FOR_LOOP_WITH_INTEGER_INDEX = 0x0080,
 
   // This is needed only as a workaround for certain OpenGL driver bugs.
-  SH_EMULATE_BUILT_IN_FUNCTIONS = 0x0100
+  SH_EMULATE_BUILT_IN_FUNCTIONS = 0x0100,
+
+  // This is an experimental flag to enforce restrictions that aim to prevent 
+  // timing attacks.
+  // It generates compilation errors for shaders that could expose sensitive
+  // texture information via the timing channel.
+  // To use this flag, you must compile the shader under the WebGL spec
+  // (using the SH_WEBGL_SPEC flag).
+  SH_TIMING_RESTRICTIONS = 0x0200,
+    
+  // This flag prints the dependency graph that is used to enforce timing
+  // restrictions on fragment shaders.
+  // This flag only has an effect if all of the following are true:
+  // - The shader spec is SH_WEBGL_SPEC.
+  // - The compile options contain the SH_TIMING_RESTRICTIONS flag.
+  // - The shader type is SH_FRAGMENT_SHADER.
+  SH_DEPENDENCY_GRAPH = 0x0400
 } ShCompileOptions;
 
 //
index 409b622..565db7d 100644 (file)
                888F1382498E2D74AF2801C8 /* debug.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4ABA230FEA3654B030E4C4FB /* debug.cpp */; };
                896B720BD21F6749A7D83F30 /* MapLongVariableNames.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 57CF1F83E842901C42D44825 /* MapLongVariableNames.cpp */; };
                93A41AF036E5EF87B366B563 /* TranslatorESSL.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0A3A260F5379A7E2655D40F3 /* TranslatorESSL.cpp */; };
-               9886BCD5D0DD69B6FDE09DD8 /* UnfoldSelect.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E3711A48A0BF16B1CBD77AC9 /* UnfoldSelect.cpp */; };
                9B111B83FB636FD5CDEC32A0 /* OutputGLSLBase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCDF01F002ADE9DB8A3EF4FE /* OutputGLSLBase.cpp */; };
                9E8DFE1CCEF038BF2B65428C /* parseConst.cpp in Sources */ = {isa = PBXBuildFile; fileRef = D2C9C8EB4A7EFF5B67FF9DBF /* parseConst.cpp */; };
+               A201083B159C31A000E57BBE /* Diagnostics.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A201081F159C31A000E57BBE /* Diagnostics.cpp */; };
+               A201083C159C31A000E57BBE /* DirectiveHandler.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A2010821159C31A000E57BBE /* DirectiveHandler.cpp */; };
+               A201083D159C31A000E57BBE /* DirectiveParser.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A2010823159C31A000E57BBE /* DirectiveParser.cpp */; };
+               A201083E159C31A000E57BBE /* ExpressionParser.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A2010825159C31A000E57BBE /* ExpressionParser.cpp */; };
+               A2010840159C31A000E57BBE /* Input.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A2010829159C31A000E57BBE /* Input.cpp */; };
+               A2010841159C31A000E57BBE /* Lexer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A201082B159C31A000E57BBE /* Lexer.cpp */; };
+               A2010842159C31A000E57BBE /* Macro.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A201082D159C31A000E57BBE /* Macro.cpp */; };
+               A2010843159C31A000E57BBE /* MacroExpander.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A201082F159C31A000E57BBE /* MacroExpander.cpp */; };
+               A2010844159C31A000E57BBE /* Preprocessor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A2010832159C31A000E57BBE /* Preprocessor.cpp */; };
+               A2010845159C31A000E57BBE /* Token.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A2010836159C31A000E57BBE /* Token.cpp */; };
+               A2010846159C31A000E57BBE /* Tokenizer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A2010838159C31A000E57BBE /* Tokenizer.cpp */; };
+               A2010862159C324F00E57BBE /* BuiltInFunctionEmulator.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A2010849159C324F00E57BBE /* BuiltInFunctionEmulator.cpp */; };
+               A2010863159C324F00E57BBE /* DependencyGraph.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A201084C159C324F00E57BBE /* DependencyGraph.cpp */; };
+               A2010864159C324F00E57BBE /* DependencyGraphBuilder.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A201084E159C324F00E57BBE /* DependencyGraphBuilder.cpp */; };
+               A2010865159C324F00E57BBE /* DependencyGraphOutput.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A2010850159C324F00E57BBE /* DependencyGraphOutput.cpp */; };
+               A2010866159C324F00E57BBE /* DependencyGraphTraverse.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A2010852159C324F00E57BBE /* DependencyGraphTraverse.cpp */; };
+               A2010867159C324F00E57BBE /* DetectRecursion.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A2010853159C324F00E57BBE /* DetectRecursion.cpp */; };
+               A2010868159C324F00E57BBE /* Diagnostics.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A2010855159C324F00E57BBE /* Diagnostics.cpp */; };
+               A2010869159C324F00E57BBE /* DirectiveHandler.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A2010857159C324F00E57BBE /* DirectiveHandler.cpp */; };
+               A201086A159C324F00E57BBE /* InitializeParseContext.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A201085A159C324F00E57BBE /* InitializeParseContext.cpp */; };
+               A201086B159C324F00E57BBE /* RestrictFragmentShaderTiming.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A201085E159C324F00E57BBE /* RestrictFragmentShaderTiming.cpp */; };
+               A201086C159C324F00E57BBE /* RestrictVertexShaderTiming.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A2010860159C324F00E57BBE /* RestrictVertexShaderTiming.cpp */; };
+               A2010871159C326200E57BBE /* DetectDiscontinuity.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A201086D159C326200E57BBE /* DetectDiscontinuity.cpp */; };
+               A2010872159C326200E57BBE /* UnfoldShortCircuit.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A201086F159C326200E57BBE /* UnfoldShortCircuit.cpp */; };
                AC23F58FDD3C55F5CA18EED7 /* RemoveTree.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B436EFF06913FCB19C3522A7 /* RemoveTree.cpp */; };
                AD85517F086FDCEF3947C403 /* symbols.c in Sources */ = {isa = PBXBuildFile; fileRef = F013A7240BDAE8A61413D8C0 /* symbols.c */; };
                B4858417E54365BE8CDE3919 /* ossource_posix.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BE258486005F6696CC031622 /* ossource_posix.cpp */; };
                27C11EE10FED2979931FFC11 /* VariableInfo.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = VariableInfo.cpp; sourceTree = "<group>"; };
                27E4C7ED0B82E18DCBEDF1C9 /* BaseTypes.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = BaseTypes.h; sourceTree = "<group>"; };
                294F442A2606FEC55F12A28E /* memory.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = memory.c; sourceTree = "<group>"; };
-               2A765B86CBAF0D4A3E69DCA7 /* UnfoldSelect.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = UnfoldSelect.h; sourceTree = "<group>"; };
                2D00745DA9914FDE274D03D5 /* tokens.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = tokens.c; sourceTree = "<group>"; };
                2E7C9B6E6DB751E12A2F6CB6 /* InitializeGlobals.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = InitializeGlobals.h; sourceTree = "<group>"; };
                3DDDC77216202A4DE1808BDB /* libtranslator_common.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libtranslator_common.a; sourceTree = BUILT_PRODUCTS_DIR; };
                9D47B1AC82E4EE859AC54243 /* QualifierAlive.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = QualifierAlive.h; sourceTree = "<group>"; };
                A0CE43631849276A31187C7B /* InitializeDll.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = InitializeDll.h; sourceTree = "<group>"; };
                A1644B00E9304C407FDC5F47 /* libtranslator_glsl.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libtranslator_glsl.a; sourceTree = BUILT_PRODUCTS_DIR; };
+               A20107FF159C313C00E57BBE /* libtranslator_common copy.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libtranslator_common copy.a"; sourceTree = BUILT_PRODUCTS_DIR; };
+               A201081F159C31A000E57BBE /* Diagnostics.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Diagnostics.cpp; sourceTree = "<group>"; };
+               A2010820159C31A000E57BBE /* Diagnostics.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Diagnostics.h; sourceTree = "<group>"; };
+               A2010821159C31A000E57BBE /* DirectiveHandler.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DirectiveHandler.cpp; sourceTree = "<group>"; };
+               A2010822159C31A000E57BBE /* DirectiveHandler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DirectiveHandler.h; sourceTree = "<group>"; };
+               A2010823159C31A000E57BBE /* DirectiveParser.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DirectiveParser.cpp; sourceTree = "<group>"; };
+               A2010824159C31A000E57BBE /* DirectiveParser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DirectiveParser.h; sourceTree = "<group>"; };
+               A2010825159C31A000E57BBE /* ExpressionParser.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ExpressionParser.cpp; sourceTree = "<group>"; };
+               A2010826159C31A000E57BBE /* ExpressionParser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ExpressionParser.h; sourceTree = "<group>"; };
+               A2010829159C31A000E57BBE /* Input.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Input.cpp; sourceTree = "<group>"; };
+               A201082A159C31A000E57BBE /* Input.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Input.h; sourceTree = "<group>"; };
+               A201082B159C31A000E57BBE /* Lexer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Lexer.cpp; sourceTree = "<group>"; };
+               A201082C159C31A000E57BBE /* Lexer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Lexer.h; sourceTree = "<group>"; };
+               A201082D159C31A000E57BBE /* Macro.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Macro.cpp; sourceTree = "<group>"; };
+               A201082E159C31A000E57BBE /* Macro.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Macro.h; sourceTree = "<group>"; };
+               A201082F159C31A000E57BBE /* MacroExpander.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MacroExpander.cpp; sourceTree = "<group>"; };
+               A2010830159C31A000E57BBE /* MacroExpander.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MacroExpander.h; sourceTree = "<group>"; };
+               A2010831159C31A000E57BBE /* pp_utils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = pp_utils.h; sourceTree = "<group>"; };
+               A2010832159C31A000E57BBE /* Preprocessor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Preprocessor.cpp; sourceTree = "<group>"; };
+               A2010833159C31A000E57BBE /* Preprocessor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Preprocessor.h; sourceTree = "<group>"; };
+               A2010835159C31A000E57BBE /* SourceLocation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SourceLocation.h; sourceTree = "<group>"; };
+               A2010836159C31A000E57BBE /* Token.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Token.cpp; sourceTree = "<group>"; };
+               A2010837159C31A000E57BBE /* Token.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Token.h; sourceTree = "<group>"; };
+               A2010838159C31A000E57BBE /* Tokenizer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Tokenizer.cpp; sourceTree = "<group>"; };
+               A2010839159C31A000E57BBE /* Tokenizer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Tokenizer.h; sourceTree = "<group>"; };
+               A2010848159C320900E57BBE /* length_limits.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = length_limits.h; sourceTree = "<group>"; };
+               A2010849159C324F00E57BBE /* BuiltInFunctionEmulator.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = BuiltInFunctionEmulator.cpp; sourceTree = "<group>"; };
+               A201084A159C324F00E57BBE /* BuiltInFunctionEmulator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BuiltInFunctionEmulator.h; sourceTree = "<group>"; };
+               A201084C159C324F00E57BBE /* DependencyGraph.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DependencyGraph.cpp; sourceTree = "<group>"; };
+               A201084D159C324F00E57BBE /* DependencyGraph.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DependencyGraph.h; sourceTree = "<group>"; };
+               A201084E159C324F00E57BBE /* DependencyGraphBuilder.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DependencyGraphBuilder.cpp; sourceTree = "<group>"; };
+               A201084F159C324F00E57BBE /* DependencyGraphBuilder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DependencyGraphBuilder.h; sourceTree = "<group>"; };
+               A2010850159C324F00E57BBE /* DependencyGraphOutput.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DependencyGraphOutput.cpp; sourceTree = "<group>"; };
+               A2010851159C324F00E57BBE /* DependencyGraphOutput.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DependencyGraphOutput.h; sourceTree = "<group>"; };
+               A2010852159C324F00E57BBE /* DependencyGraphTraverse.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DependencyGraphTraverse.cpp; sourceTree = "<group>"; };
+               A2010853159C324F00E57BBE /* DetectRecursion.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DetectRecursion.cpp; sourceTree = "<group>"; };
+               A2010854159C324F00E57BBE /* DetectRecursion.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DetectRecursion.h; sourceTree = "<group>"; };
+               A2010855159C324F00E57BBE /* Diagnostics.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Diagnostics.cpp; sourceTree = "<group>"; };
+               A2010856159C324F00E57BBE /* Diagnostics.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Diagnostics.h; sourceTree = "<group>"; };
+               A2010857159C324F00E57BBE /* DirectiveHandler.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DirectiveHandler.cpp; sourceTree = "<group>"; };
+               A2010858159C324F00E57BBE /* DirectiveHandler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DirectiveHandler.h; sourceTree = "<group>"; };
+               A2010859159C324F00E57BBE /* ExtensionBehavior.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ExtensionBehavior.h; sourceTree = "<group>"; };
+               A201085A159C324F00E57BBE /* InitializeParseContext.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InitializeParseContext.cpp; sourceTree = "<group>"; };
+               A201085B159C324F00E57BBE /* Pragma.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Pragma.h; sourceTree = "<group>"; };
+               A201085C159C324F00E57BBE /* RenameFunction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RenameFunction.h; sourceTree = "<group>"; };
+               A201085E159C324F00E57BBE /* RestrictFragmentShaderTiming.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RestrictFragmentShaderTiming.cpp; sourceTree = "<group>"; };
+               A201085F159C324F00E57BBE /* RestrictFragmentShaderTiming.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RestrictFragmentShaderTiming.h; sourceTree = "<group>"; };
+               A2010860159C324F00E57BBE /* RestrictVertexShaderTiming.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RestrictVertexShaderTiming.cpp; sourceTree = "<group>"; };
+               A2010861159C324F00E57BBE /* RestrictVertexShaderTiming.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RestrictVertexShaderTiming.h; sourceTree = "<group>"; };
+               A201086D159C326200E57BBE /* DetectDiscontinuity.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DetectDiscontinuity.cpp; sourceTree = "<group>"; };
+               A201086E159C326200E57BBE /* DetectDiscontinuity.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DetectDiscontinuity.h; sourceTree = "<group>"; };
+               A201086F159C326200E57BBE /* UnfoldShortCircuit.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UnfoldShortCircuit.cpp; sourceTree = "<group>"; };
+               A2010870159C326200E57BBE /* UnfoldShortCircuit.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UnfoldShortCircuit.h; sourceTree = "<group>"; };
                A447F75F33DA4C4C123AC952 /* libtranslator_hlsl.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libtranslator_hlsl.a; sourceTree = BUILT_PRODUCTS_DIR; };
                A51C728B615B41E1D59E9902 /* util.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = util.h; sourceTree = "<group>"; };
                A54F2ED0D82D7BBCA4E9EEEA /* Initialize.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = Initialize.cpp; sourceTree = "<group>"; };
                DDD3B7E3B7B35A0B8469AB87 /* TranslatorGLSL.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = TranslatorGLSL.h; sourceTree = "<group>"; };
                DEAF6F3126C2EC4397785C3F /* intermOut.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = intermOut.cpp; sourceTree = "<group>"; };
                DEEAFC618A3B33F1FBFE3536 /* MMap.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MMap.h; sourceTree = "<group>"; };
-               E3711A48A0BF16B1CBD77AC9 /* UnfoldSelect.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = UnfoldSelect.cpp; sourceTree = "<group>"; };
                E3A29B6E9C21B67C25FF0D2B /* TranslatorHLSL.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = TranslatorHLSL.h; sourceTree = "<group>"; };
                F013A7240BDAE8A61413D8C0 /* symbols.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = symbols.c; sourceTree = "<group>"; };
                F3E09DC8E1BF5D2958AACEDE /* SearchSymbol.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SearchSymbol.h; sourceTree = "<group>"; };
 /* End PBXFileReference section */
 
 /* Begin PBXFrameworksBuildPhase section */
+               A20107FB159C313C00E57BBE /* Frameworks */ = {
+                       isa = PBXFrameworksBuildPhase;
+                       buildActionMask = 2147483647;
+                       files = (
+                       );
+                       runOnlyForDeploymentPostprocessing = 0;
+               };
                A5C994E74DB1E60338E7BC11 /* Frameworks */ = {
                        isa = PBXFrameworksBuildPhase;
                        buildActionMask = 2147483647;
                                B75707B393B7EAB7DD9999CB /* cpp.c */,
                                528FF201839C6F233E26FFDA /* cpp.h */,
                                8058A0A2A0A02386867517EA /* cppstruct.c */,
+                               A2010848159C320900E57BBE /* length_limits.h */,
                                294F442A2606FEC55F12A28E /* memory.c */,
                                831399DEE5DABA09570FB3E7 /* memory.h */,
+                               A201081E159C31A000E57BBE /* new */,
                                CFD12C6E46EBE0839BBE52B5 /* parser.h */,
                                6BBC8224B9D8E234D117FA0C /* preprocess.h */,
                                FF3AA694DF9A4455A813234D /* scanner.c */,
                196DB6AB006BB83503C7D786 /* Source */ = {
                        isa = PBXGroup;
                        children = (
-                               0E8D65F584FDB84DAABD3969 /* preprocessor */,
                                27E4C7ED0B82E18DCBEDF1C9 /* BaseTypes.h */,
+                               A2010849159C324F00E57BBE /* BuiltInFunctionEmulator.cpp */,
+                               A201084A159C324F00E57BBE /* BuiltInFunctionEmulator.h */,
                                B7B1127C75B576FC00D74AED /* CodeGenGLSL.cpp */,
                                C49549DCCAF450EB761520E1 /* CodeGenHLSL.cpp */,
                                F74618F18FE5448115017C44 /* Common.h */,
                                0A118E5003E5C0E253C53839 /* Compiler.cpp */,
                                B2F5CA11EEA92DF2384EFD93 /* ConstantUnion.h */,
+                               4ABA230FEA3654B030E4C4FB /* debug.cpp */,
+                               95276AA6B36FC1B1D913FCE4 /* debug.h */,
+                               A201084B159C324F00E57BBE /* depgraph */,
+                               A201086D159C326200E57BBE /* DetectDiscontinuity.cpp */,
+                               A201086E159C326200E57BBE /* DetectDiscontinuity.h */,
+                               A2010853159C324F00E57BBE /* DetectRecursion.cpp */,
+                               A2010854159C324F00E57BBE /* DetectRecursion.h */,
+                               A2010855159C324F00E57BBE /* Diagnostics.cpp */,
+                               A2010856159C324F00E57BBE /* Diagnostics.h */,
+                               A2010857159C324F00E57BBE /* DirectiveHandler.cpp */,
+                               A2010858159C324F00E57BBE /* DirectiveHandler.h */,
+                               A2010859159C324F00E57BBE /* ExtensionBehavior.h */,
                                5DC9B647E10F65F66142ECC1 /* ForLoopUnroll.cpp */,
                                182BAD50D4E58B884F5EB9F3 /* ForLoopUnroll.h */,
+                               497C5C24EEF466FB4B50A259 /* glslang.h */,
+                               73A57C6D413773AEBA3C47A6 /* glslang_lex.cpp */,
+                               3F68A6AA811495718A6938C0 /* glslang_tab.cpp */,
+                               4FCF32CB2D8A42C930A66B00 /* glslang_tab.h */,
                                6E6927BE5D3C2C82F86111DF /* InfoSink.cpp */,
                                F7B2971D4EB3836B94B7ECAF /* InfoSink.h */,
                                A54F2ED0D82D7BBCA4E9EEEA /* Initialize.cpp */,
                                60C3998C9CE66DE0C5B0FD99 /* InitializeDll.cpp */,
                                A0CE43631849276A31187C7B /* InitializeDll.h */,
                                2E7C9B6E6DB751E12A2F6CB6 /* InitializeGlobals.h */,
+                               A201085A159C324F00E57BBE /* InitializeParseContext.cpp */,
                                85845FFF5A8E63364308236D /* InitializeParseContext.h */,
-                               C4FE988EF9A293867E5C771B /* IntermTraverse.cpp */,
                                3F7C486C370A72938FE8160F /* Intermediate.cpp */,
-                               DEEAFC618A3B33F1FBFE3536 /* MMap.h */,
+                               799DC9611EE2EA3BA7CF5477 /* intermediate.h */,
+                               DEAF6F3126C2EC4397785C3F /* intermOut.cpp */,
+                               C4FE988EF9A293867E5C771B /* IntermTraverse.cpp */,
+                               153BF06BF12C6F50496C6156 /* localintermediate.h */,
                                57CF1F83E842901C42D44825 /* MapLongVariableNames.cpp */,
                                81CC4245A8E5AB5584D336F3 /* MapLongVariableNames.h */,
+                               DEEAFC618A3B33F1FBFE3536 /* MMap.h */,
+                               C8BD59BD7056FFC21373C50A /* osinclude.h */,
+                               BE258486005F6696CC031622 /* ossource_posix.cpp */,
                                DB2917C5B624712364DE4A75 /* OutputESSL.cpp */,
                                6BB66AB5873868E23675B6DB /* OutputESSL.h */,
                                48B7402CC07A059FEF5EC351 /* OutputGLSL.cpp */,
                                B55B359CF7E486DBC49BBF0A /* OutputGLSLBase.h */,
                                9A5B5BB2526802479E19F993 /* OutputHLSL.cpp */,
                                5A21599C59BC1A75A7FABA34 /* OutputHLSL.h */,
+                               D2C9C8EB4A7EFF5B67FF9DBF /* parseConst.cpp */,
                                976C831A75EBE009A9861796 /* ParseHelper.cpp */,
                                CEE0C90DF6D504D1F3629711 /* ParseHelper.h */,
                                B64EABE738FC666A5E4E2F42 /* PoolAlloc.cpp */,
                                12EAF028311EEA4753E82818 /* PoolAlloc.h */,
+                               A201085B159C324F00E57BBE /* Pragma.h */,
+                               0E8D65F584FDB84DAABD3969 /* preprocessor */,
                                4857E18799D332C30EF460C7 /* QualifierAlive.cpp */,
                                9D47B1AC82E4EE859AC54243 /* QualifierAlive.h */,
                                B436EFF06913FCB19C3522A7 /* RemoveTree.cpp */,
                                D40F78CB9BA0C89921FA319D /* RemoveTree.h */,
+                               A201085C159C324F00E57BBE /* RenameFunction.h */,
                                228A6DEDDF08DB370394A7AD /* SearchSymbol.cpp */,
                                F3E09DC8E1BF5D2958AACEDE /* SearchSymbol.h */,
-                               AE65E139AE10DE9EFAD8D5B1 /* ShHandle.h */,
                                56C7E99BA500A84C35216FE0 /* ShaderLang.cpp */,
+                               AE65E139AE10DE9EFAD8D5B1 /* ShHandle.h */,
                                B7E5B0F04635E6090F0DE8EF /* SymbolTable.cpp */,
                                7C6BB12AB099556CF379D78F /* SymbolTable.h */,
+                               A201085D159C324F00E57BBE /* timing */,
                                0A3A260F5379A7E2655D40F3 /* TranslatorESSL.cpp */,
                                D53DDD0CDF15EE1DD01F1A20 /* TranslatorESSL.h */,
                                6FB70DC74A21FBCD665ABDF9 /* TranslatorGLSL.cpp */,
                                C3DAFF6BF12BB7F4784D6C7E /* TranslatorHLSL.cpp */,
                                E3A29B6E9C21B67C25FF0D2B /* TranslatorHLSL.h */,
                                AA53B6632C76F905DF08E564 /* Types.h */,
-                               E3711A48A0BF16B1CBD77AC9 /* UnfoldSelect.cpp */,
-                               2A765B86CBAF0D4A3E69DCA7 /* UnfoldSelect.h */,
+                               A201086F159C326200E57BBE /* UnfoldShortCircuit.cpp */,
+                               A2010870159C326200E57BBE /* UnfoldShortCircuit.h */,
+                               AE7674C52BDDDB28AF5FFD9F /* unistd.h */,
+                               3EE7215A7AB4EF71C97D2545 /* util.cpp */,
+                               A51C728B615B41E1D59E9902 /* util.h */,
                                B148D967B8D288A8267BFF3A /* ValidateLimitations.cpp */,
                                90254842D72975672C2E9A93 /* ValidateLimitations.h */,
                                27C11EE10FED2979931FFC11 /* VariableInfo.cpp */,
                                5D99354C4D8187D384C81207 /* VariableInfo.h */,
                                F727AEC906712EC238041464 /* VersionGLSL.cpp */,
                                120AD0A3B7642FB5A9AE3A56 /* VersionGLSL.h */,
-                               4ABA230FEA3654B030E4C4FB /* debug.cpp */,
-                               95276AA6B36FC1B1D913FCE4 /* debug.h */,
-                               497C5C24EEF466FB4B50A259 /* glslang.h */,
-                               73A57C6D413773AEBA3C47A6 /* glslang_lex.cpp */,
-                               3F68A6AA811495718A6938C0 /* glslang_tab.cpp */,
-                               4FCF32CB2D8A42C930A66B00 /* glslang_tab.h */,
-                               DEAF6F3126C2EC4397785C3F /* intermOut.cpp */,
-                               799DC9611EE2EA3BA7CF5477 /* intermediate.h */,
-                               153BF06BF12C6F50496C6156 /* localintermediate.h */,
-                               C8BD59BD7056FFC21373C50A /* osinclude.h */,
-                               BE258486005F6696CC031622 /* ossource_posix.cpp */,
-                               D2C9C8EB4A7EFF5B67FF9DBF /* parseConst.cpp */,
-                               AE7674C52BDDDB28AF5FFD9F /* unistd.h */,
-                               3EE7215A7AB4EF71C97D2545 /* util.cpp */,
-                               A51C728B615B41E1D59E9902 /* util.h */,
                        );
                        name = Source;
                        path = compiler;
                        );
                        sourceTree = "<group>";
                };
+               A201081E159C31A000E57BBE /* new */ = {
+                       isa = PBXGroup;
+                       children = (
+                               A201081F159C31A000E57BBE /* Diagnostics.cpp */,
+                               A2010820159C31A000E57BBE /* Diagnostics.h */,
+                               A2010821159C31A000E57BBE /* DirectiveHandler.cpp */,
+                               A2010822159C31A000E57BBE /* DirectiveHandler.h */,
+                               A2010823159C31A000E57BBE /* DirectiveParser.cpp */,
+                               A2010824159C31A000E57BBE /* DirectiveParser.h */,
+                               A2010825159C31A000E57BBE /* ExpressionParser.cpp */,
+                               A2010826159C31A000E57BBE /* ExpressionParser.h */,
+                               A2010829159C31A000E57BBE /* Input.cpp */,
+                               A201082A159C31A000E57BBE /* Input.h */,
+                               A201082B159C31A000E57BBE /* Lexer.cpp */,
+                               A201082C159C31A000E57BBE /* Lexer.h */,
+                               A201082D159C31A000E57BBE /* Macro.cpp */,
+                               A201082E159C31A000E57BBE /* Macro.h */,
+                               A201082F159C31A000E57BBE /* MacroExpander.cpp */,
+                               A2010830159C31A000E57BBE /* MacroExpander.h */,
+                               A2010831159C31A000E57BBE /* pp_utils.h */,
+                               A2010832159C31A000E57BBE /* Preprocessor.cpp */,
+                               A2010833159C31A000E57BBE /* Preprocessor.h */,
+                               A2010835159C31A000E57BBE /* SourceLocation.h */,
+                               A2010836159C31A000E57BBE /* Token.cpp */,
+                               A2010837159C31A000E57BBE /* Token.h */,
+                               A2010838159C31A000E57BBE /* Tokenizer.cpp */,
+                               A2010839159C31A000E57BBE /* Tokenizer.h */,
+                       );
+                       path = new;
+                       sourceTree = "<group>";
+               };
+               A201084B159C324F00E57BBE /* depgraph */ = {
+                       isa = PBXGroup;
+                       children = (
+                               A201084C159C324F00E57BBE /* DependencyGraph.cpp */,
+                               A201084D159C324F00E57BBE /* DependencyGraph.h */,
+                               A201084E159C324F00E57BBE /* DependencyGraphBuilder.cpp */,
+                               A201084F159C324F00E57BBE /* DependencyGraphBuilder.h */,
+                               A2010850159C324F00E57BBE /* DependencyGraphOutput.cpp */,
+                               A2010851159C324F00E57BBE /* DependencyGraphOutput.h */,
+                               A2010852159C324F00E57BBE /* DependencyGraphTraverse.cpp */,
+                       );
+                       path = depgraph;
+                       sourceTree = "<group>";
+               };
+               A201085D159C324F00E57BBE /* timing */ = {
+                       isa = PBXGroup;
+                       children = (
+                               A201085E159C324F00E57BBE /* RestrictFragmentShaderTiming.cpp */,
+                               A201085F159C324F00E57BBE /* RestrictFragmentShaderTiming.h */,
+                               A2010860159C324F00E57BBE /* RestrictVertexShaderTiming.cpp */,
+                               A2010861159C324F00E57BBE /* RestrictVertexShaderTiming.h */,
+                       );
+                       path = timing;
+                       sourceTree = "<group>";
+               };
                B2C184C3543198BA51592EA4 /* Build */ = {
                        isa = PBXGroup;
                        children = (
                                3DDDC77216202A4DE1808BDB /* libtranslator_common.a */,
                                A1644B00E9304C407FDC5F47 /* libtranslator_glsl.a */,
                                A447F75F33DA4C4C123AC952 /* libtranslator_hlsl.a */,
+                               A20107FF159C313C00E57BBE /* libtranslator_common copy.a */,
                        );
                        name = Products;
                        sourceTree = "<group>";
                        productReference = 3DDDC77216202A4DE1808BDB /* libtranslator_common.a */;
                        productType = "com.apple.product-type.library.static";
                };
+               A20107DC159C313C00E57BBE /* preprocessor */ = {
+                       isa = PBXNativeTarget;
+                       buildConfigurationList = A20107FC159C313C00E57BBE /* Build configuration list for PBXNativeTarget "preprocessor" */;
+                       buildPhases = (
+                               A20107DD159C313C00E57BBE /* Sources */,
+                               A20107FB159C313C00E57BBE /* Frameworks */,
+                       );
+                       buildRules = (
+                       );
+                       dependencies = (
+                       );
+                       name = preprocessor;
+                       productName = translator_common;
+                       productReference = A20107FF159C313C00E57BBE /* libtranslator_common copy.a */;
+                       productType = "com.apple.product-type.library.static";
+               };
                A838E9574B3FF14791DBDAB1 /* translator_hlsl */ = {
                        isa = PBXNativeTarget;
                        buildConfigurationList = C71E79C7829FD796CF621B44 /* Build configuration list for PBXNativeTarget "translator_hlsl" */;
                        };
                        buildConfigurationList = 0E59F8FE4A8099E8DDCA4CE7 /* Build configuration list for PBXProject "build_angle" */;
                        compatibilityVersion = "Xcode 3.1";
+                       developmentRegion = English;
                        hasScannedForEncodings = 1;
+                       knownRegions = (
+                               en,
+                       );
                        mainGroup = 5BBEFF9B91738297B95C568D;
                        projectDirPath = "";
                        projectRoot = "";
                                6F4FD35CB3DFC89D70ECD432 /* translator_common */,
                                5892C7A3695330437AFE5714 /* translator_glsl */,
                                A838E9574B3FF14791DBDAB1 /* translator_hlsl */,
+                               A20107DC159C313C00E57BBE /* preprocessor */,
                        );
                };
 /* End PBXProject section */
                                4B4BDE7AD6266B39ED43C2D4 /* CodeGenHLSL.cpp in Sources */,
                                5F7B52A54DCE8155ED94ECF8 /* OutputHLSL.cpp in Sources */,
                                E99D6D80DBF05ECE7108B26D /* TranslatorHLSL.cpp in Sources */,
-                               9886BCD5D0DD69B6FDE09DD8 /* UnfoldSelect.cpp in Sources */,
                                296466566D8C0F023A553760 /* SearchSymbol.cpp in Sources */,
+                               A2010871159C326200E57BBE /* DetectDiscontinuity.cpp in Sources */,
+                               A2010872159C326200E57BBE /* UnfoldShortCircuit.cpp in Sources */,
+                       );
+                       runOnlyForDeploymentPostprocessing = 0;
+               };
+               A20107DD159C313C00E57BBE /* Sources */ = {
+                       isa = PBXSourcesBuildPhase;
+                       buildActionMask = 2147483647;
+                       files = (
+                               A201083B159C31A000E57BBE /* Diagnostics.cpp in Sources */,
+                               A201083C159C31A000E57BBE /* DirectiveHandler.cpp in Sources */,
+                               A201083D159C31A000E57BBE /* DirectiveParser.cpp in Sources */,
+                               A201083E159C31A000E57BBE /* ExpressionParser.cpp in Sources */,
+                               A2010840159C31A000E57BBE /* Input.cpp in Sources */,
+                               A2010841159C31A000E57BBE /* Lexer.cpp in Sources */,
+                               A2010842159C31A000E57BBE /* Macro.cpp in Sources */,
+                               A2010843159C31A000E57BBE /* MacroExpander.cpp in Sources */,
+                               A2010844159C31A000E57BBE /* Preprocessor.cpp in Sources */,
+                               A2010845159C31A000E57BBE /* Token.cpp in Sources */,
+                               A2010846159C31A000E57BBE /* Tokenizer.cpp in Sources */,
                        );
                        runOnlyForDeploymentPostprocessing = 0;
                };
                                AD85517F086FDCEF3947C403 /* symbols.c in Sources */,
                                E8C727AA8E9DC5E7B58857DF /* tokens.c in Sources */,
                                B4858417E54365BE8CDE3919 /* ossource_posix.cpp in Sources */,
+                               A2010862159C324F00E57BBE /* BuiltInFunctionEmulator.cpp in Sources */,
+                               A2010863159C324F00E57BBE /* DependencyGraph.cpp in Sources */,
+                               A2010864159C324F00E57BBE /* DependencyGraphBuilder.cpp in Sources */,
+                               A2010865159C324F00E57BBE /* DependencyGraphOutput.cpp in Sources */,
+                               A2010866159C324F00E57BBE /* DependencyGraphTraverse.cpp in Sources */,
+                               A2010867159C324F00E57BBE /* DetectRecursion.cpp in Sources */,
+                               A2010868159C324F00E57BBE /* Diagnostics.cpp in Sources */,
+                               A2010869159C324F00E57BBE /* DirectiveHandler.cpp in Sources */,
+                               A201086A159C324F00E57BBE /* InitializeParseContext.cpp in Sources */,
+                               A201086B159C324F00E57BBE /* RestrictFragmentShaderTiming.cpp in Sources */,
+                               A201086C159C324F00E57BBE /* RestrictVertexShaderTiming.cpp in Sources */,
                        );
                        runOnlyForDeploymentPostprocessing = 0;
                };
                        };
                        name = Debug;
                };
+               A20107FD159C313C00E57BBE /* Debug */ = {
+                       isa = XCBuildConfiguration;
+                       buildSettings = {
+                               EXECUTABLE_PREFIX = lib;
+                               GCC_PREPROCESSOR_DEFINITIONS = (
+                                       "\"ANGLE_DISABLE_TRACE\"",
+                                       "\"ANGLE_COMPILE_OPTIMIZATION_LEVEL=D3DCOMPILE_OPTIMIZATION_LEVEL0\"",
+                               );
+                               HEADER_SEARCH_PATHS = (
+                                       .,
+                                       ../include,
+                               );
+                               PRODUCT_NAME = "translator_common copy";
+                       };
+                       name = Debug;
+               };
+               A20107FE159C313C00E57BBE /* Release */ = {
+                       isa = XCBuildConfiguration;
+                       buildSettings = {
+                               EXECUTABLE_PREFIX = lib;
+                               GCC_PREPROCESSOR_DEFINITIONS = (
+                                       "\"ANGLE_DISABLE_TRACE\"",
+                                       "\"ANGLE_COMPILE_OPTIMIZATION_LEVEL=D3DCOMPILE_OPTIMIZATION_LEVEL0\"",
+                               );
+                               HEADER_SEARCH_PATHS = (
+                                       .,
+                                       ../include,
+                               );
+                               PRODUCT_NAME = "translator_common copy";
+                       };
+                       name = Release;
+               };
                AF7C2CD10C6FEA076B141E6E /* Release */ = {
                        isa = XCBuildConfiguration;
                        buildSettings = {
                        defaultConfigurationIsVisible = 1;
                        defaultConfigurationName = Debug;
                };
+               A20107FC159C313C00E57BBE /* Build configuration list for PBXNativeTarget "preprocessor" */ = {
+                       isa = XCConfigurationList;
+                       buildConfigurations = (
+                               A20107FD159C313C00E57BBE /* Debug */,
+                               A20107FE159C313C00E57BBE /* Release */,
+                       );
+                       defaultConfigurationIsVisible = 1;
+                       defaultConfigurationName = Debug;
+               };
                C71E79C7829FD796CF621B44 /* Build configuration list for PBXNativeTarget "translator_hlsl" */ = {
                        isa = XCConfigurationList;
                        buildConfigurations = (
index 24c766b..7d9349a 100644 (file)
@@ -15,4 +15,8 @@
   TypeName(const TypeName&);               \
   void operator=(const TypeName&)
 
+#if defined(_MSC_VER)
+#define snprintf _snprintf
+#endif
+
 #endif // COMMON_ANGLEUTILS_H_
index 845d258..b2238f9 100644 (file)
-//\r
-// Copyright (c) 2002-2010 The ANGLE Project Authors. All rights reserved.\r
-// Use of this source code is governed by a BSD-style license that can be\r
-// found in the LICENSE file.\r
-//\r
-\r
-// debug.cpp: Debugging utilities.\r
-\r
-#include "common/debug.h"\r
-\r
-#include <stdio.h>\r
-#include <stdarg.h>\r
-#include <d3d9.h>\r
-#include <windows.h>\r
-\r
-namespace gl\r
-{\r
-\r
-typedef void (WINAPI *PerfOutputFunction)(D3DCOLOR, LPCWSTR);\r
-\r
-static void output(bool traceFileDebugOnly, PerfOutputFunction perfFunc, const char *format, va_list vararg)\r
-{\r
-#if !defined(ANGLE_DISABLE_PERF)\r
-    if (perfActive())\r
-    {\r
-        char message[32768];\r
-        int len = vsprintf_s(message, format, vararg);\r
-        if (len < 0)\r
-        {\r
-            return;\r
-        }\r
-\r
-        // There are no ASCII variants of these D3DPERF functions.\r
-        wchar_t wideMessage[32768];\r
-        for (int i = 0; i < len; ++i)\r
-        {\r
-            wideMessage[i] = message[i];\r
-        }\r
-        wideMessage[len] = 0;\r
-\r
-        perfFunc(0, wideMessage);\r
-    }\r
-#endif\r
-\r
-#if !defined(ANGLE_DISABLE_TRACE)\r
-#if defined(NDEBUG)\r
-    if (traceFileDebugOnly)\r
-    {\r
-        return;\r
-    }\r
-#endif\r
-\r
-    FILE* file = fopen(TRACE_OUTPUT_FILE, "a");\r
-    if (file)\r
-    {\r
-        vfprintf(file, format, vararg);\r
-        fclose(file);\r
-    }\r
-#endif\r
-}\r
-\r
-void trace(bool traceFileDebugOnly, const char *format, ...)\r
-{\r
-    va_list vararg;\r
-    va_start(vararg, format);\r
-#if defined(ANGLE_DISABLE_PERF)\r
-    output(traceFileDebugOnly, NULL, format, vararg);\r
-#else\r
-    output(traceFileDebugOnly, D3DPERF_SetMarker, format, vararg);\r
-#endif\r
-    va_end(vararg);\r
-}\r
-\r
-bool perfActive()\r
-{\r
-#if defined(ANGLE_DISABLE_PERF)\r
-    return false;\r
-#else\r
-    static bool active = D3DPERF_GetStatus() != 0;\r
-    return active;\r
-#endif\r
-}\r
-\r
-ScopedPerfEventHelper::ScopedPerfEventHelper(const char* format, ...)\r
-{\r
-#if !defined(ANGLE_DISABLE_PERF)\r
-    va_list vararg;\r
-    va_start(vararg, format);\r
-    output(true, reinterpret_cast<PerfOutputFunction>(D3DPERF_BeginEvent), format, vararg);\r
-    va_end(vararg);\r
-#endif\r
-}\r
-\r
-ScopedPerfEventHelper::~ScopedPerfEventHelper()\r
-{\r
-#if !defined(ANGLE_DISABLE_PERF)\r
-    if (perfActive())\r
-    {\r
-        D3DPERF_EndEvent();\r
-    }\r
-#endif\r
-}\r
-}\r
+//
+// Copyright (c) 2002-2010 The ANGLE Project Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+//
+
+// debug.cpp: Debugging utilities.
+
+#include "common/debug.h"
+
+#include <stdio.h>
+#include <stdarg.h>
+#include <d3d9.h>
+#include <windows.h>
+
+namespace gl
+{
+
+typedef void (WINAPI *PerfOutputFunction)(D3DCOLOR, LPCWSTR);
+
+static void output(bool traceFileDebugOnly, PerfOutputFunction perfFunc, const char *format, va_list vararg)
+{
+#if !defined(ANGLE_DISABLE_PERF)
+    if (perfActive())
+    {
+        char message[32768];
+        int len = vsprintf_s(message, format, vararg);
+        if (len < 0)
+        {
+            return;
+        }
+
+        // There are no ASCII variants of these D3DPERF functions.
+        wchar_t wideMessage[32768];
+        for (int i = 0; i < len; ++i)
+        {
+            wideMessage[i] = message[i];
+        }
+        wideMessage[len] = 0;
+
+        perfFunc(0, wideMessage);
+    }
+#endif
+
+#if !defined(ANGLE_DISABLE_TRACE)
+#if defined(NDEBUG)
+    if (traceFileDebugOnly)
+    {
+        return;
+    }
+#endif
+
+    FILE* file = fopen(TRACE_OUTPUT_FILE, "a");
+    if (file)
+    {
+        vfprintf(file, format, vararg);
+        fclose(file);
+    }
+#endif
+}
+
+void trace(bool traceFileDebugOnly, const char *format, ...)
+{
+    va_list vararg;
+    va_start(vararg, format);
+#if defined(ANGLE_DISABLE_PERF)
+    output(traceFileDebugOnly, NULL, format, vararg);
+#else
+    output(traceFileDebugOnly, D3DPERF_SetMarker, format, vararg);
+#endif
+    va_end(vararg);
+}
+
+bool perfActive()
+{
+#if defined(ANGLE_DISABLE_PERF)
+    return false;
+#else
+    static bool active = D3DPERF_GetStatus() != 0;
+    return active;
+#endif
+}
+
+ScopedPerfEventHelper::ScopedPerfEventHelper(const char* format, ...)
+{
+#if !defined(ANGLE_DISABLE_PERF)
+    va_list vararg;
+    va_start(vararg, format);
+    output(true, reinterpret_cast<PerfOutputFunction>(D3DPERF_BeginEvent), format, vararg);
+    va_end(vararg);
+#endif
+}
+
+ScopedPerfEventHelper::~ScopedPerfEventHelper()
+{
+#if !defined(ANGLE_DISABLE_PERF)
+    if (perfActive())
+    {
+        D3DPERF_EndEvent();
+    }
+#endif
+}
+}
index 203c421..bdd1624 100644 (file)
@@ -1,7 +1,7 @@
 #define MAJOR_VERSION 1
 #define MINOR_VERSION 0
 #define BUILD_VERSION 0
-#define BUILD_REVISION 1009
+#define BUILD_REVISION 1166
 
 #define STRINGIFY(x) #x
 #define MACRO_STRINGIFY(x) STRINGIFY(x)
index a7950b9..1c4b25f 100644 (file)
@@ -16,11 +16,6 @@ namespace {
 // evaluated. This is unlikely to show up in real shaders, but is something to
 // consider.
 const char* kFunctionEmulationVertexSource[] = {
-    "#error no emulation for atan(float, float)",
-    "vec2 webgl_atan_emu(vec2 y, vec2 x) { return vec2(atan(y[0], x[0]), atan(y[1], x[1])); }",
-    "vec3 webgl_atan_emu(vec3 y, vec3 x) { return vec3(atan(y[0], x[0]), atan(y[1], x[1]), atan(y[2], x[2])); }",
-    "vec4 webgl_atan_emu(vec4 y, vec4 x) { return vec4(atan(y[0], x[0]), atan(y[1], x[1]), atan(y[2], x[2]), atan(y[3], x[3])); }",
-
     "#error no emulation for cos(float)",
     "#error no emulation for cos(vec2)",
     "#error no emulation for cos(vec3)",
@@ -41,11 +36,6 @@ const char* kFunctionEmulationVertexSource[] = {
     "#error no emulation for length(vec3)",
     "#error no emulation for length(vec4)",
 
-    "#error no emulation for mod(float, float)",
-    "vec2 webgl_mod_emu(vec2 x, vec2 y) { return vec2(mod(x[0], y[0]), mod(x[1], y[1])); }",
-    "vec3 webgl_mod_emu(vec3 x, vec3 y) { return vec3(mod(x[0], y[0]), mod(x[1], y[1]), mod(x[2], y[2])); }",
-    "vec4 webgl_mod_emu(vec4 x, vec4 y) { return vec4(mod(x[0], y[0]), mod(x[1], y[1]), mod(x[2], y[2]), mod(x[3], y[3])); }",
-
     "#define webgl_normalize_emu(x) ((x) == 0.0 ? 0.0 : ((x) > 0.0 ? 1.0 : -1.0))",
     "#error no emulation for normalize(vec2)",
     "#error no emulation for normalize(vec3)",
@@ -58,42 +48,32 @@ const char* kFunctionEmulationVertexSource[] = {
 };
 
 const char* kFunctionEmulationFragmentSource[] = {
-    "#error no emulation for atan(float, float)",
-    "#error no emulation for atan(vec2, vec2)",
-    "#error no emulation for atan(vec3, vec3)",
-    "#error no emulation for atan(vec4, vec4)",
-
     "webgl_emu_precision float webgl_cos_emu(webgl_emu_precision float a) { return cos(a); }",
     "webgl_emu_precision vec2 webgl_cos_emu(webgl_emu_precision vec2 a) { return cos(a); }",
     "webgl_emu_precision vec3 webgl_cos_emu(webgl_emu_precision vec3 a) { return cos(a); }",
     "webgl_emu_precision vec4 webgl_cos_emu(webgl_emu_precision vec4 a) { return cos(a); }",
 
-    "#error no emulation for distance(float, float)",
+    "#define webgl_distance_emu(x, y) ((x) >= (y) ? (x) - (y) : (y) - (x))",
     "#error no emulation for distance(vec2, vec2)",
     "#error no emulation for distance(vec3, vec3)",
     "#error no emulation for distance(vec4, vec4)",
 
-    "#error no emulation for dot(float, float)",
+    "#define webgl_dot_emu(x, y) ((x) * (y))",
     "#error no emulation for dot(vec2, vec2)",
     "#error no emulation for dot(vec3, vec3)",
     "#error no emulation for dot(vec4, vec4)",
 
-    "#error no emulation for length(float)",
+    "#define webgl_length_emu(x) ((x) >= 0.0 ? (x) : -(x))",
     "#error no emulation for length(vec2)",
     "#error no emulation for length(vec3)",
     "#error no emulation for length(vec4)",
 
-    "#error no emulation for mod(float, float)",
-    "#error no emulation for mod(vec2, vec2)",
-    "#error no emulation for mod(vec3, vec3)",
-    "#error no emulation for mod(vec4, vec4)",
-
-    "#error no emulation for normalize(float)",
+    "#define webgl_normalize_emu(x) ((x) == 0.0 ? 0.0 : ((x) > 0.0 ? 1.0 : -1.0))",
     "#error no emulation for normalize(vec2)",
     "#error no emulation for normalize(vec3)",
     "#error no emulation for normalize(vec4)",
 
-    "#error no emulation for reflect(float, float)",
+    "#define webgl_reflect_emu(I, N) ((I) - 2.0 * (N) * (I) * (N))",
     "#error no emulation for reflect(vec2, vec2)",
     "#error no emulation for reflect(vec3, vec3)",
     "#error no emulation for reflect(vec4, vec4)"
@@ -102,10 +82,6 @@ const char* kFunctionEmulationFragmentSource[] = {
 const bool kFunctionEmulationVertexMask[] = {
 #if defined(__APPLE__)
     // Work around ATI driver bugs in Mac.
-    false, // TFunctionAtan1_1
-    false, // TFunctionAtan2_2
-    false, // TFunctionAtan3_3
-    false, // TFunctionAtan4_4
     false, // TFunctionCos1
     false, // TFunctionCos2
     false, // TFunctionCos3
@@ -122,10 +98,6 @@ const bool kFunctionEmulationVertexMask[] = {
     false, // TFunctionLength2
     false, // TFunctionLength3
     false, // TFunctionLength4
-    false, // TFunctionMod1_1
-    false, // TFunctionMod2_2
-    false, // TFunctionMod3_3
-    false, // TFunctionMod4_4
     true,  // TFunctionNormalize1
     false, // TFunctionNormalize2
     false, // TFunctionNormalize3
@@ -136,10 +108,6 @@ const bool kFunctionEmulationVertexMask[] = {
     false, // TFunctionReflect4_4
 #else
     // Work around D3D driver bug in Win.
-    false, // TFunctionAtan1_1
-    true,  // TFunctionAtan2_2
-    true,  // TFunctionAtan3_3
-    true,  // TFunctionAtan4_4
     false, // TFunctionCos1
     false, // TFunctionCos2
     false, // TFunctionCos3
@@ -156,10 +124,6 @@ const bool kFunctionEmulationVertexMask[] = {
     false, // TFunctionLength2
     false, // TFunctionLength3
     false, // TFunctionLength4
-    false, // TFunctionMod1_1
-    true,  // TFunctionMod2_2
-    true,  // TFunctionMod3_3
-    true,  // TFunctionMod4_4
     false, // TFunctionNormalize1
     false, // TFunctionNormalize2
     false, // TFunctionNormalize3
@@ -173,22 +137,38 @@ const bool kFunctionEmulationVertexMask[] = {
 };
 
 const bool kFunctionEmulationFragmentMask[] = {
-    false, // TFunctionAtan1_1
-    false, // TFunctionAtan2_2
-    false, // TFunctionAtan3_3
-    false, // TFunctionAtan4_4
 #if defined(__APPLE__)
-    // Work around a ATI driver bug in Mac that causes crashes.
+    // Work around ATI driver bugs in Mac.
     true,  // TFunctionCos1
     true,  // TFunctionCos2
     true,  // TFunctionCos3
     true,  // TFunctionCos4
+    true,  // TFunctionDistance1_1
+    false, // TFunctionDistance2_2
+    false, // TFunctionDistance3_3
+    false, // TFunctionDistance4_4
+    true,  // TFunctionDot1_1
+    false, // TFunctionDot2_2
+    false, // TFunctionDot3_3
+    false, // TFunctionDot4_4
+    true,  // TFunctionLength1
+    false, // TFunctionLength2
+    false, // TFunctionLength3
+    false, // TFunctionLength4
+    true,  // TFunctionNormalize1
+    false, // TFunctionNormalize2
+    false, // TFunctionNormalize3
+    false, // TFunctionNormalize4
+    true,  // TFunctionReflect1_1
+    false, // TFunctionReflect2_2
+    false, // TFunctionReflect3_3
+    false, // TFunctionReflect4_4
 #else
+    // Work around D3D driver bug in Win.
     false, // TFunctionCos1
     false, // TFunctionCos2
     false, // TFunctionCos3
     false, // TFunctionCos4
-#endif
     false, // TFunctionDistance1_1
     false, // TFunctionDistance2_2
     false, // TFunctionDistance3_3
@@ -201,10 +181,6 @@ const bool kFunctionEmulationFragmentMask[] = {
     false, // TFunctionLength2
     false, // TFunctionLength3
     false, // TFunctionLength4
-    false, // TFunctionMod1_1
-    false, // TFunctionMod2_2
-    false, // TFunctionMod3_3
-    false, // TFunctionMod4_4
     false, // TFunctionNormalize1
     false, // TFunctionNormalize2
     false, // TFunctionNormalize3
@@ -213,6 +189,7 @@ const bool kFunctionEmulationFragmentMask[] = {
     false, // TFunctionReflect2_2
     false, // TFunctionReflect3_3
     false, // TFunctionReflect4_4
+#endif
     false  // TFunctionUnknown
 };
 
@@ -386,18 +363,12 @@ BuiltInFunctionEmulator::IdentifyFunction(
 
     unsigned int function = TFunctionUnknown;
     switch (op) {
-        case EOpAtan:
-            function = TFunctionAtan1_1;
-            break;
         case EOpDistance:
             function = TFunctionDistance1_1;
             break;
         case EOpDot:
             function = TFunctionDot1_1;
             break;
-        case EOpMod:
-            function = TFunctionMod1_1;
-            break;
         case EOpReflect:
             function = TFunctionReflect1_1;
             break;
index b37b665..0d904f4 100644 (file)
@@ -45,12 +45,7 @@ private:
     // Built-in functions.
     //
     enum TBuiltInFunction {
-        TFunctionAtan1_1 = 0,  // float atan(float, float);
-        TFunctionAtan2_2,  // vec2 atan(vec2, vec2);
-        TFunctionAtan3_3,  // vec3 atan(vec3, vec2);
-        TFunctionAtan4_4,  // vec4 atan(vec4, vec2);
-
-        TFunctionCos1,  // float cos(float);
+        TFunctionCos1 = 0,  // float cos(float);
         TFunctionCos2,  // vec2 cos(vec2);
         TFunctionCos3,  // vec3 cos(vec3);
         TFunctionCos4,  // vec4 cos(vec4);
@@ -70,11 +65,6 @@ private:
         TFunctionLength3,  // float length(vec3);
         TFunctionLength4,  // float length(vec4);
 
-        TFunctionMod1_1,  // float mod(float, float);
-        TFunctionMod2_2,  // vec2 mod(vec2, vec2);
-        TFunctionMod3_3,  // vec3 mod(vec3, vec3);
-        TFunctionMod4_4,  // vec4 mod(vec4, vec4);
-
         TFunctionNormalize1,  // float normalize(float);
         TFunctionNormalize2,  // vec2 normalize(vec2);
         TFunctionNormalize3,  // vec3 normalize(vec3);
index f27cb75..cab8056 100644 (file)
@@ -8,10 +8,21 @@
 #include "compiler/DetectRecursion.h"
 #include "compiler/ForLoopUnroll.h"
 #include "compiler/Initialize.h"
+#include "compiler/InitializeParseContext.h"
 #include "compiler/MapLongVariableNames.h"
 #include "compiler/ParseHelper.h"
+#include "compiler/RenameFunction.h"
 #include "compiler/ShHandle.h"
 #include "compiler/ValidateLimitations.h"
+#include "compiler/depgraph/DependencyGraph.h"
+#include "compiler/depgraph/DependencyGraphOutput.h"
+#include "compiler/timing/RestrictFragmentShaderTiming.h"
+#include "compiler/timing/RestrictVertexShaderTiming.h"
+
+bool isWebGLBasedSpec(ShShaderSpec spec)
+{
+     return spec == SH_WEBGL_SPEC || spec == SH_CSS_SHADERS_SPEC;
+}
 
 namespace {
 bool InitializeSymbolTable(
@@ -123,7 +134,7 @@ bool TCompiler::compile(const char* const shaderStrings[],
         return true;
 
     // If compiling for WebGL, validate loop and indexing as well.
-    if (shaderSpec == SH_WEBGL_SPEC)
+    if (isWebGLBasedSpec(shaderSpec))
         compileOptions |= SH_VALIDATE_LOOP_INDEXING;
 
     // First string is path of source file if flag is set. The actual source follows.
@@ -161,6 +172,12 @@ bool TCompiler::compile(const char* const shaderStrings[],
         if (success && (compileOptions & SH_VALIDATE_LOOP_INDEXING))
             success = validateLimitations(root);
 
+        if (success && (compileOptions & SH_TIMING_RESTRICTIONS))
+            success = enforceTimingRestrictions(root, (compileOptions & SH_DEPENDENCY_GRAPH) != 0);
+
+        if (success && shaderSpec == SH_CSS_SHADERS_SPEC)
+            rewriteCSSShader(root);
+
         // Unroll for-loop markup needs to happen after validateLimitations pass.
         if (success && (compileOptions & SH_UNROLL_FOR_LOOP_WITH_INTEGER_INDEX))
             ForLoopUnroll::MarkForLoopsWithIntegerIndicesForUnrolling(root);
@@ -235,12 +252,58 @@ bool TCompiler::detectRecursion(TIntermNode* root)
     }
 }
 
+void TCompiler::rewriteCSSShader(TIntermNode* root)
+{
+    RenameFunction renamer("main(", "css_main(");
+    root->traverse(&renamer);
+}
+
 bool TCompiler::validateLimitations(TIntermNode* root) {
     ValidateLimitations validate(shaderType, infoSink.info);
     root->traverse(&validate);
     return validate.numErrors() == 0;
 }
 
+bool TCompiler::enforceTimingRestrictions(TIntermNode* root, bool outputGraph)
+{
+    if (shaderSpec != SH_WEBGL_SPEC) {
+        infoSink.info << "Timing restrictions must be enforced under the WebGL spec.";
+        return false;
+    }
+
+    if (shaderType == SH_FRAGMENT_SHADER) {
+        TDependencyGraph graph(root);
+
+        // Output any errors first.
+        bool success = enforceFragmentShaderTimingRestrictions(graph);
+        
+        // Then, output the dependency graph.
+        if (outputGraph) {
+            TDependencyGraphOutput output(infoSink.info);
+            output.outputAllSpanningTrees(graph);
+        }
+        
+        return success;
+    }
+    else {
+        return enforceVertexShaderTimingRestrictions(root);
+    }
+}
+
+bool TCompiler::enforceFragmentShaderTimingRestrictions(const TDependencyGraph& graph)
+{
+    RestrictFragmentShaderTiming restrictor(infoSink.info);
+    restrictor.enforceRestrictions(graph);
+    return restrictor.numErrors() == 0;
+}
+
+bool TCompiler::enforceVertexShaderTimingRestrictions(TIntermNode* root)
+{
+    RestrictVertexShaderTiming restrictor(infoSink.info);
+    restrictor.enforceRestrictions(root);
+    return restrictor.numErrors() == 0;
+}
+
 void TCompiler::collectAttribsUniforms(TIntermNode* root)
 {
     CollectAttribsUniforms collect(attribs, uniforms);
diff --git a/Source/ThirdParty/ANGLE/src/compiler/DetectDiscontinuity.cpp b/Source/ThirdParty/ANGLE/src/compiler/DetectDiscontinuity.cpp
new file mode 100644 (file)
index 0000000..472232a
--- /dev/null
@@ -0,0 +1,119 @@
+//
+// Copyright (c) 2012 The ANGLE Project Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+//
+// Contains analysis utilities for dealing with HLSL's lack of support for
+// the use of intrinsic functions which (implicitly or explicitly) compute
+// gradients of functions with discontinuities. 
+//
+
+#include "compiler/DetectDiscontinuity.h"
+
+#include "compiler/ParseHelper.h"
+
+namespace sh
+{
+bool DetectLoopDiscontinuity::traverse(TIntermNode *node)
+{
+    mLoopDiscontinuity = false;
+    node->traverse(this);
+    return mLoopDiscontinuity;
+}
+
+bool DetectLoopDiscontinuity::visitBranch(Visit visit, TIntermBranch *node)
+{
+    if (mLoopDiscontinuity)
+    {
+        return false;
+    }
+
+    switch (node->getFlowOp())
+    {
+      case EOpKill:
+        break;
+      case EOpBreak:
+      case EOpContinue:
+        mLoopDiscontinuity = true;
+      case EOpReturn:
+        break;
+      default: UNREACHABLE();
+    }
+
+    return !mLoopDiscontinuity;
+}
+
+bool DetectLoopDiscontinuity::visitAggregate(Visit visit, TIntermAggregate *node)
+{
+    return !mLoopDiscontinuity;
+}
+
+bool containsLoopDiscontinuity(TIntermNode *node)
+{
+    DetectLoopDiscontinuity detectLoopDiscontinuity;
+    return detectLoopDiscontinuity.traverse(node);
+}
+
+bool DetectGradientOperation::traverse(TIntermNode *node)
+{
+    mGradientOperation = false;
+    node->traverse(this);
+    return mGradientOperation;
+}
+
+bool DetectGradientOperation::visitUnary(Visit visit, TIntermUnary *node)
+{
+    if (mGradientOperation)
+    {
+        return false;
+    }
+
+    switch (node->getOp())
+    {
+      case EOpDFdx:
+      case EOpDFdy:
+        mGradientOperation = true;
+      default:
+        break;
+    }
+
+    return !mGradientOperation;
+}
+
+bool DetectGradientOperation::visitAggregate(Visit visit, TIntermAggregate *node)
+{
+    if (mGradientOperation)
+    {
+        return false;
+    }
+
+    if (node->getOp() == EOpFunctionCall)
+    {
+        if (!node->isUserDefined())
+        {
+            TString name = TFunction::unmangleName(node->getName());
+
+            if (name == "texture2D" ||
+                name == "texture2DProj" ||
+                name == "textureCube")
+            {
+                mGradientOperation = true;
+            }
+        }
+        else
+        {
+            // When a user defined function is called, we have to
+            // conservatively assume it to contain gradient operations
+            mGradientOperation = true;
+        }
+    }
+
+    return !mGradientOperation;
+}
+
+bool containsGradientOperation(TIntermNode *node)
+{
+    DetectGradientOperation detectGradientOperation;
+    return detectGradientOperation.traverse(node);
+}
+}
diff --git a/Source/ThirdParty/ANGLE/src/compiler/DetectDiscontinuity.h b/Source/ThirdParty/ANGLE/src/compiler/DetectDiscontinuity.h
new file mode 100644 (file)
index 0000000..8bda4c3
--- /dev/null
@@ -0,0 +1,50 @@
+//
+// Copyright (c) 2012 The ANGLE Project Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+//
+// Contains analysis utilities for dealing with HLSL's lack of support for
+// the use of intrinsic functions which (implicitly or explicitly) compute
+// gradients of functions with discontinuities. 
+//
+
+#ifndef COMPILER_DETECTDISCONTINUITY_H_
+#define COMPILER_DETECTDISCONTINUITY_H_
+
+#include "compiler/intermediate.h"
+
+namespace sh
+{
+// Checks whether a loop can run for a variable number of iterations
+class DetectLoopDiscontinuity : public TIntermTraverser
+{
+  public:
+    bool traverse(TIntermNode *node);
+
+  protected:
+    bool visitBranch(Visit visit, TIntermBranch *node);
+    bool visitAggregate(Visit visit, TIntermAggregate *node);
+
+    bool mLoopDiscontinuity;
+};
+
+bool containsLoopDiscontinuity(TIntermNode *node);
+
+// Checks for intrinsic functions which compute gradients
+class DetectGradientOperation : public TIntermTraverser
+{
+  public:
+    bool traverse(TIntermNode *node);
+
+  protected:
+    bool visitUnary(Visit visit, TIntermUnary *node);
+    bool visitAggregate(Visit visit, TIntermAggregate *node);
+
+    bool mGradientOperation;
+};
+
+bool containsGradientOperation(TIntermNode *node);
+
+}
+
+#endif   // COMPILER_DETECTDISCONTINUITY_H_
diff --git a/Source/ThirdParty/ANGLE/src/compiler/Diagnostics.cpp b/Source/ThirdParty/ANGLE/src/compiler/Diagnostics.cpp
new file mode 100644 (file)
index 0000000..5f93a03
--- /dev/null
@@ -0,0 +1,44 @@
+//
+// Copyright (c) 2012 The ANGLE Project Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+//
+
+#include "compiler/Diagnostics.h"
+
+#include "compiler/InfoSink.h"
+#include "compiler/preprocessor/new/SourceLocation.h"
+
+TDiagnostics::TDiagnostics(TInfoSink& infoSink) : mInfoSink(infoSink)
+{
+}
+
+TDiagnostics::~TDiagnostics()
+{
+}
+
+void TDiagnostics::writeInfo(Severity severity,
+                             const pp::SourceLocation& loc,
+                             const std::string& reason,
+                             const std::string& token,
+                             const std::string& extra)
+{
+    TInfoSinkBase& sink = mInfoSink.info;
+    TPrefixType prefix = severity == ERROR ? EPrefixError : EPrefixWarning;
+
+    /* VC++ format: file(linenum) : error #: 'token' : extrainfo */
+    sink.prefix(prefix);
+    sink.location(EncodeSourceLoc(loc.file, loc.line));
+    sink << "'" << token <<  "' : " << reason << " " << extra << "\n";
+}
+
+void TDiagnostics::writeDebug(const std::string& str)
+{
+    mInfoSink.debug << str;
+}
+
+void TDiagnostics::print(ID id,
+                         const pp::SourceLocation& loc,
+                         const std::string& text)
+{
+}
diff --git a/Source/ThirdParty/ANGLE/src/compiler/Diagnostics.h b/Source/ThirdParty/ANGLE/src/compiler/Diagnostics.h
new file mode 100644 (file)
index 0000000..43a1306
--- /dev/null
@@ -0,0 +1,39 @@
+//
+// Copyright (c) 2012 The ANGLE Project Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+//
+
+#ifndef COMPILER_DIAGNOSTICS_H_
+#define COMPILER_DIAGNOSTICS_H_
+
+#include "compiler/preprocessor/new/Diagnostics.h"
+
+class TInfoSink;
+
+class TDiagnostics : public pp::Diagnostics
+{
+  public:
+    TDiagnostics(TInfoSink& infoSink);
+    virtual ~TDiagnostics();
+
+    TInfoSink& infoSink() { return mInfoSink; }
+
+    void writeInfo(Severity severity,
+                   const pp::SourceLocation& loc,
+                   const std::string& reason,
+                   const std::string& token,
+                   const std::string& extra);
+
+    void writeDebug(const std::string& str);
+
+  protected:
+    virtual void print(ID id,
+                       const pp::SourceLocation& loc,
+                       const std::string& text);
+
+  private:
+    TInfoSink& mInfoSink;
+};
+
+#endif  // COMPILER_DIAGNOSTICS_H_
diff --git a/Source/ThirdParty/ANGLE/src/compiler/DirectiveHandler.cpp b/Source/ThirdParty/ANGLE/src/compiler/DirectiveHandler.cpp
new file mode 100644 (file)
index 0000000..d1f6ab3
--- /dev/null
@@ -0,0 +1,161 @@
+//
+// Copyright (c) 2012 The ANGLE Project Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+//
+
+#include "compiler/DirectiveHandler.h"
+
+#include <sstream>
+
+#include "compiler/debug.h"
+#include "compiler/Diagnostics.h"
+
+static TBehavior getBehavior(const std::string& str)
+{
+    static const std::string kRequire("require");
+    static const std::string kEnable("enable");
+    static const std::string kDisable("disable");
+    static const std::string kWarn("warn");
+
+    if (str == kRequire) return EBhRequire;
+    else if (str == kEnable) return EBhEnable;
+    else if (str == kDisable) return EBhDisable;
+    else if (str == kWarn) return EBhWarn;
+    return EBhUndefined;
+}
+
+TDirectiveHandler::TDirectiveHandler(TExtensionBehavior& extBehavior,
+                                     TDiagnostics& diagnostics)
+    : mExtensionBehavior(extBehavior),
+      mDiagnostics(diagnostics)
+{
+}
+
+TDirectiveHandler::~TDirectiveHandler()
+{
+}
+
+void TDirectiveHandler::handleError(const pp::SourceLocation& loc,
+                                    const std::string& msg)
+{
+    mDiagnostics.writeInfo(pp::Diagnostics::ERROR, loc, msg, "", "");
+}
+
+void TDirectiveHandler::handlePragma(const pp::SourceLocation& loc,
+                                     const std::string& name,
+                                     const std::string& value)
+{
+    static const std::string kSTDGL("STDGL");
+    static const std::string kOptimize("optimize");
+    static const std::string kDebug("debug");
+    static const std::string kOn("on");
+    static const std::string kOff("off");
+
+    bool invalidValue = false;
+    if (name == kSTDGL)
+    {
+        // The STDGL pragma is used to reserve pragmas for use by future
+        // revisions of GLSL. Ignore it.
+        return;
+    }
+    else if (name == kOptimize)
+    {
+        if (value == kOn) mPragma.optimize = true;
+        else if (value == kOff) mPragma.optimize = false;
+        else invalidValue = true;
+    }
+    else if (name == kDebug)
+    {
+        if (value == kOn) mPragma.debug = true;
+        else if (value == kOff) mPragma.debug = false;
+        else invalidValue = true;
+    }
+    else
+    {
+        mDiagnostics.report(pp::Diagnostics::UNRECOGNIZED_PRAGMA, loc, name);
+        return;
+    }
+
+    if (invalidValue)
+      mDiagnostics.writeInfo(pp::Diagnostics::ERROR, loc,
+                             "invalid pragma value", value,
+                             "'on' or 'off' expected");
+}
+
+void TDirectiveHandler::handleExtension(const pp::SourceLocation& loc,
+                                        const std::string& name,
+                                        const std::string& behavior)
+{
+    static const std::string kExtAll("all");
+
+    TBehavior behaviorVal = getBehavior(behavior);
+    if (behaviorVal == EBhUndefined)
+    {
+        mDiagnostics.writeInfo(pp::Diagnostics::ERROR, loc,
+                               "behavior", name, "invalid");
+        return;
+    }
+
+    if (name == kExtAll)
+    {
+        if (behaviorVal == EBhRequire)
+        {
+            mDiagnostics.writeInfo(pp::Diagnostics::ERROR, loc,
+                                   "extension", name,
+                                   "cannot have 'require' behavior");
+        }
+        else if (behaviorVal == EBhEnable)
+        {
+            mDiagnostics.writeInfo(pp::Diagnostics::ERROR, loc,
+                                   "extension", name,
+                                   "cannot have 'enable' behavior");
+        }
+        else
+        {
+            for (TExtensionBehavior::iterator iter = mExtensionBehavior.begin();
+                 iter != mExtensionBehavior.end(); ++iter)
+                iter->second = behaviorVal;
+        }
+        return;
+    }
+
+    TExtensionBehavior::iterator iter = mExtensionBehavior.find(name);
+    if (iter != mExtensionBehavior.end())
+    {
+        iter->second = behaviorVal;
+        return;
+    }
+
+    pp::Diagnostics::Severity severity = pp::Diagnostics::ERROR;
+    switch (behaviorVal) {
+      case EBhRequire:
+        severity = pp::Diagnostics::ERROR;
+        break;
+      case EBhEnable:
+      case EBhWarn:
+      case EBhDisable:
+        severity = pp::Diagnostics::WARNING;
+        break;
+      default:
+        UNREACHABLE();
+        break;
+    }
+    mDiagnostics.writeInfo(severity, loc,
+                           "extension", name, "is not supported");
+}
+
+void TDirectiveHandler::handleVersion(const pp::SourceLocation& loc,
+                                      int version)
+{
+    static const int kVersion = 100;
+
+    if (version != kVersion)
+    {
+        std::stringstream stream;
+        stream << version;
+        std::string str = stream.str();
+        mDiagnostics.writeInfo(pp::Diagnostics::ERROR, loc,
+                               "version number", str, "not supported");
+    }
+}
diff --git a/Source/ThirdParty/ANGLE/src/compiler/DirectiveHandler.h b/Source/ThirdParty/ANGLE/src/compiler/DirectiveHandler.h
new file mode 100644 (file)
index 0000000..21d3dfc
--- /dev/null
@@ -0,0 +1,46 @@
+//
+// Copyright (c) 2012 The ANGLE Project Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+//
+
+#ifndef COMPILER_DIRECTIVE_HANDLER_H_
+#define COMPILER_DIRECTIVE_HANDLER_H_
+
+#include "compiler/ExtensionBehavior.h"
+#include "compiler/Pragma.h"
+#include "compiler/preprocessor/new/DirectiveHandler.h"
+
+class TDiagnostics;
+
+class TDirectiveHandler : public pp::DirectiveHandler
+{
+  public:
+    TDirectiveHandler(TExtensionBehavior& extBehavior,
+                      TDiagnostics& diagnostics);
+    virtual ~TDirectiveHandler();
+
+    const TPragma& pragma() const { return mPragma; }
+    const TExtensionBehavior& extensionBehavior() const { return mExtensionBehavior; }
+
+    virtual void handleError(const pp::SourceLocation& loc,
+                             const std::string& msg);
+
+    virtual void handlePragma(const pp::SourceLocation& loc,
+                              const std::string& name,
+                              const std::string& value);
+
+    virtual void handleExtension(const pp::SourceLocation& loc,
+                                 const std::string& name,
+                                 const std::string& behavior);
+
+    virtual void handleVersion(const pp::SourceLocation& loc,
+                               int version);
+
+  private:
+    TPragma mPragma;
+    TExtensionBehavior& mExtensionBehavior;
+    TDiagnostics& mDiagnostics;
+};
+
+#endif  // COMPILER_DIRECTIVE_HANDLER_H_
index e9bba4b..6040980 100644 (file)
@@ -7,9 +7,11 @@
 #ifndef _EXTENSION_BEHAVIOR_INCLUDED_
 #define _EXTENSION_BEHAVIOR_INCLUDED_
 
-#include "compiler/Common.h"
+#include <map>
+#include <string>
 
-typedef enum {
+typedef enum
+{
     EBhRequire,
     EBhEnable,
     EBhWarn,
@@ -19,20 +21,17 @@ typedef enum {
 
 inline const char* getBehaviorString(TBehavior b)
 {
-    switch(b) {
-      case EBhRequire:
-        return "require";
-      case EBhEnable:
-        return "enable";
-      case EBhWarn:
-        return "warn";
-      case EBhDisable:
-        return "disable";
-      default:
-        return NULL;
+    switch(b)
+    {
+      case EBhRequire: return "require";
+      case EBhEnable: return "enable";
+      case EBhWarn: return "warn";
+      case EBhDisable: return "disable";
+      default: return NULL;
     }
 }
 
-typedef TMap<TString, TBehavior> TExtensionBehavior;
+// Mapping between extension name and behavior.
+typedef std::map<std::string, TBehavior> TExtensionBehavior;
 
 #endif // _EXTENSION_TABLE_INCLUDED_
index f3a19dc..3e94ce7 100644 (file)
@@ -475,7 +475,7 @@ static TString DefaultPrecisionFragment()
 // Implementation dependent built-in constants.
 //
 //============================================================================
-static TString BuiltInConstants(const ShBuiltInResources &resources)
+static TString BuiltInConstants(ShShaderSpec spec, const ShBuiltInResources &resources)
 {
     TStringStream s;
 
@@ -487,7 +487,9 @@ static TString BuiltInConstants(const ShBuiltInResources &resources)
     s << "const int gl_MaxCombinedTextureImageUnits = " << resources.MaxCombinedTextureImageUnits << ";";
     s << "const int gl_MaxTextureImageUnits = " << resources.MaxTextureImageUnits << ";";
     s << "const int gl_MaxFragmentUniformVectors = " << resources.MaxFragmentUniformVectors << ";";
-    s << "const int gl_MaxDrawBuffers = " << resources.MaxDrawBuffers << ";";
+
+    if (spec != SH_CSS_SHADERS_SPEC)
+        s << "const int gl_MaxDrawBuffers = " << resources.MaxDrawBuffers << ";";
 
     return s.str();
 }
@@ -513,7 +515,7 @@ void TBuiltIns::initialize(ShShaderType type, ShShaderSpec spec,
     default: assert(false && "Language not supported");
     }
 
-    builtInStrings.push_back(BuiltInConstants(resources));
+    builtInStrings.push_back(BuiltInConstants(spec, resources));
 }
 
 void IdentifyBuiltIns(ShShaderType type, ShShaderSpec spec,
@@ -526,11 +528,22 @@ void IdentifyBuiltIns(ShShaderType type, ShShaderSpec spec,
     //
     switch(type) {
     case SH_FRAGMENT_SHADER:
-        symbolTable.insert(*new TVariable(NewPoolTString("gl_FragCoord"),                   TType(EbtFloat, EbpMedium, EvqFragCoord,   4)));
-        symbolTable.insert(*new TVariable(NewPoolTString("gl_FrontFacing"),                 TType(EbtBool,  EbpUndefined, EvqFrontFacing, 1)));
-        symbolTable.insert(*new TVariable(NewPoolTString("gl_FragColor"),                   TType(EbtFloat, EbpMedium, EvqFragColor,   4)));
-        symbolTable.insert(*new TVariable(NewPoolTString("gl_FragData[gl_MaxDrawBuffers]"), TType(EbtFloat, EbpMedium, EvqFragData,    4)));
-        symbolTable.insert(*new TVariable(NewPoolTString("gl_PointCoord"),                  TType(EbtFloat, EbpMedium, EvqPointCoord,  2)));
+        symbolTable.insert(*new TVariable(NewPoolTString("gl_FragCoord"),                       TType(EbtFloat, EbpMedium, EvqFragCoord,   4)));
+        symbolTable.insert(*new TVariable(NewPoolTString("gl_FrontFacing"),                     TType(EbtBool,  EbpUndefined, EvqFrontFacing, 1)));
+        symbolTable.insert(*new TVariable(NewPoolTString("gl_PointCoord"),                      TType(EbtFloat, EbpMedium, EvqPointCoord,  2)));
+
+        //
+        // In CSS Shaders, gl_FragColor, gl_FragData, and gl_MaxDrawBuffers are not available.
+        // Instead, css_MixColor and css_ColorMatrix are available.
+        //
+        if (spec != SH_CSS_SHADERS_SPEC) {
+            symbolTable.insert(*new TVariable(NewPoolTString("gl_FragColor"),                   TType(EbtFloat, EbpMedium, EvqFragColor,   4)));
+            symbolTable.insert(*new TVariable(NewPoolTString("gl_FragData[gl_MaxDrawBuffers]"), TType(EbtFloat, EbpMedium, EvqFragData,    4)));
+        } else {
+            symbolTable.insert(*new TVariable(NewPoolTString("css_MixColor"),                   TType(EbtFloat, EbpMedium, EvqGlobal,      4)));
+            symbolTable.insert(*new TVariable(NewPoolTString("css_ColorMatrix"),                TType(EbtFloat, EbpMedium, EvqGlobal,      4, true)));
+        }
+
         break;
 
     case SH_VERTEX_SHADER:
@@ -620,7 +633,8 @@ void IdentifyBuiltIns(ShShaderType type, ShShaderSpec spec,
 
     // Finally add resource-specific variables.
     switch(type) {
-    case SH_FRAGMENT_SHADER: {
+    case SH_FRAGMENT_SHADER:
+        if (spec != SH_CSS_SHADERS_SPEC) {
             // Set up gl_FragData.  The array size.
             TType fragData(EbtFloat, EbpMedium, EvqFragData, 4, false, true);
             fragData.setArraySize(resources.MaxDrawBuffers);
diff --git a/Source/ThirdParty/ANGLE/src/compiler/InitializeParseContext.cpp b/Source/ThirdParty/ANGLE/src/compiler/InitializeParseContext.cpp
new file mode 100644 (file)
index 0000000..1f40cf5
--- /dev/null
@@ -0,0 +1,96 @@
+//
+// Copyright (c) 2012 The ANGLE Project Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+//
+
+#include "compiler/InitializeParseContext.h"
+
+#include "compiler/osinclude.h"
+
+OS_TLSIndex GlobalParseContextIndex = OS_INVALID_TLS_INDEX;
+
+bool InitializeParseContextIndex()
+{
+    if (GlobalParseContextIndex != OS_INVALID_TLS_INDEX) {
+        assert(0 && "InitializeParseContextIndex(): Parse Context already initalized");
+        return false;
+    }
+
+    //
+    // Allocate a TLS index.
+    //
+    GlobalParseContextIndex = OS_AllocTLSIndex();
+    
+    if (GlobalParseContextIndex == OS_INVALID_TLS_INDEX) {
+        assert(0 && "InitializeParseContextIndex(): Parse Context already initalized");
+        return false;
+    }
+
+    return true;
+}
+
+bool FreeParseContextIndex()
+{
+    OS_TLSIndex tlsiIndex = GlobalParseContextIndex;
+
+    if (GlobalParseContextIndex == OS_INVALID_TLS_INDEX) {
+        assert(0 && "FreeParseContextIndex(): Parse Context index not initalized");
+        return false;
+    }
+
+    GlobalParseContextIndex = OS_INVALID_TLS_INDEX;
+
+    return OS_FreeTLSIndex(tlsiIndex);
+}
+
+bool InitializeGlobalParseContext()
+{
+    if (GlobalParseContextIndex == OS_INVALID_TLS_INDEX) {
+        assert(0 && "InitializeGlobalParseContext(): Parse Context index not initalized");
+        return false;
+    }
+
+    TThreadParseContext *lpParseContext = static_cast<TThreadParseContext *>(OS_GetTLSValue(GlobalParseContextIndex));
+    if (lpParseContext != 0) {
+        assert(0 && "InitializeParseContextIndex(): Parse Context already initalized");
+        return false;
+    }
+
+    TThreadParseContext *lpThreadData = new TThreadParseContext();
+    if (lpThreadData == 0) {
+        assert(0 && "InitializeGlobalParseContext(): Unable to create thread parse context");
+        return false;
+    }
+
+    lpThreadData->lpGlobalParseContext = 0;
+    OS_SetTLSValue(GlobalParseContextIndex, lpThreadData);
+
+    return true;
+}
+
+bool FreeParseContext()
+{
+    if (GlobalParseContextIndex == OS_INVALID_TLS_INDEX) {
+        assert(0 && "FreeParseContext(): Parse Context index not initalized");
+        return false;
+    }
+
+    TThreadParseContext *lpParseContext = static_cast<TThreadParseContext *>(OS_GetTLSValue(GlobalParseContextIndex));
+    if (lpParseContext)
+        delete lpParseContext;
+
+    return true;
+}
+
+TParseContextPointer& GetGlobalParseContext()
+{
+    //
+    // Minimal error checking for speed
+    //
+
+    TThreadParseContext *lpParseContext = static_cast<TThreadParseContext *>(OS_GetTLSValue(GlobalParseContextIndex));
+
+    return lpParseContext->lpGlobalParseContext;
+}
+
index 760fd09..aa53b73 100644 (file)
@@ -13,4 +13,14 @@ bool FreeParseContextIndex();
 bool InitializeGlobalParseContext();
 bool FreeParseContext();
 
+struct TParseContext;
+typedef TParseContext* TParseContextPointer;
+extern TParseContextPointer& GetGlobalParseContext();
+#define GlobalParseContext GetGlobalParseContext()
+
+typedef struct TThreadParseContextRec
+{
+    TParseContext *lpGlobalParseContext;
+} TThreadParseContext;
+
 #endif // __INITIALIZE_PARSE_CONTEXT_INCLUDED_
index ca6d8f7..92c4505 100644 (file)
@@ -1,5 +1,5 @@
 //
-// Copyright (c) 2002-2010 The ANGLE Project Authors. All rights reserved.
+// Copyright (c) 2002-2012 The ANGLE Project Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 //
@@ -373,7 +373,7 @@ TIntermTyped* TIntermediate::addUnaryMath(TOperator op, TIntermNode* childNode,
 // their operator to EOpSequence.
 //
 // Returns an aggregate node, which could be the one passed in if
-// it was already an aggregate.
+// it was already an aggregate but no operator was set.
 //
 TIntermAggregate* TIntermediate::setAggregateOperator(TIntermNode* node, TOperator op, TSourceLoc line)
 {
@@ -592,10 +592,10 @@ TIntermNode* TIntermediate::addSelection(TIntermTyped* cond, TIntermNodePair nod
     //
 
     if (cond->getAsTyped() && cond->getAsTyped()->getAsConstantUnion()) {
-        if (cond->getAsTyped()->getAsConstantUnion()->getUnionArrayPointer()->getBConst())
-            return nodePair.node1;
+        if (cond->getAsTyped()->getAsConstantUnion()->getUnionArrayPointer()->getBConst() == true)
+            return nodePair.node1 ? setAggregateOperator(nodePair.node1, EOpSequence, nodePair.node1->getLine()) : NULL;
         else
-            return nodePair.node2;
+            return nodePair.node2 ? setAggregateOperator(nodePair.node2, EOpSequence, nodePair.node2->getLine()) : NULL;
     }
 
     TIntermSelection* node = new TIntermSelection(cond, nodePair.node1, nodePair.node2);
@@ -656,6 +656,7 @@ TIntermTyped* TIntermediate::addSelection(TIntermTyped* cond, TIntermTyped* true
     // Make a selection node.
     //
     TIntermSelection* node = new TIntermSelection(cond, trueBlock, falseBlock, trueBlock->getType());
+    node->getTypePointer()->setQualifier(EvqTemporary);
     node->setLine(line);
 
     return node;
@@ -1444,9 +1445,3 @@ TIntermTyped* TIntermediate::promoteConstantUnion(TBasicType promoteTo, TIntermC
     return addConstantUnion(leftUnionArray, TType(promoteTo, t.getPrecision(), t.getQualifier(), t.getNominalSize(), t.isMatrix(), t.isArray()), node->getLine());
 }
 
-void TIntermAggregate::addToPragmaTable(const TPragmaTable& pTable)
-{
-    assert(!pragmaTable);
-    pragmaTable = new TPragmaTable();
-    *pragmaTable = pTable;
-}
index 0c7e1a9..a503101 100644 (file)
@@ -15,7 +15,9 @@ TString mapLongName(int id, const TString& name, bool isGlobal)
     stream << "webgl_";
     if (isGlobal)
         stream << "g";
-    stream << id << "_";
+    stream << id;
+    if (name[0] != '_')
+        stream << "_";
     stream << name.substr(0, MAX_SHORTENED_IDENTIFIER_SIZE - stream.str().size());
     return stream.str();
 }
index 69b8c26..d7e69d3 100644 (file)
@@ -6,10 +6,12 @@
 
 #include "compiler/OutputHLSL.h"
 
+#include "common/angleutils.h"
 #include "compiler/debug.h"
 #include "compiler/InfoSink.h"
-#include "compiler/UnfoldSelect.h"
+#include "compiler/UnfoldShortCircuit.h"
 #include "compiler/SearchSymbol.h"
+#include "compiler/DetectDiscontinuity.h"
 
 #include <stdio.h>
 #include <algorithm>
@@ -20,13 +22,13 @@ namespace sh
 TString str(int i)
 {
     char buffer[20];
-    sprintf(buffer, "%d", i);
+    snprintf(buffer, sizeof(buffer), "%d", i);
     return buffer;
 }
 
 OutputHLSL::OutputHLSL(TParseContext &context) : TIntermTraverser(true, true, true), mContext(context)
 {
-    mUnfoldSelect = new UnfoldSelect(context, this);
+    mUnfoldShortCircuit = new UnfoldShortCircuit(context, this);
     mInsideFunction = false;
 
     mUsesTexture2D = false;
@@ -38,6 +40,12 @@ OutputHLSL::OutputHLSL(TParseContext &context) : TIntermTraverser(true, true, tr
     mUsesTextureCube = false;
     mUsesTextureCube_bias = false;
     mUsesTextureCubeLod = false;
+    mUsesTexture2DLod0 = false;
+    mUsesTexture2DLod0_bias = false;
+    mUsesTexture2DProjLod0 = false;
+    mUsesTexture2DProjLod0_bias = false;
+    mUsesTextureCubeLod0 = false;
+    mUsesTextureCubeLod0_bias = false;
     mUsesDepthRange = false;
     mUsesFragCoord = false;
     mUsesPointCoord = false;
@@ -75,20 +83,26 @@ OutputHLSL::OutputHLSL(TParseContext &context) : TIntermTraverser(true, true, tr
     mScopeDepth = 0;
 
     mUniqueIndex = 0;
+
+    mContainsLoopDiscontinuity = false;
+    mOutputLod0Function = false;
+    mInsideDiscontinuousLoop = false;
 }
 
 OutputHLSL::~OutputHLSL()
 {
-    delete mUnfoldSelect;
+    delete mUnfoldShortCircuit;
 }
 
 void OutputHLSL::output()
 {
+    mContainsLoopDiscontinuity = containsLoopDiscontinuity(mContext.treeRoot);
+
     mContext.treeRoot->traverse(this);   // Output the body first to determine what has to go in the header
     header();
 
-    mContext.infoSink.obj << mHeader.c_str();
-    mContext.infoSink.obj << mBody.c_str();
+    mContext.infoSink().obj << mHeader.c_str();
+    mContext.infoSink().obj << mBody.c_str();
 }
 
 TInfoSinkBase &OutputHLSL::getBodyStream()
@@ -205,25 +219,11 @@ void OutputHLSL::header()
         out <<  uniforms;
         out << "\n";
 
-        // The texture fetch functions "flip" the Y coordinate in one way or another. This is because textures are stored
-        // according to the OpenGL convention, i.e. (0, 0) is "bottom left", rather than the D3D convention where (0, 0)
-        // is "top left". Since the HLSL texture fetch functions expect textures to be stored according to the D3D
-        // convention, the Y coordinate passed to these functions is adjusted to compensate.
-        //
-        // The simplest case is texture2D where the mapping is Y -> 1-Y, which maps [0, 1] -> [1, 0].
-        //
-        // The texture2DProj functions are more complicated because the projection divides by either Z or W. For the vec3
-        // case, the mapping is Y -> Z-Y or Y/Z -> 1-Y/Z, which again maps [0, 1] -> [1, 0].
-        //
-        // For cube textures the mapping is Y -> -Y, which maps [-1, 1] -> [1, -1]. This is not sufficient on its own for the
-        // +Y and -Y faces, which are now on the "wrong sides" of the cube. This is compensated for by exchanging the
-        // +Y and -Y faces everywhere else throughout the code.
-        
         if (mUsesTexture2D)
         {
             out << "float4 gl_texture2D(sampler2D s, float2 t)\n"
                    "{\n"
-                   "    return tex2D(s, float2(t.x, 1 - t.y));\n"
+                   "    return tex2D(s, t);\n"
                    "}\n"
                    "\n";
         }
@@ -232,7 +232,7 @@ void OutputHLSL::header()
         {
             out << "float4 gl_texture2D(sampler2D s, float2 t, float bias)\n"
                    "{\n"
-                   "    return tex2Dbias(s, float4(t.x, 1 - t.y, 0, bias));\n"
+                   "    return tex2Dbias(s, float4(t.x, t.y, 0, bias));\n"
                    "}\n"
                    "\n";
         }
@@ -241,12 +241,12 @@ void OutputHLSL::header()
         {
             out << "float4 gl_texture2DProj(sampler2D s, float3 t)\n"
                    "{\n"
-                   "    return tex2Dproj(s, float4(t.x, t.z - t.y, 0, t.z));\n"
+                   "    return tex2Dproj(s, float4(t.x, t.y, 0, t.z));\n"
                    "}\n"
                    "\n"
                    "float4 gl_texture2DProj(sampler2D s, float4 t)\n"
                    "{\n"
-                   "    return tex2Dproj(s, float4(t.x, t.w - t.y, t.z, t.w));\n"
+                   "    return tex2Dproj(s, t);\n"
                    "}\n"
                    "\n";
         }
@@ -255,12 +255,12 @@ void OutputHLSL::header()
         {
             out << "float4 gl_texture2DProj(sampler2D s, float3 t, float bias)\n"
                    "{\n"
-                   "    return tex2Dbias(s, float4(t.x / t.z, 1 - (t.y / t.z), 0, bias));\n"
+                   "    return tex2Dbias(s, float4(t.x / t.z, t.y / t.z, 0, bias));\n"
                    "}\n"
                    "\n"
                    "float4 gl_texture2DProj(sampler2D s, float4 t, float bias)\n"
                    "{\n"
-                   "    return tex2Dbias(s, float4(t.x / t.w, 1 - (t.y / t.w), 0, bias));\n"
+                   "    return tex2Dbias(s, float4(t.x / t.w, t.y / t.w, 0, bias));\n"
                    "}\n"
                    "\n";
         }
@@ -269,7 +269,7 @@ void OutputHLSL::header()
         {
             out << "float4 gl_textureCube(samplerCUBE s, float3 t)\n"
                    "{\n"
-                   "    return texCUBE(s, float3(t.x, -t.y, t.z));\n"
+                   "    return texCUBE(s, t);\n"
                    "}\n"
                    "\n";
         }
@@ -278,7 +278,73 @@ void OutputHLSL::header()
         {
             out << "float4 gl_textureCube(samplerCUBE s, float3 t, float bias)\n"
                    "{\n"
-                   "    return texCUBEbias(s, float4(t.x, -t.y, t.z, bias));\n"
+                   "    return texCUBEbias(s, float4(t.x, t.y, t.z, bias));\n"
+                   "}\n"
+                   "\n";
+        }
+
+        // These *Lod0 intrinsics are not available in GL fragment shaders.
+        // They are used to sample using discontinuous texture coordinates.
+        if (mUsesTexture2DLod0)
+        {
+            out << "float4 gl_texture2DLod0(sampler2D s, float2 t)\n"
+                   "{\n"
+                   "    return tex2Dlod(s, float4(t.x, t.y, 0, 0));\n"
+                   "}\n"
+                   "\n";
+        }
+
+        if (mUsesTexture2DLod0_bias)
+        {
+            out << "float4 gl_texture2DLod0(sampler2D s, float2 t, float bias)\n"
+                   "{\n"
+                   "    return tex2Dlod(s, float4(t.x, t.y, 0, 0));\n"
+                   "}\n"
+                   "\n";
+        }
+
+        if (mUsesTexture2DProjLod0)
+        {
+            out << "float4 gl_texture2DProjLod0(sampler2D s, float3 t)\n"
+                   "{\n"
+                   "    return tex2Dlod(s, float4(t.x / t.z, t.y / t.z, 0, 0));\n"
+                   "}\n"
+                   "\n"
+                   "float4 gl_texture2DProjLod(sampler2D s, float4 t)\n"
+                   "{\n"
+                   "    return tex2Dlod(s, float4(t.x / t.w, t.y / t.w, 0, 0));\n"
+                   "}\n"
+                   "\n";
+        }
+
+        if (mUsesTexture2DProjLod0_bias)
+        {
+            out << "float4 gl_texture2DProjLod0_bias(sampler2D s, float3 t, float bias)\n"
+                   "{\n"
+                   "    return tex2Dlod(s, float4(t.x / t.z, t.y / t.z, 0, 0));\n"
+                   "}\n"
+                   "\n"
+                   "float4 gl_texture2DProjLod_bias(sampler2D s, float4 t, float bias)\n"
+                   "{\n"
+                   "    return tex2Dlod(s, float4(t.x / t.w, t.y / t.w, 0, 0));\n"
+                   "}\n"
+                   "\n";
+        }
+
+        if (mUsesTextureCubeLod0)
+        {
+            out << "float4 gl_textureCubeLod0(samplerCUBE s, float3 t)\n"
+                   "{\n"
+                   "    return texCUBElod(s, float4(t.x, t.y, t.z, 0));\n"
+                   "}\n"
+                   "\n";
+        }
+
+        if (mUsesTextureCubeLod0_bias)
+        {
+            out << "float4 gl_textureCubeLod0(samplerCUBE s, float3 t, float bias)\n"
+                   "{\n"
+                   "    return texCUBElod(s, float4(t.x, t.y, t.z, 0));\n"
                    "}\n"
                    "\n";
         }
@@ -897,7 +963,7 @@ bool OutputHLSL::visitBinary(Visit visit, TIntermBinary *node)
       case EOpIndexDirectStruct:
         if (visit == InVisit)
         {
-            out << "." + node->getType().getFieldName();
+            out << "." + decorateField(node->getType().getFieldName(), node->getLeft()->getType());
 
             return false;
         }
@@ -973,9 +1039,9 @@ bool OutputHLSL::visitBinary(Visit visit, TIntermBinary *node)
                 const TType *fieldType = (*fields)[i].type;
 
                 node->getLeft()->traverse(this);
-                out << "." + fieldType->getFieldName() + " == ";
+                out << "." + decorateField(fieldType->getFieldName(), node->getLeft()->getType()) + " == ";
                 node->getRight()->traverse(this);
-                out << "." + fieldType->getFieldName();
+                out << "." + decorateField(fieldType->getFieldName(), node->getLeft()->getType());
 
                 if (i < fields->size() - 1)
                 {
@@ -1054,12 +1120,16 @@ bool OutputHLSL::visitBinary(Visit visit, TIntermBinary *node)
       case EOpVectorTimesMatrix: outputTriplet(visit, "mul(", ", transpose(", "))"); break;
       case EOpMatrixTimesVector: outputTriplet(visit, "mul(transpose(", "), ", ")"); break;
       case EOpMatrixTimesMatrix: outputTriplet(visit, "transpose(mul(transpose(", "), transpose(", ")))"); break;
-      case EOpLogicalOr:         outputTriplet(visit, "(", " || ", ")");  break;
+      case EOpLogicalOr:
+        out << "s" << mUnfoldShortCircuit->getNextTemporaryIndex();
+        return false;
       case EOpLogicalXor:
         mUsesXor = true;
         outputTriplet(visit, "xor(", ", ", ")");
         break;
-      case EOpLogicalAnd:        outputTriplet(visit, "(", " && ", ")");  break;
+      case EOpLogicalAnd:
+        out << "s" << mUnfoldShortCircuit->getNextTemporaryIndex();
+        return false;
       default: UNREACHABLE();
     }
 
@@ -1131,9 +1201,36 @@ bool OutputHLSL::visitUnary(Visit visit, TIntermUnary *node)
       case EOpFract:            outputTriplet(visit, "frac(", "", ")");      break;
       case EOpLength:           outputTriplet(visit, "length(", "", ")");    break;
       case EOpNormalize:        outputTriplet(visit, "normalize(", "", ")"); break;
-      case EOpDFdx:             outputTriplet(visit, "ddx(", "", ")");       break;
-      case EOpDFdy:             outputTriplet(visit, "(-ddy(", "", "))");    break;
-      case EOpFwidth:           outputTriplet(visit, "fwidth(", "", ")");    break;        
+      case EOpDFdx:
+        if(mInsideDiscontinuousLoop || mOutputLod0Function)
+        {
+            outputTriplet(visit, "(", "", ", 0.0)");
+        }
+        else
+        {
+            outputTriplet(visit, "ddx(", "", ")");
+        }
+        break;
+      case EOpDFdy:
+        if(mInsideDiscontinuousLoop || mOutputLod0Function)
+        {
+            outputTriplet(visit, "(", "", ", 0.0)");
+        }
+        else
+        {
+           outputTriplet(visit, "ddy(", "", ")");
+        }
+        break;
+      case EOpFwidth:
+        if(mInsideDiscontinuousLoop || mOutputLod0Function)
+        {
+            outputTriplet(visit, "(", "", ", 0.0)");
+        }
+        else
+        {
+            outputTriplet(visit, "fwidth(", "", ")");
+        }
+        break;
       case EOpAny:              outputTriplet(visit, "any(", "", ")");       break;
       case EOpAll:              outputTriplet(visit, "all(", "", ")");       break;
       default: UNREACHABLE();
@@ -1171,12 +1268,7 @@ bool OutputHLSL::visitAggregate(Visit visit, TIntermAggregate *node)
             {
                 outputLineDirective((*sit)->getLine());
 
-                if (isSingleStatement(*sit))
-                {
-                    mUnfoldSelect->traverse(*sit);
-                }
-
-                (*sit)->traverse(this);
+                traverseStatements(*sit);
 
                 out << ";\n";
             }
@@ -1290,59 +1382,64 @@ bool OutputHLSL::visitAggregate(Visit visit, TIntermAggregate *node)
         {
             TString name = TFunction::unmangleName(node->getName());
 
-            if (visit == PreVisit)
+            out << typeString(node->getType()) << " ";
+
+            if (name == "main")
+            {
+                out << "gl_main(";
+            }
+            else
             {
-                out << typeString(node->getType()) << " ";
+                out << decorate(name) << (mOutputLod0Function ? "Lod0(" : "(");
+            }
 
-                if (name == "main")
-                {
-                    out << "gl_main(";
-                }
-                else
-                {
-                    out << decorate(name) << "(";
-                }
+            TIntermSequence &sequence = node->getSequence();
+            TIntermSequence &arguments = sequence[0]->getAsAggregate()->getSequence();
 
-                TIntermSequence &sequence = node->getSequence();
-                TIntermSequence &arguments = sequence[0]->getAsAggregate()->getSequence();
+            for (unsigned int i = 0; i < arguments.size(); i++)
+            {
+                TIntermSymbol *symbol = arguments[i]->getAsSymbolNode();
 
-                for (unsigned int i = 0; i < arguments.size(); i++)
+                if (symbol)
                 {
-                    TIntermSymbol *symbol = arguments[i]->getAsSymbolNode();
-
-                    if (symbol)
+                    if (symbol->getType().getStruct())
                     {
-                        if (symbol->getType().getStruct())
-                        {
-                            addConstructor(symbol->getType(), scopedStruct(symbol->getType().getTypeName()), NULL);
-                        }
+                        addConstructor(symbol->getType(), scopedStruct(symbol->getType().getTypeName()), NULL);
+                    }
 
-                        out << argumentString(symbol);
+                    out << argumentString(symbol);
 
-                        if (i < arguments.size() - 1)
-                        {
-                            out << ", ";
-                        }
+                    if (i < arguments.size() - 1)
+                    {
+                        out << ", ";
                     }
-                    else UNREACHABLE();
                 }
+                else UNREACHABLE();
+            }
 
-                sequence.erase(sequence.begin());
-
-                out << ")\n";
-                
-                outputLineDirective(node->getLine());
-                out << "{\n";
-                
+            out << ")\n"
+                "{\n";
+            
+            if (sequence.size() > 1)
+            {
                 mInsideFunction = true;
+                sequence[1]->traverse(this);
+                mInsideFunction = false;
             }
-            else if (visit == PostVisit)
-            {
-                outputLineDirective(node->getEndLine());
-                out << "}\n";
+            
+            out << "}\n";
 
-                mInsideFunction = false;
+            if (mContainsLoopDiscontinuity && !mOutputLod0Function)
+            {
+                if (name != "main")
+                {
+                    mOutputLod0Function = true;
+                    node->traverse(this);
+                    mOutputLod0Function = false;
+                }
             }
+
+            return false;
         }
         break;
       case EOpFunctionCall:
@@ -1350,54 +1447,106 @@ bool OutputHLSL::visitAggregate(Visit visit, TIntermAggregate *node)
             if (visit == PreVisit)
             {
                 TString name = TFunction::unmangleName(node->getName());
+                bool lod0 = mInsideDiscontinuousLoop || mOutputLod0Function;
 
                 if (node->isUserDefined())
                 {
-                    out << decorate(name) << "(";
+                    out << decorate(name) << (lod0 ? "Lod0(" : "(");
                 }
                 else
                 {
                     if (name == "texture2D")
                     {
-                        if (node->getSequence().size() == 2)
+                        if (!lod0)
                         {
-                            mUsesTexture2D = true;
+                            if (node->getSequence().size() == 2)
+                            {
+                                mUsesTexture2D = true;
+                            }
+                            else if (node->getSequence().size() == 3)
+                            {
+                                mUsesTexture2D_bias = true;
+                            }
+                            else UNREACHABLE();
+
+                            out << "gl_texture2D(";
                         }
-                        else if (node->getSequence().size() == 3)
+                        else
                         {
-                            mUsesTexture2D_bias = true;
-                        }
-                        else UNREACHABLE();
+                            if (node->getSequence().size() == 2)
+                            {
+                                mUsesTexture2DLod0 = true;
+                            }
+                            else if (node->getSequence().size() == 3)
+                            {
+                                mUsesTexture2DLod0_bias = true;
+                            }
+                            else UNREACHABLE();
 
-                        out << "gl_texture2D(";
+                            out << "gl_texture2DLod0(";
+                        }
                     }
                     else if (name == "texture2DProj")
                     {
-                        if (node->getSequence().size() == 2)
+                        if (!lod0)
                         {
-                            mUsesTexture2DProj = true;
+                            if (node->getSequence().size() == 2)
+                            {
+                                mUsesTexture2DProj = true;
+                            }
+                            else if (node->getSequence().size() == 3)
+                            {
+                                mUsesTexture2DProj_bias = true;
+                            }
+                            else UNREACHABLE();
+
+                            out << "gl_texture2DProj(";
                         }
-                        else if (node->getSequence().size() == 3)
+                        else
                         {
-                            mUsesTexture2DProj_bias = true;
-                        }
-                        else UNREACHABLE();
+                            if (node->getSequence().size() == 2)
+                            {
+                                mUsesTexture2DProjLod0 = true;
+                            }
+                            else if (node->getSequence().size() == 3)
+                            {
+                                mUsesTexture2DProjLod0_bias = true;
+                            }
+                            else UNREACHABLE();
 
-                        out << "gl_texture2DProj(";
+                            out << "gl_texture2DProjLod0(";
+                        }
                     }
                     else if (name == "textureCube")
                     {
-                        if (node->getSequence().size() == 2)
+                        if (!lod0)
                         {
-                            mUsesTextureCube = true;
+                            if (node->getSequence().size() == 2)
+                            {
+                                mUsesTextureCube = true;
+                            }
+                            else if (node->getSequence().size() == 3)
+                            {
+                                mUsesTextureCube_bias = true;
+                            }
+                            else UNREACHABLE();
+
+                            out << "gl_textureCube(";
                         }
-                        else if (node->getSequence().size() == 3)
+                        else
                         {
-                            mUsesTextureCube_bias = true;
-                        }
-                        else UNREACHABLE();
+                            if (node->getSequence().size() == 2)
+                            {
+                                mUsesTextureCubeLod0 = true;
+                            }
+                            else if (node->getSequence().size() == 3)
+                            {
+                                mUsesTextureCubeLod0_bias = true;
+                            }
+                            else UNREACHABLE();
 
-                        out << "gl_textureCube(";
+                            out << "gl_textureCubeLod0(";
+                        }
                     }
                     else if (name == "texture2DLod")
                     {
@@ -1583,11 +1732,11 @@ bool OutputHLSL::visitSelection(Visit visit, TIntermSelection *node)
 
     if (node->usesTernaryOperator())
     {
-        out << "s" << mUnfoldSelect->getNextTemporaryIndex();
+        out << "s" << mUnfoldShortCircuit->getNextTemporaryIndex();
     }
     else  // if/else statement
     {
-        mUnfoldSelect->traverse(node->getCondition());
+        mUnfoldShortCircuit->traverse(node->getCondition());
 
         out << "if(";
 
@@ -1600,11 +1749,11 @@ bool OutputHLSL::visitSelection(Visit visit, TIntermSelection *node)
 
         if (node->getTrueBlock())
         {
-            node->getTrueBlock()->traverse(this);
+            traverseStatements(node->getTrueBlock());
         }
 
         outputLineDirective(node->getLine());
-        out << ";}\n";
+        out << ";\n}\n";
 
         if (node->getFalseBlock())
         {
@@ -1614,10 +1763,10 @@ bool OutputHLSL::visitSelection(Visit visit, TIntermSelection *node)
             out << "{\n";
 
             outputLineDirective(node->getFalseBlock()->getLine());
-            node->getFalseBlock()->traverse(this);
+            traverseStatements(node->getFalseBlock());
 
             outputLineDirective(node->getFalseBlock()->getLine());
-            out << ";}\n";
+            out << ";\n}\n";
         }
     }
 
@@ -1631,6 +1780,13 @@ void OutputHLSL::visitConstantUnion(TIntermConstantUnion *node)
 
 bool OutputHLSL::visitLoop(Visit visit, TIntermLoop *node)
 {
+    bool wasDiscontinuous = mInsideDiscontinuousLoop;
+
+    if (!mInsideDiscontinuousLoop)
+    {
+        mInsideDiscontinuousLoop = containsLoopDiscontinuity(node);
+    }
+
     if (handleExcessiveLoop(node))
     {
         return false;
@@ -1676,7 +1832,7 @@ bool OutputHLSL::visitLoop(Visit visit, TIntermLoop *node)
 
     if (node->getBody())
     {
-        node->getBody()->traverse(this);
+        traverseStatements(node->getBody());
     }
 
     outputLineDirective(node->getLine());
@@ -1694,6 +1850,8 @@ bool OutputHLSL::visitLoop(Visit visit, TIntermLoop *node)
 
     out << "}\n";
 
+    mInsideDiscontinuousLoop = wasDiscontinuous;
+
     return false;
 }
 
@@ -1732,6 +1890,16 @@ bool OutputHLSL::visitBranch(Visit visit, TIntermBranch *node)
     return true;
 }
 
+void OutputHLSL::traverseStatements(TIntermNode *node)
+{
+    if (isSingleStatement(node))
+    {
+        mUnfoldShortCircuit->traverse(node);
+    }
+
+    node->traverse(this);
+}
+
 bool OutputHLSL::isSingleStatement(TIntermNode *node)
 {
     TIntermAggregate *aggregate = node->getAsAggregate();
@@ -1759,9 +1927,11 @@ bool OutputHLSL::isSingleStatement(TIntermNode *node)
     return true;
 }
 
-// Handle loops with more than 255 iterations (unsupported by D3D9) by splitting them
+// Handle loops with more than 254 iterations (unsupported by D3D9) by splitting them
+// (The D3D documentation says 255 iterations, but the compiler complains at anything more than 254).
 bool OutputHLSL::handleExcessiveLoop(TIntermLoop *node)
 {
+    const int MAX_LOOP_ITERATIONS = 254;
     TInfoSinkBase &out = mBody;
 
     // Parse loops of the form:
@@ -1877,14 +2047,14 @@ bool OutputHLSL::handleExcessiveLoop(TIntermLoop *node)
         {
             int iterations = (limit - initial) / increment;
 
-            if (iterations <= 255)
+            if (iterations <= MAX_LOOP_ITERATIONS)
             {
                 return false;   // Not an excessive loop
             }
 
             while (iterations > 0)
             {
-                int clampedLimit = initial + increment * std::min(255, iterations);
+                int clampedLimit = initial + increment * std::min(MAX_LOOP_ITERATIONS, iterations);
 
                 // for(int index = initial; index < clampedLimit; index += increment)
 
@@ -1915,8 +2085,8 @@ bool OutputHLSL::handleExcessiveLoop(TIntermLoop *node)
                 outputLineDirective(node->getLine());
                 out << ";}\n";
 
-                initial += 255 * increment;
-                iterations -= 255;
+                initial += MAX_LOOP_ITERATIONS * increment;
+                iterations -= MAX_LOOP_ITERATIONS;
             }
 
             return true;
@@ -2012,7 +2182,7 @@ TString OutputHLSL::typeString(const TType &type)
             {
                 const TType &field = *fields[i].type;
 
-                string += "    " + typeString(field) + " " + field.getFieldName() + arrayString(field) + ";\n";
+                string += "    " + typeString(field) + " " + decorate(field.getFieldName()) + arrayString(field) + ";\n";
             }
 
             string += "} ";
@@ -2065,6 +2235,8 @@ TString OutputHLSL::typeString(const TType &type)
             return "samplerCUBE";
           case EbtSamplerExternalOES:
             return "sampler2D";
+          default:
+            break;
         }
     }
 
@@ -2135,7 +2307,7 @@ void OutputHLSL::addConstructor(const TType &type, const TString &name, const TI
         {
             const TType &field = *fields[i].type;
 
-            structure += "    " + typeString(field) + " " + field.getFieldName() + arrayString(field) + ";\n";
+            structure += "    " + typeString(field) + " " + decorateField(field.getFieldName(), type) + arrayString(field) + ";\n";
         }
 
         structure += "};\n";
@@ -2434,4 +2606,14 @@ TString OutputHLSL::decorateUniform(const TString &string, const TType &type)
     
     return decorate(string);
 }
+
+TString OutputHLSL::decorateField(const TString &string, const TType &structure)
+{
+    if (structure.getTypeName().compare(0, 3, "gl_") != 0)
+    {
+        return decorate(string);
+    }
+
+    return string;
+}
 }
index 824bc07..ea28a3c 100644 (file)
@@ -15,7 +15,7 @@
 
 namespace sh
 {
-class UnfoldSelect;
+class UnfoldShortCircuit;
 
 class OutputHLSL : public TIntermTraverser
 {
@@ -33,6 +33,7 @@ class OutputHLSL : public TIntermTraverser
     static TString initializer(const TType &type);
     static TString decorate(const TString &string);                      // Prepends an underscore to avoid naming clashes
     static TString decorateUniform(const TString &string, const TType &type);
+    static TString decorateField(const TString &string, const TType &structure);
 
   protected:
     void header();
@@ -47,6 +48,7 @@ class OutputHLSL : public TIntermTraverser
     bool visitLoop(Visit visit, TIntermLoop*);
     bool visitBranch(Visit visit, TIntermBranch*);
 
+    void traverseStatements(TIntermNode *node);
     bool isSingleStatement(TIntermNode *node);
     bool handleExcessiveLoop(TIntermLoop *node);
     void outputTriplet(Visit visit, const TString &preString, const TString &inString, const TString &postString);
@@ -62,7 +64,7 @@ class OutputHLSL : public TIntermTraverser
     TString structLookup(const TString &typeName);
 
     TParseContext &mContext;
-    UnfoldSelect *mUnfoldSelect;
+    UnfoldShortCircuit *mUnfoldShortCircuit;
     bool mInsideFunction;
 
     // Output streams
@@ -84,6 +86,12 @@ class OutputHLSL : public TIntermTraverser
     bool mUsesTextureCube;
     bool mUsesTextureCube_bias;
     bool mUsesTextureCubeLod;
+    bool mUsesTexture2DLod0;
+    bool mUsesTexture2DLod0_bias;
+    bool mUsesTexture2DProjLod0;
+    bool mUsesTexture2DProjLod0_bias;
+    bool mUsesTextureCubeLod0;
+    bool mUsesTextureCubeLod0_bias;
     bool mUsesDepthRange;
     bool mUsesFragCoord;
     bool mUsesPointCoord;
@@ -132,6 +140,10 @@ class OutputHLSL : public TIntermTraverser
     unsigned int mScopeDepth;
 
     int mUniqueIndex;   // For creating unique names
+
+    bool mContainsLoopDiscontinuity;
+    bool mOutputLod0Function;
+    bool mInsideDiscontinuousLoop;
 };
 }
 
index 431f8d1..79bddea 100644 (file)
@@ -1,5 +1,5 @@
 //
-// Copyright (c) 2002-2010 The ANGLE Project Authors. All rights reserved.
+// Copyright (c) 2002-2012 The ANGLE Project Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 //
 #include <stdio.h>
 
 #include "compiler/glslang.h"
-#include "compiler/osinclude.h"
-#include "compiler/InitializeParseContext.h"
-
-extern "C" {
-extern int InitPreprocessor();
-extern int FinalizePreprocessor();
-extern void PredefineIntMacro(const char *name, int value);
-}
-
-static void ReportInfo(TInfoSinkBase& sink,
-                       TPrefixType type, TSourceLoc loc,
-                       const char* reason, const char* token, 
-                       const char* extraInfo)
-{
-    /* VC++ format: file(linenum) : error #: 'token' : extrainfo */
-    sink.prefix(type);
-    sink.location(loc);
-    sink << "'" << token <<  "' : " << reason << " " << extraInfo << "\n";
-}
-
-static void DefineExtensionMacros(const TExtensionBehavior& extBehavior)
-{
-    for (TExtensionBehavior::const_iterator iter = extBehavior.begin();
-         iter != extBehavior.end(); ++iter) {
-        PredefineIntMacro(iter->first.c_str(), 1);
-    }
-}
+#include "compiler/preprocessor/new/SourceLocation.h"
 
 ///////////////////////////////////////////////////////////////////////
 //
@@ -52,7 +26,7 @@ bool TParseContext::parseVectorFields(const TString& compString, int vecSize, TV
 {
     fields.num = (int) compString.size();
     if (fields.num > 4) {
-        error(line, "illegal vector field selection", compString.c_str(), "");
+        error(line, "illegal vector field selection", compString.c_str());
         return false;
     }
 
@@ -114,20 +88,20 @@ bool TParseContext::parseVectorFields(const TString& compString, int vecSize, TV
             fieldSet[i] = estpq;
             break;
         default:
-            error(line, "illegal vector field selection", compString.c_str(), "");
+            error(line, "illegal vector field selection", compString.c_str());
             return false;
         }
     }
 
     for (int i = 0; i < fields.num; ++i) {
         if (fields.offsets[i] >= vecSize) {
-            error(line, "vector field selection out of range",  compString.c_str(), "");
+            error(line, "vector field selection out of range",  compString.c_str());
             return false;
         }
 
         if (i > 0) {
             if (fieldSet[i] != fieldSet[i-1]) {
-                error(line, "illegal - vector component fields not from the same set", compString.c_str(), "");
+                error(line, "illegal - vector component fields not from the same set", compString.c_str());
                 return false;
             }
         }
@@ -149,20 +123,20 @@ bool TParseContext::parseMatrixFields(const TString& compString, int matSize, TM
     fields.col = -1;
 
     if (compString.size() != 2) {
-        error(line, "illegal length of matrix field selection", compString.c_str(), "");
+        error(line, "illegal length of matrix field selection", compString.c_str());
         return false;
     }
 
     if (compString[0] == '_') {
         if (compString[1] < '0' || compString[1] > '3') {
-            error(line, "illegal matrix field selection", compString.c_str(), "");
+            error(line, "illegal matrix field selection", compString.c_str());
             return false;
         }
         fields.wholeCol = true;
         fields.col = compString[1] - '0';
     } else if (compString[1] == '_') {
         if (compString[0] < '0' || compString[0] > '3') {
-            error(line, "illegal matrix field selection", compString.c_str(), "");
+            error(line, "illegal matrix field selection", compString.c_str());
             return false;
         }
         fields.wholeRow = true;
@@ -170,7 +144,7 @@ bool TParseContext::parseMatrixFields(const TString& compString, int matSize, TM
     } else {
         if (compString[0] < '0' || compString[0] > '3' ||
             compString[1] < '0' || compString[1] > '3') {
-            error(line, "illegal matrix field selection", compString.c_str(), "");
+            error(line, "illegal matrix field selection", compString.c_str());
             return false;
         }
         fields.row = compString[0] - '0';
@@ -178,7 +152,7 @@ bool TParseContext::parseMatrixFields(const TString& compString, int matSize, TM
     }
 
     if (fields.row >= matSize || fields.col >= matSize) {
-        error(line, "matrix field selection out of range", compString.c_str(), "");
+        error(line, "matrix field selection out of range", compString.c_str());
         return false;
     }
 
@@ -203,30 +177,28 @@ void TParseContext::recover()
 //
 void TParseContext::error(TSourceLoc loc,
                           const char* reason, const char* token, 
-                          const char* extraInfoFormat, ...)
+                          const char* extraInfo)
 {
-    char extraInfo[512];
-    va_list marker;
-    va_start(marker, extraInfoFormat);
-    vsnprintf(extraInfo, sizeof(extraInfo), extraInfoFormat, marker);
+    pp::SourceLocation srcLoc;
+    DecodeSourceLoc(loc, &srcLoc.file, &srcLoc.line);
+    diagnostics.writeInfo(pp::Diagnostics::ERROR,
+                          srcLoc, reason, token, extraInfo);
 
-    ReportInfo(infoSink.info, EPrefixError, loc, reason, token, extraInfo);
-
-    va_end(marker);
     ++numErrors;
 }
 
 void TParseContext::warning(TSourceLoc loc,
                             const char* reason, const char* token,
-                            const char* extraInfoFormat, ...) {
-    char extraInfo[512];
-    va_list marker;
-    va_start(marker, extraInfoFormat);
-    vsnprintf(extraInfo, sizeof(extraInfo), extraInfoFormat, marker);
-
-    ReportInfo(infoSink.info, EPrefixWarning, loc, reason, token, extraInfo);
+                            const char* extraInfo) {
+    pp::SourceLocation srcLoc;
+    DecodeSourceLoc(loc, &srcLoc.file, &srcLoc.line);
+    diagnostics.writeInfo(pp::Diagnostics::WARNING,
+                          srcLoc, reason, token, extraInfo);
+}
 
-    va_end(marker);
+void TParseContext::trace(const char* str)
+{
+    diagnostics.writeDebug(str);
 }
 
 //
@@ -234,8 +206,10 @@ void TParseContext::warning(TSourceLoc loc,
 //
 void TParseContext::assignError(int line, const char* op, TString left, TString right)
 {
-    error(line, "", op, "cannot convert from '%s' to '%s'",
-          right.c_str(), left.c_str());
+    std::stringstream extraInfoStream;
+    extraInfoStream << "cannot convert from '" << right << "' to '" << left << "'";
+    std::string extraInfo = extraInfoStream.str();
+    error(line, "", op, extraInfo.c_str());
 }
 
 //
@@ -243,9 +217,11 @@ void TParseContext::assignError(int line, const char* op, TString left, TString
 //
 void TParseContext::unaryOpError(int line, const char* op, TString operand)
 {
-   error(line, " wrong operand type", op, 
-          "no operation '%s' exists that takes an operand of type %s (or there is no acceptable conversion)",
-          op, operand.c_str());
+    std::stringstream extraInfoStream;
+    extraInfoStream << "no operation '" << op << "' exists that takes an operand of type " << operand 
+                    << " (or there is no acceptable conversion)";
+    std::string extraInfo = extraInfoStream.str();
+    error(line, " wrong operand type", op, extraInfo.c_str());
 }
 
 //
@@ -253,10 +229,11 @@ void TParseContext::unaryOpError(int line, const char* op, TString operand)
 //
 void TParseContext::binaryOpError(int line, const char* op, TString left, TString right)
 {
-    error(line, " wrong operand types ", op, 
-            "no operation '%s' exists that takes a left-hand operand of type '%s' and "
-            "a right operand of type '%s' (or there is no acceptable conversion)", 
-            op, left.c_str(), right.c_str());
+    std::stringstream extraInfoStream;
+    extraInfoStream << "no operation '" << op << "' exists that takes a left-hand operand of type '" << left 
+                    << "' and a right operand of type '" << right << "' (or there is no acceptable conversion)";
+    std::string extraInfo = extraInfoStream.str();
+    error(line, " wrong operand types ", op, extraInfo.c_str()); 
 }
 
 bool TParseContext::precisionErrorCheck(int line, TPrecision precision, TBasicType type){
@@ -265,13 +242,13 @@ bool TParseContext::precisionErrorCheck(int line, TPrecision precision, TBasicTy
     switch( type ){
     case EbtFloat:
         if( precision == EbpUndefined ){
-            error( line, "No precision specified for (float)", "", "" );
+            error( line, "No precision specified for (float)", "" );
             return true;
         }
         break;
     case EbtInt:
         if( precision == EbpUndefined ){
-            error( line, "No precision specified (int)", "", "" );
+            error( line, "No precision specified (int)", "" );
             return true;
         }
         break;
@@ -313,7 +290,7 @@ bool TParseContext::lValueErrorCheck(int line, const char* op, TIntermTyped* nod
                     int value = (*p)->getAsTyped()->getAsConstantUnion()->getUnionArrayPointer()->getIConst();
                     offset[value]++;     
                     if (offset[value] > 1) {
-                        error(line, " l-value of swizzle cannot have duplicate components", op, "", "");
+                        error(line, " l-value of swizzle cannot have duplicate components", op);
 
                         return true;
                     }
@@ -324,7 +301,7 @@ bool TParseContext::lValueErrorCheck(int line, const char* op, TIntermTyped* nod
         default: 
             break;
         }
-        error(line, " l-value required", op, "", "");
+        error(line, " l-value required", op);
 
         return true;
     }
@@ -364,7 +341,7 @@ bool TParseContext::lValueErrorCheck(int line, const char* op, TIntermTyped* nod
     }
 
     if (message == 0 && binaryNode == 0 && symNode == 0) {
-        error(line, " l-value required", op, "", "");
+        error(line, " l-value required", op);
 
         return true;
     }
@@ -379,10 +356,18 @@ bool TParseContext::lValueErrorCheck(int line, const char* op, TIntermTyped* nod
     //
     // If we get here, we have an error and a message.
     //
-    if (symNode)
-        error(line, " l-value required", op, "\"%s\" (%s)", symbol, message);
-    else
-        error(line, " l-value required", op, "(%s)", message);
+    if (symNode) {
+        std::stringstream extraInfoStream;
+        extraInfoStream << "\"" << symbol << "\" (" << message << ")";
+        std::string extraInfo = extraInfoStream.str();
+        error(line, " l-value required", op, extraInfo.c_str());
+    }
+    else {
+        std::stringstream extraInfoStream;
+        extraInfoStream << "(" << message << ")";
+        std::string extraInfo = extraInfoStream.str();
+        error(line, " l-value required", op, extraInfo.c_str());
+    }
 
     return true;
 }
@@ -398,7 +383,7 @@ bool TParseContext::constErrorCheck(TIntermTyped* node)
     if (node->getQualifier() == EvqConst)
         return false;
 
-    error(node->getLine(), "constant expression required", "", "");
+    error(node->getLine(), "constant expression required", "");
 
     return true;
 }
@@ -414,7 +399,7 @@ bool TParseContext::integerErrorCheck(TIntermTyped* node, const char* token)
     if (node->getBasicType() == EbtInt && node->getNominalSize() == 1)
         return false;
 
-    error(node->getLine(), "integer expression required", token, "");
+    error(node->getLine(), "integer expression required", token);
 
     return true;
 }
@@ -430,7 +415,7 @@ bool TParseContext::globalErrorCheck(int line, bool global, const char* token)
     if (global)
         return false;
 
-    error(line, "only allowed at global scope", token, "");
+    error(line, "only allowed at global scope", token);
 
     return true;
 }
@@ -449,24 +434,26 @@ bool TParseContext::reservedErrorCheck(int line, const TString& identifier)
     static const char* reservedErrMsg = "reserved built-in name";
     if (!symbolTable.atBuiltInLevel()) {
         if (identifier.compare(0, 3, "gl_") == 0) {
-            error(line, reservedErrMsg, "gl_", "");
+            error(line, reservedErrMsg, "gl_");
             return true;
         }
-        if (shaderSpec == SH_WEBGL_SPEC) {
+        if (isWebGLBasedSpec(shaderSpec)) {
             if (identifier.compare(0, 6, "webgl_") == 0) {
-                error(line, reservedErrMsg, "webgl_", "");
+                error(line, reservedErrMsg, "webgl_");
                 return true;
             }
             if (identifier.compare(0, 7, "_webgl_") == 0) {
-                error(line, reservedErrMsg, "_webgl_", "");
+                error(line, reservedErrMsg, "_webgl_");
+                return true;
+            }
+            if (shaderSpec == SH_CSS_SHADERS_SPEC && identifier.compare(0, 4, "css_") == 0) {
+                error(line, reservedErrMsg, "css_");
                 return true;
             }
         }
         if (identifier.find("__") != TString::npos) {
-            //error(line, "Two consecutive underscores are reserved for future use.", identifier.c_str(), "", "");
-            //return true;
-            infoSink.info.message(EPrefixWarning, "Two consecutive underscores are reserved for future use.", line);
-            return false;
+            error(line, "identifiers containing two consecutive underscores (__) are reserved as possible future keywords", identifier.c_str());
+            return true;
         }
     }
 
@@ -527,51 +514,51 @@ bool TParseContext::constructorErrorCheck(int line, TIntermNode* node, TFunction
         type->setQualifier(EvqConst);
 
     if (type->isArray() && type->getArraySize() != function.getParamCount()) {
-        error(line, "array constructor needs one argument per array element", "constructor", "");
+        error(line, "array constructor needs one argument per array element", "constructor");
         return true;
     }
 
     if (arrayArg && op != EOpConstructStruct) {
-        error(line, "constructing from a non-dereferenced array", "constructor", "");
+        error(line, "constructing from a non-dereferenced array", "constructor");
         return true;
     }
 
     if (matrixInMatrix && !type->isArray()) {
         if (function.getParamCount() != 1) {
-          error(line, "constructing matrix from matrix can only take one argument", "constructor", "");
+          error(line, "constructing matrix from matrix can only take one argument", "constructor");
           return true;
         }
     }
 
     if (overFull) {
-        error(line, "too many arguments", "constructor", "");
+        error(line, "too many arguments", "constructor");
         return true;
     }
     
     if (op == EOpConstructStruct && !type->isArray() && int(type->getStruct()->size()) != function.getParamCount()) {
-        error(line, "Number of constructor parameters does not match the number of structure fields", "constructor", "");
+        error(line, "Number of constructor parameters does not match the number of structure fields", "constructor");
         return true;
     }
 
     if (!type->isMatrix() || !matrixInMatrix) {
         if ((op != EOpConstructStruct && size != 1 && size < type->getObjectSize()) ||
             (op == EOpConstructStruct && size < type->getObjectSize())) {
-            error(line, "not enough data provided for construction", "constructor", "");
+            error(line, "not enough data provided for construction", "constructor");
             return true;
         }
     }
 
     TIntermTyped *typed = node ? node->getAsTyped() : 0;
     if (typed == 0) {
-        error(line, "constructor argument does not have a type", "constructor", "");
+        error(line, "constructor argument does not have a type", "constructor");
         return true;
     }
     if (op != EOpConstructStruct && IsSampler(typed->getBasicType())) {
-        error(line, "cannot convert a sampler", "constructor", "");
+        error(line, "cannot convert a sampler", "constructor");
         return true;
     }
     if (typed->getBasicType() == EbtVoid) {
-        error(line, "cannot convert a void", "constructor", "");
+        error(line, "cannot convert a void", "constructor");
         return true;
     }
 
@@ -585,7 +572,7 @@ bool TParseContext::constructorErrorCheck(int line, TIntermNode* node, TFunction
 bool TParseContext::voidErrorCheck(int line, const TString& identifier, const TPublicType& pubType)
 {
     if (pubType.type == EbtVoid) {
-        error(line, "illegal use of type 'void'", identifier.c_str(), "");
+        error(line, "illegal use of type 'void'", identifier.c_str());
         return true;
     } 
 
@@ -599,7 +586,7 @@ bool TParseContext::voidErrorCheck(int line, const TString& identifier, const TP
 bool TParseContext::boolErrorCheck(int line, const TIntermTyped* type)
 {
     if (type->getBasicType() != EbtBool || type->isArray() || type->isMatrix() || type->isVector()) {
-        error(line, "boolean expression expected", "", "");
+        error(line, "boolean expression expected", "");
         return true;
     } 
 
@@ -613,7 +600,7 @@ bool TParseContext::boolErrorCheck(int line, const TIntermTyped* type)
 bool TParseContext::boolErrorCheck(int line, const TPublicType& pType)
 {
     if (pType.type != EbtBool || pType.array || pType.matrix || (pType.size > 1)) {
-        error(line, "boolean expression expected", "", "");
+        error(line, "boolean expression expected", "");
         return true;
     } 
 
@@ -631,7 +618,7 @@ bool TParseContext::samplerErrorCheck(int line, const TPublicType& pType, const
         
         return false;
     } else if (IsSampler(pType.type)) {
-        error(line, reason, getBasicString(pType.type), "");
+        error(line, reason, getBasicString(pType.type));
 
         return true;
     }
@@ -643,7 +630,7 @@ bool TParseContext::structQualifierErrorCheck(int line, const TPublicType& pType
 {
     if ((pType.qualifier == EvqVaryingIn || pType.qualifier == EvqVaryingOut || pType.qualifier == EvqAttribute) &&
         pType.type == EbtStruct) {
-        error(line, "cannot be used with a structure", getQualifierString(pType.qualifier), "");
+        error(line, "cannot be used with a structure", getQualifierString(pType.qualifier));
         
         return true;
     }
@@ -658,7 +645,7 @@ bool TParseContext::parameterSamplerErrorCheck(int line, TQualifier qualifier, c
 {
     if ((qualifier == EvqOut || qualifier == EvqInOut) && 
              type.getBasicType() != EbtStruct && IsSampler(type.getBasicType())) {
-        error(line, "samplers cannot be output parameters", type.getBasicString(), "");
+        error(line, "samplers cannot be output parameters", type.getBasicString());
         return true;
     }
 
@@ -690,14 +677,14 @@ bool TParseContext::arraySizeErrorCheck(int line, TIntermTyped* expr, int& size)
 {
     TIntermConstantUnion* constant = expr->getAsConstantUnion();
     if (constant == 0 || constant->getBasicType() != EbtInt) {
-        error(line, "array size must be a constant integer expression", "", "");
+        error(line, "array size must be a constant integer expression", "");
         return true;
     }
 
     size = constant->getUnionArrayPointer()->getIConst();
 
     if (size <= 0) {
-        error(line, "array size must be a positive integer", "", "");
+        error(line, "array size must be a positive integer", "");
         size = 1;
         return true;
     }
@@ -713,7 +700,7 @@ bool TParseContext::arraySizeErrorCheck(int line, TIntermTyped* expr, int& size)
 bool TParseContext::arrayQualifierErrorCheck(int line, TPublicType type)
 {
     if ((type.qualifier == EvqAttribute) || (type.qualifier == EvqConst)) {
-        error(line, "cannot declare arrays of this qualifier", TType(type).getCompleteString().c_str(), "");
+        error(line, "cannot declare arrays of this qualifier", TType(type).getCompleteString().c_str());
         return true;
     }
 
@@ -731,7 +718,7 @@ bool TParseContext::arrayTypeErrorCheck(int line, TPublicType type)
     // Can the type be an array?
     //
     if (type.array) {
-        error(line, "cannot declare arrays of arrays", TType(type).getCompleteString().c_str(), "");
+        error(line, "cannot declare arrays of arrays", TType(type).getCompleteString().c_str());
         return true;
     }
 
@@ -767,34 +754,34 @@ bool TParseContext::arrayErrorCheck(int line, TString& identifier, TPublicType t
 
         if (! symbolTable.insert(*variable)) {
             delete variable;
-            error(line, "INTERNAL ERROR inserting new symbol", identifier.c_str(), "");
+            error(line, "INTERNAL ERROR inserting new symbol", identifier.c_str());
             return true;
         }
     } else {
         if (! symbol->isVariable()) {
-            error(line, "variable expected", identifier.c_str(), "");
+            error(line, "variable expected", identifier.c_str());
             return true;
         }
 
         variable = static_cast<TVariable*>(symbol);
         if (! variable->getType().isArray()) {
-            error(line, "redeclaring non-array as array", identifier.c_str(), "");
+            error(line, "redeclaring non-array as array", identifier.c_str());
             return true;
         }
         if (variable->getType().getArraySize() > 0) {
-            error(line, "redeclaration of array with size", identifier.c_str(), "");
+            error(line, "redeclaration of array with size", identifier.c_str());
             return true;
         }
         
         if (! variable->getType().sameElementType(TType(type))) {
-            error(line, "redeclaration of array with a different type", identifier.c_str(), "");
+            error(line, "redeclaration of array with a different type", identifier.c_str());
             return true;
         }
 
         TType* t = variable->getArrayInformationType();
         while (t != 0) {
             if (t->getMaxArraySize() > type.arraySize) {
-                error(line, "higher index value already used for the array", identifier.c_str(), "");
+                error(line, "higher index value already used for the array", identifier.c_str());
                 return true;
             }
             t->setArraySize(type.arraySize);
@@ -816,7 +803,7 @@ bool TParseContext::arraySetMaxSize(TIntermSymbol *node, TType* type, int size,
     bool builtIn = false;
     TSymbol* symbol = symbolTable.find(node->getSymbol(), &builtIn);
     if (symbol == 0) {
-        error(line, " undeclared identifier", node->getSymbol().c_str(), "");
+        error(line, " undeclared identifier", node->getSymbol().c_str());
         return true;
     }
     TVariable* variable = static_cast<TVariable*>(symbol);
@@ -828,14 +815,11 @@ bool TParseContext::arraySetMaxSize(TIntermSymbol *node, TType* type, int size,
     // its an error
     if (node->getSymbol() == "gl_FragData") {
         TSymbol* fragData = symbolTable.find("gl_MaxDrawBuffers", &builtIn);
-        if (fragData == 0) {
-            infoSink.info.message(EPrefixInternalError, "gl_MaxDrawBuffers not defined", line);
-            return true;
-        }
+        ASSERT(fragData);
 
         int fragDataValue = static_cast<TVariable*>(fragData)->getConstPointer()[0].getIConst();
         if (fragDataValue <= size) {
-            error(line, "", "[", "gl_FragData can only have a max array size of up to gl_MaxDrawBuffers", "");
+            error(line, "", "[", "gl_FragData can only have a max array size of up to gl_MaxDrawBuffers");
             return true;
         }
     }
@@ -870,7 +854,7 @@ bool TParseContext::nonInitConstErrorCheck(int line, TString& identifier, TPubli
     //
     if (type.qualifier == EvqConst) {
         type.qualifier = EvqTemporary;
-        error(line, "variables with qualifier 'const' must be initialized", identifier.c_str(), "");
+        error(line, "variables with qualifier 'const' must be initialized", identifier.c_str());
         return true;
     }
 
@@ -891,7 +875,7 @@ bool TParseContext::nonInitErrorCheck(int line, TString& identifier, TPublicType
     variable = new TVariable(&identifier, TType(type));
 
     if (! symbolTable.insert(*variable)) {
-        error(line, "redefinition", variable->getName().c_str(), "");
+        error(line, "redefinition", variable->getName().c_str());
         delete variable;
         variable = 0;
         return true;
@@ -906,7 +890,7 @@ bool TParseContext::nonInitErrorCheck(int line, TString& identifier, TPublicType
 bool TParseContext::paramErrorCheck(int line, TQualifier qualifier, TQualifier paramQualifier, TType* type)
 {    
     if (qualifier != EvqConst && qualifier != EvqTemporary) {
-        error(line, "qualifier not allowed on function parameter", getQualifierString(qualifier), "");
+        error(line, "qualifier not allowed on function parameter", getQualifierString(qualifier));
         return true;
     }
     if (qualifier == EvqConst && paramQualifier != EvqIn) {
@@ -924,8 +908,9 @@ bool TParseContext::paramErrorCheck(int line, TQualifier qualifier, TQualifier p
 
 bool TParseContext::extensionErrorCheck(int line, const TString& extension)
 {
-    TExtensionBehavior::const_iterator iter = extensionBehavior.find(extension);
-    if (iter == extensionBehavior.end()) {
+    const TExtensionBehavior& extBehavior = extensionBehavior();
+    TExtensionBehavior::const_iterator iter = extBehavior.find(extension.c_str());
+    if (iter == extBehavior.end()) {
         error(line, "extension", extension.c_str(), "is not supported");
         return true;
     }
@@ -935,8 +920,7 @@ bool TParseContext::extensionErrorCheck(int line, const TString& extension)
         return true;
     }
     if (iter->second == EBhWarn) {
-        TString msg = "extension " + extension + " is being used";
-        infoSink.info.message(EPrefixWarning, msg.c_str(), line);
+        warning(line, "extension", extension.c_str(), "is being used");
         return false;
     }
 
@@ -945,8 +929,23 @@ bool TParseContext::extensionErrorCheck(int line, const TString& extension)
 
 bool TParseContext::supportsExtension(const char* extension)
 {
-    TExtensionBehavior::const_iterator iter = extensionBehavior.find(extension);
-    return (iter != extensionBehavior.end());
+    const TExtensionBehavior& extbehavior = extensionBehavior();
+    TExtensionBehavior::const_iterator iter = extbehavior.find(extension);
+    return (iter != extbehavior.end());
+}
+
+void TParseContext::handleExtensionDirective(int line, const char* extName, const char* behavior)
+{
+    pp::SourceLocation loc;
+    DecodeSourceLoc(line, &loc.file, &loc.line);
+    directiveHandler.handleExtension(loc, extName, behavior);
+}
+
+void TParseContext::handlePragmaDirective(int line, const char* name, const char* value)
+{
+    pp::SourceLocation loc;
+    DecodeSourceLoc(line, &loc.file, &loc.line);
+    directiveHandler.handlePragma(loc, name, value);
 }
 
 /////////////////////////////////////////////////////////////////////////////////
@@ -970,12 +969,12 @@ const TFunction* TParseContext::findFunction(int line, TFunction* call, bool *bu
     }
 
     if (symbol == 0) {
-        error(line, "no matching overloaded function found", call->getName().c_str(), "");
+        error(line, "no matching overloaded function found", call->getName().c_str());
         return 0;
     }
 
     if (!symbol->isFunction()) {
-        error(line, "function name expected", call->getName().c_str(), "");
+        error(line, "function name expected", call->getName().c_str());
         return 0;
     }
 
@@ -1003,7 +1002,7 @@ bool TParseContext::executeInitializer(TSourceLoc line, TString& identifier, TPu
         //
         variable = new TVariable(&identifier, type);
         if (! symbolTable.insert(*variable)) {
-            error(line, "redefinition", variable->getName().c_str(), "");
+            error(line, "redefinition", variable->getName().c_str());
             return true;
             // don't delete variable, it's used by error recovery, and the pool 
             // pop will take care of the memory
@@ -1015,7 +1014,7 @@ bool TParseContext::executeInitializer(TSourceLoc line, TString& identifier, TPu
     //
     TQualifier qualifier = variable->getType().getQualifier();
     if ((qualifier != EvqTemporary) && (qualifier != EvqGlobal) && (qualifier != EvqConst)) {
-        error(line, " cannot initialize this type of qualifier ", variable->getType().getQualifierString(), "");
+        error(line, " cannot initialize this type of qualifier ", variable->getType().getQualifierString());
         return true;
     }
     //
@@ -1024,13 +1023,16 @@ bool TParseContext::executeInitializer(TSourceLoc line, TString& identifier, TPu
 
     if (qualifier == EvqConst) {
         if (qualifier != initializer->getType().getQualifier()) {
-            error(line, " assigning non-constant to", "=", "'%s'", variable->getType().getCompleteString().c_str());
+            std::stringstream extraInfoStream;
+            extraInfoStream << "'" << variable->getType().getCompleteString() << "'";
+            std::string extraInfo = extraInfoStream.str();
+            error(line, " assigning non-constant to", "=", extraInfo.c_str());
             variable->getType().setQualifier(EvqTemporary);
             return true;
         }
         if (type != initializer->getType()) {
             error(line, " non-matching types for const initializer ", 
-                variable->getType().getQualifierString(), "");
+                variable->getType().getQualifierString());
             variable->getType().setQualifier(EvqTemporary);
             return true;
         }
@@ -1049,7 +1051,10 @@ bool TParseContext::executeInitializer(TSourceLoc line, TString& identifier, TPu
             ConstantUnion* constArray = tVar->getConstPointer();
             variable->shareConstPointer(constArray);
         } else {
-            error(line, " cannot assign to", "=", "'%s'", variable->getType().getCompleteString().c_str());
+            std::stringstream extraInfoStream;
+            extraInfoStream << "'" << variable->getType().getCompleteString() << "'";
+            std::string extraInfo = extraInfoStream.str();
+            error(line, " cannot assign to", "=", extraInfo.c_str());
             variable->getType().setQualifier(EvqTemporary);
             return true;
         }
@@ -1234,14 +1239,14 @@ TIntermTyped* TParseContext::constructBuiltIn(const TType* type, TOperator op, T
         break;
 
     default:
-        error(line, "unsupported construction", "", "");
+        error(line, "unsupported construction", "");
         recover();
 
         return 0;
     }
     newNode = intermediate.addUnaryMath(basicOp, node, node->getLine(), symbolTable);
     if (newNode == 0) {
-        error(line, "can't convert", "constructor", "");
+        error(line, "can't convert", "constructor");
         return 0;
     }
 
@@ -1270,8 +1275,12 @@ TIntermTyped* TParseContext::constructStruct(TIntermNode* node, TType* type, int
         else
             return intermediate.setAggregateOperator(node->getAsTyped(), EOpConstructStruct, line);
     } else {
-        error(line, "", "constructor", "cannot convert parameter %d from '%s' to '%s'", paramCount,
-                node->getAsTyped()->getType().getBasicString(), type->getBasicString());
+        std::stringstream extraInfoStream;
+        extraInfoStream << "cannot convert parameter " << paramCount 
+                        << " from '" << node->getAsTyped()->getType().getBasicString()
+                        << "' to '" << type->getBasicString() << "'";
+        std::string extraInfo = extraInfoStream.str();
+        error(line, "", "constructor", extraInfo.c_str());
         recover();
     }
 
@@ -1293,15 +1302,13 @@ TIntermTyped* TParseContext::addConstVectorNode(TVectorFields& fields, TIntermTy
     ConstantUnion *unionArray;
     if (tempConstantNode) {
         unionArray = tempConstantNode->getUnionArrayPointer();
+        ASSERT(unionArray);
 
-        if (!unionArray) {  // this error message should never be raised
-            infoSink.info.message(EPrefixInternalError, "ConstantUnion not initialized in addConstVectorNode function", line);
-            recover();
-
+        if (!unionArray) {
             return node;
         }
     } else { // The node has to be either a symbol node or an aggregate node or a tempConstant node, else, its an error
-        error(line, "Cannot offset into the vector", "Error", "");
+        error(line, "Cannot offset into the vector", "Error");
         recover();
 
         return 0;
@@ -1311,7 +1318,10 @@ TIntermTyped* TParseContext::addConstVectorNode(TVectorFields& fields, TIntermTy
 
     for (int i = 0; i < fields.num; i++) {
         if (fields.offsets[i] >= node->getType().getObjectSize()) {
-            error(line, "", "[", "vector field selection out of range '%d'", fields.offsets[i]);
+            std::stringstream extraInfoStream;
+            extraInfoStream << "vector field selection out of range '" << fields.offsets[i] << "'";
+            std::string extraInfo = extraInfoStream.str();
+            error(line, "", "[", extraInfo.c_str());
             recover();
             fields.offsets[i] = 0;
         }
@@ -1335,7 +1345,10 @@ TIntermTyped* TParseContext::addConstMatrixNode(int index, TIntermTyped* node, T
     TIntermConstantUnion* tempConstantNode = node->getAsConstantUnion();
 
     if (index >= node->getType().getNominalSize()) {
-        error(line, "", "[", "matrix field selection out of range '%d'", index);
+        std::stringstream extraInfoStream;
+        extraInfoStream << "matrix field selection out of range '" << index << "'";
+        std::string extraInfo = extraInfoStream.str();
+        error(line, "", "[", extraInfo.c_str());
         recover();
         index = 0;
     }
@@ -1345,7 +1358,7 @@ TIntermTyped* TParseContext::addConstMatrixNode(int index, TIntermTyped* node, T
          int size = tempConstantNode->getType().getNominalSize();
          typedNode = intermediate.addConstantUnion(&unionArray[size*index], tempConstantNode->getType(), line);
     } else {
-        error(line, "Cannot offset into the matrix", "Error", "");
+        error(line, "Cannot offset into the matrix", "Error");
         recover();
 
         return 0;
@@ -1369,7 +1382,10 @@ TIntermTyped* TParseContext::addConstArrayNode(int index, TIntermTyped* node, TS
     arrayElementType.clearArrayness();
 
     if (index >= node->getType().getArraySize()) {
-        error(line, "", "[", "array field selection out of range '%d'", index);
+        std::stringstream extraInfoStream;
+        extraInfoStream << "array field selection out of range '" << index << "'";
+        std::string extraInfo = extraInfoStream.str();
+        error(line, "", "[", extraInfo.c_str());
         recover();
         index = 0;
     }
@@ -1380,7 +1396,7 @@ TIntermTyped* TParseContext::addConstArrayNode(int index, TIntermTyped* node, TS
          ConstantUnion* unionArray = tempConstantNode->getUnionArrayPointer();
          typedNode = intermediate.addConstantUnion(&unionArray[arrayElementSize * index], tempConstantNode->getType(), line);
     } else {
-        error(line, "Cannot offset into the array", "Error", "");
+        error(line, "Cannot offset into the array", "Error");
         recover();
 
         return 0;
@@ -1416,7 +1432,7 @@ TIntermTyped* TParseContext::addConstStruct(TString& identifier, TIntermTyped* n
 
          typedNode = intermediate.addConstantUnion(constArray+instanceSize, tempConstantNode->getType(), line); // type will be changed in the calling function
     } else {
-        error(line, "Cannot offset into the structure", "Error", "");
+        error(line, "Cannot offset into the structure", "Error");
         recover();
 
         return 0;
@@ -1433,7 +1449,7 @@ bool TParseContext::enterStructDeclaration(int line, const TString& identifier)
     // They aren't allowed in GLSL either, but we need to detect this here
     // so we don't rely on the GLSL compiler to catch it.
     if (structNestingLevel > 1) {
-        error(line, "", "Embedded struct definitions are not allowed", "");
+        error(line, "", "Embedded struct definitions are not allowed");
         return true;
     }
 
@@ -1453,7 +1469,7 @@ const int kWebGLMaxStructNesting = 4;
 
 bool TParseContext::structNestingErrorCheck(TSourceLoc line, const TType& fieldType)
 {
-    if (shaderSpec != SH_WEBGL_SPEC) {
+    if (!isWebGLBasedSpec(shaderSpec)) {
         return false;
     }
 
@@ -1464,8 +1480,11 @@ bool TParseContext::structNestingErrorCheck(TSourceLoc line, const TType& fieldT
     // We're already inside a structure definition at this point, so add
     // one to the field's struct nesting.
     if (1 + fieldType.getDeepestStructNesting() > kWebGLMaxStructNesting) {
-        error(line, "", "", "Reference of struct type %s exceeds maximum struct nesting of %d",
-              fieldType.getTypeName().c_str(), kWebGLMaxStructNesting);
+        std::stringstream extraInfoStream;
+        extraInfoStream << "Reference of struct type " << fieldType.getTypeName() 
+                        << " exceeds maximum struct nesting of " << kWebGLMaxStructNesting;
+        std::string extraInfo = extraInfoStream.str();
+        error(line, "", "", extraInfo.c_str());
         return true;
     }
 
@@ -1482,105 +1501,17 @@ int PaParseStrings(int count, const char* const string[], const int length[],
     if ((count == 0) || (string == NULL))
         return 1;
 
-    // setup preprocessor.
-    if (InitPreprocessor())
-        return 1;
-    DefineExtensionMacros(context->extensionBehavior);
-
     if (glslang_initialize(context))
         return 1;
 
-    glslang_scan(count, string, length, context);
-    int error = glslang_parse(context);
+    int error = glslang_scan(count, string, length, context);
+    if (!error)
+        error = glslang_parse(context);
 
     glslang_finalize(context);
-    FinalizePreprocessor();
-    return (error == 0) && (context->numErrors == 0) ? 0 : 1;
-}
-
-OS_TLSIndex GlobalParseContextIndex = OS_INVALID_TLS_INDEX;
-
-bool InitializeParseContextIndex()
-{
-    if (GlobalParseContextIndex != OS_INVALID_TLS_INDEX) {
-        assert(0 && "InitializeParseContextIndex(): Parse Context already initalised");
-        return false;
-    }
-
-    //
-    // Allocate a TLS index.
-    //
-    GlobalParseContextIndex = OS_AllocTLSIndex();
-    
-    if (GlobalParseContextIndex == OS_INVALID_TLS_INDEX) {
-        assert(0 && "InitializeParseContextIndex(): Parse Context already initalised");
-        return false;
-    }
 
-    return true;
-}
-
-bool FreeParseContextIndex()
-{
-    OS_TLSIndex tlsiIndex = GlobalParseContextIndex;
-
-    if (GlobalParseContextIndex == OS_INVALID_TLS_INDEX) {
-        assert(0 && "FreeParseContextIndex(): Parse Context index not initalised");
-        return false;
-    }
-
-    GlobalParseContextIndex = OS_INVALID_TLS_INDEX;
-
-    return OS_FreeTLSIndex(tlsiIndex);
-}
-
-bool InitializeGlobalParseContext()
-{
-    if (GlobalParseContextIndex == OS_INVALID_TLS_INDEX) {
-        assert(0 && "InitializeGlobalParseContext(): Parse Context index not initalised");
-        return false;
-    }
-
-    TThreadParseContext *lpParseContext = static_cast<TThreadParseContext *>(OS_GetTLSValue(GlobalParseContextIndex));
-    if (lpParseContext != 0) {
-        assert(0 && "InitializeParseContextIndex(): Parse Context already initalised");
-        return false;
-    }
-
-    TThreadParseContext *lpThreadData = new TThreadParseContext();
-    if (lpThreadData == 0) {
-        assert(0 && "InitializeGlobalParseContext(): Unable to create thread parse context");
-        return false;
-    }
-
-    lpThreadData->lpGlobalParseContext = 0;
-    OS_SetTLSValue(GlobalParseContextIndex, lpThreadData);
-
-    return true;
-}
-
-bool FreeParseContext()
-{
-    if (GlobalParseContextIndex == OS_INVALID_TLS_INDEX) {
-        assert(0 && "FreeParseContext(): Parse Context index not initalised");
-        return false;
-    }
-
-    TThreadParseContext *lpParseContext = static_cast<TThreadParseContext *>(OS_GetTLSValue(GlobalParseContextIndex));
-    if (lpParseContext)
-        delete lpParseContext;
-
-    return true;
+    return (error == 0) && (context->numErrors == 0) ? 0 : 1;
 }
 
-TParseContextPointer& GetGlobalParseContext()
-{
-    //
-    // Minimal error checking for speed
-    //
 
-    TThreadParseContext *lpParseContext = static_cast<TThreadParseContext *>(OS_GetTLSValue(GlobalParseContextIndex));
-
-    return lpParseContext->lpGlobalParseContext;
-}
 
index 3e05763..8dee8fd 100644 (file)
@@ -6,8 +6,10 @@
 #ifndef _PARSER_HELPER_INCLUDED_
 #define _PARSER_HELPER_INCLUDED_
 
-#include "compiler/ExtensionBehavior.h"
+#include "compiler/Diagnostics.h"
+#include "compiler/DirectiveHandler.h"
 #include "compiler/localintermediate.h"
+#include "compiler/preprocessor/new/Preprocessor.h"
 #include "compiler/ShHandle.h"
 #include "compiler/SymbolTable.h"
 
@@ -18,13 +20,6 @@ struct TMatrixFields {
     int col;
 };
 
-struct TPragma {
-    TPragma(bool o, bool d) : optimize(o), debug(d) { }
-    bool optimize;
-    bool debug;
-    TPragmaTable pragmaTable;
-};
-
 //
 // The following are extra variables needed during parsing, grouped together so
 // they can be passed to the parser without needing a global.
@@ -33,8 +28,6 @@ struct TParseContext {
     TParseContext(TSymbolTable& symt, TExtensionBehavior& ext, TIntermediate& interm, ShShaderType type, ShShaderSpec spec, int options, bool checksPrecErrors, const char* sourcePath, TInfoSink& is) :
             intermediate(interm),
             symbolTable(symt),
-            extensionBehavior(ext),
-            infoSink(is),
             shaderType(type),
             shaderSpec(spec),
             compileOptions(options),
@@ -48,12 +41,12 @@ struct TParseContext {
             currentFunctionType(NULL),
             functionReturnsValue(false),
             checksPrecisionErrors(checksPrecErrors),
-            contextPragma(true, false),
+            diagnostics(is),
+            directiveHandler(ext, diagnostics),
+            preprocessor(&diagnostics, &directiveHandler),
             scanner(NULL) {  }
     TIntermediate& intermediate; // to hold and build a parse tree
     TSymbolTable& symbolTable;   // symbol table that goes with the language currently being parsed
-    TExtensionBehavior& extensionBehavior;  // mapping between supported extensions and current behavior.
-    TInfoSink& infoSink;
     ShShaderType shaderType;              // vertex or fragment language (future: pack or unpack)
     ShShaderSpec shaderSpec;              // The language specification compiler conforms to - GLES2 or WebGL.
     int compileOptions;
@@ -67,15 +60,19 @@ struct TParseContext {
     const TType* currentFunctionType;  // the return type of the function that's currently being parsed
     bool functionReturnsValue;   // true if a non-void function has a return
     bool checksPrecisionErrors;  // true if an error will be generated when a variable is declared without precision, explicit or implicit.
-    struct TPragma contextPragma;
     TString HashErrMsg;
     bool AfterEOF;
+    TDiagnostics diagnostics;
+    TDirectiveHandler directiveHandler;
+    pp::Preprocessor preprocessor;
     void* scanner;
 
+    TInfoSink& infoSink() { return diagnostics.infoSink(); }
     void error(TSourceLoc loc, const char *reason, const char* token,
-               const char* extraInfoFormat, ...);
+               const char* extraInfo="");
     void warning(TSourceLoc loc, const char* reason, const char* token,
-                 const char* extraInfoFormat, ...);
+                 const char* extraInfo="");
+    void trace(const char* str);
     void recover();
 
     bool parseVectorFields(const TString&, int vecSize, TVectorFields&, int line);
@@ -105,7 +102,13 @@ struct TParseContext {
     bool nonInitErrorCheck(int line, TString& identifier, TPublicType& type, TVariable*& variable);
     bool paramErrorCheck(int line, TQualifier qualifier, TQualifier paramQualifier, TType* type);
     bool extensionErrorCheck(int line, const TString&);
+
+    const TExtensionBehavior& extensionBehavior() const { return directiveHandler.extensionBehavior(); }
     bool supportsExtension(const char* extension);
+    void handleExtensionDirective(int line, const char* extName, const char* behavior);
+
+    const TPragma& pragma() const { return directiveHandler.pragma(); }
+    void handlePragmaDirective(int line, const char* name, const char* value);
 
     bool containsSampler(TType& type);
     bool areAllChildConst(TIntermAggregate* aggrNode);
@@ -135,13 +138,4 @@ struct TParseContext {
 int PaParseStrings(int count, const char* const string[], const int length[],
                    TParseContext* context);
 
-typedef TParseContext* TParseContextPointer;
-extern TParseContextPointer& GetGlobalParseContext();
-#define GlobalParseContext GetGlobalParseContext()
-
-typedef struct TThreadParseContextRec
-{
-    TParseContext *lpGlobalParseContext;
-} TThreadParseContext;
-
 #endif // _PARSER_HELPER_INCLUDED_
index a600c02..9ef4f59 100644 (file)
@@ -11,6 +11,7 @@
 #endif
 #include <stdio.h>
 
+#include "common/angleutils.h"
 #include "compiler/InitializeGlobals.h"
 #include "compiler/osinclude.h"
 
@@ -158,10 +159,10 @@ void TAllocation::checkGuardBlock(unsigned char* blockMem, unsigned char val, co
 
             // We don't print the assert message.  It's here just to be helpful.
 #if defined(_MSC_VER)
-            sprintf(assertMsg, "PoolAlloc: Damage %s %Iu byte allocation at 0x%p\n",
+            snprintf(assertMsg, sizeof(assertMsg), "PoolAlloc: Damage %s %Iu byte allocation at 0x%p\n",
                     locText, size, data());
 #else
-            sprintf(assertMsg, "PoolAlloc: Damage %s %zu byte allocation at 0x%p\n",
+            snprintf(assertMsg, sizeof(assertMsg), "PoolAlloc: Damage %s %zu byte allocation at 0x%p\n",
                     locText, size, data());
 #endif
             assert(0 && "PoolAlloc: Damage in guard block");
diff --git a/Source/ThirdParty/ANGLE/src/compiler/Pragma.h b/Source/ThirdParty/ANGLE/src/compiler/Pragma.h
new file mode 100644 (file)
index 0000000..2f74412
--- /dev/null
@@ -0,0 +1,19 @@
+//
+// Copyright (c) 2012 The ANGLE Project Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+//
+
+#ifndef COMPILER_PRAGMA_H_
+#define COMPILER_PRAGMA_H_
+
+struct TPragma {
+    // By default optimization is turned on and debug is turned off.
+    TPragma() : optimize(true), debug(false) { }
+    TPragma(bool o, bool d) : optimize(o), debug(d) { }
+
+    bool optimize;
+    bool debug;
+};
+
+#endif // COMPILER_PRAGMA_H_
diff --git a/Source/ThirdParty/ANGLE/src/compiler/RenameFunction.h b/Source/ThirdParty/ANGLE/src/compiler/RenameFunction.h
new file mode 100644 (file)
index 0000000..cfdb40d
--- /dev/null
@@ -0,0 +1,36 @@
+//
+// Copyright (c) 2012 The ANGLE Project Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+//
+
+#ifndef COMPILER_RENAME_FUNCTION
+#define COMPILER_RENAME_FUNCTION
+
+#include "compiler/intermediate.h"
+
+//
+// Renames a function, including its declaration and any calls to it.
+//
+class RenameFunction : public TIntermTraverser
+{
+public:
+    RenameFunction(const TString& oldFunctionName, const TString& newFunctionName)
+    : TIntermTraverser(true, false, false)
+    , mOldFunctionName(oldFunctionName)
+    , mNewFunctionName(newFunctionName) {}
+
+    virtual bool visitAggregate(Visit visit, TIntermAggregate* node)
+    {
+        TOperator op = node->getOp();
+        if ((op == EOpFunction || op == EOpFunctionCall) && node->getName() == mOldFunctionName)
+            node->setName(mNewFunctionName);
+        return true;
+    }
+
+private:
+    const TString& mOldFunctionName;
+    const TString& mNewFunctionName;
+};
+
+#endif  // COMPILER_RENAME_FUNCTION
index 91c47e7..26528b8 100644 (file)
 
 class LongNameMap;
 class TCompiler;
+class TDependencyGraph;
+
+//
+// Helper function to identify specs that are based on the WebGL spec,
+// like the CSS Shaders spec.
+//
+bool isWebGLBasedSpec(ShShaderSpec spec);
 
 //
 // The base class used to back handles returned to the driver.
@@ -70,6 +77,8 @@ protected:
     void clearResults();
     // Return true if function recursion is detected.
     bool detectRecursion(TIntermNode* root);
+    // Rewrites a shader's intermediate tree according to the CSS Shaders spec.
+    void rewriteCSSShader(TIntermNode* root);
     // Returns true if the given shader does not exceed the minimum
     // functionality mandated in GLSL 1.0 spec Appendix A.
     bool validateLimitations(TIntermNode* root);
@@ -79,6 +88,13 @@ protected:
     void mapLongVariableNames(TIntermNode* root);
     // Translate to object code.
     virtual void translate(TIntermNode* root) = 0;
+    // Returns true if the shader passes the restrictions that aim to prevent timing attacks.
+    bool enforceTimingRestrictions(TIntermNode* root, bool outputGraph);
+    // Returns true if the shader does not use samplers.
+    bool enforceVertexShaderTimingRestrictions(TIntermNode* root);
+    // Returns true if the shader does not use sampler dependent values to affect control 
+    // flow or in operations whose time can depend on the input values.
+    bool enforceFragmentShaderTimingRestrictions(const TDependencyGraph& graph);
     // Get built-in extensions with default behavior.
     const TExtensionBehavior& getExtensionBehavior() const;
 
index 13f11b5..56f5c7f 100644 (file)
@@ -72,12 +72,14 @@ static void getVariableInfo(ShShaderInfo varType,
     int activeUniformAndAttribLength = 1 + MAX_SYMBOL_NAME_LEN;
     ASSERT(checkActiveUniformAndAttribMaxLengths(handle, activeUniformAndAttribLength));
     strncpy(name, varInfo.name.c_str(), activeUniformAndAttribLength);
+    name[activeUniformAndAttribLength - 1] = 0;
     if (mappedName) {
         // This size must match that queried by
         // SH_MAPPED_NAME_MAX_LENGTH in ShGetInfo, below.
         int maxMappedNameLength = 1 + MAX_SYMBOL_NAME_LEN;
         ASSERT(checkMappedNameMaxLength(handle, maxMappedNameLength));
         strncpy(mappedName, varInfo.mappedName.c_str(), maxMappedNameLength);
+        mappedName[maxMappedNameLength - 1] = 0;
     }
 }
 
index edbea99..68f029d 100644 (file)
 #include "compiler/SymbolTable.h"
 
 #include <stdio.h>
-
 #include <algorithm>
 
+#include "common/angleutils.h"
+
 //
 // TType helper function needs a place to live.
 //
@@ -56,7 +57,7 @@ void TType::buildMangledName(TString& mangledName)
     mangledName += static_cast<char>('0' + getNominalSize());
     if (isArray()) {
         char buf[20];
-        sprintf(buf, "%d", arraySize);
+        snprintf(buf, sizeof(buf), "%d", arraySize);
         mangledName += '[';
         mangledName += buf;
         mangledName += ']';
index 96d7f10..f41decd 100644 (file)
@@ -6,6 +6,7 @@
 
 #include "compiler/TranslatorHLSL.h"
 
+#include "compiler/InitializeParseContext.h"
 #include "compiler/OutputHLSL.h"
 
 TranslatorHLSL::TranslatorHLSL(ShShaderType type, ShShaderSpec spec)
diff --git a/Source/ThirdParty/ANGLE/src/compiler/UnfoldSelect.cpp b/Source/ThirdParty/ANGLE/src/compiler/UnfoldSelect.cpp
deleted file mode 100644 (file)
index d3985e6..0000000
+++ /dev/null
@@ -1,96 +0,0 @@
-//
-// Copyright (c) 2002-2010 The ANGLE Project Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-//
-// UnfoldSelect is an AST traverser to output the select operator ?: as if-else statements
-//
-
-#include "compiler/UnfoldSelect.h"
-
-#include "compiler/InfoSink.h"
-#include "compiler/OutputHLSL.h"
-
-namespace sh
-{
-UnfoldSelect::UnfoldSelect(TParseContext &context, OutputHLSL *outputHLSL) : mContext(context), mOutputHLSL(outputHLSL)
-{
-    mTemporaryIndex = 0;
-}
-
-void UnfoldSelect::traverse(TIntermNode *node)
-{
-    int rewindIndex = mTemporaryIndex;
-    node->traverse(this);
-    mTemporaryIndex = rewindIndex;
-}
-
-bool UnfoldSelect::visitSelection(Visit visit, TIntermSelection *node)
-{
-    TInfoSinkBase &out = mOutputHLSL->getBodyStream();
-
-    if (node->usesTernaryOperator())
-    {
-        int i = mTemporaryIndex;
-
-        out << mOutputHLSL->typeString(node->getType()) << " s" << i << ";\n";
-
-        mTemporaryIndex = i + 1;
-        node->getCondition()->traverse(this);
-        out << "if(";
-        mTemporaryIndex = i + 1;
-        node->getCondition()->traverse(mOutputHLSL);
-        out << ")\n"
-               "{\n";
-        mTemporaryIndex = i + 1;
-        node->getTrueBlock()->traverse(this);
-        out << "    s" << i << " = ";
-        mTemporaryIndex = i + 1;
-        node->getTrueBlock()->traverse(mOutputHLSL);
-        out << ";\n"
-               "}\n"
-               "else\n"
-               "{\n";
-        mTemporaryIndex = i + 1;
-        node->getFalseBlock()->traverse(this);
-        out << "    s" << i << " = ";
-        mTemporaryIndex = i + 1;
-        node->getFalseBlock()->traverse(mOutputHLSL);
-        out << ";\n"
-               "}\n";
-
-        mTemporaryIndex = i + 1;
-    }
-
-    return false;
-}
-
-bool UnfoldSelect::visitLoop(Visit visit, TIntermLoop *node)
-{
-    int rewindIndex = mTemporaryIndex;
-
-    if (node->getInit())
-    {
-        node->getInit()->traverse(this);
-    }
-    
-    if (node->getCondition())
-    {
-        node->getCondition()->traverse(this);
-    }
-
-    if (node->getExpression())
-    {
-        node->getExpression()->traverse(this);
-    }
-
-    mTemporaryIndex = rewindIndex;
-
-    return false;
-}
-
-int UnfoldSelect::getNextTemporaryIndex()
-{
-    return mTemporaryIndex++;
-}
-}
diff --git a/Source/ThirdParty/ANGLE/src/compiler/UnfoldShortCircuit.cpp b/Source/ThirdParty/ANGLE/src/compiler/UnfoldShortCircuit.cpp
new file mode 100644 (file)
index 0000000..1782ebc
--- /dev/null
@@ -0,0 +1,172 @@
+//
+// Copyright (c) 2002-2012 The ANGLE Project Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+//
+// UnfoldShortCircuit is an AST traverser to output short-circuiting operators as if-else statements.
+// The results are assigned to s# temporaries, which are used by the main translator instead of
+// the original expression.
+//
+
+#include "compiler/UnfoldShortCircuit.h"
+
+#include "compiler/InfoSink.h"
+#include "compiler/OutputHLSL.h"
+
+namespace sh
+{
+UnfoldShortCircuit::UnfoldShortCircuit(TParseContext &context, OutputHLSL *outputHLSL) : mContext(context), mOutputHLSL(outputHLSL)
+{
+    mTemporaryIndex = 0;
+}
+
+void UnfoldShortCircuit::traverse(TIntermNode *node)
+{
+    int rewindIndex = mTemporaryIndex;
+    node->traverse(this);
+    mTemporaryIndex = rewindIndex;
+}
+
+bool UnfoldShortCircuit::visitBinary(Visit visit, TIntermBinary *node)
+{
+    TInfoSinkBase &out = mOutputHLSL->getBodyStream();
+
+    switch (node->getOp())
+    {
+      case EOpLogicalOr:
+        // "x || y" is equivalent to "x ? true : y", which unfolds to "bool s; if(x) s = true; else s = y;",
+        // and then further simplifies down to "bool s = x; if(!s) s = y;".
+        {
+            int i = mTemporaryIndex;
+
+            out << "bool s" << i << ";\n";
+
+            out << "{\n";
+
+            mTemporaryIndex = i + 1;
+            node->getLeft()->traverse(this);
+            out << "s" << i << " = ";
+            mTemporaryIndex = i + 1;
+            node->getLeft()->traverse(mOutputHLSL);
+            out << ";\n";
+            out << "if(!s" << i << ")\n"
+                   "{\n";
+            mTemporaryIndex = i + 1;
+            node->getRight()->traverse(this);
+            out << "    s" << i << " = ";
+            mTemporaryIndex = i + 1;
+            node->getRight()->traverse(mOutputHLSL);
+            out << ";\n"
+                   "}\n";
+
+            out << "}\n";
+
+            mTemporaryIndex = i + 1;
+        }
+        return false;
+      case EOpLogicalAnd:
+        // "x && y" is equivalent to "x ? y : false", which unfolds to "bool s; if(x) s = y; else s = false;",
+        // and then further simplifies down to "bool s = x; if(s) s = y;".
+        {
+            int i = mTemporaryIndex;
+
+            out << "bool s" << i << ";\n";
+
+            out << "{\n";
+
+            mTemporaryIndex = i + 1;
+            node->getLeft()->traverse(this);
+            out << "s" << i << " = ";
+            mTemporaryIndex = i + 1;
+            node->getLeft()->traverse(mOutputHLSL);
+            out << ";\n";
+            out << "if(s" << i << ")\n"
+                   "{\n";
+            mTemporaryIndex = i + 1;
+            node->getRight()->traverse(this);
+            out << "    s" << i << " = ";
+            mTemporaryIndex = i + 1;
+            node->getRight()->traverse(mOutputHLSL);
+            out << ";\n"
+                   "}\n";
+
+            out << "}\n";
+
+            mTemporaryIndex = i + 1;
+        }
+        return false;
+    }
+
+    return true;
+}
+
+bool UnfoldShortCircuit::visitSelection(Visit visit, TIntermSelection *node)
+{
+    TInfoSinkBase &out = mOutputHLSL->getBodyStream();
+
+    // Unfold "b ? x : y" into "type s; if(b) s = x; else s = y;"
+    if (node->usesTernaryOperator())
+    {
+        int i = mTemporaryIndex;
+
+        out << mOutputHLSL->typeString(node->getType()) << " s" << i << ";\n";
+
+        mTemporaryIndex = i + 1;
+        node->getCondition()->traverse(this);
+        out << "if(";
+        mTemporaryIndex = i + 1;
+        node->getCondition()->traverse(mOutputHLSL);
+        out << ")\n"
+               "{\n";
+        mTemporaryIndex = i + 1;
+        node->getTrueBlock()->traverse(this);
+        out << "    s" << i << " = ";
+        mTemporaryIndex = i + 1;
+        node->getTrueBlock()->traverse(mOutputHLSL);
+        out << ";\n"
+               "}\n"
+               "else\n"
+               "{\n";
+        mTemporaryIndex = i + 1;
+        node->getFalseBlock()->traverse(this);
+        out << "    s" << i << " = ";
+        mTemporaryIndex = i + 1;
+        node->getFalseBlock()->traverse(mOutputHLSL);
+        out << ";\n"
+               "}\n";
+
+        mTemporaryIndex = i + 1;
+    }
+
+    return false;
+}
+
+bool UnfoldShortCircuit::visitLoop(Visit visit, TIntermLoop *node)
+{
+    int rewindIndex = mTemporaryIndex;
+
+    if (node->getInit())
+    {
+        node->getInit()->traverse(this);
+    }
+    
+    if (node->getCondition())
+    {
+        node->getCondition()->traverse(this);
+    }
+
+    if (node->getExpression())
+    {
+        node->getExpression()->traverse(this);
+    }
+
+    mTemporaryIndex = rewindIndex;
+
+    return false;
+}
+
+int UnfoldShortCircuit::getNextTemporaryIndex()
+{
+    return mTemporaryIndex++;
+}
+}
@@ -1,13 +1,13 @@
 //
-// Copyright (c) 2002-2010 The ANGLE Project Authors. All rights reserved.
+// Copyright (c) 2002-2012 The ANGLE Project Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 //
-// UnfoldSelect is an AST traverser to output the select operator ?: as if-else statements
+// UnfoldShortCircuit is an AST traverser to output short-circuiting operators as if-else statements
 //
 
-#ifndef COMPILER_UNFOLDSELECT_H_
-#define COMPILER_UNFOLDSELECT_H_
+#ifndef COMPILER_UNFOLDSHORTCIRCUIT_H_
+#define COMPILER_UNFOLDSHORTCIRCUIT_H_
 
 #include "compiler/intermediate.h"
 #include "compiler/ParseHelper.h"
@@ -16,12 +16,13 @@ namespace sh
 {
 class OutputHLSL;
 
-class UnfoldSelect : public TIntermTraverser
+class UnfoldShortCircuit : public TIntermTraverser
 {
   public:
-    UnfoldSelect(TParseContext &context, OutputHLSL *outputHLSL);
+    UnfoldShortCircuit(TParseContext &context, OutputHLSL *outputHLSL);
 
     void traverse(TIntermNode *node);
+    bool visitBinary(Visit visit, TIntermBinary*);
     bool visitSelection(Visit visit, TIntermSelection *node);
     bool visitLoop(Visit visit, TIntermLoop *node);
 
@@ -35,4 +36,4 @@ class UnfoldSelect : public TIntermTraverser
 };
 }
 
-#endif   // COMPILER_UNFOLDSELECT_H_
+#endif   // COMPILER_UNFOLDSHORTCIRCUIT_H_