mirror of
https://github.com/skyline-emu/skyline.git
synced 2024-11-05 17:45:09 +01:00
Update indexed quad conversion for new API
This commit is contained in:
parent
498b4966d3
commit
586f872655
@ -93,16 +93,17 @@ namespace skyline::gpu::interconnect::maxwell3d {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static BufferBinding GenerateQuadConversionIndexBuffer(InterconnectContext &ctx, vk::IndexType indexType, BufferView &view, u32 elementCount) {
|
static BufferBinding GenerateQuadConversionIndexBuffer(InterconnectContext &ctx, engine::IndexBuffer::IndexSize indexType, BufferView &view, u32 elementCount) {
|
||||||
auto viewSpan{view.GetReadOnlyBackingSpan(false /* We attach above so always false */, []() {
|
auto viewSpan{view.GetReadOnlyBackingSpan(false /* We attach above so always false */, []() {
|
||||||
// TODO: see Read()
|
// TODO: see Read()
|
||||||
Logger::Error("Dirty index buffer reads for attached buffers are unimplemented");
|
Logger::Error("Dirty index buffer reads for attached buffers are unimplemented");
|
||||||
})};
|
})};
|
||||||
|
|
||||||
vk::DeviceSize indexBufferSize{conversion::quads::GetRequiredBufferSize(elementCount, indexType)};
|
size_t indexSize{1U << static_cast<u32>(indexType)};
|
||||||
|
vk::DeviceSize indexBufferSize{conversion::quads::GetRequiredBufferSize(elementCount, indexSize)};
|
||||||
auto quadConversionAllocation{ctx.executor.AcquireMegaBufferAllocator().Allocate(ctx.executor.cycle, indexBufferSize)};
|
auto quadConversionAllocation{ctx.executor.AcquireMegaBufferAllocator().Allocate(ctx.executor.cycle, indexBufferSize)};
|
||||||
|
|
||||||
conversion::quads::GenerateIndexedQuadConversionBuffer(quadConversionAllocation.region.data(), viewSpan.data(), elementCount, indexType);
|
conversion::quads::GenerateIndexedQuadConversionBuffer(quadConversionAllocation.region.data(), viewSpan.data(), elementCount, ConvertIndexType(indexType));
|
||||||
|
|
||||||
return {quadConversionAllocation.buffer, quadConversionAllocation.offset, indexBufferSize};
|
return {quadConversionAllocation.buffer, quadConversionAllocation.offset, indexBufferSize};
|
||||||
}
|
}
|
||||||
@ -130,7 +131,7 @@ namespace skyline::gpu::interconnect::maxwell3d {
|
|||||||
indexType = ConvertIndexType(engine->indexBuffer.indexSize);
|
indexType = ConvertIndexType(engine->indexBuffer.indexSize);
|
||||||
|
|
||||||
if (quadConversion)
|
if (quadConversion)
|
||||||
megaBufferBinding = GenerateQuadConversionIndexBuffer(ctx, indexType, *view, elementCount);
|
megaBufferBinding = GenerateQuadConversionIndexBuffer(ctx, engine->indexBuffer.indexSize, *view, elementCount);
|
||||||
else
|
else
|
||||||
megaBufferBinding = view->TryMegaBuffer(ctx.executor.cycle, ctx.executor.AcquireMegaBufferAllocator(), ctx.executor.executionNumber);
|
megaBufferBinding = view->TryMegaBuffer(ctx.executor.cycle, ctx.executor.AcquireMegaBufferAllocator(), ctx.executor.executionNumber);
|
||||||
|
|
||||||
@ -149,7 +150,7 @@ namespace skyline::gpu::interconnect::maxwell3d {
|
|||||||
|
|
||||||
// TODO: optimise this to use buffer sequencing to avoid needing to regenerate the quad buffer every time. We can't use as it is rn though because sequences aren't globally unique and may conflict after buffer recreation
|
// TODO: optimise this to use buffer sequencing to avoid needing to regenerate the quad buffer every time. We can't use as it is rn though because sequences aren't globally unique and may conflict after buffer recreation
|
||||||
if (usedQuadConversion) {
|
if (usedQuadConversion) {
|
||||||
megaBufferBinding = GenerateQuadConversionIndexBuffer(ctx, indexType, *view, elementCount);
|
megaBufferBinding = GenerateQuadConversionIndexBuffer(ctx, engine->indexBuffer.indexSize, *view, elementCount);
|
||||||
builder.SetIndexBuffer(megaBufferBinding, indexType);
|
builder.SetIndexBuffer(megaBufferBinding, indexType);
|
||||||
} else if (megaBufferBinding) {
|
} else if (megaBufferBinding) {
|
||||||
if (auto newMegaBufferBinding{view->TryMegaBuffer(ctx.executor.cycle, ctx.executor.AcquireMegaBufferAllocator(), ctx.executor.executionNumber)};
|
if (auto newMegaBufferBinding{view->TryMegaBuffer(ctx.executor.cycle, ctx.executor.AcquireMegaBufferAllocator(), ctx.executor.executionNumber)};
|
||||||
|
Loading…
Reference in New Issue
Block a user