mirror of
https://github.com/skyline-emu/skyline.git
synced 2024-11-30 07:54:15 +01:00
Implement Host Vertex Buffer Translation
Uses the buffer cache to retrieve an equivalent host vertex buffer for a corresponding guest vertex buffer.
This commit is contained in:
parent
b6ba770a27
commit
8989305637
@ -1060,6 +1060,22 @@ namespace skyline::gpu::interconnect {
|
||||
}
|
||||
}
|
||||
|
||||
BufferView *GetVertexBuffer(size_t index) {
|
||||
auto &vertexBuffer{vertexBuffers.at(index)};
|
||||
if (vertexBuffer.disabled || vertexBuffer.start > vertexBuffer.end)
|
||||
return nullptr;
|
||||
else if (vertexBuffer.view)
|
||||
return &*vertexBuffer.view;
|
||||
|
||||
if (vertexBuffer.guest.mappings.empty()) {
|
||||
auto mappings{channelCtx.asCtx->gmmu.TranslateRange(vertexBuffer.start, (vertexBuffer.end + 1) - vertexBuffer.start)};
|
||||
vertexBuffer.guest.mappings.assign(mappings.begin(), mappings.end());
|
||||
}
|
||||
|
||||
vertexBuffer.view = gpu.buffer.FindOrCreate(vertexBuffer.guest);
|
||||
return vertexBuffer.view.get();
|
||||
}
|
||||
|
||||
/* Input Assembly */
|
||||
private:
|
||||
vk::PipelineInputAssemblyStateCreateInfo inputAssemblyState{};
|
||||
|
Loading…
Reference in New Issue
Block a user