summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/i965_render.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/src/i965_render.c b/src/i965_render.c
index de1c8b32..ab7f7d22 100644
--- a/src/i965_render.c
+++ b/src/i965_render.c
@@ -1715,7 +1715,7 @@ gen4_render_state_cleanup(ScrnInfoPtr pScrn)
{
I830Ptr pI830 = I830PTR(pScrn);
struct gen4_render_state *render_state= pI830->gen4_render_state;
- int i;
+ int i, j, k, l, m;
if (render_state->vertex_buffer_bo) {
dri_bo_unreference (render_state->vertex_buffer_bo);
@@ -1728,12 +1728,23 @@ gen4_render_state_cleanup(ScrnInfoPtr pScrn)
render_state->sf_state_bo = NULL;
drm_intel_bo_unreference(render_state->sf_mask_state_bo);
render_state->sf_mask_state_bo = NULL;
- drm_intel_bo_unreference(render_state->cc_state_bo);
- render_state->cc_state_bo = NULL;
+
for (i = 0; i < WM_KERNEL_COUNT; i++) {
drm_intel_bo_unreference(render_state->wm_kernel_bo[i]);
render_state->wm_kernel_bo[i] = NULL;
}
+
+ for (i = 0; i < SAMPLER_STATE_FILTER_COUNT; i++)
+ for (j = 0; j < SAMPLER_STATE_EXTEND_COUNT; j++)
+ for (k = 0; k < SAMPLER_STATE_FILTER_COUNT; k++)
+ for (l = 0; l < SAMPLER_STATE_EXTEND_COUNT; l++)
+ for (m = 0; m < WM_KERNEL_COUNT; m++) {
+ drm_intel_bo_unreference(render_state->wm_state_bo[m][i][j][k][l]);
+ render_state->wm_state_bo[m][i][j][k][l] = NULL;
+ }
+
+ drm_intel_bo_unreference(render_state->cc_state_bo);
+ render_state->cc_state_bo = NULL;
drm_intel_bo_unreference(render_state->sip_kernel_bo);
render_state->sip_kernel_bo = NULL;
}