summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/radeonsi/r600_buffer.c
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2013-09-22 13:06:27 +0200
committerMarek Olšák <[email protected]>2013-09-29 15:18:10 +0200
commite64633e8c3a5498998a45ab721bf80edca101cf5 (patch)
tree525282c2cfb50d874c3cdcd5ee55e1587951c90c /src/gallium/drivers/radeonsi/r600_buffer.c
parent4069d39465be2a54b52c5de77393603d9a6b3e5a (diff)
r600g,radeonsi: share r600_texture.c
The function r600_choose_tiling is new and needs a review. The only change in functionality is that it enables 2D tiling for compressed textures on SI. It was probably accidentally turned off. v2: don't make scanout buffers linear
Diffstat (limited to 'src/gallium/drivers/radeonsi/r600_buffer.c')
-rw-r--r--src/gallium/drivers/radeonsi/r600_buffer.c46
1 files changed, 1 insertions, 45 deletions
diff --git a/src/gallium/drivers/radeonsi/r600_buffer.c b/src/gallium/drivers/radeonsi/r600_buffer.c
index 12e5c4d366b..4c95130c352 100644
--- a/src/gallium/drivers/radeonsi/r600_buffer.c
+++ b/src/gallium/drivers/radeonsi/r600_buffer.c
@@ -96,50 +96,6 @@ static const struct u_resource_vtbl r600_buffer_vtbl =
NULL /* transfer_inline_write */
};
-bool si_init_resource(struct r600_screen *rscreen,
- struct r600_resource *res,
- unsigned size, unsigned alignment,
- boolean use_reusable_pool, unsigned usage)
-{
- uint32_t initial_domain, domains;
-
- /* Staging resources particpate in transfers and blits only
- * and are used for uploads and downloads from regular
- * resources. We generate them internally for some transfers.
- */
- if (usage == PIPE_USAGE_STAGING) {
- domains = RADEON_DOMAIN_GTT;
- initial_domain = RADEON_DOMAIN_GTT;
- } else {
- domains = RADEON_DOMAIN_GTT | RADEON_DOMAIN_VRAM;
-
- switch(usage) {
- case PIPE_USAGE_DYNAMIC:
- case PIPE_USAGE_STREAM:
- case PIPE_USAGE_STAGING:
- initial_domain = RADEON_DOMAIN_GTT;
- break;
- case PIPE_USAGE_DEFAULT:
- case PIPE_USAGE_STATIC:
- case PIPE_USAGE_IMMUTABLE:
- default:
- initial_domain = RADEON_DOMAIN_VRAM;
- break;
- }
- }
-
- res->buf = rscreen->b.ws->buffer_create(rscreen->b.ws, size, alignment,
- use_reusable_pool,
- initial_domain);
- if (!res->buf) {
- return false;
- }
-
- res->cs_buf = rscreen->b.ws->buffer_get_cs_handle(res->buf);
- res->domains = domains;
- return true;
-}
-
struct pipe_resource *si_buffer_create(struct pipe_screen *screen,
const struct pipe_resource *templ)
{
@@ -156,7 +112,7 @@ struct pipe_resource *si_buffer_create(struct pipe_screen *screen,
rbuffer->b.vtbl = &r600_buffer_vtbl;
util_range_init(&rbuffer->valid_buffer_range);
- if (!si_init_resource(rscreen, rbuffer, templ->width0, alignment, TRUE, templ->usage)) {
+ if (!r600_init_resource(&rscreen->b, rbuffer, templ->width0, alignment, TRUE, templ->usage)) {
FREE(rbuffer);
return NULL;
}