mirror of
https://github.com/scratchfoundation/bgfx.git
synced 2024-11-24 16:48:18 -05:00
Added min spec checks.
This commit is contained in:
parent
48c8200ed3
commit
7f5e8b2f91
2 changed files with 9 additions and 1 deletions
|
@ -137,7 +137,8 @@ namespace bgfx
|
|||
{
|
||||
enum Enum
|
||||
{
|
||||
D3D9_UnableToCreateInterface = 1,
|
||||
MinimumRequiredSpecs = 1,
|
||||
D3D9_UnableToCreateInterface,
|
||||
D3D9_UnableToCreateDevice,
|
||||
D3D9_UnableToCreateRenderTarget,
|
||||
};
|
||||
|
|
|
@ -184,6 +184,13 @@ namespace bgfx
|
|||
|
||||
DX_CHECK(m_device->GetDeviceCaps(&m_caps) );
|
||||
|
||||
// For shit GPUs that can create DX9 device but can't do simple stuff. GTFO!
|
||||
BGFX_FATAL( (D3DPTEXTURECAPS_SQUAREONLY & m_caps.TextureCaps) == 0, bgfx::Fatal::MinimumRequiredSpecs, "D3DPTEXTURECAPS_SQUAREONLY");
|
||||
BGFX_FATAL( (D3DPTEXTURECAPS_MIPMAP & m_caps.TextureCaps) == D3DPTEXTURECAPS_MIPMAP, bgfx::Fatal::MinimumRequiredSpecs, "D3DPTEXTURECAPS_MIPMAP");
|
||||
BGFX_FATAL( (D3DPTEXTURECAPS_ALPHA & m_caps.TextureCaps) == D3DPTEXTURECAPS_ALPHA, bgfx::Fatal::MinimumRequiredSpecs, "D3DPTEXTURECAPS_ALPHA");
|
||||
BGFX_FATAL( (m_caps.VertexShaderVersion&0x300) == 0x300 && (m_caps.PixelShaderVersion&0x300) == 0x300, bgfx::Fatal::MinimumRequiredSpecs, "Shader Version is not 3.0.");
|
||||
BGFX_FATAL(m_caps.MaxTextureWidth >= 2048 && m_caps.MaxTextureHeight >= 2048, bgfx::Fatal::MinimumRequiredSpecs, "Maximum texture size is below 2048.");
|
||||
|
||||
m_fmtNULL = SUCCEEDED(m_d3d9->CheckDeviceFormat(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, D3DFMT_X8R8G8B8, D3DUSAGE_DEPTHSTENCIL, D3DRTYPE_TEXTURE, D3DFMT_NULL) );
|
||||
m_fmtDF16 = SUCCEEDED(m_d3d9->CheckDeviceFormat(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, D3DFMT_X8R8G8B8, D3DUSAGE_DEPTHSTENCIL, D3DRTYPE_TEXTURE, D3DFMT_DF16) );
|
||||
m_fmtDF24 = SUCCEEDED(m_d3d9->CheckDeviceFormat(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, D3DFMT_X8R8G8B8, D3DUSAGE_DEPTHSTENCIL, D3DRTYPE_TEXTURE, D3DFMT_DF24) );
|
||||
|
|
Loading…
Reference in a new issue