if (rfence) {
/* Create a fence, which is a dummy BO. */
- *rfence = r300->rws->buffer_create(r300->rws, 1, 1,
- PIPE_BIND_CUSTOM,
+ *rfence = r300->rws->buffer_create(r300->rws, 1, 1, TRUE,
RADEON_DOMAIN_GTT);
/* Add the fence as a dummy relocation. */
r300->rws->cs_add_reloc(r300->cs,
else
q->num_pipes = r300screen->info.r300_num_gb_pipes;
- q->buf = r300->rws->buffer_create(r300->rws, 4096, 4096,
- PIPE_BIND_CUSTOM, RADEON_DOMAIN_GTT);
+ q->buf = r300->rws->buffer_create(r300->rws, 4096, 4096, TRUE,
+ RADEON_DOMAIN_GTT);
if (!q->buf) {
FREE(q);
return NULL;
struct pb_buffer *new_buf;
/* Create a new one in the same pipe_resource. */
- new_buf = r300->rws->buffer_create(r300->rws,
- rbuf->b.b.width0, R300_BUFFER_ALIGNMENT,
- rbuf->b.b.bind, rbuf->domain);
+ new_buf = r300->rws->buffer_create(r300->rws, rbuf->b.b.width0,
+ R300_BUFFER_ALIGNMENT, TRUE,
+ rbuf->domain);
if (new_buf) {
/* Discard the old buffer. */
pb_reference(&rbuf->buf, NULL);
}
rbuf->buf =
- r300screen->rws->buffer_create(r300screen->rws,
- rbuf->b.b.width0, R300_BUFFER_ALIGNMENT,
- rbuf->b.b.bind, rbuf->domain);
+ r300screen->rws->buffer_create(r300screen->rws, rbuf->b.b.width0,
+ R300_BUFFER_ALIGNMENT, TRUE,
+ rbuf->domain);
if (!rbuf->buf) {
FREE(rbuf);
return NULL;
/* Create the backing buffer if needed. */
if (!tex->buf) {
- tex->buf = rws->buffer_create(rws, tex->tex.size_in_bytes, 2048,
- base->bind, tex->domain);
+ tex->buf = rws->buffer_create(rws, tex->tex.size_in_bytes, 2048, TRUE,
+ tex->domain);
if (!tex->buf) {
goto fail;
/* Create a new one in the same pipe_resource. */
/* XXX We probably want a different alignment for buffers and textures. */
r600_init_resource(rctx->screen, rbuffer, rbuffer->b.b.width0, 4096,
- rbuffer->b.b.bind, rbuffer->b.b.usage);
+ TRUE, rbuffer->b.b.usage);
/* We changed the buffer, now we need to bind it where the old one was bound. */
/* Vertex buffers. */
bool r600_init_resource(struct r600_screen *rscreen,
struct r600_resource *res,
unsigned size, unsigned alignment,
- unsigned bind, unsigned usage)
+ bool use_reusable_pool, unsigned usage)
{
uint32_t initial_domain, domains;
break;
}
- res->buf = rscreen->ws->buffer_create(rscreen->ws, size, alignment, bind, initial_domain);
+ res->buf = rscreen->ws->buffer_create(rscreen->ws, size, alignment,
+ use_reusable_pool,
+ initial_domain);
if (!res->buf) {
return false;
}
rbuffer->b.b.screen = screen;
rbuffer->b.vtbl = &r600_buffer_vtbl;
- if (!r600_init_resource(rscreen, rbuffer, templ->width0, alignment, templ->bind, templ->usage)) {
+ if (!r600_init_resource(rscreen, rbuffer, templ->width0, alignment, TRUE, templ->usage)) {
FREE(rbuffer);
return NULL;
}
bool r600_init_resource(struct r600_screen *rscreen,
struct r600_resource *res,
unsigned size, unsigned alignment,
- unsigned bind, unsigned usage);
+ bool use_reusable_pool, unsigned usage);
struct pipe_resource *r600_buffer_create(struct pipe_screen *screen,
const struct pipe_resource *templ,
unsigned alignment);
unsigned base_align = rtex->surface.bo_alignment;
unsigned usage = R600_TEX_IS_TILED(rtex, 0) ? PIPE_USAGE_STATIC : base->usage;
- if (!r600_init_resource(rscreen, resource, rtex->size, base_align, base->bind, usage)) {
+ if (!r600_init_resource(rscreen, resource, rtex->size, base_align, FALSE, usage)) {
FREE(rtex);
return NULL;
}
bool si_init_resource(struct r600_screen *rscreen,
struct si_resource *res,
unsigned size, unsigned alignment,
- unsigned bind, unsigned usage)
+ boolean use_reusable_pool, unsigned usage)
{
uint32_t initial_domain, domains;
}
}
- res->buf = rscreen->ws->buffer_create(rscreen->ws, size, alignment, bind, initial_domain);
+ res->buf = rscreen->ws->buffer_create(rscreen->ws, size, alignment,
+ use_reusable_pool,
+ initial_domain);
if (!res->buf) {
return false;
}
rbuffer->b.b.screen = screen;
rbuffer->b.vtbl = &r600_buffer_vtbl;
- if (!si_init_resource(rscreen, rbuffer, templ->width0, alignment, templ->bind, templ->usage)) {
+ if (!si_init_resource(rscreen, rbuffer, templ->width0, alignment, TRUE, templ->usage)) {
FREE(rbuffer);
return NULL;
}
unsigned size = rtex->surface.bo_size;
base_align = rtex->surface.bo_alignment;
- if (!si_init_resource(rscreen, resource, size, base_align, base->bind, base->usage)) {
+ if (!si_init_resource(rscreen, resource, size, base_align, FALSE, base->usage)) {
FREE(rtex);
return NULL;
}
bool si_init_resource(struct r600_screen *rscreen,
struct si_resource *res,
unsigned size, unsigned alignment,
- unsigned bind, unsigned usage);
+ boolean use_reusable_pool, unsigned usage);
struct pipe_resource *si_buffer_create(struct pipe_screen *screen,
const struct pipe_resource *templ);
void r600_upload_index_buffer(struct r600_context *rctx,
radeon_winsys_bo_create(struct radeon_winsys *rws,
unsigned size,
unsigned alignment,
- unsigned bind,
+ boolean use_reusable_pool,
enum radeon_bo_domain domain)
{
struct radeon_drm_winsys *ws = radeon_drm_winsys(rws);
desc.initial_domains = domain;
/* Assign a buffer manager. */
- if (bind & (PIPE_BIND_VERTEX_BUFFER | PIPE_BIND_INDEX_BUFFER |
- PIPE_BIND_CONSTANT_BUFFER | PIPE_BIND_CUSTOM))
+ if (use_reusable_pool)
provider = ws->cman;
else
provider = ws->kman;
* \param ws The winsys this function is called from.
* \param size The size to allocate.
* \param alignment An alignment of the buffer in memory.
- * \param bind A bitmask of the PIPE_BIND_* flags.
+ * \param use_reusable_pool Whether the cache buffer manager should be used.
* \param domain A bitmask of the RADEON_DOMAIN_* flags.
* \return The created buffer object.
*/
struct pb_buffer *(*buffer_create)(struct radeon_winsys *ws,
unsigned size,
unsigned alignment,
- unsigned bind,
+ boolean use_reusable_pool,
enum radeon_bo_domain domain);
struct radeon_winsys_cs_handle *(*buffer_get_cs_handle)(