static bool compile_programs(GLuint *gl_prog) { unsigned i; for (i = 0; i < glsl_shader->passes; i++) { struct gfx_shader_pass *pass = &glsl_shader->pass[i]; // If we load from GLSLP (CGP), // load the file here, and pretend // we were really using XML all along. if (*pass->source.cg && !load_source_path(pass, pass->source.cg)) { RARCH_ERR("Failed to load GLSL shader: %s.\n", pass->source.cg); return false; } *pass->source.cg = '\0'; const char *vertex = pass->source.xml.vertex; const char *fragment = pass->source.xml.fragment; gl_prog[i] = compile_program(vertex, fragment, i); if (!gl_prog[i]) { RARCH_ERR("Failed to create GL program #%u.\n", i); return false; } } return true; }
static bool compile_programs(glsl_shader_data_t *glsl, GLuint *gl_prog) { unsigned i; for (i = 0; i < glsl->shader->passes; i++) { const char *vertex = NULL; const char *fragment = NULL; struct video_shader_pass *pass = (struct video_shader_pass*) &glsl->shader->pass[i]; /* If we load from GLSLP (CGP), * load the file here, and pretend * we were really using XML all along. */ if (*pass->source.path && !load_source_path(pass, pass->source.path)) { RARCH_ERR("Failed to load GLSL shader: %s.\n", pass->source.path); return false; } *pass->source.path = '\0'; vertex = pass->source.string.vertex; fragment = pass->source.string.fragment; gl_prog[i] = compile_program(glsl, vertex, fragment, i); if (!gl_prog[i]) { RARCH_ERR("Failed to create GL program #%u.\n", i); return false; } } return true; }