Skip to content

Commit 3cb7820

Browse files
committed
xrRenderDX10/dx10HW.cpp: correct format support check
1 parent e14ec3d commit 3cb7820

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

src/Layers/xrRender/HW.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ class CHW
126126
void UpdateViews();
127127
#endif
128128
#if defined(USE_DX10) || defined(USE_DX11)
129-
bool CheckFormatSupport(DXGI_FORMAT format, D3D_FORMAT_SUPPORT feature) const;
129+
bool CheckFormatSupport(DXGI_FORMAT format, UINT feature) const;
130130
DXGI_FORMAT SelectFormat(D3D_FORMAT_SUPPORT feature, const DXGI_FORMAT formats[], size_t count) const;
131131
virtual void OnAppActivate();
132132
virtual void OnAppDeactivate();

src/Layers/xrRenderDX10/dx10HW.cpp

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -260,11 +260,16 @@ void CHW::Reset()
260260
UpdateViews();
261261
}
262262

263-
bool CHW::CheckFormatSupport(const DXGI_FORMAT format, const D3D_FORMAT_SUPPORT feature) const
263+
bool CHW::CheckFormatSupport(const DXGI_FORMAT format, const UINT feature) const
264264
{
265-
UINT feature_bit = feature;
266-
if (SUCCEEDED(pDevice->CheckFormatSupport(format, &feature_bit)))
267-
return true;
265+
UINT supports;
266+
267+
if (SUCCEEDED(pDevice->CheckFormatSupport(format, &supports)))
268+
{
269+
if (supports & feature)
270+
return true;
271+
}
272+
268273
return false;
269274
}
270275

0 commit comments

Comments
 (0)