1) Don't propagate precision of built-in function arguments to return type when return type is bool (e.g., isnan).

2) Check an additional path for missing default precision qualification, except allow built-in declarations to pass the check.  

git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@22241 e7fa87d3-cd2b-0410-9028-fcbf551c1848
This commit is contained in:
John Kessenich 2013-07-01 17:56:24 +00:00
parent 6c0928d924
commit 1fde51d3fb
6 changed files with 17 additions and 9 deletions

View file

@ -62,7 +62,7 @@ struct TPragma {
// they can be passed to the parser without needing a global.
//
struct TParseContext {
TParseContext(TSymbolTable&, TIntermediate&, int version, EProfile, EShLanguage, TInfoSink&,
TParseContext(TSymbolTable&, TIntermediate&, bool parsingBuiltins, int version, EProfile, EShLanguage, TInfoSink&,
bool forwardCompatible = false, EShMessages messages = EShMsgDefault);
TIntermediate& intermediate; // to hold and build a parse tree
TSymbolTable& symbolTable; // symbol table that goes with the current language, version, and profile
@ -78,6 +78,7 @@ struct TParseContext {
bool inTypeParen; // true if in parentheses, looking only for an identifier
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 parsingBuiltins; // true if parsing built-in symbols/functions
int version; // version, updated by #version in the shader
EProfile profile; // the declared profile in the shader (core by default)