diff options
author | vangelis@google.com <vangelis@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-06-16 01:25:53 +0000 |
---|---|---|
committer | vangelis@google.com <vangelis@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-06-16 01:25:53 +0000 |
commit | e923dceaa3f695c34bf4801bbc821cfafa090b87 (patch) | |
tree | 852a1891736b63ac05db7754efc90de380abfbcc /o3d/core | |
parent | 3b9cca4c8d1d88590b42e44f37dbc7aadd6fca48 (diff) | |
download | chromium_src-e923dceaa3f695c34bf4801bbc821cfafa090b87.zip chromium_src-e923dceaa3f695c34bf4801bbc821cfafa090b87.tar.gz chromium_src-e923dceaa3f695c34bf4801bbc821cfafa090b87.tar.bz2 |
Adding code to turn off anti-aliasing for certain older ATI drivers
Review URL: http://codereview.chromium.org/126173
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@18475 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'o3d/core')
-rw-r--r-- | o3d/core/win/d3d9/renderer_d3d9.cc | 32 |
1 files changed, 30 insertions, 2 deletions
diff --git a/o3d/core/win/d3d9/renderer_d3d9.cc b/o3d/core/win/d3d9/renderer_d3d9.cc index b81bf47..0c3c5b2 100644 --- a/o3d/core/win/d3d9/renderer_d3d9.cc +++ b/o3d/core/win/d3d9/renderer_d3d9.cc @@ -297,7 +297,7 @@ bool CheckDeviceCaps(LPDIRECT3D9 d3d, Features* features) { << " for depth/stencil buffers."; return false; } - } + } return true; } @@ -326,6 +326,34 @@ Renderer::InitStatus CreateDirect3D(Direct3DCreate9_Ptr d3d_create_function, return Renderer::SUCCESS; } +// For certain GPU drivers we need to force anti-aliasing off to avoid a +// a huge performance hit when certain types of windows are used on the same +// desktop as O3D. This function returns true if O3D is running on one +// of these GPUs/Drivers. +bool ForceAntiAliasingOff(LPDIRECT3D9* d3d) { + D3DADAPTER_IDENTIFIER9 identifier; + HRESULT hr = (*d3d)->GetAdapterIdentifier(D3DADAPTER_DEFAULT, 0, &identifier); + + unsigned int vendor_id = identifier.VendorId; + unsigned int device_id = identifier.DeviceId; + unsigned int product = HIWORD(identifier.DriverVersion.HighPart);
+ unsigned int version = LOWORD(identifier.DriverVersion.HighPart);
+ unsigned int subversion = HIWORD(identifier.DriverVersion.LowPart);
+ unsigned int build = LOWORD(identifier.DriverVersion.LowPart); + + // Disable ATI drivers 6.14.10.x where x is 6800 or lower. + if (vendor_id == 4098 && // ATI + product == 6 && + version == 14 && + subversion == 10 && + build <= 6800) { + return true; + } + + return false; +} + + // Helper function that gets the D3D Interface, checks the available // multisampling modes and selects the most advanced one available to create // a D3D Device with a back buffer containing depth and stencil buffers that @@ -405,7 +433,7 @@ Renderer::InitStatus InitializeD3D9Context( } } - if (features->not_anti_aliased()) { + if (features->not_anti_aliased() || ForceAntiAliasingOff(d3d)) { d3d_present_parameters->MultiSampleType = D3DMULTISAMPLE_NONE; d3d_present_parameters->MultiSampleQuality = 0; } else { |