Cleanup, disable device local buffers for now.

This commit is contained in:
riperiperi 2021-12-23 01:04:52 +00:00
parent 4994e50d1c
commit dc0d0f49b1
6 changed files with 9 additions and 18 deletions

View file

@ -180,8 +180,9 @@ namespace Ryujinx.Graphics.Vulkan
if (_map != IntPtr.Zero) if (_map != IntPtr.Zero)
{ {
// If persistently mapped, set the data directly if the buffer is not currently in use. // If persistently mapped, set the data directly if the buffer is not currently in use.
//bool needsFlush = _gd.CommandBufferPool.HasWaitableOnRentedCommandBuffer(_waitable, offset, dataSize); // TODO: Reintroduce waitable & granular use tracking.
bool needsFlush = _buffer.HasRentedCommandBufferDependency(_gd.CommandBufferPool);// (_waitable, offset, dataSize); // bool needsFlush = _gd.CommandBufferPool.HasWaitableOnRentedCommandBuffer(_waitable, offset, dataSize);
bool needsFlush = _buffer.HasRentedCommandBufferDependency(_gd.CommandBufferPool);
if (!needsFlush) if (!needsFlush)
{ {

View file

@ -19,8 +19,6 @@ namespace Ryujinx.Graphics.Vulkan
private readonly CommandPool _pool; private readonly CommandPool _pool;
private readonly Thread _owner; private readonly Thread _owner;
public int PerFrame = 0;
public bool OwnedByCurrentThread => _owner == Thread.CurrentThread; public bool OwnedByCurrentThread => _owner == Thread.CurrentThread;
private struct ReservedCommandBuffer private struct ReservedCommandBuffer
@ -125,12 +123,6 @@ namespace Ryujinx.Graphics.Vulkan
entry.Waitables.Add(waitable); entry.Waitables.Add(waitable);
} }
public bool HasWaitable(int cbIndex, MultiFenceHolder waitable)
{
ref var entry = ref _commandBuffers[cbIndex];
return entry.Waitables.Contains(waitable);
}
public bool HasWaitableOnRentedCommandBuffer(MultiFenceHolder waitable, int offset, int size) public bool HasWaitableOnRentedCommandBuffer(MultiFenceHolder waitable, int offset, int size)
{ {
lock (_commandBuffers) lock (_commandBuffers)
@ -200,7 +192,6 @@ namespace Ryujinx.Graphics.Vulkan
public CommandBufferScoped Rent() public CommandBufferScoped Rent()
{ {
PerFrame++;
lock (_commandBuffers) lock (_commandBuffers)
{ {
CheckConsumption(_cursor); CheckConsumption(_cursor);

View file

@ -31,11 +31,6 @@ namespace Ryujinx.Graphics.Vulkan
_pool.AddDependency(CommandBufferIndex, dependencyCbs); _pool.AddDependency(CommandBufferIndex, dependencyCbs);
} }
public bool HasWaitable(MultiFenceHolder waitable)
{
return _pool.HasWaitable(CommandBufferIndex, waitable);
}
public FenceHolder GetFence() public FenceHolder GetFence()
{ {
return _pool.GetFence(CommandBufferIndex); return _pool.GetFence(CommandBufferIndex);

View file

@ -82,6 +82,11 @@ namespace Ryujinx.Graphics.Vulkan
{ {
scoped.Dispose(); scoped.Dispose();
} }
else if (_gd.IsIntelWindows)
{
// Not flushing commands here causes glitches on Intel (driver bug?)
_gd.FlushAllCommands();
}
} }
private void PushDataImpl(CommandBufferScoped cbs, BufferHolder dst, int dstOffset, ReadOnlySpan<byte> data) private void PushDataImpl(CommandBufferScoped cbs, BufferHolder dst, int dstOffset, ReadOnlySpan<byte> data)

View file

@ -746,7 +746,6 @@ namespace Ryujinx.Graphics.Vulkan
if (loadInline) if (loadInline)
{ {
_gd.PipelineInternal.EndRenderPass(); _gd.PipelineInternal.EndRenderPass();
Common.Logging.Logger.Error?.PrintMsg(Common.Logging.LogClass.Gpu, "Loaded inline!");
} }
CopyDataToBuffer(bufferHolder.GetDataStorage(0, bufferDataLength), data); CopyDataToBuffer(bufferHolder.GetDataStorage(0, bufferDataLength), data);

View file

@ -197,7 +197,7 @@ namespace Ryujinx.Graphics.Vulkan
public BufferHandle CreateBuffer(int size) public BufferHandle CreateBuffer(int size)
{ {
return BufferManager.CreateWithHandle(this, size, true); return BufferManager.CreateWithHandle(this, size, false);
} }
public IProgram CreateProgram(IShader[] shaders, ShaderInfo info) public IProgram CreateProgram(IShader[] shaders, ShaderInfo info)