diff options
Diffstat (limited to 'src/gallium/drivers/r300/r300_texture.c')
-rw-r--r-- | src/gallium/drivers/r300/r300_texture.c | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/src/gallium/drivers/r300/r300_texture.c b/src/gallium/drivers/r300/r300_texture.c index fc84004fb97..d2b3f3c2e6b 100644 --- a/src/gallium/drivers/r300/r300_texture.c +++ b/src/gallium/drivers/r300/r300_texture.c @@ -878,7 +878,6 @@ r300_texture_create_object(struct r300_screen *rscreen, enum radeon_bo_layout microtile, enum radeon_bo_layout macrotile, unsigned stride_in_bytes_override, - unsigned max_buffer_size, struct pb_buffer *buffer) { struct radeon_winsys *rws = rscreen->rws; @@ -901,7 +900,7 @@ r300_texture_create_object(struct r300_screen *rscreen, tex->domain = base->flags & R300_RESOURCE_FLAG_TRANSFER ? RADEON_DOMAIN_GTT : RADEON_DOMAIN_VRAM | RADEON_DOMAIN_GTT; - tex->buf_size = max_buffer_size; + tex->buf = buffer; if (!r300_resource_set_properties(&rscreen->screen, &tex->b.b.b, 0, base)) { if (buffer) @@ -911,8 +910,7 @@ r300_texture_create_object(struct r300_screen *rscreen, } /* Create the backing buffer if needed. */ - if (!buffer) { - tex->buf_size = tex->tex.size_in_bytes; + if (!tex->buf) { tex->buf = rws->buffer_create(rws, tex->tex.size_in_bytes, 2048, base->bind, tex->domain); @@ -920,8 +918,6 @@ r300_texture_create_object(struct r300_screen *rscreen, FREE(tex); return NULL; } - } else { - tex->buf = buffer; } tex->cs_buf = rws->buffer_get_cs_handle(tex->buf); @@ -952,7 +948,7 @@ struct pipe_resource *r300_texture_create(struct pipe_screen *screen, return (struct pipe_resource*) r300_texture_create_object(rscreen, base, microtile, macrotile, - 0, 0, NULL); + 0, NULL); } struct pipe_resource *r300_texture_from_handle(struct pipe_screen *screen, @@ -963,7 +959,7 @@ struct pipe_resource *r300_texture_from_handle(struct pipe_screen *screen, struct r300_screen *rscreen = r300_screen(screen); struct pb_buffer *buffer; enum radeon_bo_layout microtile, macrotile; - unsigned stride, size; + unsigned stride; /* Support only 2D textures without mipmaps */ if ((base->target != PIPE_TEXTURE_2D && @@ -973,7 +969,7 @@ struct pipe_resource *r300_texture_from_handle(struct pipe_screen *screen, return NULL; } - buffer = rws->buffer_from_handle(rws, whandle, &stride, &size); + buffer = rws->buffer_from_handle(rws, whandle, &stride, NULL); if (!buffer) return NULL; @@ -995,7 +991,7 @@ struct pipe_resource *r300_texture_from_handle(struct pipe_screen *screen, return (struct pipe_resource*) r300_texture_create_object(rscreen, base, microtile, macrotile, - stride, size, buffer); + stride, buffer); } /* Not required to implement u_resource_vtbl, consider moving to another file: |