gallium: add some temporary code for testing draw module vertex passthrough
[mesa.git] / src / mesa / state_tracker / st_cb_program.c
index aed6b1ee97d1aa6fa3fab527ed5f67b7960bf20f..4dc76f19b10abb0814a2af4455aff8fd3a59f5ec 100644 (file)
@@ -39,6 +39,9 @@
 #include "shader/programopt.h"
 #include "shader/shader_api.h"
 
+#include "cso_cache/cso_cache.h"
+#include "draw/draw_context.h"
+
 #include "st_context.h"
 #include "st_program.h"
 #include "st_atom_shader.h"
@@ -165,11 +168,13 @@ static void st_program_string_notify( GLcontext *ctx,
 
       stfp->serialNo++;
 
-      if (stfp->fs) {
+#if 0
+      if (stfp->cso) {
          /* free the TGSI code */
          // cso_delete(stfp->vs);
-         stfp->fs = NULL;
+         stfp->cso = NULL;
       }
+#endif
 
       stfp->param_state = stfp->Base.Base.Parameters->StateFlags;
 
@@ -181,17 +186,23 @@ 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 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;
+      }
+#endif
+      if (stvp->draw_shader) {
+         draw_delete_vertex_shader(st->draw, stvp->draw_shader);
+         stvp->draw_shader = NULL;
       }
 
       stvp->param_state = stvp->Base.Base.Parameters->StateFlags;
 
       if (st->vp == stvp)
         st->dirty.st |= ST_NEW_VERTEX_PROGRAM;
-
    }
 }