PP: Recognize the '::' token, and translate appropriately to GLSL/HLSL token.
This commit is contained in:
parent
6212e86faa
commit
523e20dc02
@ -21,3 +21,8 @@ struct SA { float f[4]; };
|
|||||||
out SA outSA;
|
out SA outSA;
|
||||||
struct SS { float f; S s; };
|
struct SS { float f; S s; };
|
||||||
out SS outSS;
|
out SS outSS;
|
||||||
|
|
||||||
|
void foo()
|
||||||
|
{
|
||||||
|
SS::f;
|
||||||
|
}
|
||||||
|
|||||||
@ -2,7 +2,8 @@
|
|||||||
Warning, version 450 is not yet complete; most version-specific features are present, but some are missing.
|
Warning, version 450 is not yet complete; most version-specific features are present, but some are missing.
|
||||||
ERROR: 0:12: 'out' : cannot be bool
|
ERROR: 0:12: 'out' : cannot be bool
|
||||||
ERROR: 0:13: 'sampler2D' : sampler/image types can only be used in uniform variables or function parameters: outo
|
ERROR: 0:13: 'sampler2D' : sampler/image types can only be used in uniform variables or function parameters: outo
|
||||||
ERROR: 2 compilation errors. No code generated.
|
ERROR: 0:27: '::' : not supported
|
||||||
|
ERROR: 3 compilation errors. No code generated.
|
||||||
|
|
||||||
|
|
||||||
Shader version: 450
|
Shader version: 450
|
||||||
@ -20,6 +21,8 @@ ERROR: node is still EOpNull!
|
|||||||
0:9 2 (const int)
|
0:9 2 (const int)
|
||||||
0:9 Constant:
|
0:9 Constant:
|
||||||
0:9 4.500000
|
0:9 4.500000
|
||||||
|
0:25 Function Definition: foo( (global void)
|
||||||
|
0:25 Function Parameters:
|
||||||
0:? Linker Objects
|
0:? Linker Objects
|
||||||
0:? 'anon@0' (out block{out 3-element array of float CullDistance gl_CullDistance})
|
0:? 'anon@0' (out block{out 3-element array of float CullDistance gl_CullDistance})
|
||||||
0:? 'outb' (smooth out bool)
|
0:? 'outb' (smooth out bool)
|
||||||
|
|||||||
@ -2,5 +2,5 @@
|
|||||||
// For the version, it uses the latest git tag followed by the number of commits.
|
// For the version, it uses the latest git tag followed by the number of commits.
|
||||||
// For the date, it uses the current date (when then script is run).
|
// For the date, it uses the current date (when then script is run).
|
||||||
|
|
||||||
#define GLSLANG_REVISION "Overload400-PrecQual.1892"
|
#define GLSLANG_REVISION "Overload400-PrecQual.1897"
|
||||||
#define GLSLANG_DATE "09-Mar-2017"
|
#define GLSLANG_DATE "10-Mar-2017"
|
||||||
|
|||||||
@ -701,6 +701,10 @@ int TScanContext::tokenize(TPpContext* pp, TParserToken& token)
|
|||||||
case PpAtomDecrement: return DEC_OP;
|
case PpAtomDecrement: return DEC_OP;
|
||||||
case PpAtomIncrement: return INC_OP;
|
case PpAtomIncrement: return INC_OP;
|
||||||
|
|
||||||
|
case PpAtomColonColon:
|
||||||
|
parseContext.error(loc, "not supported", "::", "");
|
||||||
|
break;
|
||||||
|
|
||||||
case PpAtomConstInt: parserToken->sType.lex.i = ppToken.ival; return INTCONSTANT;
|
case PpAtomConstInt: parserToken->sType.lex.i = ppToken.ival; return INTCONSTANT;
|
||||||
case PpAtomConstUint: parserToken->sType.lex.i = ppToken.ival; return UINTCONSTANT;
|
case PpAtomConstUint: parserToken->sType.lex.i = ppToken.ival; return UINTCONSTANT;
|
||||||
case PpAtomConstInt64: parserToken->sType.lex.i64 = ppToken.i64val; return INT64CONSTANT;
|
case PpAtomConstInt64: parserToken->sType.lex.i64 = ppToken.i64val; return INT64CONSTANT;
|
||||||
|
|||||||
@ -120,6 +120,8 @@ const struct {
|
|||||||
{ PpAtomDecrement, "--" },
|
{ PpAtomDecrement, "--" },
|
||||||
{ PpAtomIncrement, "++" },
|
{ PpAtomIncrement, "++" },
|
||||||
|
|
||||||
|
{ PpAtomColonColon, "::" },
|
||||||
|
|
||||||
{ PpAtomDefine, "define" },
|
{ PpAtomDefine, "define" },
|
||||||
{ PpAtomUndef, "undef" },
|
{ PpAtomUndef, "undef" },
|
||||||
{ PpAtomIf, "if" },
|
{ PpAtomIf, "if" },
|
||||||
|
|||||||
@ -691,6 +691,12 @@ int TPpContext::tStringInput::scan(TPpToken* ppToken)
|
|||||||
pp->parseContext.ppError(ppToken->loc, "End of line in string", "string", "");
|
pp->parseContext.ppError(ppToken->loc, "End of line in string", "string", "");
|
||||||
}
|
}
|
||||||
return PpAtomConstString;
|
return PpAtomConstString;
|
||||||
|
case ':':
|
||||||
|
ch = getch();
|
||||||
|
if (ch == ':')
|
||||||
|
return PpAtomColonColon;
|
||||||
|
ungetch();
|
||||||
|
return ':';
|
||||||
}
|
}
|
||||||
|
|
||||||
ch = getch();
|
ch = getch();
|
||||||
|
|||||||
@ -117,6 +117,8 @@ enum EFixedAtoms {
|
|||||||
PpAtomDecrement,
|
PpAtomDecrement,
|
||||||
PpAtomIncrement,
|
PpAtomIncrement,
|
||||||
|
|
||||||
|
PpAtomColonColon,
|
||||||
|
|
||||||
PpAtomPaste,
|
PpAtomPaste,
|
||||||
|
|
||||||
// Constants
|
// Constants
|
||||||
|
|||||||
@ -328,6 +328,7 @@ enum EHlslTokenClass {
|
|||||||
EHTokDot,
|
EHTokDot,
|
||||||
EHTokComma,
|
EHTokComma,
|
||||||
EHTokColon,
|
EHTokColon,
|
||||||
|
EHTokColonColon,
|
||||||
EHTokSemicolon,
|
EHTokSemicolon,
|
||||||
EHTokBang,
|
EHTokBang,
|
||||||
EHTokDash,
|
EHTokDash,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user