mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-04 17:10:47 +00:00
Work around poor D3D12 behaviour to return unusable Desc. Closes #3728
* For some cases D3D12's GetDesc() returns a desc that is not usable for resource creation, and must instead be modified to work.
This commit is contained in:
@@ -1536,7 +1536,15 @@ public:
|
||||
//////////////////////////////
|
||||
// implement ID3D12Resource
|
||||
|
||||
virtual D3D12_RESOURCE_DESC STDMETHODCALLTYPE GetDesc() { return m_pReal->GetDesc(); }
|
||||
virtual D3D12_RESOURCE_DESC STDMETHODCALLTYPE GetDesc()
|
||||
{
|
||||
D3D12_RESOURCE_DESC ret = m_pReal->GetDesc();
|
||||
// normalise alignment - sometimes D3D12 returns an alignment that is invalid to use
|
||||
if(ret.Dimension == D3D12_RESOURCE_DIMENSION_BUFFER &&
|
||||
ret.Alignment != D3D12_DEFAULT_RESOURCE_PLACEMENT_ALIGNMENT)
|
||||
ret.Alignment = 0;
|
||||
return ret;
|
||||
}
|
||||
virtual D3D12_GPU_VIRTUAL_ADDRESS STDMETHODCALLTYPE GetGPUVirtualAddress()
|
||||
{
|
||||
return m_pReal->GetGPUVirtualAddress();
|
||||
|
||||
Reference in New Issue
Block a user