summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/i965simple/brw_tex_layout.c
diff options
context:
space:
mode:
authorZack Rusin <zackr@vmware.com>2009-01-29 21:43:15 -0500
committerZack Rusin <zackr@vmware.com>2009-01-29 21:43:15 -0500
commitb3028acd98e2b7fd09344f9005c5b20bba91262c (patch)
tree78fcf2c5088b69e2fd4f31bea305a36581080e56 /src/gallium/drivers/i965simple/brw_tex_layout.c
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/i965simple/brw_tex_layout.c')
-rw-r--r--src/gallium/drivers/i965simple/brw_tex_layout.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/src/gallium/drivers/i965simple/brw_tex_layout.c b/src/gallium/drivers/i965simple/brw_tex_layout.c
index 12e2e02cfd..c99eb8e75a 100644
--- a/src/gallium/drivers/i965simple/brw_tex_layout.c
+++ b/src/gallium/drivers/i965simple/brw_tex_layout.c
@@ -295,10 +295,10 @@ brw_texture_create_screen(struct pipe_screen *screen,
tex->base.nblocksy[0] = pf_get_nblocksy(&tex->base.block, tex->base.height[0]);
if (brw_miptree_layout(tex))
- tex->buffer = ws->buffer_create(ws, 64,
- PIPE_BUFFER_USAGE_PIXEL,
- tex->stride *
- tex->total_nblocksy);
+ tex->buffer = ws->_buffer_create(ws, 64,
+ PIPE_BUFFER_USAGE_PIXEL,
+ tex->stride *
+ tex->total_nblocksy);
if (!tex->buffer) {
FREE(tex);
@@ -322,7 +322,6 @@ brw_texture_release_screen(struct pipe_screen *screen,
__FUNCTION__, (void *) *pt, (*pt)->refcount - 1);
*/
if (--(*pt)->refcount <= 0) {
- struct pipe_winsys *ws = screen->winsys;
struct brw_texture *tex = (struct brw_texture *)*pt;
uint i;
@@ -330,7 +329,7 @@ brw_texture_release_screen(struct pipe_screen *screen,
DBG("%s deleting %p\n", __FUNCTION__, (void *) tex);
*/
- winsys_buffer_reference(ws, &tex->buffer, NULL);
+ pipe_buffer_reference(screen, &tex->buffer, NULL);
for (i = 0; i < PIPE_MAX_TEXTURE_LEVELS; i++)
if (tex->image_offset[i])
@@ -347,7 +346,6 @@ brw_get_tex_surface_screen(struct pipe_screen *screen,
struct pipe_texture *pt,
unsigned face, unsigned level, unsigned zslice)
{
- struct pipe_winsys *ws = screen->winsys;
struct brw_texture *tex = (struct brw_texture *)pt;
struct pipe_surface *ps;
unsigned offset; /* in bytes */
@@ -369,7 +367,7 @@ brw_get_tex_surface_screen(struct pipe_screen *screen,
if (ps) {
ps->refcount = 1;
pipe_texture_reference(&ps->texture, pt);
- winsys_buffer_reference(ws, &ps->buffer, tex->buffer);
+ pipe_buffer_reference(screen, &ps->buffer, tex->buffer);
ps->format = pt->format;
ps->width = pt->width[level];
ps->height = pt->height[level];