Define GL_FRAGMENT_PRECISION_HIGH

TRAC #12266 Signed-off-by: Andrew Lewycky Signed-off-by: Daniel Koch Author: Nicolas Capens git-svn-id: https://angleproject.googlecode.com/svn/trunk@301 736b8ea6-26fd-11df-bfd4-992fa37f6226
parent e0d7d434
......@@ -84,7 +84,6 @@ static int errorAtom = 0;
static int __LINE__Atom = 0;
static int __FILE__Atom = 0;
static int __VERSION__Atom = 0;
static int gl_esAtom = 0;
static int versionAtom = 0;
static int extensionAtom = 0;
......@@ -99,11 +98,6 @@ int InitCPP(void)
char buffer[64], *t;
const char *f;
SourceLoc location = {0};
Symbol *symbol;
MacroSymbol macro = {0};
yystypepp one = {0};
// Add various atoms needed by the CPP line scanner:
bindAtom = LookUpAddString(atable, "bind");
constAtom = LookUpAddString(atable, "const");
......@@ -125,7 +119,6 @@ int InitCPP(void)
__LINE__Atom = LookUpAddString(atable, "__LINE__");
__FILE__Atom = LookUpAddString(atable, "__FILE__");
__VERSION__Atom = LookUpAddString(atable, "__VERSION__");
gl_esAtom = LookUpAddString(atable, "GL_ES");
versionAtom = LookUpAddString(atable, "version");
extensionAtom = LookUpAddString(atable, "extension");
macros = NewScopeInPool(mem_CreatePool(0, 0));
......@@ -136,13 +129,8 @@ int InitCPP(void)
*t++ = toupper(*f++);
*t = 0;
// #define GL_ES 1
macro.body = NewTokenStream("GL_ES", macros->pool);
one.sc_int = 1;
strcpy(one.symbol_name, "1");
RecordToken(macro.body, CPP_INTCONSTANT, &one);
symbol = AddSymbol(&location, macros, gl_esAtom, MACRO_S);
symbol->details.mac = macro;
PredefineIntMacro("GL_ES", 1);
PredefineIntMacro("GL_FRAGMENT_PRECISION_HIGH", 1);
return 1;
} // InitCPP
......@@ -811,6 +799,22 @@ void FreeMacro(MacroSymbol *s) {
DeleteTokenStream(s->body);
}
void PredefineIntMacro(const char *name, int value) {
SourceLoc location = {0};
Symbol *symbol = NULL;
MacroSymbol macro = {0};
yystypepp val = {0};
int atom = 0;
macro.body = NewTokenStream(name, macros->pool);
val.sc_int = value;
sprintf(val.symbol_name, "%d", value);
RecordToken(macro.body, CPP_INTCONSTANT, &val);
atom = LookUpAddString(atable, name);
symbol = AddSymbol(&location, macros, atom, MACRO_S);
symbol->details.mac = macro;
}
static int eof_scan(InputSrc *in, yystypepp * yylvalpp) { return -1; }
static void noop(InputSrc *in, int ch, yystypepp * yylvalpp) { }
......
......@@ -71,7 +71,7 @@ typedef struct MacroSymbol {
} MacroSymbol;
void FreeMacro(MacroSymbol *);
int PredefineMacro(char *);
void PredefineIntMacro(const char *name, int value);
void CPPDebugLogMsg(const char *msg); // Prints information into debug log
void CPPShInfoLogMsg(const char*); // Store cpp Err Msg into Sh.Info.Log
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment