Go to the source code of this file.
Functions | |
void | st_init_program_functions (struct dd_function_table *functions) |
void | st_delete_program (GLcontext *ctx, struct gl_program *prog) |
void st_delete_program | ( | GLcontext * | ctx, | |
struct gl_program * | prog | |||
) |
Definition at line 132 of file st_cb_program.c.
References assert, st_fragment_program::Base, st_fragment_program::bitmap_program, st_context::cso_context, cso_delete_fragment_shader(), cso_delete_vertex_shader(), st_context::draw, draw_delete_vertex_shader(), st_vertex_program::draw_shader, st_fragment_program::driver_shader, st_vertex_program::driver_shader, FREE, st_context(), st_free_translated_vertex_programs(), st_fragment_program::state, st_vertex_program::state, pipe_shader_state::tokens, and st_fragment_program::vertex_programs.
00133 { 00134 struct st_context *st = st_context(ctx); 00135 00136 switch( prog->Target ) { 00137 case GL_VERTEX_PROGRAM_ARB: 00138 { 00139 struct st_vertex_program *stvp = (struct st_vertex_program *) prog; 00140 00141 if (stvp->driver_shader) { 00142 cso_delete_vertex_shader(st->cso_context, stvp->driver_shader); 00143 stvp->driver_shader = NULL; 00144 } 00145 00146 if (stvp->draw_shader) { 00147 #if FEATURE_feedback || FEATURE_drawpix 00148 /* this would only have been allocated for the RasterPos path */ 00149 draw_delete_vertex_shader(st->draw, stvp->draw_shader); 00150 stvp->draw_shader = NULL; 00151 #endif 00152 } 00153 00154 if (stvp->state.tokens) { 00155 FREE((void *) stvp->state.tokens); 00156 stvp->state.tokens = NULL; 00157 } 00158 } 00159 break; 00160 case GL_FRAGMENT_PROGRAM_ARB: 00161 { 00162 struct st_fragment_program *stfp = (struct st_fragment_program *) prog; 00163 00164 if (stfp->driver_shader) { 00165 cso_delete_fragment_shader(st->cso_context, stfp->driver_shader); 00166 stfp->driver_shader = NULL; 00167 } 00168 00169 if (stfp->state.tokens) { 00170 FREE((void *) stfp->state.tokens); 00171 stfp->state.tokens = NULL; 00172 } 00173 00174 if (stfp->bitmap_program) { 00175 struct gl_program *prg = &stfp->bitmap_program->Base.Base; 00176 _mesa_reference_program(ctx, &prg, NULL); 00177 stfp->bitmap_program = NULL; 00178 } 00179 00180 st_free_translated_vertex_programs(st, stfp->vertex_programs); 00181 } 00182 break; 00183 default: 00184 assert(0); /* problem */ 00185 } 00186 00187 /* delete base class */ 00188 _mesa_delete_program( ctx, prog ); 00189 }
void st_init_program_functions | ( | struct dd_function_table * | functions | ) |
Definition at line 258 of file st_cb_program.c.
References st_bind_program(), st_delete_program(), st_is_program_native(), st_new_program(), st_program_string_notify(), and st_use_program().
00259 { 00260 functions->BindProgram = st_bind_program; 00261 functions->UseProgram = st_use_program; 00262 functions->NewProgram = st_new_program; 00263 functions->DeleteProgram = st_delete_program; 00264 functions->IsProgramNative = st_is_program_native; 00265 functions->ProgramStringNotify = st_program_string_notify; 00266 }