Commit 53db2790 authored by Marek Olšák's avatar Marek Olšák

radeonsi: add/update assertions for 32-bit address space

parent 16856a1e
......@@ -218,10 +218,21 @@ bool si_alloc_resource(struct si_screen *sscreen,
old_buf = res->buf;
res->buf = new_buf; /* should be atomic */
if (sscreen->info.has_virtual_memory)
if (sscreen->info.has_virtual_memory) {
res->gpu_address = sscreen->ws->buffer_get_virtual_address(res->buf);
else
if (res->flags & RADEON_FLAG_32BIT) {
uint64_t start = res->gpu_address;
uint64_t last = start + res->bo_size - 1;
(void)start;
(void)last;
assert((start >> 32) == sscreen->info.address32_hi);
assert((last >> 32) == sscreen->info.address32_hi);
}
} else {
res->gpu_address = 0;
}
pb_reference(&old_buf, NULL);
......
......@@ -188,6 +188,10 @@ static bool si_upload_descriptors(struct si_context *sctx,
buffer_offset -= first_slot_offset;
desc->gpu_address = desc->buffer->gpu_address + buffer_offset;
assert(desc->buffer->flags & RADEON_FLAG_32BIT);
assert((desc->buffer->gpu_address >> 32) == sctx->screen->info.address32_hi);
assert((desc->gpu_address >> 32) == sctx->screen->info.address32_hi);
si_mark_atom_dirty(sctx, &sctx->shader_pointers.atom);
return true;
}
......@@ -2016,7 +2020,7 @@ static void si_emit_shader_pointer_body(struct si_screen *sscreen,
radeon_emit(cs, va);
if (HAVE_32BIT_POINTERS)
assert((va >> 32) == sscreen->info.address32_hi);
assert(va == 0 || (va >> 32) == sscreen->info.address32_hi);
else
radeon_emit(cs, va >> 32);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment