YaGL: add new rule for texture2D in GLSL 94/163194/2 accepted/tizen/unified/20171208.170413 submit/tizen/20171208.080618
authorJinhyung Jo <jinhyung.jo@samsung.com>
Thu, 7 Dec 2017 12:18:23 +0000 (21:18 +0900)
committerSeokYeon Hwang <syeon.hwang@samsung.com>
Fri, 8 Dec 2017 08:03:13 +0000 (08:03 +0000)
The GLSL patchers did not work correctly with a statement like bellow:

    #define TextureLookup texture2D

The token 'texture2D' in the comment is not parsed with desired result.
So, add a new rule for that situation.

Change-Id: I84ae9166c0d322baf48d1c20bb74a1c27172c59f
Signed-off-by: Jinhyung Jo <jinhyung.jo@samsung.com>
GLESv2/yagl_glsl_lexer.l

index b3508d602f8138d19202ed22770daab046b8eb1b..65badd092e76fed6ceec7d8afc7100f1b9797a92 100644 (file)
@@ -151,6 +151,12 @@ STRING [^ \r\t\v\f\n()\[\]{},;?:/%*&|^!+\-=<>\.]+
     return TOK_TEXTURE2D;
 }
 
+<PP>"texture2D" {
+    struct yagl_glsl_state *state = yagl_glsl_lexer_get_extra(yyscanner);
+    yagl_glsl_state_new_str_token(state, yylval, yytext);
+    return TOK_TEXTURE2D;
+}
+
 "texture3DProjLod" {
     struct yagl_glsl_state *state = yagl_glsl_lexer_get_extra(yyscanner);
     yagl_glsl_state_new_str_token(state, yylval, yytext);