i965: Don't bother telling tnl about state updates unless we fall back.
authorEric Anholt <eric@anholt.net>
Tue, 21 Jun 2011 23:52:51 +0000 (16:52 -0700)
committerEric Anholt <eric@anholt.net>
Fri, 24 Jun 2011 17:37:15 +0000 (10:37 -0700)
This was sucking up 1% of the CPU on 3DMMES.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
src/mesa/drivers/dri/i915/i830_vtbl.c
src/mesa/drivers/dri/i915/i915_vtbl.c
src/mesa/drivers/dri/i965/brw_draw.c
src/mesa/drivers/dri/intel/intel_context.c

index 08ea2870aa07739fdd0f39800778d3d0f811b323..16c7acab3e788566a32f02addcac8c0b7d0e96cc 100644 (file)
@@ -31,6 +31,7 @@
 #include "intel_regions.h"
 #include "intel_tris.h"
 #include "intel_fbo.h"
+#include "tnl/tnl.h"
 #include "tnl/t_context.h"
 #include "tnl/t_vertex.h"
 
@@ -715,6 +716,11 @@ i830_assert_not_dirty( struct intel_context *intel )
 static void
 i830_invalidate_state(struct intel_context *intel, GLuint new_state)
 {
+   struct gl_context *ctx = &intel->ctx;
+
+   _tnl_InvalidateState(ctx, new_state);
+   _tnl_invalidate_vertex_state(ctx, new_state);
+
    if (new_state & _NEW_LIGHT)
       i830_update_provoking_vertex(&intel->ctx);
 }
index baff49bb2f5a846f5ae5759633e6551b661bdff4..6383cda606983a9a5d23f0cb8e99fdac913b8b16 100644 (file)
@@ -33,6 +33,7 @@
 #include "main/macros.h"
 #include "main/colormac.h"
 
+#include "tnl/tnl.h"
 #include "tnl/t_context.h"
 #include "tnl/t_vertex.h"
 
@@ -703,6 +704,15 @@ i915_is_hiz_depth_format(struct intel_context *intel,
    return false;
 }
 
+static void
+i915_invalidate_state(struct intel_context *intel, GLuint new_state)
+{
+   struct gl_context *ctx = &intel->ctx;
+
+   _tnl_InvalidateState(ctx, new_state);
+   _tnl_invalidate_vertex_state(ctx, new_state);
+}
+
 void
 i915InitVtbl(struct i915_context *i915)
 {
@@ -717,6 +727,7 @@ i915InitVtbl(struct i915_context *i915)
    i915->intel.vtbl.update_texture_state = i915UpdateTextureState;
    i915->intel.vtbl.assert_not_dirty = i915_assert_not_dirty;
    i915->intel.vtbl.finish_batch = intel_finish_vb;
+   i915->intel.vtbl.invalidate_state = i915_invalidate_state;
    i915->intel.vtbl.render_target_supported = i915_render_target_supported;
    i915->intel.vtbl.is_hiz_depth_format = i915_is_hiz_depth_format;
 }
index 350fc51a8a1962cd7b451dc9b7d1694182debc89..bdb5b672899d556141c02d8118335735b9c43b5e 100644 (file)
@@ -436,6 +436,7 @@ void brw_draw_prims( struct gl_context *ctx,
     */
    if (!retval) {
        _swsetup_Wakeup(ctx);
+       _tnl_wakeup(ctx);
       _tnl_draw_prims(ctx, arrays, prim, nr_prims, ib, min_index, max_index);
    }
 
index 30d5c5b43c1607bd4c65c62d8a42cc6811ecb742..8b954446649172ba0b335b81a26936c188e62147 100644 (file)
@@ -506,8 +506,6 @@ intelInvalidateState(struct gl_context * ctx, GLuint new_state)
    _swrast_InvalidateState(ctx, new_state);
    _swsetup_InvalidateState(ctx, new_state);
    _vbo_InvalidateState(ctx, new_state);
-   _tnl_InvalidateState(ctx, new_state);
-   _tnl_invalidate_vertex_state(ctx, new_state);
 
    intel->NewGLState |= new_state;