mirror of
https://git.naxdy.org/Mirror/Ryujinx.git
synced 2025-02-22 09:03:36 +00:00
Fix triangle overlay on SMO, Captain Toad, maybe others?
This commit is contained in:
parent
393d0a6134
commit
cd01a2f74a
2 changed files with 18 additions and 3 deletions
|
@ -953,6 +953,7 @@ namespace Ryujinx.Graphics.Gpu.Engine.Threed
|
||||||
|
|
||||||
_drawState.IsAnyVbInstanced |= divisor != 0;
|
_drawState.IsAnyVbInstanced |= divisor != 0;
|
||||||
|
|
||||||
|
ulong vbSize = endAddress.Pack() - address + 1;
|
||||||
ulong size;
|
ulong size;
|
||||||
|
|
||||||
if (_drawState.IbStreamer.HasInlineIndexData || _drawState.DrawIndexed || stride == 0 || instanced)
|
if (_drawState.IbStreamer.HasInlineIndexData || _drawState.DrawIndexed || stride == 0 || instanced)
|
||||||
|
@ -960,7 +961,7 @@ namespace Ryujinx.Graphics.Gpu.Engine.Threed
|
||||||
// This size may be (much) larger than the real vertex buffer size.
|
// This size may be (much) larger than the real vertex buffer size.
|
||||||
// Avoid calculating it this way, unless we don't have any other option.
|
// Avoid calculating it this way, unless we don't have any other option.
|
||||||
|
|
||||||
size = endAddress.Pack() - address + 1;
|
size = vbSize;
|
||||||
|
|
||||||
if (stride > 0 && indexTypeSmall && _drawState.DrawIndexed && !instanced)
|
if (stride > 0 && indexTypeSmall && _drawState.DrawIndexed && !instanced)
|
||||||
{
|
{
|
||||||
|
@ -984,7 +985,7 @@ namespace Ryujinx.Graphics.Gpu.Engine.Threed
|
||||||
|
|
||||||
var drawState = _state.State.VertexBufferDrawState;
|
var drawState = _state.State.VertexBufferDrawState;
|
||||||
|
|
||||||
size = (ulong)((firstInstance + drawState.First + drawState.Count) * stride);
|
size = Math.Min(vbSize, (ulong)((firstInstance + drawState.First + drawState.Count) * stride));
|
||||||
}
|
}
|
||||||
|
|
||||||
_channel.BufferManager.SetVertexBuffer(index, address, size, stride, divisor);
|
_channel.BufferManager.SetVertexBuffer(index, address, size, stride, divisor);
|
||||||
|
|
|
@ -57,9 +57,23 @@ namespace Ryujinx.Graphics.Vulkan
|
||||||
{
|
{
|
||||||
var buffer = _buffer.Get(cbs, _offset, _size).Value;
|
var buffer = _buffer.Get(cbs, _offset, _size).Value;
|
||||||
|
|
||||||
|
if (gd.Capabilities.SupportsExtendedDynamicState)
|
||||||
|
{
|
||||||
|
gd.ExtendedDynamicStateApi.CmdBindVertexBuffers2(
|
||||||
|
cbs.CommandBuffer,
|
||||||
|
binding,
|
||||||
|
1,
|
||||||
|
buffer,
|
||||||
|
(ulong)_offset,
|
||||||
|
(ulong)_size,
|
||||||
|
_stride);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
gd.Api.CmdBindVertexBuffers(cbs.CommandBuffer, binding, 1, buffer, (ulong)_offset);
|
gd.Api.CmdBindVertexBuffers(cbs.CommandBuffer, binding, 1, buffer, (ulong)_offset);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public void Dispose()
|
public void Dispose()
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue