MCPcopy Create free account
hub / github.com/SakuraEngine/SakuraEngine / resolve

Method resolve

modules/engine/runtime/src/io/ram/ram_resolvers.cpp:8–38  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6namespace io {
7
8void AllocateIOBufferResolver::resolve(SkrAsyncServicePriority priority, IOBatchId batch, IORequestId request) SKR_NOEXCEPT
9{
10 SkrZoneScopedNC("IOBuffer::Allocate", tracy::Color::BlueViolet);
11 auto rq = skr::static_pointer_cast<RAMRequestMixin>(request);
12 auto buf = skr::static_pointer_cast<RAMIOBuffer>(rq->destination);
13 auto pFiles = io_component<FileComponent>(rq.get());
14 // deal with 0 block size
15 if (auto pBlocks = io_component<BlocksComponent>(rq.get()))
16 {
17 for (auto& block : pBlocks->blocks)
18 {
19 if (block.size == 0)
20 {
21 block.size = pFiles->get_fsize() - block.offset;
22 }
23 if (buf->get_size() == 0)
24 {
25 buf->size += block.size;
26 }
27 }
28 }
29 // allocate
30 if (buf->get_data() == nullptr)
31 {
32 if (buf->get_size() == 0)
33 {
34 SKR_ASSERT(0 && "invalid destination size");
35 }
36 buf->allocate_buffer(buf->size);
37 }
38}
39
40ChunkingVFSReadResolver::ChunkingVFSReadResolver(uint64_t chunk_size) SKR_NOEXCEPT
41 : chunk_size(chunk_size)

Callers

nothing calls this directly

Calls 10

get_fsizeMethod · 0.80
allocate_bufferMethod · 0.80
getMethod · 0.45
get_sizeMethod · 0.45
get_dataMethod · 0.45
get_blocksMethod · 0.45
reset_blocksMethod · 0.45
reserveMethod · 0.45
add_blockMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected