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);
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;
}
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);
}