🐛 Lay no-copy buffers over the same bytes in one pages block

Each no-copy buffer over the app's own pages took a pages block of its own, so
two buffers over the same bytes had two host views of the same pages, and where
the views' gate refuses their import (a buffer of scattered guest pages at the
stock vm.max_map_count on NVIDIA), the runtime made a copy and a snapshot for
each. Apple's OpenCL makes such buffers: a Shared no-copy buffer over its
staging pages at each clEnqueueWriteBuffer, the same pages each time, while the
one before still lives. On the RTX 5080 host, each 256 MiB of them cost QEMU
512 MiB more Rss per write.

The region now gives a block asked for the same bytes, writability and join
again while it is joinable, so such buffers lie in one view and one copy, as on
a Mac they lie in the same pages. A block stays joinable until each buffer over
it has gone for the app, so a block is never joined over memory the app freed
and took again at the same address, and it goes back to the kext once the host
has dropped every buffer over it. A buffer of Metal's private bit 24, which the
host's runtime takes as read-only memory, joins only its own kind. Nothing
changes for the guest: each buffer keeps its object, GPU address and contents.

Tests: the region's joins and their release order, two no-copy buffers over
one block in the bundle, and the host's one view under two buffers.
This commit is contained in:
Anees Iqbal committed 2026-11-11 11:38:41 -08:00
1 parent 5689ee9486
commit 00268441aa
6 files changed
+372 -12

No files matched your search

+56
View File
@@ -9333,6 +9333,62 @@ fn buffer_over_pages(obj_id: u64, length: u64) -> Vec<u8> {
.to_vec()
}
/// Two `BUFFER_OVER_PAGES` over one pages block, as the guest sends for two no-copy buffers over
/// the same bytes (Apple's OpenCL makes one over its staging pages at each write), lie in
/// its one view: the view and its import are made once, and a buffer over the view for each. The
/// block's release is refused while either lives, and answered once both are destroyed
#[test]
fn two_buffers_over_one_pages_block_lie_in_its_one_view() {
let (device, platform, _ram, page) = surface_device(8);
let mut guest = Guest::new(&device);
guest.send(&device, block_grant(1, SURFACE_BLOCK, SURFACE_BLOCK_SIZE));
let mut pages = surface_pages(&device, page, &[(5, 2), (1, 1)]);
pages.extend_from_slice(
RgfxSurfacePagesCache {
flags: RGFX_SURFACE_PAGES_PRIVATE,
reserved_04: 0,
}
.as_bytes(),
);
guest.send(&device, pages);
let pages_seqno = guest.seqno;
let answer = complete_of(&guest.event().expect("the SURFACE_PAGES' answer"));
assert_eq!(answer, (pages_seqno, RGFX_STATUS_OK));
let worker = device.control.decoder();
worker.surface_worker().flush();
let mark = platform.call_log().mark();
guest.send(&device, buffer_over_pages(obj(1, 11), 3 * page));
guest.send(&device, buffer_over_pages(obj(1, 12), 3 * page));
assert!(objects_become(&device, 2), "both buffers made");
worker.surface_worker().flush();
let made = platform.call_log().sels_since(mark);
let buffers = made
.iter()
.filter(|&&s| s == "newBufferWithDescriptor:")
.count();
assert_eq!(
buffers, 3,
"the view's import, and a buffer over it for each: {made:?}"
);
assert_eq!(worker.views_of_surfaces().counts().private, 1, "one view");
let release = || block_release(1, SURFACE_BLOCK, SURFACE_BLOCK_SIZE);
assert_eq!(
answered(&device, &mut guest, release()),
RGFX_STATUS_REFUSED,
"both lie in it"
);
guest.send(&device, object_destroy(obj(1, 11)));
assert_eq!(
answered(&device, &mut guest, release()),
RGFX_STATUS_REFUSED,
"the second lies in it"
);
guest.send(&device, object_destroy(obj(1, 12)));
assert_eq!(answered(&device, &mut guest, release()), RGFX_STATUS_OK);
}
/// A pages block's view, which its first `BUFFER_OVER_PAGES` makes, is made off ring 0's threads:
/// while it is being made, ring 0 goes on with another context's messages, before and after the
/// buffer's context's next messages, an object's create and the buffer's destroy, and the block's
+39 -6
View File
@@ -27,6 +27,15 @@ namespace {
/// the device's view of a block starts at the page of the buffer's first byte.
constexpr uint64_t kRgfxGuestPage = 0x1000;
/// MTLResourceOptions bit 24, Metal's private bit, which a create carries to the host
/// (kRgfxHostResourceOptions) and the host's runtime takes as read-only memory.
constexpr MTLResourceOptions kBit24 = 1u << 24;
/// The joins of no-copy buffers over the app's own pages (RgfxRegion::acquirePages): one of
/// buffers with bit 24, and one of the rest.
constexpr uint32_t kPagesJoin = 1;
constexpr uint32_t kPagesJoinBit24 = 2;
// The whole 4 KiB pages `length` bytes at `pointer` lie in, which both x86-64 Macs' GPUs answer a
// buffer's allocatedSize with (oracle_bundle buffers and nocopy.*, AMD 5300M and Intel 630, macOS
// 26.7.1): a buffer made from a length or bytes in any storage mode answers its length rounded up
@@ -157,6 +166,11 @@ NSString *rgfxLinearTypeName(MTLTextureType type)
// copy, the app's memory, which the host's GPU uses as a Shared buffer's, so neither
// didModifyRange: nor a synchronize has anything to bring over.
BOOL _oneCopy;
// A no-copy buffer over the app's own pages (bufferOverPagesOf): the region whose pages block
// it lies over, which the buffer leaves joinable no longer as it goes (RgfxRegion::leavePages),
// and the block's offset; null for any other.
RgfxRegion *_pagesRegion;
uint64_t _pagesBlock;
}
+ (instancetype)bufferWithLength:(NSUInteger)length
@@ -425,6 +439,14 @@ NSString *rgfxLinearTypeName(MTLTextureType type)
// docs/graphics-kext/dgpu-oracle.md, Q3; the AMD 5300M's is two copies, which Metal's contract
// for the mode allows either way): the host's buffer over the pages is a Shared one, and the
// buffer answers the Managed options it was asked.
//
// Buffers over the same bytes share their pages block (RgfxRegion::acquirePages), so the host
// makes one view of the pages, and one copy where it copies them rather than importing them, as on
// a Mac they lie in the same pages. Apple's OpenCL makes such buffers: a Shared no-copy one over
// its staging pages at each clEnqueueWriteBuffer, the same pages each time, while the one before
// still lives (measured: a macOS 26.6.1 guest on the RTX 5080 host, 2026-11-11). One with Metal's
// private bit 24, which the host's runtime takes as read-only memory, joins only its own kind,
// never a writable one's view.
+ (instancetype)bufferOverPagesOf:(void *)pointer
length:(NSUInteger)length
options:(MTLResourceOptions)options
@@ -433,7 +455,8 @@ NSString *rgfxLinearTypeName(MTLTextureType type)
device:(id<MTLDevice>)device
serializer:(RgfxSerializer *)serializer
{
RgfxRegion::Block block = region->acquirePages(pointer, length, true);
const uint32_t join = (options & kBit24) != 0 ? kPagesJoinBit24 : kPagesJoin;
RgfxRegion::Block block = region->acquirePages(pointer, length, true, join);
if (!block.ok)
return nil;
// The block's view starts at the page of the pointer's first byte, of the kext's page.
@@ -449,11 +472,13 @@ NSString *rgfxLinearTypeName(MTLTextureType type)
RgfxCreated created = serializer->createBufferOverPages(length, static_cast<uint32_t>(onHost),
block.offset, block.size, offset);
if (created.obj_id == 0 || serializer->refused(created)) {
region->leavePages(block.offset);
region->release(block.offset); // no buffer lies over the block
return nil;
}
// The block goes back once the host has dropped the buffer, then the caller's memory: the
// kext unwires its pages once the device has answered the block's release.
// kext unwires its pages once the device has answered the block's release. It is joinable no
// longer once the buffer has gone for the app (dealloc).
const uint64_t at = block.offset;
RgfxBuffer *buffer = [[RgfxBuffer alloc] initWithObjId:created.obj_id
gpuAddress:created.gpu_address + offset
@@ -467,11 +492,15 @@ NSString *rgfxLinearTypeName(MTLTextureType type)
}
device:device
serializer:serializer];
if (buffer != nil) {
buffer->_ownsAddress = YES;
buffer->_addressPick = created.gpu_address;
buffer->_oneCopy = managed;
if (buffer == nil) {
region->leavePages(at);
return nil;
}
buffer->_ownsAddress = YES;
buffer->_addressPick = created.gpu_address;
buffer->_oneCopy = managed;
buffer->_pagesRegion = region;
buffer->_pagesBlock = at;
return buffer;
}
@@ -541,6 +570,10 @@ NSString *rgfxLinearTypeName(MTLTextureType type)
// caller's pages), so nothing reuses it while the host may still read it.
if (_ownsContents)
std::free(_contents);
// Gone for the app, which may free the memory under it once its deallocator runs: a buffer
// made since over the same bytes takes a block of its own.
if (_pagesRegion != nullptr)
_pagesRegion->leavePages(_pagesBlock);
void (^deallocator)(void) = _hostDeallocator;
RgfxSerializer *serializer = _serializer;
uint64_t address = !_ownsAddress ? 0 : _addressPick != 0 ? _addressPick : _gpuAddress;
+47 -3
View File
@@ -159,23 +159,56 @@ void RgfxRegion::setPagesBlockSource(PagesBlockFn acquire, void *context)
m_pagesBlockContext = context;
}
RgfxRegion::Block RgfxRegion::acquirePages(const void *address, uint64_t length, bool writable)
RgfxRegion::Block RgfxRegion::acquirePages(const void *address, uint64_t length, bool writable,
uint32_t join)
{
Block out = {};
if (m_pagesBlock == nullptr)
return out; // ok == false
const PagesRange range = {reinterpret_cast<uintptr_t>(address), length, writable, join};
if (join != kPagesOwn) {
std::lock_guard<std::mutex> guard(m_pagesLock);
auto it = m_joinablePages.find(range);
if (it != m_joinablePages.end()) {
JoinedPages &joined = m_joinedPages.at(it->second);
joined.joinable++;
joined.held++;
out.offset = it->second;
out.size = joined.size;
out.ok = true;
return out;
}
}
uint64_t offset = 0, size = 0;
if (m_pagesBlock == nullptr ||
!m_pagesBlock(m_pagesBlockContext, address, length, writable, &offset, &size))
if (!m_pagesBlock(m_pagesBlockContext, address, length, writable, &offset, &size))
return out; // ok == false
if (offset < m_floor || offset > m_size || size > m_size - offset) {
release(offset);
return out;
}
// A block the kext gave for the same bytes on another thread meanwhile stays the one joined;
// this one is its own.
if (join != kPagesOwn) {
std::lock_guard<std::mutex> guard(m_pagesLock);
if (m_joinablePages.emplace(range, offset).second)
m_joinedPages[offset] = JoinedPages{range, size, 1, 1};
}
out.offset = offset;
out.size = size;
out.ok = true;
return out;
}
void RgfxRegion::leavePages(uint64_t offset)
{
std::lock_guard<std::mutex> guard(m_pagesLock);
auto it = m_joinedPages.find(offset);
if (it == m_joinedPages.end() || it->second.joinable == 0)
return;
if (--it->second.joinable == 0)
m_joinablePages.erase(it->second.range);
}
void RgfxRegion::releaseSurface(uint64_t offset)
{
if (m_surfaceRelease != nullptr) {
@@ -185,6 +218,17 @@ void RgfxRegion::releaseSurface(uint64_t offset)
void RgfxRegion::release(uint64_t offset)
{
{
std::lock_guard<std::mutex> guard(m_pagesLock);
auto it = m_joinedPages.find(offset);
if (it != m_joinedPages.end()) {
if (--it->second.held != 0)
return;
if (it->second.joinable != 0)
m_joinablePages.erase(it->second.range);
m_joinedPages.erase(it);
}
}
if (m_release != nullptr) {
m_release(m_sourceContext, offset);
}
+45 -3
View File
@@ -46,7 +46,9 @@
#define RGFX_REGION_HPP_
#include <cstdint>
#include <map>
#include <mutex>
#include <tuple>
#include "reims_graphics_wire.h"
@@ -109,8 +111,9 @@ public:
/// (WRITE-COMBINED PARTS); the whole block write-back otherwise.
Block allocate(uint64_t size, uint64_t align, uint64_t writeCombinedFrom);
/// Hands back the block at region offset `offset` (one allocate() returned) to the block
/// source; nothing without one.
/// Hands back the block at region offset `offset` (one allocate() or acquirePages() returned)
/// to the block source; nothing without one. A pages block given more than once
/// (acquirePages' `join`) goes back at the release for the last time it was given.
void release(uint64_t offset);
/// Where blocks come from: `alloc` places `size` bytes aligned to `align` and writes the
@@ -253,7 +256,24 @@ public:
/// The pages block of the `length` bytes at `address` (PagesBlockFn): `ok` false without a
/// pages block source, or where it gives none. Its `ptr` is null: the process never maps a
/// pages block, which holds the device's runs alone.
Block acquirePages(const void *address, uint64_t length, bool writable);
///
/// With a `join` other than kPagesOwn, a block given for the same bytes, writability and
/// `join` that is still joinable is given again rather than a new one, so the device makes one
/// view of the pages, and one copy of them where it copies them: two no-copy buffers over the
/// same memory lie in one host memory, as on a Mac they lie in the same pages. A block stays
/// joinable until leavePages() was called for each time it was given: the caller calls it as
/// the object over the block goes for the app, while the app still keeps the memory, so a
/// block is never joined over memory the app freed and took again at the same address. It goes
/// back through the block source at the release() for the last time it was given.
Block acquirePages(const void *address, uint64_t length, bool writable,
uint32_t join = kPagesOwn);
/// acquirePages' `join` for a block of its own, given to no one else.
static const uint32_t kPagesOwn = 0;
/// The pages block at `offset` is no longer joinable for one of the times acquirePages gave
/// it (its object went for the app); nothing for a block given with kPagesOwn.
void leavePages(uint64_t offset);
/// A submission + completion ring pair (see RingPair). Each data size must be a
/// power of two; `complete_data_size` may be 0 (no completion ring placed).
@@ -303,6 +323,28 @@ private:
#if defined(__arm64__)
uint64_t m_pagesPage = 0x1000; // pagesPage()
#endif
// The pages blocks given with a join (acquirePages): the joinable ones by their bytes,
// writability and join, and each such block's counts by its offset, under m_pagesLock.
struct PagesRange {
uintptr_t address;
uint64_t length;
bool writable;
uint32_t join;
bool operator<(const PagesRange &o) const
{
return std::tie(address, length, writable, join) <
std::tie(o.address, o.length, o.writable, o.join);
}
};
struct JoinedPages {
PagesRange range;
uint64_t size;
uint32_t joinable; // the times given whose leavePages has not come
uint32_t held; // the times given whose release has not come
};
std::map<PagesRange, uint64_t> m_joinablePages;
std::map<uint64_t, JoinedPages> m_joinedPages;
std::mutex m_pagesLock;
SurfaceWritesFn m_writesNote = nullptr; // the surface write source, where set (the kext)
SurfaceRetireFn m_writesRetire = nullptr;
void *m_writesContext = nullptr;
+80
View File
@@ -2959,6 +2959,85 @@ void test_region_pages_blocks()
CHECK(src.released.size() == 1 && src.released[0] == mem.size() - 0x800);
}
// A pages block asked with a join (RgfxRegion::acquirePages) is given again for the same bytes,
// writability and join while it is joinable, the kext asked once: it stays joinable until
// leavePages came for each time it was given, and goes back to the block source at the release
// for the last of them, whichever order those come in. Other bytes, another writability, another
// join and kPagesOwn each take a block of their own; once a block is joinable no longer, the same
// bytes take a new block though the old one is still held.
void test_region_pages_joins()
{
std::vector<uint8_t> mem(RGFX_ALLOCATIONS_OFFSET + 0x100000, 0);
RgfxRegion region(mem.data(), mem.size());
struct Source {
int asked = 0;
uint64_t next = RGFX_ALLOCATIONS_OFFSET + 0x10000;
std::vector<uint64_t> released;
static bool block(void *c, const void *, uint64_t, bool, uint64_t *offset, uint64_t *size)
{
Source *s = static_cast<Source *>(c);
s->asked++;
*offset = s->next;
*size = 0x4000;
s->next += 0x4000;
return true;
}
static bool alloc(void *, uint64_t, uint64_t, uint64_t *) { return false; }
static void release(void *c, uint64_t offset)
{
static_cast<Source *>(c)->released.push_back(offset);
}
} src;
region.setBlockSource(&Source::alloc, &Source::release, &src);
region.setPagesBlockSource(&Source::block, &src);
static uint8_t bytes[0x8000];
const uint32_t join = 1;
RgfxRegion::Block a = region.acquirePages(bytes, 0x4000, true, join);
RgfxRegion::Block b = region.acquirePages(bytes, 0x4000, true, join);
CHECK(a.ok && b.ok && a.offset == b.offset && a.size == b.size && b.ptr == nullptr);
CHECK(src.asked == 1);
// Each of these takes a block of its own.
const RgfxRegion::Block others[] = {
region.acquirePages(bytes, 0x3000, true, join),
region.acquirePages(bytes + 0x1000, 0x4000, true, join),
region.acquirePages(bytes, 0x4000, false, join),
region.acquirePages(bytes, 0x4000, true, join + 1),
region.acquirePages(bytes, 0x4000, true, RgfxRegion::kPagesOwn),
region.acquirePages(bytes, 0x4000, true, RgfxRegion::kPagesOwn),
};
CHECK(src.asked == 7);
for (const RgfxRegion::Block &o : others)
CHECK(o.ok && o.offset != a.offset);
CHECK(others[4].offset != others[5].offset);
// The first holder's release before its leave: held still, and joinable.
region.release(a.offset);
CHECK(src.released.empty());
RgfxRegion::Block c = region.acquirePages(bytes, 0x4000, true, join);
CHECK(c.ok && c.offset == a.offset && src.asked == 7);
region.leavePages(a.offset);
region.leavePages(a.offset);
CHECK(region.acquirePages(bytes, 0x4000, true, join).offset == a.offset && src.asked == 7);
// The last leave: the same bytes take a new block while the old one is held.
region.leavePages(a.offset);
region.leavePages(a.offset);
RgfxRegion::Block d = region.acquirePages(bytes, 0x4000, true, join);
CHECK(d.ok && d.offset != a.offset && src.asked == 8);
region.leavePages(a.offset); // past the last leave: nothing
region.release(a.offset);
region.release(a.offset);
CHECK(src.released.empty());
region.release(a.offset); // the last of the four
CHECK(src.released.size() == 1 && src.released[0] == a.offset);
region.release(d.offset);
CHECK(src.released.size() == 2 && src.released[1] == d.offset);
// A block of kPagesOwn goes back at its one release.
region.leavePages(others[4].offset);
region.release(others[4].offset);
CHECK(src.released.size() == 3 && src.released[2] == others[4].offset);
}
// Where the kext maps parts of blocks write-combined, a block asked with a write-combined part
// takes it from the write-combined source, and one asked without from the block source; a queue's
// submission ring's data starts its block's second page, write-combined, with the ring's header
@@ -3038,6 +3117,7 @@ int main()
test_id_space();
test_obj_ids_are_given_once();
test_region_pages_blocks();
test_region_pages_joins();
test_region_write_combined_parts();
test_address_picks();
test_resource_id_chunks();
+105
View File
@@ -11260,6 +11260,110 @@ void test_no_copy_buffers_in_place()
CHECK(!RgfxMemoryShadow::anyLive());
}
// Two no-copy buffers over the same writable bytes of the app's (Apple's OpenCL makes a Shared one
// over its staging pages at each write; here a Shared and a Managed one) lie over one pages
// block (RgfxRegion::acquirePages): the kext asked once, and two BUFFER_OVER_PAGES naming that
// block, each with an object and a GPU address of its own, so the host makes one view of the
// pages and one copy of them where it copies them. The block goes back once the host has dropped
// both, not at the first. One of bit 24, or over other bytes, takes a block of its own, and once
// both have gone for the app the same bytes take a new block.
void test_no_copy_buffers_over_the_same_bytes_share_a_block()
{
@autoreleasepool {
QueueFixture f;
(void)expectQueueCreate(f.control);
std::vector<uint8_t> mem(RGFX_ALLOCATIONS_OFFSET + 0x200000, 0xff);
RgfxRegion region(mem.data(), mem.size());
BlockLog blocks;
region.setBlockSource(&BlockLog::alloc, &BlockLog::release, &blocks);
RgfxRegionSlabSource slabSource(region, f.ser);
RgfxSlabs slabs(slabSource);
struct Pages {
int asked = 0;
uint64_t next = RGFX_ALLOCATIONS_OFFSET + 0x100000;
static bool block(void *c, const void *, uint64_t, bool, uint64_t *offset, uint64_t *size)
{
Pages *p = static_cast<Pages *>(c);
p->asked++;
*offset = p->next;
*size = 0x5000;
p->next += 0x10000;
return true;
}
} pages;
region.setPagesBlockSource(&Pages::block, &pages);
vm_address_t app = 0;
CHECK(vm_allocate(mach_task_self(), &app, 0x10000, VM_FLAGS_ANYWHERE) == KERN_SUCCESS);
uint8_t *p = reinterpret_cast<uint8_t *>(app);
auto noCopy = [&](void *ptr, NSUInteger length, MTLResourceOptions options) {
return [RgfxBuffer bufferWithBytesNoCopy:ptr
length:length
options:options
deallocator:nil
region:&region
slabs:&slabs
device:nil
serializer:&f.ser];
};
const uint64_t joined = pages.next;
auto heldJoined = [&] {
return std::find(blocks.released.begin(), blocks.released.end(), joined) ==
blocks.released.end();
};
@autoreleasepool {
RgfxBuffer *shared = noCopy(p, 0x4000, 0x100000 | MTLResourceStorageModeShared);
CHECK(shared != nil && [shared contents] == p && pages.asked == 1);
auto one = expectMessage<RgfxBufferOverPages>(f.control, RGFX_CMD_BUFFER_OVER_PAGES);
@autoreleasepool {
RgfxBuffer *managed = noCopy(p, 0x4000, 0x100000 | MTLResourceStorageModeManaged);
CHECK(managed != nil && [managed contents] == p && pages.asked == 1);
auto two = expectMessage<RgfxBufferOverPages>(f.control, RGFX_CMD_BUFFER_OVER_PAGES);
CHECK(one.block_offset == joined && two.block_offset == joined);
CHECK(one.block_size == 0x5000 && two.block_size == 0x5000);
CHECK(one.obj_id == shared.rgfxObjId && two.obj_id == managed.rgfxObjId);
CHECK(one.obj_id != two.obj_id && shared.gpuAddress != managed.gpuAddress);
CHECK((two.options & MTLResourceStorageModeMask) == MTLResourceStorageModeShared);
// Bit 24, and fewer bytes: blocks of their own.
RgfxBuffer *bit24 = noCopy(p, 0x4000, MTLResourceStorageModeShared | (1u << 24));
auto three = expectMessage<RgfxBufferOverPages>(f.control, RGFX_CMD_BUFFER_OVER_PAGES);
RgfxBuffer *fewer = noCopy(p, 0x2000, MTLResourceStorageModeShared);
auto four = expectMessage<RgfxBufferOverPages>(f.control, RGFX_CMD_BUFFER_OVER_PAGES);
CHECK(bit24 != nil && fewer != nil && pages.asked == 3);
CHECK(three.block_offset != joined && four.block_offset != joined &&
three.block_offset != four.block_offset);
}
// The Managed one, the bit 24 one and the shorter one gone: theirs back, the joined
// block still under the Shared one.
CHECK(eventually([&] { return blocks.released.size() == 2; }));
CHECK(heldJoined());
drainRing(f.control);
// Joinable still while the Shared one lives.
@autoreleasepool {
RgfxBuffer *again = noCopy(p, 0x4000, MTLResourceStorageModeShared);
CHECK(again != nil && pages.asked == 3);
auto five = expectMessage<RgfxBufferOverPages>(f.control, RGFX_CMD_BUFFER_OVER_PAGES);
CHECK(five.block_offset == joined);
}
drainRing(f.control);
CHECK(heldJoined());
}
CHECK(eventually([&] { return !heldJoined(); }));
CHECK(blocks.released.size() == 3);
drainRing(f.control);
// Both gone for the app: the same bytes take a new block.
@autoreleasepool {
RgfxBuffer *later = noCopy(p, 0x4000, MTLResourceStorageModeShared);
CHECK(later != nil && pages.asked == 4);
auto six = expectMessage<RgfxBufferOverPages>(f.control, RGFX_CMD_BUFFER_OVER_PAGES);
CHECK(six.block_offset != joined);
}
CHECK(eventually([&] { return blocks.released.size() == 4; }));
drainRing(f.control);
vm_deallocate(mach_task_self(), app, 0x10000);
}
CHECK(!RgfxMemoryShadow::anyLive());
}
// A no-copy buffer's GPU copy (its shadow) is a range of a slab of its options, as a device
// buffer's is (RgfxBuffer.h): with the process's own pages as the slabs' first source, the
@@ -16747,6 +16851,7 @@ int main(int argc, char **argv)
test_managed_texture_copy_block_after_destroys();
test_no_copy_buffers();
test_no_copy_buffers_in_place();
test_no_copy_buffers_over_the_same_bytes_share_a_block();
test_no_copy_shadows_lie_in_slabs();
test_binds_note_shadow_writes();
test_block_call();