mirror of
https://github.com/par274/sharpemu.git
synced 2026-09-01 22:31:17 +08:00
[shader] add scalar memory fallback
This commit is contained in:
@@ -27,7 +27,7 @@ internal static class AgcShaderCompilerHooks
|
||||
internal static void Install()
|
||||
{
|
||||
Gen5ShaderScalarEvaluator.FallbackMemoryReader =
|
||||
KernelMemoryCompatExports.TryReadTrackedLibcHeap;
|
||||
KernelMemoryCompatExports.TryReadShaderGuestMemory;
|
||||
Gen5ShaderScalarEvaluator.GlobalMemoryPool =
|
||||
GuestDataPool.Shared;
|
||||
}
|
||||
|
||||
@@ -2350,7 +2350,8 @@ public static class Gen5ShaderScalarEvaluator
|
||||
private static bool TryReadUInt32(CpuContext ctx, ulong address, out uint value)
|
||||
{
|
||||
Span<byte> bytes = stackalloc byte[sizeof(uint)];
|
||||
if (!ctx.Memory.TryRead(address, bytes))
|
||||
if (!ctx.Memory.TryRead(address, bytes) &&
|
||||
FallbackMemoryReader?.Invoke(address, bytes) != true)
|
||||
{
|
||||
value = 0;
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user