- Assign width and height to the actual powers of two rather than to the exponents...
- Clean up FramebufferManager()
- Make use of more depth buffer formats to prevent some devices from failing to create a depth buffer

Should fix issue 3256.

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@6730 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
NeoBrainX
2011-01-03 14:35:07 +00:00
parent ae71e63872
commit 5cad834c96
5 changed files with 100 additions and 67 deletions

View File

@ -444,8 +444,8 @@ bool FixTextureSize(int& width, int& height)
if ((caps.TextureCaps & D3DPTEXTURECAPS_POW2) && !(caps.TextureCaps & D3DPTEXTURECAPS_NONPOW2CONDITIONAL))
{
// all texture dimensions need to be powers of two
width = GetPow2(width);
height = GetPow2(height);
width = (int)MakePow2((u32)width);
height = (int)MakePow2((u32)height);
}
if (caps.TextureCaps & D3DPTEXTURECAPS_SQUAREONLY)
{
@ -458,6 +458,17 @@ bool FixTextureSize(int& width, int& height)
return (width != oldw) || (height != oldh);
}
// returns true if format is supported
bool CheckTextureSupport(DWORD usage, D3DFORMAT tex_format)
{
return D3D_OK == D3D->CheckDeviceFormat(cur_adapter, D3DDEVTYPE_HAL, D3DFMT_X8R8G8B8, usage, D3DRTYPE_TEXTURE, tex_format);
}
bool CheckDepthStencilSupport(D3DFORMAT target_format, D3DFORMAT depth_format)
{
return D3D_OK == D3D->CheckDepthStencilMatch(cur_adapter, D3DDEVTYPE_HAL, D3DFMT_X8R8G8B8, target_format, depth_format);
}
const char *VertexShaderVersionString()
{
static const char *versions[5] = {"ERROR", "vs_1_4", "vs_2_0", "vs_3_0", "vs_4_0"};