summaryrefslogtreecommitdiff
path: root/src/sna/gen7_render.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/sna/gen7_render.c')
-rw-r--r--src/sna/gen7_render.c21
1 files changed, 13 insertions, 8 deletions
diff --git a/src/sna/gen7_render.c b/src/sna/gen7_render.c
index faeedf06..c872c633 100644
--- a/src/sna/gen7_render.c
+++ b/src/sna/gen7_render.c
@@ -1033,6 +1033,9 @@ static int gen7_vertex_finish(struct sna *sna)
bo = sna->render.vbo;
if (bo) {
+ if (sna->render_state.gen7.vertex_offset)
+ gen7_vertex_flush(sna);
+
for (i = 0; i < ARRAY_SIZE(sna->render.vertex_reloc); i++) {
if (sna->render.vertex_reloc[i]) {
DBG(("%s: reloc[%d] = %d\n", __FUNCTION__,
@@ -1669,24 +1672,26 @@ inline static int gen7_get_rectangles(struct sna *sna,
DBG(("flushing vbo for %s: %d < %d\n",
__FUNCTION__, rem, op->floats_per_rect));
rem = gen7_get_rectangles__flush(sna, op);
- if (rem == 0) {
- if (sna->render_state.gen7.vertex_offset) {
- gen7_vertex_flush(sna);
- gen7_magic_ca_pass(sna, op);
- }
- return 0;
- }
+ if (rem == 0)
+ goto flush;
}
if (sna->render_state.gen7.vertex_offset == 0 &&
!gen7_rectangle_begin(sna, op))
- return 0;
+ goto flush;
if (want > 1 && want * op->floats_per_rect > rem)
want = rem / op->floats_per_rect;
sna->render.vertex_index += 3*want;
return want;
+
+flush:
+ if (sna->render_state.gen7.vertex_offset) {
+ gen7_vertex_flush(sna);
+ gen7_magic_ca_pass(sna, op);
+ }
+ return 0;
}
inline static uint32_t *gen7_composite_get_binding_table(struct sna *sna,