d3d12: Add GetDesc wrapper for ID3D12Heap

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/10779
Fixes: 55e377e965 ("d3d12: Add partial media, compute, graphics support with CORE and GENERIC feature levels")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28074>
This commit is contained in:
Sil Vilerino 2024-03-08 07:30:04 -05:00 committed by Marge Bot
parent 089cb522be
commit 1b6d7ab80b
2 changed files with 13 additions and 1 deletions

View file

@ -63,6 +63,11 @@ GetGPUDescriptorHandleForHeapStart(ID3D12DescriptorHeap *heap)
{
return heap->GetGPUDescriptorHandleForHeapStart();
}
D3D12_HEAP_DESC
inline GetDesc(ID3D12Heap* heap)
{
return heap->GetDesc();
}
inline D3D12_RESOURCE_DESC
GetDesc(ID3D12Resource *res)
{
@ -98,6 +103,13 @@ GetGPUDescriptorHandleForHeapStart(ID3D12DescriptorHeap *heap)
heap->GetGPUDescriptorHandleForHeapStart(&ret);
return ret;
}
D3D12_HEAP_DESC
inline GetDesc(ID3D12Heap* heap)
{
D3D12_HEAP_DESC ret;
heap->GetDesc(&ret);
return ret;
}
inline D3D12_RESOURCE_DESC
GetDesc(ID3D12Resource *res)
{

View file

@ -304,7 +304,7 @@ init_texture(struct d3d12_screen *screen,
D3D12_FEATURE_DATA_PLACED_RESOURCE_SUPPORT_INFO capData;
capData.Dimension = desc.Dimension;
capData.Format = desc.Format;
capData.DestHeapProperties = heap->GetDesc().Properties;
capData.DestHeapProperties = GetDesc(heap).Properties;
capData.Supported = false;
if (FAILED(screen->dev->CheckFeatureSupport(D3D12_FEATURE_PLACED_RESOURCE_SUPPORT_INFO, &capData, sizeof(capData))) || !capData.Supported) {
debug_printf("D3D12: d3d12_resource_create_or_place cannot place a resource since D3D12_FEATURE_DATA_PLACED_RESOURCE_SUPPORT_INFO is not supported\n");