unsigned default_size; /* Minimum size of the upload buffer, in bytes. */
unsigned bind; /* Bitmask of PIPE_BIND_* flags. */
enum pipe_resource_usage usage;
+ unsigned flags;
unsigned map_flags; /* Bitmask of PIPE_TRANSFER_* flags. */
boolean map_persistent; /* If persistent mappings are supported. */
struct u_upload_mgr *
u_upload_create(struct pipe_context *pipe, unsigned default_size,
- unsigned bind, enum pipe_resource_usage usage)
+ unsigned bind, enum pipe_resource_usage usage, unsigned flags)
{
struct u_upload_mgr *upload = CALLOC_STRUCT(u_upload_mgr);
if (!upload)
upload->default_size = default_size;
upload->bind = bind;
upload->usage = usage;
+ upload->flags = flags;
upload->map_persistent =
pipe->screen->get_param(pipe->screen,
PIPE_BIND_VERTEX_BUFFER |
PIPE_BIND_INDEX_BUFFER |
PIPE_BIND_CONSTANT_BUFFER,
- PIPE_USAGE_STREAM);
+ PIPE_USAGE_STREAM, 0);
}
struct u_upload_mgr *
u_upload_clone(struct pipe_context *pipe, struct u_upload_mgr *upload)
{
return u_upload_create(pipe, upload->default_size, upload->bind,
- upload->usage);
+ upload->usage, upload->flags);
}
static void
buffer.format = PIPE_FORMAT_R8_UNORM; /* want TYPELESS or similar */
buffer.bind = upload->bind;
buffer.usage = upload->usage;
+ buffer.flags = upload->flags;
buffer.width0 = size;
buffer.height0 = 1;
buffer.depth0 = 1;
buffer.array_size = 1;
if (upload->map_persistent) {
- buffer.flags = PIPE_RESOURCE_FLAG_MAP_PERSISTENT |
- PIPE_RESOURCE_FLAG_MAP_COHERENT;
+ buffer.flags |= PIPE_RESOURCE_FLAG_MAP_PERSISTENT |
+ PIPE_RESOURCE_FLAG_MAP_COHERENT;
}
upload->buffer = screen->resource_create(screen, &buffer);
*/
struct u_upload_mgr *
u_upload_create(struct pipe_context *pipe, unsigned default_size,
- unsigned bind, enum pipe_resource_usage usage);
+ unsigned bind, enum pipe_resource_usage usage, unsigned flags);
/**
* Create the default uploader for pipe_context. Only pipe_context::screen
fd3_query_context_init(pctx);
fd3_ctx->border_color_uploader = u_upload_create(pctx, 4096, 0,
- PIPE_USAGE_STREAM);
+ PIPE_USAGE_STREAM, 0);
return pctx;
}
fd4_query_context_init(pctx);
fd4_ctx->border_color_uploader = u_upload_create(pctx, 4096, 0,
- PIPE_USAGE_STREAM);
+ PIPE_USAGE_STREAM, 0);
return pctx;
}
fd5_query_context_init(pctx);
fd5_ctx->border_color_uploader = u_upload_create(pctx, 4096, 0,
- PIPE_USAGE_STREAM);
+ PIPE_USAGE_STREAM, 0);
return pctx;
}
r300->context.create_video_buffer = vl_video_buffer_create;
r300->uploader = u_upload_create(&r300->context, 1024 * 1024,
- PIPE_BIND_CUSTOM, PIPE_USAGE_STREAM);
+ PIPE_BIND_CUSTOM, PIPE_USAGE_STREAM, 0);
r300->context.stream_uploader = r300->uploader;
r300->context.const_uploader = r300->uploader;
return false;
rctx->b.stream_uploader = u_upload_create(&rctx->b, 1024 * 1024,
- 0, PIPE_USAGE_STREAM);
+ 0, PIPE_USAGE_STREAM, 0);
if (!rctx->b.stream_uploader)
return false;
rctx->b.const_uploader = u_upload_create(&rctx->b, 128 * 1024,
- 0, PIPE_USAGE_DEFAULT);
+ 0, PIPE_USAGE_DEFAULT, 0);
if (!rctx->b.const_uploader)
return false;
return false;
rctx->b.stream_uploader = u_upload_create(&rctx->b, 1024 * 1024,
- 0, PIPE_USAGE_STREAM);
+ 0, PIPE_USAGE_STREAM, 0);
if (!rctx->b.stream_uploader)
return false;
rctx->b.const_uploader = u_upload_create(&rctx->b, 128 * 1024,
- 0, PIPE_USAGE_DEFAULT);
+ 0, PIPE_USAGE_DEFAULT, 0);
if (!rctx->b.const_uploader)
return false;
svga->pipe.stream_uploader = u_upload_create(&svga->pipe, 1024 * 1024,
PIPE_BIND_VERTEX_BUFFER |
PIPE_BIND_INDEX_BUFFER,
- PIPE_USAGE_STREAM);
+ PIPE_USAGE_STREAM, 0);
if (!svga->pipe.stream_uploader)
goto cleanup;
svga->pipe.const_uploader = u_upload_create(&svga->pipe, 128 * 1024,
PIPE_BIND_CONSTANT_BUFFER,
- PIPE_USAGE_STREAM);
+ PIPE_USAGE_STREAM, 0);
if (!svga->pipe.const_uploader)
goto cleanup;
svga->const0_upload = u_upload_create(&svga->pipe,
CONST0_UPLOAD_DEFAULT_SIZE,
PIPE_BIND_CONSTANT_BUFFER,
- PIPE_USAGE_STREAM);
+ PIPE_USAGE_STREAM, 0);
if (!svga->const0_upload)
goto cleanup;
svga_texture_transfer_map_upload_create(struct svga_context *svga)
{
svga->tex_upload = u_upload_create(&svga->pipe, TEX_UPLOAD_DEFAULT_SIZE,
- 0, PIPE_USAGE_STAGING);
+ 0, PIPE_USAGE_STAGING, 0);
return svga->tex_upload != NULL;
}
vctx->primconvert = util_primconvert_create(&vctx->base, rs->caps.caps.v1.prim_mask);
vctx->uploader = u_upload_create(&vctx->base, 1024 * 1024,
- PIPE_BIND_INDEX_BUFFER, PIPE_USAGE_STREAM);
+ PIPE_BIND_INDEX_BUFFER, PIPE_USAGE_STREAM, 0);
if (!vctx->uploader)
goto fail;
vctx->base.stream_uploader = vctx->uploader;