bind_aaline_fragment_shader(aaline);
aaline->state.sampler[num] = aaline->sampler_cso;
- aaline->state.texture[num] = aaline->texture;
+ pipe_texture_reference(&aaline->state.texture[num], aaline->texture);
aaline->driver_bind_sampler_states(pipe, num + 1, aaline->state.sampler);
aaline->driver_set_sampler_textures(pipe, num + 1, aaline->state.texture);
unsigned num, struct pipe_texture **texture)
{
struct aaline_stage *aaline = aaline_stage_from_pipe(pipe);
+ uint i;
+
/* save current */
- memcpy(aaline->state.texture, texture, num * sizeof(struct pipe_texture *));
+ for (i = 0; i < num; i++) {
+ pipe_texture_reference(&aaline->state.texture[i], texture[i]);
+ }
aaline->num_textures = num;
+
/* pass-through */
aaline->driver_set_sampler_textures(aaline->pipe, num, texture);
}
texTemp.cpp = 1;
pstip->texture = screen->texture_create(screen, &texTemp);
+ assert(pstip->texture->refcount == 1);
//pstip_update_texture(pstip);
}
/* plug in our sampler, texture */
pstip->state.samplers[pstip->sampler_unit] = pstip->sampler_cso;
- pstip->state.textures[pstip->sampler_unit] = pstip->texture;
+ pipe_texture_reference(&pstip->state.textures[pstip->sampler_unit],
+ pstip->texture);
pstip->driver_bind_sampler_states(pipe, num_samplers, pstip->state.samplers);
pstip->driver_set_sampler_textures(pipe, num_samplers, pstip->state.textures);
unsigned num, void **sampler)
{
struct pstip_stage *pstip = pstip_stage_from_pipe(pipe);
+
/* save current */
memcpy(pstip->state.samplers, sampler, num * sizeof(void *));
pstip->num_samplers = num;
unsigned num, struct pipe_texture **texture)
{
struct pstip_stage *pstip = pstip_stage_from_pipe(pipe);
+ uint i;
+
/* save current */
- memcpy(pstip->state.textures, texture, num * sizeof(struct pipe_texture *));
+ for (i = 0; i < num; i++) {
+ pipe_texture_reference(&pstip->state.textures[i], texture[i]);
+ }
pstip->num_textures = num;
+
/* pass-through */
pstip->driver_set_sampler_textures(pstip->pipe, num, texture);
}