jit_tex->height = tex->height0;
jit_tex->depth = tex->depth0;
jit_tex->last_level = tex->last_level;
+
+ /* We're referencing the texture's internal data, so save a
+ * reference to it.
+ */
+ pipe_texture_reference(&setup->fs.current_tex[i], tex);
+
if (!lp_tex->dt) {
/* regular texture - setup array of mipmap level pointers */
int j;
jit_tex->row_stride[0] = lp_tex->stride[0];
assert(jit_tex->data[0]);
}
-
- /* the scene references this texture */
- {
- struct lp_scene *scene = lp_setup_get_current_scene(setup);
- lp_scene_texture_reference(scene, tex);
- }
}
}
* the new, current state. So allocate a new lp_rast_state object
* and append it to the bin's setup data buffer.
*/
+ uint i;
struct lp_rast_state *stored =
(struct lp_rast_state *) lp_scene_alloc(scene, sizeof *stored);
if(stored) {
lp_rast_set_state,
lp_rast_arg_state(setup->fs.stored) );
}
+
+ /* The scene now references the textures in the rasterization
+ * state record. Note that now.
+ */
+ for (i = 0; i < Elements(setup->fs.current_tex); i++) {
+ if (setup->fs.current_tex[i])
+ lp_scene_texture_reference(scene, setup->fs.current_tex[i]);
+ }
}
}
void
lp_setup_destroy( struct lp_setup_context *setup )
{
+ uint i;
+
reset_context( setup );
+ for (i = 0; i < Elements(setup->fs.current_tex); i++) {
+ pipe_texture_reference(&setup->fs.current_tex[i], NULL);
+ }
+
pipe_buffer_reference(&setup->constants.current, NULL);
/* free the scenes in the 'empty' queue */