HLE: Detect video buffer copies.

These are common and can help us notify the texture cache appropriately.
This commit is contained in:
Unknown W. Brackets committed 2021-09-19 07:51:33 -07:00
1 parent 2d9719ed26
commit ec3d408da0
1 file changed
+14
+14
View File
@@ -160,6 +160,13 @@ static int Replace_memcpy() {
NotifyMemInfo(MemBlockFlags::READ, srcPtr, bytes, tag.c_str(), tag.size());
NotifyMemInfo(MemBlockFlags::WRITE, destPtr, bytes, tag.c_str(), tag.size());
// It's pretty common that games will copy video data.
if (tag == "ReplaceMemcpy/VideoDecode" || tag == "ReplaceMemcpy/VideoDecodeRange") {
if (bytes == 512 * 272 * 4) {
gpu->NotifyVideoUpload(destPtr, bytes, 512, GE_FORMAT_8888);
}
}
return 10 + bytes / 4; // approximation
}
@@ -203,6 +210,13 @@ static int Replace_memcpy_jak() {
NotifyMemInfo(MemBlockFlags::READ, srcPtr, bytes, tag.c_str(), tag.size());
NotifyMemInfo(MemBlockFlags::WRITE, destPtr, bytes, tag.c_str(), tag.size());
// It's pretty common that games will copy video data.
if (tag == "ReplaceMemcpy/VideoDecode" || tag == "ReplaceMemcpy/VideoDecodeRange") {
if (bytes == 512 * 272 * 4) {
gpu->NotifyVideoUpload(destPtr, bytes, 512, GE_FORMAT_8888);
}
}
return 5 + bytes * 8 + 2; // approximation. This is a slow memcpy - a byte copy loop..
}