mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-05 17:40:39 +00:00
Remove manual pitch calculation.
Since the pitch is calculated by GetResourcePitchForSubresource, there is no need to calculate it manually, or even erroneously as were the case by using the resource pitch determined by the D3D11 API.
This commit is contained in:
committed by
Baldur Karlsson
parent
a091dea6f8
commit
da650b0481
@@ -286,7 +286,7 @@ uint32_t WrappedID3D11Device::GetSize_InitialState(ResourceId id, ID3D11DeviceCh
|
||||
// pessimistic DepthPitch alignment
|
||||
const UINT WorstDepthPitchAlign = 256;
|
||||
|
||||
ResourcePitch pitch = {WorstRowPitchAlign, WorstDepthPitchAlign};
|
||||
ResourcePitch pitch = {};
|
||||
|
||||
D3D11ResourceType type = IdentifyTypeByPtr(res);
|
||||
|
||||
@@ -362,14 +362,11 @@ uint32_t WrappedID3D11Device::GetSize_InitialState(ResourceId id, ID3D11DeviceCh
|
||||
numRows = AlignUp4(numRows) / 4;
|
||||
|
||||
if(stage)
|
||||
{
|
||||
pitch = GetResourcePitchForSubresource(m_pImmediateContext->GetReal(), stage, sub);
|
||||
else
|
||||
pitch = {WorstRowPitchAlign, WorstDepthPitchAlign};
|
||||
ret += pitch.m_RowPitch * numRows;
|
||||
}
|
||||
|
||||
const UINT RowPitch = GetByteSize(desc.Width, 1, 1, desc.Format, mip);
|
||||
const UINT WorstRowPitch = AlignUp(RowPitch, pitch.m_RowPitch);
|
||||
|
||||
ret += WorstRowPitch * numRows;
|
||||
ret += (uint32_t)WriteSerialiser::GetChunkAlignment();
|
||||
}
|
||||
}
|
||||
@@ -394,21 +391,11 @@ uint32_t WrappedID3D11Device::GetSize_InitialState(ResourceId id, ID3D11DeviceCh
|
||||
UINT mip = GetMipForSubresource(tex, sub);
|
||||
|
||||
if(stage)
|
||||
{
|
||||
pitch = GetResourcePitchForSubresource(m_pImmediateContext->GetReal(), stage, sub);
|
||||
else
|
||||
pitch = {WorstRowPitchAlign, WorstDepthPitchAlign};
|
||||
ret += pitch.m_DepthPitch * RDCMAX(1U, desc.Depth >> mip);
|
||||
}
|
||||
|
||||
uint32_t numRows = RDCMAX(1U, desc.Height >> mip);
|
||||
if(IsBlockFormat(desc.Format))
|
||||
numRows = AlignUp4(numRows) / 4;
|
||||
|
||||
const UINT RowPitch = GetByteSize(desc.Width, 1, 1, desc.Format, mip);
|
||||
const UINT WorstRowPitch = AlignUp(RowPitch, pitch.m_RowPitch);
|
||||
|
||||
const UINT DepthPitch = WorstRowPitch * numRows;
|
||||
const UINT WorstDepthPitch = AlignUp(DepthPitch, pitch.m_DepthPitch);
|
||||
|
||||
ret += WorstDepthPitch * RDCMAX(1U, desc.Depth >> mip);
|
||||
ret += (uint32_t)WriteSerialiser::GetChunkAlignment();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user