Skip to content

Commit

Permalink
Update VertexBufferState.cs
Browse files Browse the repository at this point in the history
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: ryujinx-mirror/ryujinx#52
  • Loading branch information
extherian authored Nov 13, 2024
1 parent 4cb5946 commit c952b4e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/Ryujinx.Graphics.Vulkan/VertexBufferState.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,10 @@ public void BindVertexBuffer(VulkanRenderer gd, CommandBufferScoped cbs, uint bi
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);

Expand Down

0 comments on commit c952b4e

Please sign in to comment.