Bind an empty uniform buffer in place of unbound constant buffers

This commit is contained in:
Billy Laws 2022-09-29 21:20:42 +01:00
parent 55b85d0691
commit 98cb94ca6c

View File

@ -607,6 +607,9 @@ namespace skyline::gpu::interconnect::maxwell3d {
}
static DynamicBufferBinding GetConstantBufferBinding(InterconnectContext &ctx, const Shader::Info &info, BufferView view, size_t idx) {
if (!view) // Return a dummy buffer if the constant buffer isn't bound
return BufferBinding{ctx.executor.AcquireMegaBufferAllocator().Allocate(ctx.executor.cycle, 0).buffer, 0, PAGE_SIZE};
ctx.executor.AttachBuffer(view);
size_t sizeOverride{std::min<size_t>(info.constant_buffer_used_sizes[idx], view.size)};