if (buffers[i].attachment == __DRI_BUFFER_DEPTH)
depth_region = region;
- intel_renderbuffer_set_region(rb, region);
+ intel_renderbuffer_set_region(intel, rb, region);
intel_region_release(®ion);
if (buffers[i].attachment == __DRI_BUFFER_DEPTH_STENCIL) {
continue;
intel_region_reference(&stencil_region, region);
- intel_renderbuffer_set_region(rb, stencil_region);
+ intel_renderbuffer_set_region(intel, rb, stencil_region);
intel_region_release(&stencil_region);
}
}
#include "intel_fbo.h"
#include "intel_mipmap_tree.h"
#include "intel_regions.h"
-
+#ifndef I915
+#include "brw_state.h"
+#endif
#define FILE_DEBUG_FLAG DEBUG_FBO
void
-intel_renderbuffer_set_region(struct intel_renderbuffer *rb,
+intel_renderbuffer_set_region(struct intel_context *intel,
+ struct intel_renderbuffer *rb,
struct intel_region *region)
{
struct intel_region *old;
old = rb->region;
rb->region = NULL;
intel_region_reference(&rb->region, region);
+#ifndef I915
+ if (old) {
+ brw_state_cache_bo_delete(&brw_context(&intel->ctx)->surface_cache,
+ old->buffer);
+ }
+#endif
intel_region_release(&old);
}
extern void
-intel_renderbuffer_set_region(struct intel_renderbuffer *irb,
+intel_renderbuffer_set_region(struct intel_context *intel,
+ struct intel_renderbuffer *irb,
struct intel_region *region);
irb = intel_create_renderbuffer(MESA_FORMAT_ARGB8888);
irb->Base.Width = depth_irb->Base.Width;
irb->Base.Height = depth_irb->Base.Height;
- intel_renderbuffer_set_region(irb, depth_irb->region);
+ intel_renderbuffer_set_region(intel, irb, depth_irb->region);
/* Create a name for our renderbuffer, which lets us use other mesa
* rb functions for convenience.