Skip to content

Commit

Permalink
feat: 记录显卡是否支持 fp16
Browse files Browse the repository at this point in the history
  • Loading branch information
Blinue committed Jan 8, 2025
1 parent abdd6c3 commit 13b0ecb
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Magpie.Core/DeviceResources.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ bool DeviceResources::Initialize() noexcept {
UINT flag = DXGI_CREATE_FACTORY_DEBUG;
#else
UINT flag = 0;
#endif // _DEBUG
#endif

HRESULT hr = CreateDXGIFactory2(flag, IID_PPV_ARGS(_dxgiFactory.put()));
if (FAILED(hr)) {
Expand Down Expand Up @@ -230,6 +230,7 @@ bool DeviceResources::_TryCreateD3DDevice(const winrt::com_ptr<IDXGIAdapter1>& a
hr = d3dDevice->CheckFeatureSupport(D3D11_FEATURE_SHADER_MIN_PRECISION_SUPPORT, &value, sizeof(value));
if (SUCCEEDED(hr)) {
_isFP16Supported = value.AllOtherShaderStagesMinPrecision & D3D11_SHADER_MIN_PRECISION_16_BIT;
Logger::Get().Info(StrHelper::Concat("FP16 支持: ", _isFP16Supported ? "" : ""));
} else {
Logger::Get().ComError("CheckFeatureSupport 失败", hr);
}
Expand Down

0 comments on commit 13b0ecb

Please sign in to comment.