static struct pipe_resource *r600_resource_create(struct pipe_screen *screen, const struct pipe_resource *templ) { if (templ->target == PIPE_BUFFER) { return r600_buffer_create(screen, templ); } else { return r600_texture_create(screen, templ); } }
struct pipe_resource *r600_resource_create_common(struct pipe_screen *screen, const struct pipe_resource *templ) { struct r600_common_screen *rscreen = (struct r600_common_screen*)screen; if (templ->target == PIPE_BUFFER) { return r600_buffer_create(screen, templ, rscreen->info.gart_page_size); } else { return r600_texture_create(screen, templ); } }
static struct pipe_resource *r600_resource_create(struct pipe_screen *screen, const struct pipe_resource *templ) { if (templ->target == PIPE_BUFFER) { if (templ->bind & PIPE_BIND_GLOBAL) { return r600_compute_global_buffer_create(screen, templ); } else { return r600_buffer_create(screen, templ, 4096); } } else { return r600_texture_create(screen, templ); } }
struct pipe_resource *r600_aligned_buffer_create(struct pipe_screen *screen, unsigned bind, unsigned usage, unsigned size, unsigned alignment) { struct pipe_resource buffer; memset(&buffer, 0, sizeof buffer); buffer.target = PIPE_BUFFER; buffer.format = PIPE_FORMAT_R8_UNORM; buffer.bind = bind; buffer.usage = usage; buffer.flags = 0; buffer.width0 = size; buffer.height0 = 1; buffer.depth0 = 1; buffer.array_size = 1; return r600_buffer_create(screen, &buffer, alignment); }