#include "pipe/p_util.h"
#include "pipe/p_shader_tokens.h"
+#include "tgsi/util/tgsi_parse.h"
#include "nv04_context.h"
#include "nv04_state.h"
struct nv04_fragment_program *fp;
fp = CALLOC(1, sizeof(struct nv04_fragment_program));
- fp->pipe = cso;
+ fp->pipe.tokens = tgsi_dup_tokens(cso->tokens);
return (void *)fp;
}
struct nv04_fragment_program *fp = hwcso;
nv04_fragprog_destroy(nv04, fp);
+ free((void*)fp->pipe.tokens);
free(fp);
}
};
struct nv04_fragment_program {
- const struct pipe_shader_state *pipe;
+ struct pipe_shader_state pipe;
struct tgsi_shader_info info;
boolean translated;
#include "pipe/p_util.h"
#include "pipe/p_shader_tokens.h"
+#include "tgsi/util/tgsi_parse.h"
#include "nv10_context.h"
#include "nv10_state.h"
struct nv10_fragment_program *fp;
fp = CALLOC(1, sizeof(struct nv10_fragment_program));
- fp->pipe = cso;
+ fp->pipe.tokens = tgsi_dup_tokens(cso->tokens);
tgsi_scan_shader(cso->tokens, &fp->info);
struct nv10_fragment_program *fp = hwcso;
nv10_fragprog_destroy(nv10, fp);
+ FREE((void*)fp->pipe.tokens);
FREE(fp);
}
};
struct nv10_fragment_program {
- const struct pipe_shader_state *pipe;
+ struct pipe_shader_state pipe;
struct tgsi_shader_info info;
boolean translated;
#include "pipe/p_util.h"
#include "pipe/p_inlines.h"
+#include "tgsi/util/tgsi_parse.h"
+
#include "nv30_context.h"
#include "nv30_state.h"
struct nv30_vertex_program *vp;
vp = CALLOC(1, sizeof(struct nv30_vertex_program));
- vp->pipe = *cso;
+ vp->pipe.tokens = tgsi_dup_tokens(cso->tokens);
/*vp->draw = draw_create_vertex_shader(nv30->draw, &vp->pipe);*/
return (void *)vp;
/*draw_delete_vertex_shader(nv30->draw, vp->draw);*/
nv30_vertprog_destroy(nv30, vp);
+ FREE((void*)vp->pipe.tokens);
FREE(vp);
}
struct nv30_fragment_program *fp;
fp = CALLOC(1, sizeof(struct nv30_fragment_program));
- fp->pipe = *cso;
+ fp->pipe.tokens = tgsi_dup_tokens(cso->tokens);
tgsi_scan_shader(fp->pipe.tokens, &fp->info);
struct nv30_fragment_program *fp = hwcso;
nv30_fragprog_destroy(nv30, fp);
+ FREE((void*)fp->pipe.tokens);
FREE(fp);
}
#include "draw/draw_context.h"
+#include "tgsi/util/tgsi_parse.h"
+
#include "nv40_context.h"
#include "nv40_state.h"
struct nv40_vertex_program *vp;
vp = CALLOC(1, sizeof(struct nv40_vertex_program));
- vp->pipe = *cso;
+ vp->pipe.tokens = tgsi_dup_tokens(cso->tokens);
vp->draw = draw_create_vertex_shader(nv40->draw, &vp->pipe);
return (void *)vp;
draw_delete_vertex_shader(nv40->draw, vp->draw);
nv40_vertprog_destroy(nv40, vp);
+ FREE((void*)vp->pipe.tokens);
FREE(vp);
}
struct nv40_fragment_program *fp;
fp = CALLOC(1, sizeof(struct nv40_fragment_program));
- fp->pipe = *cso;
+ fp->pipe.tokens = tgsi_dup_tokens(cso->tokens);
tgsi_scan_shader(fp->pipe.tokens, &fp->info);
struct nv40_fragment_program *fp = hwcso;
nv40_fragprog_destroy(nv40, fp);
+ FREE((void*)fp->pipe.tokens);
FREE(fp);
}
#include "pipe/p_util.h"
#include "pipe/p_inlines.h"
+#include "tgsi/util/tgsi_parse.h"
+
#include "nv50_context.h"
#include "nv50_texture.h"
{
struct nv50_program *p = CALLOC_STRUCT(nv50_program);
- p->pipe = *cso;
+ p->pipe.tokens = tgsi_dup_tokens(cso->tokens);
p->type = PIPE_SHADER_VERTEX;
tgsi_scan_shader(p->pipe.tokens, &p->info);
return (void *)p;
nv50_vp_state_delete(struct pipe_context *pipe, void *hwcso)
{
struct nv50_context *nv50 = nv50_context(pipe);
+ struct nv50_program *p = hwcso;
- nv50_program_destroy(nv50, hwcso);
- FREE(hwcso);
+ nv50_program_destroy(nv50, p);
+ FREE((void*)p->pipe.tokens);
+ FREE(p);
}
static void *
{
struct nv50_program *p = CALLOC_STRUCT(nv50_program);
- p->pipe = *cso;
+ p->pipe.tokens = tgsi_dup_tokens(cso->tokens);
p->type = PIPE_SHADER_FRAGMENT;
tgsi_scan_shader(p->pipe.tokens, &p->info);
return (void *)p;
nv50_fp_state_delete(struct pipe_context *pipe, void *hwcso)
{
struct nv50_context *nv50 = nv50_context(pipe);
+ struct nv50_program *p = hwcso;
- nv50_program_destroy(nv50, hwcso);
- FREE(hwcso);
+ nv50_program_destroy(nv50, p);
+ FREE((void*)p->pipe.tokens);
+ FREE(p);
}
static void
vs.tokens = tokens;
context->states.mc.i_vs = pipe->create_vs_state(pipe, &vs);
- //free(tokens);
+ free(tokens);
return 0;
}
fs.tokens = tokens;
context->states.mc.i_fs = pipe->create_fs_state(pipe, &fs);
- //free(tokens);
+ free(tokens);
return 0;
}
vs.tokens = tokens;
context->states.mc.p_vs[0] = pipe->create_vs_state(pipe, &vs);
- //free(tokens);
+ free(tokens);
return 0;
}
vs.tokens = tokens;
context->states.mc.p_vs[1] = pipe->create_vs_state(pipe, &vs);
- //free(tokens);
+ free(tokens);
return 0;
}
fs.tokens = tokens;
context->states.mc.p_fs[0] = pipe->create_fs_state(pipe, &fs);
- //free(tokens);
+ free(tokens);
return 0;
}
fs.tokens = tokens;
context->states.mc.p_fs[1] = pipe->create_fs_state(pipe, &fs);
- //free(tokens);
+ free(tokens);
return 0;
}
vs.tokens = tokens;
context->states.mc.b_vs[0] = pipe->create_vs_state(pipe, &vs);
- //free(tokens);
+ free(tokens);
return 0;
}
vs.tokens = tokens;
context->states.mc.b_vs[1] = pipe->create_vs_state(pipe, &vs);
- //free(tokens);
+ free(tokens);
return 0;
}
fs.tokens = tokens;
context->states.mc.b_fs[0] = pipe->create_fs_state(pipe, &fs);
- //free(tokens);
+ free(tokens);
return 0;
}
fs.tokens = tokens;
context->states.mc.b_fs[1] = pipe->create_fs_state(pipe, &fs);
- //free(tokens);
+ free(tokens);
return 0;
}