mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-04 09:00:44 +00:00
Tight alignment D3D12 bug workaround should apply to textures as well
This commit is contained in:
@@ -246,6 +246,7 @@ bool D3D12ResourceManager::Prepare_InitialState(ID3D12DeviceChild *res)
|
||||
const bool isUploadHeap = (heapProps.Type == D3D12_HEAP_TYPE_UPLOAD);
|
||||
|
||||
desc.Flags = D3D12_RESOURCE_FLAG_NONE;
|
||||
desc.Alignment = 0;
|
||||
|
||||
ID3D12Resource *copyDst = NULL;
|
||||
hr = m_Device->CreateInitialStateBuffer(desc, ©Dst);
|
||||
@@ -437,6 +438,10 @@ bool D3D12ResourceManager::Prepare_InitialState(ID3D12DeviceChild *res)
|
||||
desc.Flags &= ~D3D12_RESOURCE_FLAG_ALLOW_UNORDERED_ACCESS;
|
||||
}
|
||||
|
||||
// normalise alignment - sometimes D3D12 returns an alignment that is invalid to use
|
||||
if(desc.Flags & D3D12_RESOURCE_FLAG_USE_TIGHT_ALIGNMENT)
|
||||
desc.Alignment = 0;
|
||||
|
||||
for(UINT i = 0; i < numSubresources; i++)
|
||||
{
|
||||
// skip non-MSAA sparse subresources that are not mapped at all
|
||||
@@ -2133,6 +2138,9 @@ void D3D12ResourceManager::Apply_InitialState(ID3D12DeviceChild *res, D3D12Initi
|
||||
else
|
||||
{
|
||||
D3D12_RESOURCE_DESC desc = unwrappedCopyDst->GetDesc();
|
||||
// normalise alignment - sometimes D3D12 returns an alignment that is invalid to use
|
||||
if(desc.Flags & D3D12_RESOURCE_FLAG_USE_TIGHT_ALIGNMENT)
|
||||
desc.Alignment = 0;
|
||||
|
||||
UINT numSubresources = desc.MipLevels;
|
||||
if(desc.Dimension != D3D12_RESOURCE_DIMENSION_TEXTURE3D)
|
||||
|
||||
@@ -1640,6 +1640,8 @@ public:
|
||||
if(ret.Dimension == D3D12_RESOURCE_DIMENSION_BUFFER &&
|
||||
ret.Alignment != D3D12_DEFAULT_RESOURCE_PLACEMENT_ALIGNMENT)
|
||||
ret.Alignment = 0;
|
||||
if(ret.Flags & D3D12_RESOURCE_FLAG_USE_TIGHT_ALIGNMENT)
|
||||
ret.Alignment = 0;
|
||||
return ret;
|
||||
}
|
||||
virtual D3D12_GPU_VIRTUAL_ADDRESS STDMETHODCALLTYPE GetGPUVirtualAddress()
|
||||
|
||||
Reference in New Issue
Block a user