Commit f78fff94 by John Kessenich

Implement __VERSION__ macro, make ftransform() non-ES only, add more tests.

parent fb7044a9
......@@ -79,6 +79,7 @@ void main()
f >> i;
m4 >> i;
a >> u;
iv3 >> iv4;
i & u;
u ^ uv3;
......@@ -86,6 +87,7 @@ void main()
u & f;
m2 | m2;
s ^ s;
(f = f) = f;
// These are all okay:
f * v4;
......@@ -118,6 +120,7 @@ void main()
uv3 <<= i;
i >> i;
u << u;
iv3 >> iv3;
i & i;
u | u;
......
......@@ -121,5 +121,9 @@ sum += 0.05;
#error bad6
#endif
int linenumber = __LINE__;
int filenumber = __FILE__;
int version = __VERSION__;
#define PASTE(a,b) a ## b
float PASTE(tod, ay) = 17;
......@@ -630,7 +630,8 @@ void TBuiltIns::initialize(int version, EProfile profile)
//
// Geometric Functions.
//
s.append(TString("vec4 ftransform();"));
if (profile != EEsProfile)
s.append(TString("vec4 ftransform();"));
//
// Original-style texture Functions with lod.
......
......@@ -1128,6 +1128,13 @@ void SetVersion(int version)
// CPP should still report errors in semantics
}
int GetVersion(void* cppPc)
{
TParseContext& pc = *((TParseContext *)cppPc);
return pc.version;
}
void SetProfile(EProfile profile)
{
// called by the CPP, but this functionality is currently
......
......@@ -1027,8 +1027,8 @@ int MacroExpand(int atom, yystypepp* yylvalpp, int expandUndef)
}
if (atom == __VERSION__Atom) {
strcpy(yylvalpp->symbol_name, "100");
yylvalpp->sc_int = atoi(yylvalpp->symbol_name);
yylvalpp->sc_int = GetVersion(cpp->pC);
sprintf(yylvalpp->symbol_name, "%d", yylvalpp->sc_int);
UngetToken(CPP_INTCONSTANT, yylvalpp);
return 1;
......
......@@ -117,6 +117,7 @@ int GetStringNumber(void); // Get the current String Number.
const char* GetStrfromTStr(void); // Convert TString to String.
void SetVersion(int);
void SetProfile(EProfile);
int GetVersion(void*);
void updateExtensionBehavior(const char* extName, const char* behavior);
int FreeCPP(void);
......
......@@ -83,7 +83,7 @@ NVIDIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
typedef struct CPPStruct_Rec CPPStruct;
// Multi-threading note: The existence of this global makes
// TODO: threading: Multi-threading note: The existence of this global makes
// this preprocessing single-threaded only.
extern CPPStruct *cpp;
......
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