static void
-exec_delete( struct sp_fragment_shader_variant *var )
+exec_delete(struct sp_fragment_shader_variant *var,
+ struct tgsi_exec_machine *machine)
{
+ if (machine->Tokens == var->tokens) {
+ tgsi_exec_machine_bind_shader(machine, NULL, 0, NULL);
+ }
+
FREE( (void *) var->tokens );
FREE(var);
}
struct quad_header *quad);
/* Deletes this instance of the object */
- void (*delete)(struct sp_fragment_shader_variant *shader);
+ void (*delete)(struct sp_fragment_shader_variant *shader,
+ struct tgsi_exec_machine *machine);
struct sp_fragment_shader_variant *next;
};
#include "draw/draw_vs.h"
#include "draw/draw_gs.h"
#include "tgsi/tgsi_dump.h"
-#include "tgsi/tgsi_exec.h"
#include "tgsi/tgsi_scan.h"
#include "tgsi/tgsi_parse.h"
assert(fs != softpipe->fs);
- if (softpipe->fs_machine->Tokens == state->shader.tokens) {
- /* unbind the shader from the tgsi executor if we're
- * deleting it.
- */
- tgsi_exec_machine_bind_shader(softpipe->fs_machine, NULL, 0, NULL);
- }
-
/* delete variants */
for (var = state->variants; var; var = next_var) {
next_var = var->next;
draw_delete_fragment_shader(softpipe->draw, var->draw_shader);
#endif
- var->delete(var);
+ var->delete(var, softpipe->fs_machine);
}
draw_delete_fragment_shader(softpipe->draw, state->draw_shader);