mirror of
https://github.com/GreemDev/Ryujinx.git
synced 2024-11-30 20:54:30 +01:00
Vulkan: Cache delegate for EndRenderPass (#6132)
This prevents a small allocation each time this method is called. This is a top 3 SOH allocation during gameplay in most games, and eliminating it is pretty free.
This commit is contained in:
parent
f4b74e9ce1
commit
bebd8eb822
@ -520,7 +520,7 @@ namespace Ryujinx.Graphics.Vulkan
|
|||||||
|
|
||||||
if (_gd.PipelineInternal.CurrentCommandBuffer.CommandBuffer.Handle == cbs.CommandBuffer.Handle)
|
if (_gd.PipelineInternal.CurrentCommandBuffer.CommandBuffer.Handle == cbs.CommandBuffer.Handle)
|
||||||
{
|
{
|
||||||
SetData(rangeOffset, _pendingData.AsSpan(rangeOffset, rangeSize), cbs, _gd.PipelineInternal.EndRenderPass, false);
|
SetData(rangeOffset, _pendingData.AsSpan(rangeOffset, rangeSize), cbs, _gd.PipelineInternal.EndRenderPassDelegate, false);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -30,6 +30,7 @@ namespace Ryujinx.Graphics.Vulkan
|
|||||||
public readonly PipelineCache PipelineCache;
|
public readonly PipelineCache PipelineCache;
|
||||||
|
|
||||||
public readonly AutoFlushCounter AutoFlush;
|
public readonly AutoFlushCounter AutoFlush;
|
||||||
|
public readonly Action EndRenderPassDelegate;
|
||||||
|
|
||||||
protected PipelineDynamicState DynamicState;
|
protected PipelineDynamicState DynamicState;
|
||||||
private PipelineState _newState;
|
private PipelineState _newState;
|
||||||
@ -92,6 +93,7 @@ namespace Ryujinx.Graphics.Vulkan
|
|||||||
Device = device;
|
Device = device;
|
||||||
|
|
||||||
AutoFlush = new AutoFlushCounter(gd);
|
AutoFlush = new AutoFlushCounter(gd);
|
||||||
|
EndRenderPassDelegate = EndRenderPass;
|
||||||
|
|
||||||
var pipelineCacheCreateInfo = new PipelineCacheCreateInfo
|
var pipelineCacheCreateInfo = new PipelineCacheCreateInfo
|
||||||
{
|
{
|
||||||
|
@ -784,7 +784,7 @@ namespace Ryujinx.Graphics.Vulkan
|
|||||||
|
|
||||||
public void SetBufferData(BufferHandle buffer, int offset, ReadOnlySpan<byte> data)
|
public void SetBufferData(BufferHandle buffer, int offset, ReadOnlySpan<byte> data)
|
||||||
{
|
{
|
||||||
BufferManager.SetData(buffer, offset, data, _pipeline.CurrentCommandBuffer, _pipeline.EndRenderPass);
|
BufferManager.SetData(buffer, offset, data, _pipeline.CurrentCommandBuffer, _pipeline.EndRenderPassDelegate);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void UpdateCounters()
|
public void UpdateCounters()
|
||||||
|
Loading…
Reference in New Issue
Block a user