Implement Force Early Z Register (#1755)
This commit is contained in:
@@ -332,6 +332,23 @@ namespace Ryujinx.Graphics.Gpu.Shader.Cache
|
||||
return null;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Builds gpu state flags using information from the given gpu accessor.
|
||||
/// </summary>
|
||||
/// <param name="gpuAccessor">The gpu accessor</param>
|
||||
/// <returns>The gpu state flags</returns>
|
||||
private static GuestGpuStateFlags GetGpuStateFlags(IGpuAccessor gpuAccessor)
|
||||
{
|
||||
GuestGpuStateFlags flags = 0;
|
||||
|
||||
if (gpuAccessor.QueryEarlyZForce())
|
||||
{
|
||||
flags |= GuestGpuStateFlags.EarlyZForce;
|
||||
}
|
||||
|
||||
return flags;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Create a new instance of <see cref="GuestGpuAccessorHeader"/> from an gpu accessor.
|
||||
/// </summary>
|
||||
@@ -347,6 +364,7 @@ namespace Ryujinx.Graphics.Gpu.Shader.Cache
|
||||
ComputeLocalMemorySize = gpuAccessor.QueryComputeLocalMemorySize(),
|
||||
ComputeSharedMemorySize = gpuAccessor.QueryComputeSharedMemorySize(),
|
||||
PrimitiveTopology = gpuAccessor.QueryPrimitiveTopology(),
|
||||
StateFlags = GetGpuStateFlags(gpuAccessor)
|
||||
};
|
||||
}
|
||||
|
||||
|
@@ -55,8 +55,8 @@ namespace Ryujinx.Graphics.Gpu.Shader.Cache.Definition
|
||||
public ushort Reserved2;
|
||||
|
||||
/// <summary>
|
||||
/// Unused/reserved.
|
||||
/// GPU boolean state that can influence shader compilation.
|
||||
/// </summary>
|
||||
public byte Reserved3;
|
||||
public GuestGpuStateFlags StateFlags;
|
||||
}
|
||||
}
|
||||
|
@@ -0,0 +1,10 @@
|
||||
using System;
|
||||
|
||||
namespace Ryujinx.Graphics.Gpu.Shader.Cache.Definition
|
||||
{
|
||||
[Flags]
|
||||
enum GuestGpuStateFlags : byte
|
||||
{
|
||||
EarlyZForce = 1 << 0
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user