0002-win7-8-dynamic-load.patch 4.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. diff --git a/thirdparty/directx_headers/include/directx/d3dx12_root_signature.h b/thirdparty/directx_headers/include/directx/d3dx12_root_signature.h
  2. index 572efed852..2da79d10f1 100644
  3. --- a/thirdparty/directx_headers/include/directx/d3dx12_root_signature.h
  4. +++ b/thirdparty/directx_headers/include/directx/d3dx12_root_signature.h
  5. @@ -996,6 +996,7 @@ struct CD3DX12_GPU_DESCRIPTOR_HANDLE : public D3D12_GPU_DESCRIPTOR_HANDLE
  6. // two code paths for building root signatures, this helper method reconstructs a 1.0 signature when
  7. // 1.1 is not supported.
  8. inline HRESULT D3DX12SerializeVersionedRootSignature(
  9. + _In_ HMODULE pLibD3D12,
  10. _In_ const D3D12_VERSIONED_ROOT_SIGNATURE_DESC* pRootSignatureDesc,
  11. D3D_ROOT_SIGNATURE_VERSION MaxVersion,
  12. _Outptr_ ID3DBlob** ppBlob,
  13. @@ -1006,13 +1007,18 @@ inline HRESULT D3DX12SerializeVersionedRootSignature(
  14. *ppErrorBlob = nullptr;
  15. }
  16. + 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");
  21. switch (MaxVersion)
  22. {
  23. case D3D_ROOT_SIGNATURE_VERSION_1_0:
  24. switch (pRootSignatureDesc->Version)
  25. {
  26. case 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);
  29. case D3D_ROOT_SIGNATURE_VERSION_1_1:
  30. #if defined(D3D12_SDK_VERSION) && (D3D12_SDK_VERSION >= 609)
  31. @@ -1114,7 +1120,7 @@ inline HRESULT D3DX12SerializeVersionedRootSignature(
  32. if (SUCCEEDED(hr))
  33. {
  34. const 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);
  35. - hr = D3D12SerializeRootSignature(&desc_1_0, D3D_ROOT_SIGNATURE_VERSION_1, ppBlob, ppErrorBlob);
  36. + hr = d3d_D3D12SerializeRootSignature(&desc_1_0, D3D_ROOT_SIGNATURE_VERSION_1, ppBlob, ppErrorBlob);
  37. }
  38. if (pParameters)
  39. @@ -1145,7 +1151,7 @@ inline HRESULT D3DX12SerializeVersionedRootSignature(
  40. {
  41. case D3D_ROOT_SIGNATURE_VERSION_1_0:
  42. case D3D_ROOT_SIGNATURE_VERSION_1_1:
  43. - return D3D12SerializeVersionedRootSignature(pRootSignatureDesc, ppBlob, ppErrorBlob);
  44. + return d3d_D3D12SerializeVersionedRootSignature(pRootSignatureDesc, ppBlob, ppErrorBlob);
  45. #if defined(D3D12_SDK_VERSION) && (D3D12_SDK_VERSION >= 609)
  46. case D3D_ROOT_SIGNATURE_VERSION_1_2:
  47. @@ -1181,7 +1187,7 @@ inline HRESULT D3DX12SerializeVersionedRootSignature(
  48. if (SUCCEEDED(hr))
  49. {
  50. const 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);
  51. - hr = D3D12SerializeVersionedRootSignature(&desc, ppBlob, ppErrorBlob);
  52. + hr = d3d_D3D12SerializeVersionedRootSignature(&desc, ppBlob, ppErrorBlob);
  53. }
  54. if (pStaticSamplers)
  55. @@ -1197,7 +1203,7 @@ inline HRESULT D3DX12SerializeVersionedRootSignature(
  56. #if defined(D3D12_SDK_VERSION) && (D3D12_SDK_VERSION >= 609)
  57. case D3D_ROOT_SIGNATURE_VERSION_1_2:
  58. #endif
  59. - return D3D12SerializeVersionedRootSignature(pRootSignatureDesc, ppBlob, ppErrorBlob);
  60. + return d3d_D3D12SerializeVersionedRootSignature(pRootSignatureDesc, ppBlob, ppErrorBlob);
  61. }
  62. return E_INVALIDARG;