struct compute_memory_pool* pool,
int64_t size_in_dw)
{
- assert(size_in_dw <= pool->size_in_dw);
-
struct compute_memory_item *item;
int last_end = 0;
+ assert(size_in_dw <= pool->size_in_dw);
+
COMPUTE_DBG("* compute_memory_prealloc_chunk() size_in_dw = %ld\n",
size_in_dw);
int64_t allocated = 0;
int64_t unallocated = 0;
+ int64_t start_in_dw = 0;
+
COMPUTE_DBG("* compute_memory_finalize_pending()\n");
for (item = pool->item_list; item; item = item->next) {
for (item = pending_list; item; item = next) {
next = item->next;
- int64_t start_in_dw;
-
/* Search for free space in the pool for this item. */
while ((start_in_dw=compute_memory_prealloc_chunk(pool,
item->size_in_dw)) == -1) {
struct compute_memory_pool* pool,
int64_t size_in_dw)
{
- struct compute_memory_item *new_item;
+ struct compute_memory_item *new_item = NULL, *last_item = NULL;
COMPUTE_DBG("* compute_memory_alloc() size_in_dw = %ld (%ld bytes)\n",
size_in_dw, 4 * size_in_dw);
new_item->id = pool->next_id++;
new_item->pool = pool;
- struct compute_memory_item *last_item;
-
if (pool->item_list) {
for (last_item = pool->item_list; last_item->next;
last_item = last_item->next);
struct pipe_screen *screen,
const struct pipe_resource *templ)
{
+ struct r600_resource_global* result = NULL;
+ struct r600_screen* rscreen = NULL;
+ int size_in_dw = 0;
+
assert(templ->target == PIPE_BUFFER);
assert(templ->bind & PIPE_BIND_GLOBAL);
assert(templ->array_size == 1 || templ->array_size == 0);
assert(templ->depth0 == 1 || templ->depth0 == 0);
assert(templ->height0 == 1 || templ->height0 == 0);
- struct r600_resource_global* result = (struct r600_resource_global*)
- CALLOC(sizeof(struct r600_resource_global), 1);
- struct r600_screen* rscreen = (struct r600_screen*)screen;
+ result = (struct r600_resource_global*)
+ CALLOC(sizeof(struct r600_resource_global), 1);
+ rscreen = (struct r600_screen*)screen;
COMPUTE_DBG("*** r600_compute_global_buffer_create\n");
COMPUTE_DBG("width = %u array_size = %u\n", templ->width0,
result->base.b.b = *templ;
pipe_reference_init(&result->base.b.b.reference, 1);
- int size_in_dw = (templ->width0+3) / 4;
+ size_in_dw = (templ->width0+3) / 4;
result->chunk = compute_memory_alloc(rscreen->global_pool, size_in_dw);
struct pipe_screen *screen,
struct pipe_resource *res)
{
+ struct r600_resource_global* buffer = NULL;
+ struct r600_screen* rscreen = NULL;
+
assert(res->target == PIPE_BUFFER);
assert(res->bind & PIPE_BIND_GLOBAL);
- struct r600_resource_global* buffer = (struct r600_resource_global*)res;
- struct r600_screen* rscreen = (struct r600_screen*)screen;
+ buffer = (struct r600_resource_global*)res;
+ rscreen = (struct r600_screen*)screen;
compute_memory_free(rscreen->global_pool, buffer->chunk->id);
struct pipe_context *ctx_,
struct pipe_transfer* transfer)
{
+ struct r600_context *ctx = NULL;
+ struct r600_resource_global* buffer = NULL;
+
assert(transfer->resource->target == PIPE_BUFFER);
assert(transfer->resource->bind & PIPE_BIND_GLOBAL);
- struct r600_context *ctx = (struct r600_context *)ctx_;
- struct r600_resource_global* buffer =
- (struct r600_resource_global*)transfer->resource;
+ ctx = (struct r600_context *)ctx_;
+ buffer = (struct r600_resource_global*)transfer->resource;
COMPUTE_DBG("* r600_compute_global_transfer_unmap()\n");
{
int code_index = -1;
int code_size = -1;
+ int index = 0;
+ struct evergreen_compute_resource* res = NULL;
{
int i = 0;
assert(code_index != -1 && "internal error: resouce index not found");
assert(offset_index < code_size && "internal error: overindexing resource");
- int index = code_index + offset_index;
+ index = code_index + offset_index;
- struct evergreen_compute_resource* res = &pipe->resources[index];
+ res = &pipe->resources[index];
res->enabled = true;
res->bo = NULL;
unsigned index,
int num)
{
+ int cs_end = 0;
+
res->enabled = 1;
- int cs_end = res->cs_end;
+ cs_end = res->cs_end;
if (index >= EVERGREEN_CONFIG_REG_OFFSET
&& index < EVERGREEN_CONFIG_REG_END) {
struct r600_resource *bo,
enum radeon_bo_usage usage)
{
+ u32 rr = 0;
+
assert(bo);
ctx->cs->buf[ctx->cs->cdw++] = PKT3(PKT3_NOP, 0, 0);
- u32 rr = r600_context_bo_reloc(ctx, bo, usage);
+ rr = r600_context_bo_reloc(ctx, bo, usage);
ctx->cs->buf[ctx->cs->cdw++] = rr;
}
int start,
int size)
{
+ struct pipe_surface rat_templ;
+ struct r600_surface *surf = NULL;
+ struct r600_context *rctx = NULL;
+
assert(id < 12);
assert((size & 3) == 0);
assert((start & 0xFF) == 0);
- struct pipe_surface rat_templ;
- struct r600_surface *surf;
- struct r600_context *rctx = pipe->ctx;
+ rctx = pipe->ctx;
COMPUTE_DBG("bind rat: %i \n", id);
struct r600_screen *screen,
unsigned size)
{
+ struct pipe_resource * buffer = NULL;
assert(size);
- struct pipe_resource * buffer = pipe_buffer_create(
- (struct pipe_screen*) screen,
- PIPE_BIND_CUSTOM,
- PIPE_USAGE_IMMUTABLE,
- size);
+ buffer = pipe_buffer_create(
+ (struct pipe_screen*) screen,
+ PIPE_BIND_CUSTOM,
+ PIPE_USAGE_IMMUTABLE,
+ size);
return (struct r600_resource *)buffer;
}
static int r600_export_from_byte_stream(struct r600_shader_ctx *ctx,
unsigned char * bytes, unsigned bytes_read)
{
+ uint32_t word0 = 0, word1 = 0;
struct r600_bytecode_output output;
memset(&output, 0, sizeof(struct r600_bytecode_output));
- uint32_t word0 = i32_from_byte_stream(bytes, &bytes_read);
- uint32_t word1 = i32_from_byte_stream(bytes, &bytes_read);
+ word0 = i32_from_byte_stream(bytes, &bytes_read);
+ word1 = i32_from_byte_stream(bytes, &bytes_read);
if (ctx->bc->chip_class >= EVERGREEN)
eg_bytecode_export_read(&output, word0,word1);
else
case PIPE_CAP_TEXTURE_MULTISAMPLE:
case PIPE_CAP_COMPUTE:
case PIPE_CAP_QUERY_TIMESTAMP:
+ case PIPE_CAP_CUBE_MAP_ARRAY:
+ case PIPE_CAP_TEXTURE_BUFFER_OBJECTS:
return 0;
/* Stream output. */