summaryrefslogtreecommitdiff
path: root/src/gallium/auxiliary/draw/draw_pipe_aaline.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium/auxiliary/draw/draw_pipe_aaline.c')
-rw-r--r--src/gallium/auxiliary/draw/draw_pipe_aaline.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/gallium/auxiliary/draw/draw_pipe_aaline.c b/src/gallium/auxiliary/draw/draw_pipe_aaline.c
index f501b2aed4..346a96e37f 100644
--- a/src/gallium/auxiliary/draw/draw_pipe_aaline.c
+++ b/src/gallium/auxiliary/draw/draw_pipe_aaline.c
@@ -713,6 +713,11 @@ static void
aaline_destroy(struct draw_stage *stage)
{
struct aaline_stage *aaline = aaline_stage(stage);
+ uint i;
+
+ for (i = 0; i < PIPE_MAX_SAMPLERS; i++) {
+ pipe_texture_reference(&aaline->state.texture[i], NULL);
+ }
if (aaline->sampler_cso)
aaline->pipe->delete_sampler_state(aaline->pipe, aaline->sampler_cso);
@@ -836,6 +841,9 @@ aaline_set_sampler_textures(struct pipe_context *pipe,
for (i = 0; i < num; i++) {
pipe_texture_reference(&aaline->state.texture[i], texture[i]);
}
+ for ( ; i < PIPE_MAX_SAMPLERS; i++) {
+ pipe_texture_reference(&aaline->state.texture[i], NULL);
+ }
aaline->num_textures = num;
/* pass-through */