Address feedback from previous PR

This commit is contained in:
Henrik Rydgård 2023-03-12 23:14:20 +01:00
parent f88633b696
commit 1860a73d58
4 changed files with 6 additions and 10 deletions

View File

@ -111,8 +111,8 @@ void ParallelRangeLoop(ThreadManager *threadMan, const std::function<void(int, i
// NOTE: Supports a max of 2GB.
void ParallelMemcpy(ThreadManager *threadMan, void *dst, const void *src, size_t bytes, TaskPriority priority) {
// This threshold can probably be a lot bigger.
if (bytes < 512) {
// This threshold should be the same as the minimum split below, 128kb.
if (bytes < 128 * 1024) {
memcpy(dst, src, bytes);
return;
}
@ -129,7 +129,7 @@ void ParallelMemcpy(ThreadManager *threadMan, void *dst, const void *src, size_t
// NOTE: Supports a max of 2GB.
void ParallelMemset(ThreadManager *threadMan, void *dst, uint8_t value, size_t bytes, TaskPriority priority) {
// This threshold can probably be a lot bigger.
if (bytes < 512) {
if (bytes < 128 * 1024) {
memset(dst, 0, bytes);
return;
}

View File

@ -561,8 +561,7 @@ bool ReplacedTexture::CopyLevelTo(int level, void *out, int rowPitch) {
}
} else {
// TODO: Add sanity checks here for other formats?
// Just gonna do a memcpy, slightly scared of the parallel ones.
memcpy(out, data.data(), data.size());
ParallelMemcpy(&g_threadManager, out, data.data(), data.size());
}
return true;

View File

@ -455,9 +455,6 @@ void TextureCacheVulkan::BuildTexture(TexCacheEntry *const entry) {
Draw::DataFormat fmt = plan.replaced->Format();
bcFormat = Draw::DataFormatIsBlockCompressed(fmt, &bcAlign);
actualFmt = ToVulkanFormat(fmt);
if (actualFmt != VULKAN_8888_FORMAT) {
actualFmt = actualFmt;
}
}
bool computeUpload = false;