Mesa (main): dzn: Remove the cast when the SDK version is high enough

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Fri Jul 15 16:54:58 UTC 2022


Module: Mesa
Branch: main
Commit: 489ab1aa3bfe7397e2c0ccd8480f77955c201305
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=489ab1aa3bfe7397e2c0ccd8480f77955c201305

Author: Jesse Natalie <jenatali at microsoft.com>
Date:   Thu Jul 14 14:58:25 2022 -0700

dzn: Remove the cast when the SDK version is high enough

Reviewed-by: Bill Kristiansen <billkris at microsoft.com>
Reviewed-by: Sil Vilerino <sivileri at microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17548>

---

 src/microsoft/vulkan/dzn_abi_helper.h | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/src/microsoft/vulkan/dzn_abi_helper.h b/src/microsoft/vulkan/dzn_abi_helper.h
index dad871cd69c..ece2b55046d 100644
--- a/src/microsoft/vulkan/dzn_abi_helper.h
+++ b/src/microsoft/vulkan/dzn_abi_helper.h
@@ -40,6 +40,8 @@ dzn_ID3D12Device2_GetCustomHeapProperties(ID3D12Device2 *dev, UINT node_mask, D3
     D3D12_HEAP_PROPERTIES ret;
 #ifdef _WIN32
     ID3D12Device2_GetCustomHeapProperties(dev, &ret, node_mask, type);
+#elif D3D12_SDK_VERSION >= 606
+    ret = ID3D12Device2_GetCustomHeapProperties(dev, node_mask, type);
 #else
     ret = ((D3D12_HEAP_PROPERTIES (STDMETHODCALLTYPE *)(ID3D12Device2 *, UINT, D3D12_HEAP_TYPE))dev->lpVtbl->GetCustomHeapProperties)(dev, node_mask, type);
 #endif
@@ -52,6 +54,8 @@ dzn_ID3D12Device2_GetResourceAllocationInfo(ID3D12Device2 *dev, UINT visible_mas
     D3D12_RESOURCE_ALLOCATION_INFO ret;
 #ifdef _WIN32
     ID3D12Device2_GetResourceAllocationInfo(dev, &ret, visible_mask, num_resource_descs, resource_descs);
+#elif D3D12_SDK_VERSION >= 606
+    ret = ID3D12Device2_GetResourceAllocationInfo(dev, visible_mask, num_resource_descs, resource_descs);
 #else
     ret = ((D3D12_RESOURCE_ALLOCATION_INFO (STDMETHODCALLTYPE *)(ID3D12Device2 *, UINT, UINT, const D3D12_RESOURCE_DESC *))
         dev->lpVtbl->GetResourceAllocationInfo)(dev, visible_mask, num_resource_descs, resource_descs);
@@ -65,6 +69,8 @@ dzn_ID3D12Resource_GetDesc(ID3D12Resource *res)
     D3D12_RESOURCE_DESC ret;
 #ifdef _WIN32
     ID3D12Resource_GetDesc(res, &ret);
+#elif D3D12_SDK_VERSION >= 606
+    ret = ID3D12Resource_GetDesc(res);
 #else
     ret = ((D3D12_RESOURCE_DESC (STDMETHODCALLTYPE *)(ID3D12Resource *))res->lpVtbl->GetDesc)(res);
 #endif
@@ -77,6 +83,8 @@ dzn_ID3D12DescriptorHeap_GetCPUDescriptorHandleForHeapStart(ID3D12DescriptorHeap
     D3D12_CPU_DESCRIPTOR_HANDLE ret;
 #ifdef _WIN32
     ID3D12DescriptorHeap_GetCPUDescriptorHandleForHeapStart(heap, &ret);
+#elif D3D12_SDK_VERSION >= 606
+    ret = ID3D12DescriptorHeap_GetCPUDescriptorHandleForHeapStart(heap);
 #else
     ret = ((D3D12_CPU_DESCRIPTOR_HANDLE (STDMETHODCALLTYPE *)(ID3D12DescriptorHeap *))heap->lpVtbl->GetCPUDescriptorHandleForHeapStart)(heap);
 #endif
@@ -89,6 +97,8 @@ dzn_ID3D12DescriptorHeap_GetGPUDescriptorHandleForHeapStart(ID3D12DescriptorHeap
     D3D12_GPU_DESCRIPTOR_HANDLE ret;
 #ifdef _WIN32
     ID3D12DescriptorHeap_GetGPUDescriptorHandleForHeapStart(heap, &ret);
+#elif D3D12_SDK_VERSION >= 606
+    ret = ID3D12DescriptorHeap_GetGPUDescriptorHandleForHeapStart(heap);
 #else
     ret = ((D3D12_GPU_DESCRIPTOR_HANDLE (STDMETHODCALLTYPE *)(ID3D12DescriptorHeap *))heap->lpVtbl->GetGPUDescriptorHandleForHeapStart)(heap);
 #endif



More information about the mesa-commit mailing list