mirror of
https://github.com/RPCS3/glslang.git
synced 2025-01-26 05:04:27 +00:00
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;
|
||||
struct SS { float f; S s; };
|
||||
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.
|
||||
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: 2 compilation errors. No code generated.
|
||||
ERROR: 0:27: '::' : not supported
|
||||
ERROR: 3 compilation errors. No code generated.
|
||||
|
||||
|
||||
Shader version: 450
|
||||
@ -20,6 +21,8 @@ ERROR: node is still EOpNull!
|
||||
0:9 2 (const int)
|
||||
0:9 Constant:
|
||||
0:9 4.500000
|
||||
0:25 Function Definition: foo( (global void)
|
||||
0:25 Function Parameters:
|
||||
0:? Linker Objects
|
||||
0:? 'anon@0' (out block{out 3-element array of float CullDistance gl_CullDistance})
|
||||
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 date, it uses the current date (when then script is run).
|
||||
|
||||
#define GLSLANG_REVISION "Overload400-PrecQual.1892"
|
||||
#define GLSLANG_DATE "09-Mar-2017"
|
||||
#define GLSLANG_REVISION "Overload400-PrecQual.1897"
|
||||
#define GLSLANG_DATE "10-Mar-2017"
|
||||
|
@ -701,6 +701,10 @@ int TScanContext::tokenize(TPpContext* pp, TParserToken& token)
|
||||
case PpAtomDecrement: return DEC_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 PpAtomConstUint: parserToken->sType.lex.i = ppToken.ival; return UINTCONSTANT;
|
||||
case PpAtomConstInt64: parserToken->sType.lex.i64 = ppToken.i64val; return INT64CONSTANT;
|
||||
|
@ -120,6 +120,8 @@ const struct {
|
||||
{ PpAtomDecrement, "--" },
|
||||
{ PpAtomIncrement, "++" },
|
||||
|
||||
{ PpAtomColonColon, "::" },
|
||||
|
||||
{ PpAtomDefine, "define" },
|
||||
{ PpAtomUndef, "undef" },
|
||||
{ PpAtomIf, "if" },
|
||||
|
@ -691,6 +691,12 @@ int TPpContext::tStringInput::scan(TPpToken* ppToken)
|
||||
pp->parseContext.ppError(ppToken->loc, "End of line in string", "string", "");
|
||||
}
|
||||
return PpAtomConstString;
|
||||
case ':':
|
||||
ch = getch();
|
||||
if (ch == ':')
|
||||
return PpAtomColonColon;
|
||||
ungetch();
|
||||
return ':';
|
||||
}
|
||||
|
||||
ch = getch();
|
||||
|
@ -117,6 +117,8 @@ enum EFixedAtoms {
|
||||
PpAtomDecrement,
|
||||
PpAtomIncrement,
|
||||
|
||||
PpAtomColonColon,
|
||||
|
||||
PpAtomPaste,
|
||||
|
||||
// Constants
|
||||
|
@ -328,6 +328,7 @@ enum EHlslTokenClass {
|
||||
EHTokDot,
|
||||
EHTokComma,
|
||||
EHTokColon,
|
||||
EHTokColonColon,
|
||||
EHTokSemicolon,
|
||||
EHTokBang,
|
||||
EHTokDash,
|
||||
|
Loading…
x
Reference in New Issue
Block a user