Path: blob/master/thirdparty/directx_headers/patches/0002-win7-8-dynamic-load.patch
9903 views
diff --git a/thirdparty/directx_headers/include/directx/d3dx12_root_signature.h b/thirdparty/directx_headers/include/directx/d3dx12_root_signature.h1index 572efed852..2da79d10f1 1006442--- a/thirdparty/directx_headers/include/directx/d3dx12_root_signature.h3+++ b/thirdparty/directx_headers/include/directx/d3dx12_root_signature.h4@@ -996,6 +996,7 @@ struct CD3DX12_GPU_DESCRIPTOR_HANDLE : public D3D12_GPU_DESCRIPTOR_HANDLE5// two code paths for building root signatures, this helper method reconstructs a 1.0 signature when6// 1.1 is not supported.7inline HRESULT D3DX12SerializeVersionedRootSignature(8+ _In_ HMODULE pLibD3D12,9_In_ const D3D12_VERSIONED_ROOT_SIGNATURE_DESC* pRootSignatureDesc,10D3D_ROOT_SIGNATURE_VERSION MaxVersion,11_Outptr_ ID3DBlob** ppBlob,12@@ -1006,13 +1007,18 @@ inline HRESULT D3DX12SerializeVersionedRootSignature(13*ppErrorBlob = nullptr;14}1516+ PFN_D3D12_SERIALIZE_ROOT_SIGNATURE d3d_D3D12SerializeRootSignature = (PFN_D3D12_SERIALIZE_ROOT_SIGNATURE)(void *)GetProcAddress(pLibD3D12, "D3D12SerializeRootSignature");17+ if (d3d_D3D12SerializeRootSignature == nullptr) {18+ return E_INVALIDARG;19+ }20+ PFN_D3D12_SERIALIZE_VERSIONED_ROOT_SIGNATURE d3d_D3D12SerializeVersionedRootSignature = (PFN_D3D12_SERIALIZE_VERSIONED_ROOT_SIGNATURE)(void *)GetProcAddress(pLibD3D12, "D3D12SerializeVersionedRootSignature");21switch (MaxVersion)22{23case D3D_ROOT_SIGNATURE_VERSION_1_0:24switch (pRootSignatureDesc->Version)25{26case D3D_ROOT_SIGNATURE_VERSION_1_0:27- return D3D12SerializeRootSignature(&pRootSignatureDesc->Desc_1_0, D3D_ROOT_SIGNATURE_VERSION_1, ppBlob, ppErrorBlob);28+ return d3d_D3D12SerializeRootSignature(&pRootSignatureDesc->Desc_1_0, D3D_ROOT_SIGNATURE_VERSION_1, ppBlob, ppErrorBlob);2930case D3D_ROOT_SIGNATURE_VERSION_1_1:31#if defined(D3D12_SDK_VERSION) && (D3D12_SDK_VERSION >= 609)32@@ -1114,7 +1120,7 @@ inline HRESULT D3DX12SerializeVersionedRootSignature(33if (SUCCEEDED(hr))34{35const CD3DX12_ROOT_SIGNATURE_DESC desc_1_0(desc_1_1.NumParameters, pParameters_1_0, desc_1_1.NumStaticSamplers, pStaticSamplers == nullptr ? desc_1_1.pStaticSamplers : pStaticSamplers, desc_1_1.Flags);36- hr = D3D12SerializeRootSignature(&desc_1_0, D3D_ROOT_SIGNATURE_VERSION_1, ppBlob, ppErrorBlob);37+ hr = d3d_D3D12SerializeRootSignature(&desc_1_0, D3D_ROOT_SIGNATURE_VERSION_1, ppBlob, ppErrorBlob);38}3940if (pParameters)41@@ -1145,7 +1151,7 @@ inline HRESULT D3DX12SerializeVersionedRootSignature(42{43case D3D_ROOT_SIGNATURE_VERSION_1_0:44case D3D_ROOT_SIGNATURE_VERSION_1_1:45- return D3D12SerializeVersionedRootSignature(pRootSignatureDesc, ppBlob, ppErrorBlob);46+ return d3d_D3D12SerializeVersionedRootSignature(pRootSignatureDesc, ppBlob, ppErrorBlob);4748#if defined(D3D12_SDK_VERSION) && (D3D12_SDK_VERSION >= 609)49case D3D_ROOT_SIGNATURE_VERSION_1_2:50@@ -1181,7 +1187,7 @@ inline HRESULT D3DX12SerializeVersionedRootSignature(51if (SUCCEEDED(hr))52{53const CD3DX12_VERSIONED_ROOT_SIGNATURE_DESC desc(desc_1_1.NumParameters, desc_1_1.pParameters, desc_1_1.NumStaticSamplers, pStaticSamplers == nullptr ? desc_1_1.pStaticSamplers : pStaticSamplers, desc_1_1.Flags);54- hr = D3D12SerializeVersionedRootSignature(&desc, ppBlob, ppErrorBlob);55+ hr = d3d_D3D12SerializeVersionedRootSignature(&desc, ppBlob, ppErrorBlob);56}5758if (pStaticSamplers)59@@ -1197,7 +1203,7 @@ inline HRESULT D3DX12SerializeVersionedRootSignature(60#if defined(D3D12_SDK_VERSION) && (D3D12_SDK_VERSION >= 609)61case D3D_ROOT_SIGNATURE_VERSION_1_2:62#endif63- return D3D12SerializeVersionedRootSignature(pRootSignatureDesc, ppBlob, ppErrorBlob);64+ return d3d_D3D12SerializeVersionedRootSignature(pRootSignatureDesc, ppBlob, ppErrorBlob);65}6667return E_INVALIDARG;686970