mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-24 14:49:42 -06:00
Common: Add alignment header
Gets rid of duplicated alignment code.
This commit is contained in:
@ -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 = {};
|
||||
|
Reference in New Issue
Block a user