struct gl_program *prog )
{
struct st_context *st = st_context(ctx);
+ struct pipe_context *pipe = st->pipe;
switch( prog->Target ) {
case GL_VERTEX_PROGRAM_ARB:
{
struct st_vertex_program *stvp = (struct st_vertex_program *) prog;
st_remove_vertex_program(st, stvp);
+ if (stvp->driver_shader) {
+ pipe->delete_vs_state(pipe, stvp->driver_shader);
+ stvp->driver_shader = NULL;
+ }
}
break;
case GL_FRAGMENT_PROGRAM_ARB:
struct st_fragment_program *stfp
= (struct st_fragment_program *) prog;
st_remove_fragment_program(st, stfp);
+ if (stfp->driver_shader) {
+ pipe->delete_fs_state(pipe, stfp->driver_shader);
+ stfp->driver_shader = NULL;
+ }
+
+ assert(!stfp->vertex_programs);
+
}
break;
default:
struct gl_program *prog )
{
struct st_context *st = st_context(ctx);
+ struct pipe_context *pipe = st->pipe;
if (target == GL_FRAGMENT_PROGRAM_ARB) {
struct st_fragment_program *stfp = (struct st_fragment_program *) prog;
stfp->serialNo++;
-#if 0
- if (stfp->cso) {
- /* free the TGSI code */
- // cso_delete(stfp->vs);
- stfp->cso = NULL;
+ if (stfp->driver_shader) {
+ pipe->delete_fs_state(pipe, stfp->driver_shader);
+ stfp->driver_shader = NULL;
}
-#endif
stfp->param_state = stfp->Base.Base.Parameters->StateFlags;
stvp->serialNo++;
-#if 0
- if (stvp->cso) {
- /* free the CSO data */
- st->pipe->delete_vs_state(st->pipe, stvp->cso->data);
- FREE((void *) stvp->cso);
- stvp->cso = NULL;
+ if (stvp->driver_shader) {
+ pipe->delete_vs_state(pipe, stvp->driver_shader);
+ stvp->driver_shader = NULL;
}
-#endif
+
if (stvp->draw_shader) {
draw_delete_vertex_shader(st->draw, stvp->draw_shader);
stvp->draw_shader = NULL;