#include "draw_context.h"
#include "draw_vs.h"
+#include "tgsi/util/tgsi_parse.h"
+
static INLINE unsigned
compute_clipmask(const float *clip, /*const*/ float plane[][4], unsigned nr)
static void
vs_exec_delete( struct draw_vertex_shader *dvs )
{
+ FREE((void*) dvs->state.tokens);
FREE( dvs );
}
const struct pipe_shader_state *state)
{
struct draw_vertex_shader *vs = CALLOC_STRUCT( draw_vertex_shader );
+ uint nt = tgsi_num_tokens(state->tokens);
if (vs == NULL)
return NULL;
- vs->state = *state;
+ /* we make a private copy of the tokens */
+ vs->state.tokens = mem_dup(state->tokens, nt * sizeof(state->tokens[0]));
vs->prepare = vs_exec_prepare;
vs->run = vs_exec_run;
vs->delete = vs_exec_delete;
#include "draw_context.h"
#include "draw_vs.h"
+#include "tgsi/util/tgsi_parse.h"
+
#ifdef MESA_LLVM
#include "gallivm/gallivm.h"
/* Do something to free compiled shader:
*/
+ FREE( (void*) shader->base.state.tokens );
FREE( shader );
}
const struct pipe_shader_state *templ)
{
struct draw_llvm_vertex_shader *vs;
+ uint nt = tgsi_num_tokens(templ->tokens);
vs = CALLOC_STRUCT( draw_llvm_vertex_shader );
if (vs == NULL)
return NULL;
- vs->base.state = templ;
+ /* we make a private copy of the tokens */
+ vs->base.state.tokens = mem_dup(templ->tokens, nt * sizeof(templ->tokens[0]));
vs->base.prepare = vs_llvm_prepare;
vs->base.run = vs_llvm_run;
vs->base.delete = vs_llvm_delete;
#include "rtasm/rtasm_x86sse.h"
#include "tgsi/exec/tgsi_sse2.h"
+#include "tgsi/util/tgsi_parse.h"
typedef void (XSTDCALL *codegen_function) (
x86_release_func( &shader->sse2_program );
+ FREE( (void*) shader->base.state.tokens );
FREE( shader );
}
const struct pipe_shader_state *templ)
{
struct draw_sse_vertex_shader *vs;
+ uint nt = tgsi_num_tokens(templ->tokens);
if (!draw->use_sse)
return NULL;
if (vs == NULL)
return NULL;
- vs->base.state = *templ;
+ /* we make a private copy of the tokens */
+ vs->base.state.tokens = mem_dup(templ->tokens, nt * sizeof(templ->tokens[0]));
vs->base.prepare = vs_sse_prepare;
vs->base.run = vs_sse_run;
vs->base.delete = vs_sse_delete;