mirror of
https://github.com/microsoft/DirectXTex.git
synced 2026-02-04 12:16:14 +01:00
Fix of CaptureTexture for Reserved and MultiSample resources (#218)
This commit is contained in:
@@ -691,12 +691,8 @@ namespace
|
||||
return HRESULT_E_NOT_SUPPORTED;
|
||||
|
||||
D3D12_HEAP_PROPERTIES sourceHeapProperties;
|
||||
D3D12_HEAP_FLAGS sourceHeapFlags;
|
||||
HRESULT hr = pSource->GetHeapProperties(&sourceHeapProperties, &sourceHeapFlags);
|
||||
if (FAILED(hr))
|
||||
return hr;
|
||||
|
||||
if (sourceHeapProperties.Type == D3D12_HEAP_TYPE_READBACK)
|
||||
HRESULT hr = pSource->GetHeapProperties(&sourceHeapProperties, nullptr);
|
||||
if (SUCCEEDED(hr) && sourceHeapProperties.Type == D3D12_HEAP_TYPE_READBACK)
|
||||
{
|
||||
// Handle case where the source is already a staging texture we can use directly
|
||||
pStaging = pSource;
|
||||
@@ -745,6 +741,7 @@ namespace
|
||||
auto descCopy = desc;
|
||||
descCopy.SampleDesc.Count = 1;
|
||||
descCopy.SampleDesc.Quality = 0;
|
||||
descCopy.Alignment = D3D12_DEFAULT_RESOURCE_PLACEMENT_ALIGNMENT;
|
||||
|
||||
ComPtr<ID3D12Resource> pTemp;
|
||||
hr = device->CreateCommittedResource(
|
||||
|
||||
Reference in New Issue
Block a user