gallium/radeon: stop using PIPE_BIND_CUSTOM

it has no effect whatsoever

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
This commit is contained in:
Marek Olšák 2016-10-24 23:26:39 +02:00
parent e3c3a7fada
commit 29144d0f34
11 changed files with 18 additions and 24 deletions

View file

@ -87,9 +87,7 @@ struct r600_resource *r600_compute_buffer_alloc_vram(struct r600_screen *screen,
assert(size);
buffer = pipe_buffer_create((struct pipe_screen*) screen,
PIPE_BIND_CUSTOM,
PIPE_USAGE_IMMUTABLE,
size);
0, PIPE_USAGE_IMMUTABLE, size);
return (struct r600_resource *)buffer;
}
@ -335,7 +333,7 @@ static void evergreen_compute_upload_input(struct pipe_context *ctx,
if (!shader->kernel_param) {
/* Add space for the grid dimensions */
shader->kernel_param = (struct r600_resource *)
pipe_buffer_create(ctx->screen, PIPE_BIND_CUSTOM,
pipe_buffer_create(ctx->screen, 0,
PIPE_USAGE_IMMUTABLE, input_size);
}

View file

@ -137,7 +137,7 @@ static int store_shader(struct pipe_context *ctx,
if (shader->bo == NULL) {
shader->bo = (struct r600_resource*)
pipe_buffer_create(ctx->screen, PIPE_BIND_CUSTOM, PIPE_USAGE_IMMUTABLE, shader->shader.bc.ndw * 4);
pipe_buffer_create(ctx->screen, 0, PIPE_USAGE_IMMUTABLE, shader->shader.bc.ndw * 4);
if (shader->bo == NULL) {
return -ENOMEM;
}

View file

@ -1326,14 +1326,14 @@ static void update_gs_block_state(struct r600_context *rctx, unsigned enable)
if (enable && !rctx->gs_rings.esgs_ring.buffer) {
unsigned size = 0x1C000;
rctx->gs_rings.esgs_ring.buffer =
pipe_buffer_create(rctx->b.b.screen, PIPE_BIND_CUSTOM,
pipe_buffer_create(rctx->b.b.screen, 0,
PIPE_USAGE_DEFAULT, size);
rctx->gs_rings.esgs_ring.buffer_size = size;
size = 0x4000000;
rctx->gs_rings.gsvs_ring.buffer =
pipe_buffer_create(rctx->b.b.screen, PIPE_BIND_CUSTOM,
pipe_buffer_create(rctx->b.b.screen, 0,
PIPE_USAGE_DEFAULT, size);
rctx->gs_rings.gsvs_ring.buffer_size = size;
}

View file

@ -338,7 +338,7 @@ static struct r600_resource *r600_new_query_buffer(struct r600_common_context *c
* usage pattern.
*/
struct r600_resource *buf = (struct r600_resource*)
pipe_buffer_create(ctx->b.screen, PIPE_BIND_CUSTOM,
pipe_buffer_create(ctx->b.screen, 0,
PIPE_USAGE_STAGING, buf_size);
if (!buf)
return NULL;
@ -1580,7 +1580,7 @@ void r600_query_init_backend_mask(struct r600_common_context *ctx)
/* create buffer for event data */
buffer = (struct r600_resource*)
pipe_buffer_create(ctx->b.screen, PIPE_BIND_CUSTOM,
pipe_buffer_create(ctx->b.screen, 0,
PIPE_USAGE_STAGING, ctx->max_db*16);
if (!buffer)
goto err;

View file

@ -879,8 +879,7 @@ static void r600_texture_allocate_htile(struct r600_common_screen *rscreen,
return;
rtex->htile_buffer = (struct r600_resource*)
r600_aligned_buffer_create(&rscreen->b, PIPE_BIND_CUSTOM,
PIPE_USAGE_DEFAULT,
r600_aligned_buffer_create(&rscreen->b, 0, PIPE_USAGE_DEFAULT,
rtex->surface.htile_size,
rtex->surface.htile_alignment);
if (rtex->htile_buffer == NULL) {

View file

@ -72,7 +72,7 @@ bool rvid_create_buffer(struct pipe_screen *screen, struct rvid_buffer *buffer,
* non-sub-allocated buffer.
*/
buffer->res = (struct r600_resource *)
pipe_buffer_create(screen, PIPE_BIND_CUSTOM | PIPE_BIND_SHARED,
pipe_buffer_create(screen, PIPE_BIND_SHARED,
usage, size);
return buffer->res != NULL;

View file

@ -159,7 +159,7 @@ void si_begin_new_cs(struct si_context *ctx)
/* Create a buffer used for writing trace IDs and initialize it to 0. */
assert(!ctx->trace_buf);
ctx->trace_buf = (struct r600_resource*)
pipe_buffer_create(ctx->b.b.screen, PIPE_BIND_CUSTOM,
pipe_buffer_create(ctx->b.b.screen, 0,
PIPE_USAGE_STAGING, 4);
if (ctx->trace_buf)
pipe_buffer_write_nooverlap(&ctx->b.b, &ctx->trace_buf->b.b,

View file

@ -202,8 +202,7 @@ static struct pipe_context *si_create_context(struct pipe_screen *screen,
sctx->ce_suballocator =
u_suballocator_create(&sctx->b.b, 1024 * 1024,
PIPE_BIND_CUSTOM,
PIPE_USAGE_DEFAULT, false);
0, PIPE_USAGE_DEFAULT, false);
if (!sctx->ce_suballocator)
goto fail;
}
@ -217,7 +216,7 @@ static struct pipe_context *si_create_context(struct pipe_screen *screen,
goto fail;
sctx->border_color_buffer = (struct r600_resource*)
pipe_buffer_create(screen, PIPE_BIND_CUSTOM, PIPE_USAGE_DEFAULT,
pipe_buffer_create(screen, 0, PIPE_USAGE_DEFAULT,
SI_MAX_BORDER_COLORS *
sizeof(*sctx->border_color_table));
if (!sctx->border_color_buffer)

View file

@ -406,8 +406,7 @@ si_resource_create_custom(struct pipe_screen *screen,
unsigned usage, unsigned size)
{
assert(size);
return r600_resource(pipe_buffer_create(screen,
PIPE_BIND_CUSTOM, usage, size));
return r600_resource(pipe_buffer_create(screen, 0, usage, size));
}
static inline void

View file

@ -190,7 +190,7 @@ void si_pm4_upload_indirect_buffer(struct si_context *sctx,
r600_resource_reference(&state->indirect_buffer, NULL);
state->indirect_buffer = (struct r600_resource*)
pipe_buffer_create(screen, PIPE_BIND_CUSTOM,
pipe_buffer_create(screen, 0,
PIPE_USAGE_DEFAULT, aligned_ndw * 4);
if (!state->indirect_buffer)
return;

View file

@ -1730,7 +1730,7 @@ static bool si_update_gs_ring_buffers(struct si_context *sctx)
if (update_esgs) {
pipe_resource_reference(&sctx->esgs_ring, NULL);
sctx->esgs_ring = pipe_buffer_create(sctx->b.b.screen, PIPE_BIND_CUSTOM,
sctx->esgs_ring = pipe_buffer_create(sctx->b.b.screen, 0,
PIPE_USAGE_DEFAULT,
esgs_ring_size);
if (!sctx->esgs_ring)
@ -1739,7 +1739,7 @@ static bool si_update_gs_ring_buffers(struct si_context *sctx)
if (update_gsvs) {
pipe_resource_reference(&sctx->gsvs_ring, NULL);
sctx->gsvs_ring = pipe_buffer_create(sctx->b.b.screen, PIPE_BIND_CUSTOM,
sctx->gsvs_ring = pipe_buffer_create(sctx->b.b.screen, 0,
PIPE_USAGE_DEFAULT,
gsvs_ring_size);
if (!sctx->gsvs_ring)
@ -2008,7 +2008,7 @@ static void si_init_tess_factor_ring(struct si_context *sctx)
}
assert(!sctx->tf_ring);
sctx->tf_ring = pipe_buffer_create(sctx->b.b.screen, PIPE_BIND_CUSTOM,
sctx->tf_ring = pipe_buffer_create(sctx->b.b.screen, 0,
PIPE_USAGE_DEFAULT,
32768 * sctx->screen->b.info.max_se);
if (!sctx->tf_ring)
@ -2016,8 +2016,7 @@ static void si_init_tess_factor_ring(struct si_context *sctx)
assert(((sctx->tf_ring->width0 / 4) & C_030938_SIZE) == 0);
sctx->tess_offchip_ring = pipe_buffer_create(sctx->b.b.screen,
PIPE_BIND_CUSTOM,
sctx->tess_offchip_ring = pipe_buffer_create(sctx->b.b.screen, 0,
PIPE_USAGE_DEFAULT,
max_offchip_buffers *
sctx->screen->tess_offchip_block_dw_size * 4);