Add a new shader-versioning infrastructure capable of handling multiple profiles, desktop/ES, many versions, features coming and going in different versions across different profiles, and extensions.
NB: *Use* of this infrastructure is so far only skeletal. Fixed a few typos and minor issues along the way. git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@19951 e7fa87d3-cd2b-0410-9028-fcbf551c1848
This commit is contained in:
parent
5d3e2e35b6
commit
9fd55bd338
31 changed files with 1662 additions and 706 deletions
|
|
@ -127,10 +127,6 @@ struct CPPStruct_Rec {
|
|||
int PaArgc; // count of strings in the array
|
||||
char** PaArgv; // our array of strings to parse
|
||||
unsigned int tokensBeforeEOF : 1;
|
||||
|
||||
// Declared version of the shader
|
||||
int version;
|
||||
int profileAtom;
|
||||
};
|
||||
|
||||
#endif // !defined(__COMPILE_H)
|
||||
|
|
|
|||
|
|
@ -685,18 +685,22 @@ static int CPPversion(yystypepp * yylvalpp)
|
|||
|
||||
yylvalpp->sc_int=atoi(yylvalpp->symbol_name);
|
||||
|
||||
cpp->version = yylvalpp->sc_int;
|
||||
SetVersion(yylvalpp->sc_int);
|
||||
|
||||
token = cpp->currentInput->scan(cpp->currentInput, yylvalpp);
|
||||
|
||||
if (token == '\n'){
|
||||
if (token == '\n') {
|
||||
SetProfile(ENoProfile);
|
||||
return token;
|
||||
}
|
||||
else{
|
||||
cpp->profileAtom = yylvalpp->sc_ident;
|
||||
if (cpp->profileAtom != coreAtom &&
|
||||
cpp->profileAtom != compatibilityAtom &&
|
||||
cpp->profileAtom != esAtom)
|
||||
else {
|
||||
if (yylvalpp->sc_ident == coreAtom)
|
||||
SetProfile(ECoreProfile);
|
||||
else if (yylvalpp->sc_ident == compatibilityAtom)
|
||||
SetProfile(ECompatibilityProfile);
|
||||
else if (yylvalpp->sc_ident == esAtom)
|
||||
SetProfile(EEsProfile);
|
||||
else
|
||||
CPPErrorToInfoLog("#version profile name");
|
||||
|
||||
token = cpp->currentInput->scan(cpp->currentInput, yylvalpp);
|
||||
|
|
|
|||
|
|
@ -83,6 +83,7 @@ NVIDIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|||
|
||||
#include "parser.h"
|
||||
#include "tokens.h"
|
||||
#include "Versions.h"
|
||||
|
||||
int InitCPP(void);
|
||||
int FinalCPP(void);
|
||||
|
|
@ -113,6 +114,8 @@ void SetStringNumber(int); // Set string number.
|
|||
int GetLineNumber(void); // Get the current String Number.
|
||||
int GetStringNumber(void); // Get the current String Number.
|
||||
const char* GetStrfromTStr(void); // Convert TString to String.
|
||||
void SetVersion(int);
|
||||
void SetProfile(EProfile);
|
||||
void updateExtensionBehavior(const char* extName, const char* behavior);
|
||||
int FreeCPP(void);
|
||||
|
||||
|
|
|
|||
|
|
@ -132,8 +132,6 @@ int ResetPreprocessor(void)
|
|||
cpp->elsedepth[cpp->elsetracker]=0;
|
||||
cpp->elsetracker=0;
|
||||
cpp->tokensBeforeEOF = 0;
|
||||
cpp->version = 110;
|
||||
cpp->profileAtom = 0;
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue