From 31ccfffd386cdf7bfafdccda240a179431ecc98c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9o=20Lam?= Date: Sun, 27 Nov 2016 11:56:22 +0100 Subject: Common: Add alignment header Gets rid of duplicated alignment code. --- Source/Core/VideoBackends/D3D12/Render.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'Source/Core/VideoBackends/D3D12/Render.cpp') diff --git a/Source/Core/VideoBackends/D3D12/Render.cpp b/Source/Core/VideoBackends/D3D12/Render.cpp index 2bfe8d3a07..be65d04f4b 100644 --- a/Source/Core/VideoBackends/D3D12/Render.cpp +++ b/Source/Core/VideoBackends/D3D12/Render.cpp @@ -9,6 +9,7 @@ #include #include +#include "Common/Align.h" #include "Common/CommonTypes.h" #include "Common/FileUtil.h" #include "Common/MathUtil.h" @@ -180,7 +181,7 @@ void CreateScreenshotTexture() // This texture is released to be recreated when the window is resized in Renderer::SwapImpl. const unsigned int screenshot_buffer_size = - D3D::AlignValue(D3D::GetBackBufferWidth() * 4, D3D12_TEXTURE_DATA_PITCH_ALIGNMENT) * + Common::AlignUp(D3D::GetBackBufferWidth() * 4, D3D12_TEXTURE_DATA_PITCH_ALIGNMENT) * D3D::GetBackBufferHeight(); CheckHR(D3D::device12->CreateCommittedResource( @@ -757,7 +758,7 @@ void Renderer::SwapImpl(u32 xfb_addr, u32 fb_width, u32 fb_stride, u32 fb_height dst_location.PlacedFootprint.Footprint.Width = GetTargetRectangle().GetWidth(); dst_location.PlacedFootprint.Footprint.Height = GetTargetRectangle().GetHeight(); dst_location.PlacedFootprint.Footprint.Depth = 1; - dst_location.PlacedFootprint.Footprint.RowPitch = D3D::AlignValue( + dst_location.PlacedFootprint.Footprint.RowPitch = Common::AlignUp( dst_location.PlacedFootprint.Footprint.Width * 4, D3D12_TEXTURE_DATA_PITCH_ALIGNMENT); D3D12_TEXTURE_COPY_LOCATION src_location = {}; -- cgit v1.2.3