Initial support for GPU channels (#2372)
* Ground work for separate GPU channels * Rename TextureManager to TextureCache * Decouple texture bindings management from the texture cache * Rename BufferManager to BufferCache * Decouple buffer bindings management from the buffer cache * More comments and proper disposal * PR feedback * Force host state update on channel switch * Typo * PR feedback * Missing using
This commit is contained in:
parent
12a7a2ead8
commit
a10b2c5ff2
24 changed files with 1745 additions and 1456 deletions
|
@ -1,4 +1,5 @@
|
|||
using System;
|
||||
using Ryujinx.Graphics.Gpu.Image;
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace Ryujinx.Graphics.Gpu.State
|
||||
|
@ -37,11 +38,19 @@ namespace Ryujinx.Graphics.Gpu.State
|
|||
/// </summary>
|
||||
public ShadowRamControl ShadowRamControl { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// GPU channel for the sub-channel state.
|
||||
/// </summary>
|
||||
public GpuChannel Channel { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Creates a new instance of the GPU state.
|
||||
/// </summary>
|
||||
public GpuState()
|
||||
/// <param name="channel">Channel that the sub-channel state belongs to</param>
|
||||
public GpuState(GpuChannel channel)
|
||||
{
|
||||
Channel = channel;
|
||||
|
||||
_memory = new int[RegistersCount];
|
||||
_shadow = new int[RegistersCount];
|
||||
|
||||
|
@ -221,6 +230,21 @@ namespace Ryujinx.Graphics.Gpu.State
|
|||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Forces a full host state update by marking all state as modified,
|
||||
/// and also requests all GPU resources in use to be rebound.
|
||||
/// </summary>
|
||||
public void ForceAllDirty()
|
||||
{
|
||||
for (int index = 0; index < _registers.Length; index++)
|
||||
{
|
||||
_registers[index].Modified = true;
|
||||
}
|
||||
|
||||
Channel.BufferManager.Rebind();
|
||||
Channel.TextureManager.Rebind();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Checks if a given register has been modified since the last call to this method.
|
||||
/// </summary>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue