summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/nv20
diff options
context:
space:
mode:
authorZack Rusin <[email protected]>2009-01-29 21:43:15 -0500
committerZack Rusin <[email protected]>2009-01-29 21:43:15 -0500
commitb3028acd98e2b7fd09344f9005c5b20bba91262c (patch)
tree78fcf2c5088b69e2fd4f31bea305a36581080e56 /src/gallium/drivers/nv20
parent444e98de31c5456008a4b3568373db02ddc5385f (diff)
gallium: give the screen priority when it comes to buffer allocations
allows the driver to overwrite buffer allocation, first step on the way to making winsys interface internal to the drivers. state trackers and the code above it will go through the screen
Diffstat (limited to 'src/gallium/drivers/nv20')
-rw-r--r--src/gallium/drivers/nv20/nv20_miptree.c2
-rw-r--r--src/gallium/drivers/nv20/nv20_prim_vbuf.c6
-rw-r--r--src/gallium/drivers/nv20/nv20_screen.c4
-rw-r--r--src/gallium/drivers/nv20/nv20_state.c4
-rw-r--r--src/gallium/drivers/nv20/nv20_vbo.c8
-rw-r--r--src/gallium/drivers/nv20/nv20_vertprog.c4
6 files changed, 14 insertions, 14 deletions
diff --git a/src/gallium/drivers/nv20/nv20_miptree.c b/src/gallium/drivers/nv20/nv20_miptree.c
index d2038c391d6..759f29c9515 100644
--- a/src/gallium/drivers/nv20/nv20_miptree.c
+++ b/src/gallium/drivers/nv20/nv20_miptree.c
@@ -65,7 +65,7 @@ nv20_miptree_create(struct pipe_screen *screen, const struct pipe_texture *pt)
nv20_miptree_layout(mt);
- mt->buffer = ws->buffer_create(ws, 256, PIPE_BUFFER_USAGE_PIXEL,
+ mt->buffer = ws->_buffer_create(ws, 256, PIPE_BUFFER_USAGE_PIXEL,
mt->total_size);
if (!mt->buffer) {
FREE(mt);
diff --git a/src/gallium/drivers/nv20/nv20_prim_vbuf.c b/src/gallium/drivers/nv20/nv20_prim_vbuf.c
index 74540845a87..c4841026b3d 100644
--- a/src/gallium/drivers/nv20/nv20_prim_vbuf.c
+++ b/src/gallium/drivers/nv20/nv20_prim_vbuf.c
@@ -113,9 +113,9 @@ static void *
nv20__allocate_pbuffer(struct nv20_vbuf_render *nv20_render, size_t size)
{
struct pipe_winsys *winsys = nv20_render->nv20->pipe.winsys;
- nv20_render->pbuffer = winsys->buffer_create(winsys, 64,
+ nv20_render->pbuffer = winsys->_buffer_create(winsys, 64,
PIPE_BUFFER_USAGE_VERTEX, size);
- return winsys->buffer_map(winsys,
+ return winsys->_buffer_map(winsys,
nv20_render->pbuffer,
PIPE_BUFFER_USAGE_CPU_WRITE);
}
@@ -334,7 +334,7 @@ nv20_vbuf_render_release_vertices( struct vbuf_render *render,
struct pipe_screen *pscreen = &nv20->screen->pipe;
if (nv20_render->pbuffer) {
- winsys->buffer_unmap(winsys, nv20_render->pbuffer);
+ winsys->_buffer_unmap(winsys, nv20_render->pbuffer);
pipe_buffer_reference(pscreen, &nv20_render->pbuffer, NULL);
} else if (nv20_render->mbuffer) {
FREE(nv20_render->mbuffer);
diff --git a/src/gallium/drivers/nv20/nv20_screen.c b/src/gallium/drivers/nv20/nv20_screen.c
index 2ca6e6b1498..e9adf05a7d2 100644
--- a/src/gallium/drivers/nv20/nv20_screen.c
+++ b/src/gallium/drivers/nv20/nv20_screen.c
@@ -122,7 +122,7 @@ nv20_surface_map(struct pipe_screen *screen, struct pipe_surface *surface,
struct pipe_winsys *ws = screen->winsys;
void *map;
- map = ws->buffer_map(ws, surface->buffer, flags);
+ map = ws->_buffer_map(ws, surface->buffer, flags);
if (!map)
return NULL;
@@ -134,7 +134,7 @@ nv20_surface_unmap(struct pipe_screen *screen, struct pipe_surface *surface)
{
struct pipe_winsys *ws = screen->winsys;
- ws->buffer_unmap(ws, surface->buffer);
+ ws->_buffer_unmap(ws, surface->buffer);
}
static void
diff --git a/src/gallium/drivers/nv20/nv20_state.c b/src/gallium/drivers/nv20/nv20_state.c
index ecec4f49a0c..65060006dac 100644
--- a/src/gallium/drivers/nv20/nv20_state.c
+++ b/src/gallium/drivers/nv20/nv20_state.c
@@ -461,12 +461,12 @@ nv20_set_constant_buffer(struct pipe_context *pipe, uint shader, uint index,
if (buf) {
void *mapped;
if (buf->buffer && buf->buffer->size &&
- (mapped = ws->buffer_map(ws, buf->buffer, PIPE_BUFFER_USAGE_CPU_READ)))
+ (mapped = ws->_buffer_map(ws, buf->buffer, PIPE_BUFFER_USAGE_CPU_READ)))
{
memcpy(nv20->constbuf[shader], mapped, buf->buffer->size);
nv20->constbuf_nr[shader] =
buf->buffer->size / (4 * sizeof(float));
- ws->buffer_unmap(ws, buf->buffer);
+ ws->_buffer_unmap(ws, buf->buffer);
}
}
}
diff --git a/src/gallium/drivers/nv20/nv20_vbo.c b/src/gallium/drivers/nv20/nv20_vbo.c
index 4edc4efebd8..d6b731790cc 100644
--- a/src/gallium/drivers/nv20/nv20_vbo.c
+++ b/src/gallium/drivers/nv20/nv20_vbo.c
@@ -25,7 +25,7 @@ boolean nv20_draw_elements( struct pipe_context *pipe,
for (i = 0; i < PIPE_MAX_ATTRIBS; i++) {
if (nv20->vtxbuf[i].buffer) {
void *buf
- = pipe->winsys->buffer_map(pipe->winsys,
+ = pipe->winsys->_buffer_map(pipe->winsys,
nv20->vtxbuf[i].buffer,
PIPE_BUFFER_USAGE_CPU_READ);
draw_set_mapped_vertex_buffer(draw, i, buf);
@@ -34,7 +34,7 @@ boolean nv20_draw_elements( struct pipe_context *pipe,
/* Map index buffer, if present */
if (indexBuffer) {
void *mapped_indexes
- = pipe->winsys->buffer_map(pipe->winsys, indexBuffer,
+ = pipe->winsys->_buffer_map(pipe->winsys, indexBuffer,
PIPE_BUFFER_USAGE_CPU_READ);
draw_set_mapped_element_buffer(draw, indexSize, mapped_indexes);
}
@@ -55,12 +55,12 @@ boolean nv20_draw_elements( struct pipe_context *pipe,
*/
for (i = 0; i < PIPE_MAX_ATTRIBS; i++) {
if (nv20->vtxbuf[i].buffer) {
- pipe->winsys->buffer_unmap(pipe->winsys, nv20->vtxbuf[i].buffer);
+ pipe->winsys->_buffer_unmap(pipe->winsys, nv20->vtxbuf[i].buffer);
draw_set_mapped_vertex_buffer(draw, i, NULL);
}
}
if (indexBuffer) {
- pipe->winsys->buffer_unmap(pipe->winsys, indexBuffer);
+ pipe->winsys->_buffer_unmap(pipe->winsys, indexBuffer);
draw_set_mapped_element_buffer(draw, 0, NULL);
}
diff --git a/src/gallium/drivers/nv20/nv20_vertprog.c b/src/gallium/drivers/nv20/nv20_vertprog.c
index a885fcd7a56..c4f3d0f14fb 100644
--- a/src/gallium/drivers/nv20/nv20_vertprog.c
+++ b/src/gallium/drivers/nv20/nv20_vertprog.c
@@ -749,7 +749,7 @@ nv20_vertprog_validate(struct nv20_context *nv20)
float *map = NULL;
if (constbuf) {
- map = ws->buffer_map(ws, constbuf,
+ map = ws->_buffer_map(ws, constbuf,
PIPE_BUFFER_USAGE_CPU_READ);
}
@@ -771,7 +771,7 @@ nv20_vertprog_validate(struct nv20_context *nv20)
}
if (constbuf) {
- ws->buffer_unmap(ws, constbuf);
+ ws->_buffer_unmap(ws, constbuf);
}
}