summaryrefslogtreecommitdiff
path: root/src/mesa/state_tracker/st_cb_program.c
diff options
context:
space:
mode:
authorBrian <brian.paul@tungstengraphics.com>2008-01-14 19:12:46 -0700
committerBrian <brian.paul@tungstengraphics.com>2008-01-14 19:13:34 -0700
commitac95fee4fffee77bb7bd798d094ed2e3a7c4019b (patch)
treedb6569f204ba1414d11c7bf4be8b47dafb7c2b0c /src/mesa/state_tracker/st_cb_program.c
parentb4e4fafb4157d416077e985c03204ed5bbe0f2e1 (diff)
Fix problems with vertex shaders and the private draw module.
The CSO returned by pipe->create_vs_state() can't be passed to the private draw module. That was causing glRasterPos to blow up. Add a 'draw_shader' field to st_vertex_program for use with the private draw module. Change st_context->state.vs type from cso_vertex_shader to st_vertex_program.
Diffstat (limited to 'src/mesa/state_tracker/st_cb_program.c')
-rw-r--r--src/mesa/state_tracker/st_cb_program.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/mesa/state_tracker/st_cb_program.c b/src/mesa/state_tracker/st_cb_program.c
index aed6b1ee97..63a954264e 100644
--- a/src/mesa/state_tracker/st_cb_program.c
+++ b/src/mesa/state_tracker/st_cb_program.c
@@ -39,6 +39,8 @@
#include "shader/programopt.h"
#include "shader/shader_api.h"
+#include "pipe/cso_cache/cso_cache.h"
+
#include "st_context.h"
#include "st_program.h"
#include "st_atom_shader.h"
@@ -181,10 +183,11 @@ static void st_program_string_notify( GLcontext *ctx,
stvp->serialNo++;
- if (stvp->vs) {
- /* free the TGSI code */
- // cso_delete(stfp->vs);
- stvp->vs = NULL;
+ if (stvp->cso) {
+ /* free the CSO data */
+ st->pipe->delete_vs_state(st->pipe, stvp->cso->data);
+ FREE((void *) stvp->cso);
+ stvp->cso = NULL;
}
stvp->param_state = stvp->Base.Base.Parameters->StateFlags;