int setup_shader(char * filename, Sourceparams_t * sourceparams, Displaydata_t * displaydata) { GLuint program; int retval; program = setup_shader_program(filename); if (0 == program) { /* we didn't get a compiled program; return error */ retval = -1; } else { retval = setup_shader_interface(program, sourceparams, displaydata); } return(retval); }
void shader_bind(struct shader *shader) { struct vg_context *ctx = shader->context; struct pipe_sampler_state *samplers[PIPE_MAX_SAMPLERS]; struct pipe_sampler_view *sampler_views[PIPE_MAX_SAMPLERS]; VGint num_samplers, param_bytes; /* first resolve the real paint type */ paint_resolve_type(shader->paint); num_samplers = setup_samplers(shader, samplers, sampler_views); param_bytes = setup_constant_buffer(shader); setup_shader_program(shader); renderer_validate_for_shader(ctx->renderer, (const struct pipe_sampler_state **) samplers, sampler_views, num_samplers, &shader->modelview, shader->fs, (const void *) shader->constants, param_bytes); }