r600_init_resource_fields(rscreen, rbuffer, templ->width0, alignment);
+ if (templ->bind & PIPE_BIND_SHARED)
+ rbuffer->flags |= RADEON_FLAG_HANDLE;
+
if (!r600_alloc_resource(rscreen, rbuffer)) {
FREE(rbuffer);
return NULL;
{
memset(buffer, 0, sizeof(*buffer));
buffer->usage = usage;
+
+ /* Hardware buffer placement restrictions require the kernel to be
+ * able to move buffers around individually, so request a
+ * non-sub-allocated buffer.
+ */
buffer->res = (struct r600_resource *)
- pipe_buffer_create(screen, PIPE_BIND_CUSTOM, usage, size);
+ pipe_buffer_create(screen, PIPE_BIND_CUSTOM | PIPE_BIND_SHARED,
+ usage, size);
return buffer->res != NULL;
}