Skip to content

Commit

Permalink
xrRenderDX10/dx10HW.cpp: correct format support check
Browse files Browse the repository at this point in the history
  • Loading branch information
Xottab-DUTY committed Oct 2, 2018
1 parent e14ec3d commit 3cb7820
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/Layers/xrRender/HW.h
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ class CHW
void UpdateViews();
#endif
#if defined(USE_DX10) || defined(USE_DX11)
bool CheckFormatSupport(DXGI_FORMAT format, D3D_FORMAT_SUPPORT feature) const;
bool CheckFormatSupport(DXGI_FORMAT format, UINT feature) const;
DXGI_FORMAT SelectFormat(D3D_FORMAT_SUPPORT feature, const DXGI_FORMAT formats[], size_t count) const;
virtual void OnAppActivate();
virtual void OnAppDeactivate();
Expand Down
13 changes: 9 additions & 4 deletions src/Layers/xrRenderDX10/dx10HW.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -260,11 +260,16 @@ void CHW::Reset()
UpdateViews();
}

bool CHW::CheckFormatSupport(const DXGI_FORMAT format, const D3D_FORMAT_SUPPORT feature) const
bool CHW::CheckFormatSupport(const DXGI_FORMAT format, const UINT feature) const
{
UINT feature_bit = feature;
if (SUCCEEDED(pDevice->CheckFormatSupport(format, &feature_bit)))
return true;
UINT supports;

if (SUCCEEDED(pDevice->CheckFormatSupport(format, &supports)))
{
if (supports & feature)
return true;
}

return false;
}

Expand Down

0 comments on commit 3cb7820

Please sign in to comment.