From f93a8a995b6e16625c60303ccabb0ea71e7dbeb2 Mon Sep 17 00:00:00 2001 From: JosJuice Date: Sat, 22 Aug 2026 11:22:33 +0200 Subject: Common: Add DivideRoundingUp function Many callers of AlignUp are dividing immediately after aligning. Let's add a helper function for this so callers don't have to specify the alignment size twice. --- Source/Core/VideoBackends/Vulkan/VKTexture.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Source/Core/VideoBackends/Vulkan/VKTexture.cpp') diff --git a/Source/Core/VideoBackends/Vulkan/VKTexture.cpp b/Source/Core/VideoBackends/Vulkan/VKTexture.cpp index ee6a1b77b3..ea7472597b 100644 --- a/Source/Core/VideoBackends/Vulkan/VKTexture.cpp +++ b/Source/Core/VideoBackends/Vulkan/VKTexture.cpp @@ -378,7 +378,7 @@ void VKTexture::Load(u32 level, u32 width, u32 height, u32 row_length, const u8* // that lie outside of the texture's dimensions. const u32 upload_alignment = static_cast(g_vulkan_context->GetBufferImageGranularity()); const u32 block_size = GetBlockSizeForFormat(GetFormat()); - const u32 num_rows = Common::AlignUp(height, block_size) / block_size; + const u32 num_rows = Common::DivideRoundingUp(height, block_size); const u32 source_pitch = CalculateStrideForFormat(m_config.format, row_length); const u32 upload_size = source_pitch * num_rows; std::unique_ptr temp_buffer; -- cgit v1.2.3