if (have_strings) {
uint8_t *tmp_buff;
- struct yagl_glsl_state glsl_state;
int ret;
int patched_len = 0;
char *patched_source;
YAGL_LOG_TRACE("orig source = %s", tmp_buff);
- yagl_glsl_state_init(&glsl_state,
+ yagl_glsl_state_init(&shader_obj->state,
shader_obj->type,
(char*)tmp_buff,
total_length,
(ctx->base.base.client_api == yagl_client_api_gles3));
- ret = yagl_glsl_parse(&glsl_state);
+ ret = yagl_glsl_parse(&shader_obj->state);
- if ((ret == 0) && !glsl_state.have_error) {
- patched_source = yagl_glsl_state_get_output(&glsl_state,
+ if ((ret == 0) && !shader_obj->state.have_error) {
+ patched_source = yagl_glsl_state_get_output(&shader_obj->state,
&patched_len);
YAGL_LOG_TRACE("patched source = %s", patched_source);
/*
* Unable to parse source, pass as-is.
*/
+ YAGL_LOG_TRACE("unable to patch shader source, passed as-is");
yagl_gles2_shader_source(shader_obj,
(GLchar*)tmp_buff,
(GLchar*)tmp_buff,
total_length);
}
-
- yagl_glsl_state_cleanup(&glsl_state);
}
out:
#include "yagl_types.h"
#include "yagl_object.h"
+#include "yagl_glsl_state.h"
/*
* Programs and shaders share the same namespace,
GLenum type;
GLchar *source;
+
+ struct yagl_glsl_state state; // for late analysis at draw calls
};
struct yagl_gles2_shader *yagl_gles2_shader_create(GLenum type);