mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-12-04 03:33:44 +01:00
Revive old alignment utility functions, give them better names.
This commit is contained in:
1 parent
f2df336f79
commit
33b87578c5
6 files changed
+31
-19
No files matched your search
@@ -582,8 +582,9 @@ void TextureCacheVulkan::BuildTexture(TexCacheEntry *const entry) {
|
||||
plan.GetMipSize(i, &mipWidth, &mipHeight);
|
||||
|
||||
int bpp = VkFormatBytesPerPixel(actualFmt);
|
||||
int optimalStrideAlignment = std::max(4, (int)vulkan->GetPhysicalDeviceProperties().properties.limits.optimalBufferCopyRowPitchAlignment);
|
||||
int byteStride = RoundUpToPowerOf2(mipWidth * bpp, optimalStrideAlignment); // output stride
|
||||
// RoundToNextPowerOf2 is probably not necessary as the optimal alignment is gonna be a power of 2.
|
||||
int optimalStrideAlignment = RoundToNextPowerOf2(std::max(4, (int)vulkan->GetPhysicalDeviceProperties().properties.limits.optimalBufferCopyRowPitchAlignment));
|
||||
int byteStride = RoundUpToMultipleOf(mipWidth * bpp, optimalStrideAlignment); // output stride
|
||||
int pixelStride = byteStride / bpp;
|
||||
int uploadSize = byteStride * mipHeight;
|
||||
|
||||
|
||||
Reference in new issue
Block a user