pcsx2 icon indicating copy to clipboard operation
pcsx2 copied to clipboard

ChdFileReader: implement precaching of CHD files within PCSX2 instead of modifying libchdr

Open TheLastRar opened this issue 1 year ago • 2 comments

Description of Changes

Removes the patches applied to libchdr, and instead uses libchdr's virtual IO API to achieve the same behaviour.

Rationale behind Changes

Such patches can be missed when updating dependencies, potentially leading to difficulty updating.

We now also precache parent CHD files, which the patched libchdr did not.

Includes on https://github.com/PCSX2/pcsx2/pull/12075

Suggested Testing Steps

Test precaching using CHD files

TheLastRar avatar Dec 14 '24 19:12 TheLastRar

I know it's not ready for review, but I was curious and ran it through a profiler and verified that there is no significant performance decrease or increase. We are still fread() bound.

F0bes avatar Dec 14 '24 21:12 F0bes

Marking this as ready.

I'm not yet 100% sure on FileSystem::ReadFileWithPartialProgress, so I'm open to suggestions if anyone has a better idea, but if you think it's fine then I'm happy with it.

TheLastRar avatar Dec 16 '24 15:12 TheLastRar