summaryrefslogtreecommitdiff
path: root/Source/Core/VideoBackends/D3D12/PSTextureEncoder.cpp
diff options
context:
space:
mode:
authorLéo Lam <leo@innovatetechnologi.es>2016-11-27 11:56:22 +0100
committerLéo Lam <leo@innovatetechnologi.es>2016-12-06 20:33:53 +0100
commit31ccfffd386cdf7bfafdccda240a179431ecc98c (patch)
tree820bdb640091e5726e4c52d42f819956f82bfd28 /Source/Core/VideoBackends/D3D12/PSTextureEncoder.cpp
parent7192789c1162e2deb5923151d05158f459448ab9 (diff)
Common: Add alignment header
Gets rid of duplicated alignment code.
Diffstat (limited to 'Source/Core/VideoBackends/D3D12/PSTextureEncoder.cpp')
-rw-r--r--Source/Core/VideoBackends/D3D12/PSTextureEncoder.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/Source/Core/VideoBackends/D3D12/PSTextureEncoder.cpp b/Source/Core/VideoBackends/D3D12/PSTextureEncoder.cpp
index 25c5dd92c5..f95c1528eb 100644
--- a/Source/Core/VideoBackends/D3D12/PSTextureEncoder.cpp
+++ b/Source/Core/VideoBackends/D3D12/PSTextureEncoder.cpp
@@ -3,6 +3,7 @@
// Refer to the license.txt file included.
#include "VideoBackends/D3D12/PSTextureEncoder.h"
+#include "Common/Align.h"
#include "Core/HW/Memmap.h"
#include "VideoBackends/D3D12/D3DBase.h"
#include "VideoBackends/D3D12/D3DCommandListManager.h"
@@ -62,7 +63,7 @@ void PSTextureEncoder::Init()
CheckHR(D3D::device12->CreateCommittedResource(
&CD3DX12_HEAP_PROPERTIES(D3D12_HEAP_TYPE_READBACK), D3D12_HEAP_FLAG_NONE,
&CD3DX12_RESOURCE_DESC::Buffer(
- D3D::AlignValue(static_cast<unsigned int>(out_tex_desc.Width) * 4,
+ Common::AlignUp(static_cast<unsigned int>(out_tex_desc.Width) * 4,
D3D12_TEXTURE_DATA_PITCH_ALIGNMENT) *
out_tex_desc.Height),
D3D12_RESOURCE_STATE_COPY_DEST, nullptr, IID_PPV_ARGS(&m_out_readback_buffer)));
@@ -179,7 +180,7 @@ void PSTextureEncoder::Encode(u8* dst, u32 format, u32 native_width, u32 bytes_p
dst_location.PlacedFootprint.Footprint.Width = EFB_WIDTH * 4;
dst_location.PlacedFootprint.Footprint.Height = EFB_HEIGHT / 4;
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 = {};