diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2010-05-28 21:49:38 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2010-05-28 21:50:04 +0100 |
commit | 90c74a43149ec72bef64fb7e64b812294bda69a5 (patch) | |
tree | d6bcc70c4347fcba578e7722b494cb07cf286000 | |
parent | a94ae175d6a69243a4465de0be0a8a3368e0ab28 (diff) |
i915: Don't re-emit vertex size unless it has changed.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r-- | src/i830.h | 1 | ||||
-rw-r--r-- | src/i830_uxa.c | 1 | ||||
-rw-r--r-- | src/i915_render.c | 10 |
3 files changed, 7 insertions, 5 deletions
@@ -367,6 +367,7 @@ typedef struct intel_screen_private { int dstX, int dstY, int w, int h); int floats_per_vertex; + int last_floats_per_vertex; uint32_t vertex_count; uint32_t vertex_index; uint32_t vertex_used; diff --git a/src/i830_uxa.c b/src/i830_uxa.c index b063d0fa..208de07e 100644 --- a/src/i830_uxa.c +++ b/src/i830_uxa.c @@ -1088,6 +1088,7 @@ Bool i830_uxa_init(ScreenPtr screen) intel->prim_offset = 0; intel->vertex_count = 0; intel->floats_per_vertex = 0; + intel->last_floats_per_vertex = 0; intel->vertex_bo = NULL; /* Solid fill */ diff --git a/src/i915_render.c b/src/i915_render.c index 3d38397c..1c9127be 100644 --- a/src/i915_render.c +++ b/src/i915_render.c @@ -1166,10 +1166,8 @@ i915_composite(PixmapPtr dest, int srcX, int srcY, int maskX, int maskY, if (intel->needs_render_state_emit) i915_emit_composite_setup(scrn); - if (intel_vertex_space(intel) < 3*4*intel->floats_per_vertex) - intel->needs_render_vertex_emit = TRUE; - - if (intel->needs_render_vertex_emit) { + if (intel->needs_render_vertex_emit || + intel_vertex_space(intel) < 3*4*intel->floats_per_vertex) { i915_vertex_flush(intel); if (intel_vertex_space(intel) < 256) { @@ -1181,7 +1179,7 @@ i915_composite(PixmapPtr dest, int srcX, int srcY, int maskX, int maskY, OUT_BATCH((intel->floats_per_vertex << S1_VERTEX_WIDTH_SHIFT) | (intel->floats_per_vertex << S1_VERTEX_PITCH_SHIFT)); intel->vertex_index = 0; - } else { + } else if (intel->floats_per_vertex != intel->last_floats_per_vertex){ OUT_BATCH(_3DSTATE_LOAD_STATE_IMMEDIATE_1 | I1_LOAD_S(1) | 0); OUT_BATCH((intel->floats_per_vertex << S1_VERTEX_WIDTH_SHIFT) | @@ -1192,6 +1190,7 @@ i915_composite(PixmapPtr dest, int srcX, int srcY, int maskX, int maskY, intel->vertex_used = intel->vertex_index * intel->floats_per_vertex; } + intel->last_floats_per_vertex = intel->floats_per_vertex; intel->needs_render_vertex_emit = FALSE; } @@ -1248,4 +1247,5 @@ i915_batch_flush_notify(ScrnInfoPtr scrn) intel_screen_private *intel = intel_get_screen_private(scrn); intel->needs_render_state_emit = TRUE; + intel->last_floats_per_vertex = 0; } |