struct pipe_context *pipe = st->pipe;
if (st->clear.fs) {
- pipe->delete_fs_state(pipe, st->clear.fs);
+ cso_delete_fragment_shader(st->cso_context, st->clear.fs);
st->clear.fs = NULL;
}
if (st->clear.vs) {
- pipe->delete_vs_state(pipe, st->clear.vs);
+ cso_delete_vertex_shader(st->cso_context, st->clear.vs);
st->clear.vs = NULL;
}
if (st->clear.vbuf) {
#include "shader/programopt.h"
#include "shader/shader_api.h"
-#include "cso_cache/cso_cache.h"
+#include "cso_cache/cso_context.h"
#include "draw/draw_context.h"
#include "st_context.h"
st_delete_program(GLcontext *ctx, 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;
if (stvp->driver_shader) {
- pipe->delete_vs_state(pipe, stvp->driver_shader);
+ cso_delete_vertex_shader(st->cso_context, stvp->driver_shader);
stvp->driver_shader = NULL;
}
struct st_fragment_program *stfp = (struct st_fragment_program *) prog;
if (stfp->driver_shader) {
- pipe->delete_fs_state(pipe, stfp->driver_shader);
+ cso_delete_fragment_shader(st->cso_context, stfp->driver_shader);
stfp->driver_shader = NULL;
}
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 (stfp->driver_shader) {
- pipe->delete_fs_state(pipe, stfp->driver_shader);
+ cso_delete_fragment_shader(st->cso_context, stfp->driver_shader);
stfp->driver_shader = NULL;
}
stvp->serialNo++;
if (stvp->driver_shader) {
- pipe->delete_vs_state(pipe, stvp->driver_shader);
+ cso_delete_vertex_shader(st->cso_context, stvp->driver_shader);
stvp->driver_shader = NULL;
}
}
}
- st->pipe->destroy( st->pipe );
free( st );
}
void st_destroy_context( struct st_context *st )
{
+ struct pipe_context *pipe = st->pipe;
+ struct cso_context *cso = st->cso_context;
GLcontext *ctx = st->ctx;
/* need to unbind and destroy CSO objects before anything else */
- cso_destroy_context(st->cso_context);
+ cso_release_all(st->cso_context);
_mesa_delete_program_cache(st->ctx, st->pixel_xfer.cache);
_mesa_free_context_data(ctx);
+
st_destroy_context_priv(st);
+
+ cso_destroy_context(cso);
+
+ pipe->destroy( pipe );
+
free(ctx);
}