summaryrefslogtreecommitdiff
path: root/src/radeon_vbo.h
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2010-08-01 16:51:48 +1000
committerDave Airlie <airlied@redhat.com>2010-08-01 16:57:40 +1000
commitc79ce215a01b45fc63b483da167ae37ec7aefad6 (patch)
tree23016107c9d591494d86739565433a146812a9c3 /src/radeon_vbo.h
parent82254b59268140c4102ae3cd713743ae2be15c00 (diff)
radeon/r600: restructure exa + vbo to provide more sharing
This is a precursor for r300/500 vbo support. Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'src/radeon_vbo.h')
-rw-r--r--src/radeon_vbo.h13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/radeon_vbo.h b/src/radeon_vbo.h
index a8c70b30..b505f66b 100644
--- a/src/radeon_vbo.h
+++ b/src/radeon_vbo.h
@@ -2,7 +2,7 @@
#ifndef RADEON_VBO_H
#define RADEON_VBO_H
-extern void r600_vb_no_space(ScrnInfoPtr pScrn, int vert_size);
+extern void radeon_vb_no_space(ScrnInfoPtr pScrn, int vert_size);
extern void radeon_vbo_init_lists(ScrnInfoPtr pScrn);
extern void radeon_vbo_free_lists(ScrnInfoPtr pScrn);
extern void radeon_vbo_flush_bos(ScrnInfoPtr pScrn);
@@ -14,8 +14,8 @@ static inline void radeon_vbo_check(ScrnInfoPtr pScrn, int vert_size)
RADEONInfoPtr info = RADEONPTR(pScrn);
struct radeon_accel_state *accel_state = info->accel_state;
- if ((accel_state->vb_offset + (3 * vert_size)) > accel_state->vb_total) {
- r600_vb_no_space(pScrn, vert_size);
+ if ((accel_state->vb_offset + (accel_state->verts_per_op * vert_size)) > accel_state->vb_total) {
+ radeon_vb_no_space(pScrn, vert_size);
}
}
@@ -28,9 +28,8 @@ radeon_vbo_space(ScrnInfoPtr pScrn, int vert_size)
/* we've ran out of space in the vertex buffer - need to get a
new one */
- if ((accel_state->vb_offset + (3 * vert_size)) > accel_state->vb_total) {
- r600_vb_no_space(pScrn, vert_size);
- }
+ radeon_vbo_check(pScrn, vert_size);
+
accel_state->vb_op_vert_size = vert_size;
#if defined(XF86DRM_MODE)
if (info->cs) {
@@ -56,7 +55,7 @@ static inline void radeon_vbo_commit(ScrnInfoPtr pScrn)
RADEONInfoPtr info = RADEONPTR(pScrn);
struct radeon_accel_state *accel_state = info->accel_state;
- accel_state->vb_offset += 3 * accel_state->vb_op_vert_size;
+ accel_state->vb_offset += accel_state->verts_per_op * accel_state->vb_op_vert_size;
}
#endif