summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakob Bornecrantz <jakob@tungstengraphics.com>2008-05-23 16:11:38 +0200
committerJakob Bornecrantz <jakob@tungstengraphics.com>2008-05-23 16:30:00 +0200
commit5bf6ffb0b2be34ffb000e9700861b177afa9df97 (patch)
treee3cea58fa95366dd8a9e72f593fa1b9c9bcb95c5
parent845db16dbe66c0f741063333a70af79bca5b6544 (diff)
i915: Improved vertex buffer performance
-rw-r--r--src/gallium/winsys/dri/intel/intel_winsys_pipe.c22
1 files changed, 19 insertions, 3 deletions
diff --git a/src/gallium/winsys/dri/intel/intel_winsys_pipe.c b/src/gallium/winsys/dri/intel/intel_winsys_pipe.c
index 7b1c0acfc9..62b43cc395 100644
--- a/src/gallium/winsys/dri/intel/intel_winsys_pipe.c
+++ b/src/gallium/winsys/dri/intel/intel_winsys_pipe.c
@@ -51,7 +51,8 @@ struct intel_pipe_winsys {
struct pipe_winsys winsys;
struct _DriBufferPool *regionPool;
struct _DriBufferPool *mallocPool;
- struct _DriFreeSlabManager *fMan;
+ struct _DriBufferPool *vertexPool;
+ struct _DriFreeSlabManager *fMan; /** shared between all pipes */
};
@@ -119,8 +120,12 @@ intel_buffer_create(struct pipe_winsys *winsys,
buffer->base.size = size;
if (usage & (PIPE_BUFFER_USAGE_VERTEX | PIPE_BUFFER_USAGE_CONSTANT)) {
- flags |= DRM_BO_FLAG_MEM_LOCAL | DRM_BO_FLAG_CACHED;
+ flags |= DRM_BO_FLAG_MEM_LOCAL;
pool = iws->mallocPool;
+ } else if (usage & PIPE_BUFFER_USAGE_CUSTOM) {
+ /* For vertex buffers */
+ flags |= DRM_BO_FLAG_MEM_VRAM | DRM_BO_FLAG_MEM_TT;
+ pool = iws->vertexPool;
} else {
flags |= DRM_BO_FLAG_MEM_VRAM | DRM_BO_FLAG_MEM_TT;
pool = iws->regionPool;
@@ -313,8 +318,19 @@ intel_create_pipe_winsys( int fd, struct _DriFreeSlabManager *fMan )
iws->winsys.fence_signalled = intel_fence_signalled;
iws->winsys.fence_finish = intel_fence_finish;
- if (fd)
+ if (fd) {
iws->regionPool = driDRMPoolInit(fd);
+ iws->vertexPool = driSlabPoolInit(fd,
+ DRM_BO_FLAG_READ |
+ DRM_BO_FLAG_WRITE |
+ DRM_BO_FLAG_MEM_TT,
+ DRM_BO_FLAG_READ |
+ DRM_BO_FLAG_WRITE |
+ DRM_BO_FLAG_MEM_TT,
+ 32 * 4096,
+ 1, 40, 32 * 4096 * 2, 0,
+ fMan);
+ }
iws->mallocPool = driMallocPoolInit();