i965: Dirty state in BO reallocation based on usage history
authorChris Forbes <chrisf@ijw.co.nz>
Wed, 1 Oct 2014 06:29:25 +0000 (19:29 +1300)
committerChris Forbes <chrisf@ijw.co.nz>
Thu, 16 Oct 2014 09:31:43 +0000 (22:31 +1300)
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
src/mesa/drivers/dri/i965/intel_buffer_objects.c

index 82e0744455062e3696ee8a1a1686a94e414b4e40..9298e247b348d2a90336ec72cb120d8a32f94c71 100644 (file)
@@ -110,7 +110,10 @@ intel_bufferobj_alloc_buffer(struct brw_context *brw,
 
    /* the buffer might be bound as a uniform buffer, need to update it
     */
-   brw->state.dirty.brw |= BRW_NEW_UNIFORM_BUFFER;
+   if (intel_obj->Base.UsageHistory & USAGE_UNIFORM_BUFFER)
+      brw->state.dirty.brw |= BRW_NEW_UNIFORM_BUFFER;
+   if (intel_obj->Base.UsageHistory & USAGE_TEXTURE_BUFFER)
+      brw->state.dirty.brw |= BRW_NEW_TEXTURE_BUFFER;
 
    intel_bufferobj_mark_inactive(intel_obj);
 }