summaryrefslogtreecommitdiff
path: root/src/sna/sna_render_inline.h
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2012-01-13 19:00:01 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2012-01-14 18:13:47 +0000
commita62429a1f79b8fa4a5ddaf61b2bc80fc8dbe576c (patch)
tree589d96fc4b8978b7da3edca53c01e630390877b4 /src/sna/sna_render_inline.h
parent24df8ab9742f771cfeb6d30bd8a61a17a9e22ca7 (diff)
sna: Upload continuation vertices into mmapped buffers
In the common case, we expect a very small number of vertices which will fit into the batch along with the commands. However, in full flow we overflow the on-stack buffer and likely several continuation buffers. Streaming those straight into the GTT seems like a good idea, with the usual caveats over aperture pressure. (Since these are linear we could use snoopable bo for the architectures that support such for vertex buffers and if we had kernel support.) Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src/sna/sna_render_inline.h')
-rw-r--r--src/sna/sna_render_inline.h10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/sna/sna_render_inline.h b/src/sna/sna_render_inline.h
index ee55db7d..27f4909b 100644
--- a/src/sna/sna_render_inline.h
+++ b/src/sna/sna_render_inline.h
@@ -19,17 +19,17 @@ static inline bool need_redirect(struct sna *sna, PixmapPtr dst)
static inline int vertex_space(struct sna *sna)
{
- return ARRAY_SIZE(sna->render.vertex_data) - sna->render.vertex_used;
+ return sna->render.vertex_size - sna->render.vertex_used;
}
static inline void vertex_emit(struct sna *sna, float v)
{
- assert(sna->render.vertex_used < ARRAY_SIZE(sna->render.vertex_data));
- sna->render.vertex_data[sna->render.vertex_used++] = v;
+ assert(sna->render.vertex_used < sna->render.vertex_size);
+ sna->render.vertices[sna->render.vertex_used++] = v;
}
static inline void vertex_emit_2s(struct sna *sna, int16_t x, int16_t y)
{
- int16_t *v = (int16_t *)&sna->render.vertex_data[sna->render.vertex_used++];
- assert(sna->render.vertex_used <= ARRAY_SIZE(sna->render.vertex_data));
+ int16_t *v = (int16_t *)&sna->render.vertices[sna->render.vertex_used++];
+ assert(sna->render.vertex_used <= sna->render.vertex_size);
v[0] = x;
v[1] = y;
}