[Mesa-dev] [PATCH 6/7] i965: Dirty state in BO reallocation based on usage history

Chris Forbes chrisf at ijw.co.nz
Wed Oct 1 02:02:37 PDT 2014


Signed-off-by: Chris Forbes <chrisf at ijw.co.nz>
---
 src/mesa/drivers/dri/i965/intel_buffer_objects.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/mesa/drivers/dri/i965/intel_buffer_objects.c b/src/mesa/drivers/dri/i965/intel_buffer_objects.c
index 0e19e46..3532de6 100644
--- a/src/mesa/drivers/dri/i965/intel_buffer_objects.c
+++ b/src/mesa/drivers/dri/i965/intel_buffer_objects.c
@@ -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);
 }
-- 
2.1.1



More information about the mesa-dev mailing list