Fixed compatibility with older AMD/ATI cards when calling ADL2_Adapter_FrameMetrics_Caps #535
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
AtiDlxx.ADL2_Adapter_FrameMetrics_Caps is not present in older drivers, so calling it in Hardware/Gpu/AmdGpu.cs was throwing an exception preventing LHM to detect older cards. My proposed fix is to add a method in AtiDlxx.cs to check if a method is present in the DLL file and calling it in AmdGpu.cs before the actual method.
It can be used with any method, so in the future it would be wiser to use this instead of assuming that the method exists to ensure compatibility.
Added a function ADL_Method_Exists in Interop/AtiDlxx.cs to check if an entry point of a given method name exists.
Added a call to ADL_Method_Exists in Hardware/Gpu/AmdGpu.cs before calling AtiDlxx.ADL2_Adapter_FrameMetrics_Caps.
Issue: #529