Get rid of redundancies (#260)

This commit is contained in:
cristei 2021-11-24 01:37:57 +02:00 committed by GitHub
parent 7a08ff19fc
commit bcf514174c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 13 deletions

View File

@ -759,17 +759,9 @@ HRESULT DirectX::CaptureTexture(
return E_FAIL; return E_FAIL;
} }
UINT arraySize, depth; UINT arraySize = (desc.Dimension == D3D12_RESOURCE_DIMENSION_TEXTURE3D)
if (desc.Dimension == D3D12_RESOURCE_DIMENSION_TEXTURE3D) ? 1
{ : desc.DepthOrArraySize;
arraySize = 1;
depth = desc.DepthOrArraySize;
}
else
{
arraySize = desc.DepthOrArraySize;
depth = 1;
}
for (UINT plane = 0; plane < numberOfPlanes; ++plane) for (UINT plane = 0; plane < numberOfPlanes; ++plane)
{ {

View File

@ -361,8 +361,6 @@ namespace
if (FAILED(hr)) if (FAILED(hr))
return hr; return hr;
blobSize = mBlob.GetBufferSize();
auto ptr = static_cast<uint8_t*>(mBlob.GetBufferPointer()); auto ptr = static_cast<uint8_t*>(mBlob.GetBufferPointer());
if (m_streamEOF < size.LowPart) if (m_streamEOF < size.LowPart)
{ {