mirror of
https://github.com/skyline-emu/skyline.git
synced 2024-11-23 01:19:16 +01:00
Avoid page faults when using the fallback shader size
These occured in some homebrew otherwise.
This commit is contained in:
parent
10e7e6272a
commit
198e9e8e48
@ -100,7 +100,16 @@ namespace skyline::gpu::interconnect {
|
|||||||
size_t storageOffset{splitBinaryStorage.size()};
|
size_t storageOffset{splitBinaryStorage.size()};
|
||||||
splitBinaryStorage.resize(storageOffset + FallbackSize);
|
splitBinaryStorage.resize(storageOffset + FallbackSize);
|
||||||
auto shaderStorage{span{splitBinaryStorage}.subspan(storageOffset, FallbackSize)};
|
auto shaderStorage{span{splitBinaryStorage}.subspan(storageOffset, FallbackSize)};
|
||||||
ctx.channelCtx.asCtx->gmmu.Read(shaderStorage, programBase + programOffset);
|
auto mappings{ctx.channelCtx.asCtx->gmmu.TranslateRange(programBase + programOffset, storageOffset + FallbackSize)};
|
||||||
|
u8 *shaderStoragePtr{shaderStorage.data()};
|
||||||
|
for (auto mapping : mappings) {
|
||||||
|
if (!mapping.valid())
|
||||||
|
break;
|
||||||
|
|
||||||
|
std::memcpy(shaderStoragePtr, mapping.data(), mapping.size());
|
||||||
|
shaderStoragePtr += mapping.size();
|
||||||
|
}
|
||||||
|
|
||||||
binary.binary = shaderStorage;
|
binary.binary = shaderStorage;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user