return TOK_GLFRAGCOLOR;
}
-"samplerExternalOES" {
- struct yagl_glsl_state *state = yagl_glsl_lexer_get_extra(yyscanner);
- yagl_glsl_state_new_str_token(state, yylval, yytext);
- return TOK_SAMPLEREXTERNALOES;
-}
-
{PRECISION} {
struct yagl_glsl_state *state = yagl_glsl_lexer_get_extra(yyscanner);
yagl_glsl_state_new_str_token(state, yylval, yytext);
%token <str> TOK_TEXTURECUBE
%token <str> TOK_TEXTURECUBELOD
%token <str> TOK_GLFRAGCOLOR
-%token <str> TOK_SAMPLEREXTERNALOES
%%
yagl_glsl_state_append_output(state, $1.value);
}
}
-| TOK_SAMPLEREXTERNALOES
-{
- yagl_glsl_state_flush_pending(state, $1.index);
- yagl_glsl_state_append_output(state, "sampler2D");
-}
;
{
int have_version = state->have_version;
int have_extensions = state->have_extensions;
+ int have_samplerexternaloes = state->have_samplerexternaloes;
- if (have_version && have_extensions) {
+ if (have_version && have_extensions && have_samplerexternaloes) {
return;
}
state->have_version = 1;
state->have_extensions = 1;
+ state->have_samplerexternaloes = 1;
if (!have_version) {
switch (state->patch_version) {
break;
}
}
+
+ if(!have_samplerexternaloes) {
+ yagl_glsl_state_append_header(state, "#define samplerExternalOES sampler2D\n\n");
+ }
}
static void yagl_glsl_state_move_pending(struct yagl_glsl_state *state)
int have_extensions;
+ int have_samplerexternaloes;
+
int frag_color_declared;
int texture1d_declared;
int texture1dproj_declared;