From 05a23e6c6f08d4d901dc9fc9995b3444fa6355dd Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Mon, 14 Jul 2008 10:45:40 +0900 Subject: python: Allow to create/specify shaders. --- src/gallium/state_trackers/python/st_device.c | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) (limited to 'src/gallium/state_trackers/python/st_device.c') diff --git a/src/gallium/state_trackers/python/st_device.c b/src/gallium/state_trackers/python/st_device.c index 430a7af176..e9002b493d 100644 --- a/src/gallium/state_trackers/python/st_device.c +++ b/src/gallium/state_trackers/python/st_device.c @@ -99,18 +99,12 @@ st_context_destroy(struct st_context *st_ctx) if(st_ctx) { struct st_device *st_dev = st_ctx->st_dev; - if(st_ctx->vs) { - st_ctx->pipe->bind_vs_state(st_ctx->pipe, NULL); - st_ctx->pipe->delete_vs_state(st_ctx->pipe, st_ctx->vs); - } - - if(st_ctx->fs) { - st_ctx->pipe->bind_fs_state(st_ctx->pipe, NULL); - st_ctx->pipe->delete_fs_state(st_ctx->pipe, st_ctx->fs); - } - - if(st_ctx->cso) + if(st_ctx->cso) { + cso_delete_vertex_shader(st_ctx->cso, st_ctx->vs); + cso_delete_fragment_shader(st_ctx->cso, st_ctx->fs); + cso_destroy_context(st_ctx->cso); + } if(st_ctx->pipe) st_ctx->st_dev->st_ws->context_destroy(st_ctx->pipe); @@ -162,8 +156,8 @@ st_context_create(struct st_device *st_dev) st_ctx->fs = util_make_fragment_passthrough_shader(st_ctx->pipe, &st_ctx->frag_shader); - st_ctx->pipe->bind_fs_state(st_ctx->pipe, st_ctx->fs); - st_ctx->pipe->bind_vs_state(st_ctx->pipe, st_ctx->vs); + cso_set_fragment_shader_handle(st_ctx->cso, st_ctx->fs); + cso_set_vertex_shader_handle(st_ctx->cso, st_ctx->vs); return st_ctx; } -- cgit v1.2.3