There is no guarantee that the tokens TGSI will persist beyond the
create_fs_state. The pipe driver (and therefore the draw module) is
responsible for making copies of the TGSI tokens when it needs them.
Reviewed-by: Brian Paul <brianp@vmware.com>
if (aafs == NULL)
return NULL;
- aafs->state = *fs;
+ aafs->state.tokens = tgsi_dup_tokens(fs->tokens);
/* pass-through */
aafs->driver_fs = aaline->driver_create_fs_state(pipe, fs);
if (aafs->aaline_fs)
aaline->driver_delete_fs_state(pipe, aafs->aaline_fs);
+ FREE((void*)aafs->state.tokens);
+
FREE(aafs);
}
if (aafs == NULL)
return NULL;
- aafs->state = *fs;
+ aafs->state.tokens = tgsi_dup_tokens(fs->tokens);
/* pass-through */
aafs->driver_fs = aapoint->driver_create_fs_state(pipe, fs);
if (aafs->aapoint_fs)
aapoint->driver_delete_fs_state(pipe, aafs->aapoint_fs);
+ FREE((void*)aafs->state.tokens);
+
FREE(aafs);
}