Update VertexBufferState.cs

Adds the fix for the crash in the opening cutscene of Baldo: The Sacred Owls when using Vulkan, from ryujinx-mirror. The original discussion about the fix can be found here: https://github.com/ryujinx-mirror/ryujinx/pull/52
This commit is contained in:
extherian 2024-11-13 15:09:17 +00:00 committed by GitHub
parent 4cb5946be4
commit c952b4e349
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -55,8 +55,10 @@ namespace Ryujinx.Graphics.Vulkan
if (_handle != BufferHandle.Null)
{
// May need to restride the vertex buffer.
if (gd.NeedsVertexBufferAlignment(AttributeScalarAlignment, out int alignment) && (_stride % alignment) != 0)
//
// Fix divide by zero when recovering from missed draw (Oct. 16 2024)
// (fixes crash in 'Baldo: The Guardian Owls' opening cutscene)
if (gd.NeedsVertexBufferAlignment(AttributeScalarAlignment, out int alignment) && alignment != 0 && (_stride % alignment) != 0)
{
autoBuffer = gd.BufferManager.GetAlignedVertexBuffer(cbs, _handle, _offset, _size, _stride, alignment);