Jamie Madill | 7acae0a | 2014-09-24 17:10:51 -0400 | [diff] [blame] | 1 | // |
| 2 | // Copyright (c) 2014 The ANGLE Project Authors. All rights reserved. |
| 3 | // Use of this source code is governed by a BSD-style license that can be |
| 4 | // found in the LICENSE file. |
| 5 | // |
| 6 | |
| 7 | // angletypes.h: Workarounds for driver bugs and other issues. |
| 8 | |
Geoff Lang | 0a73dd8 | 2014-11-19 16:18:08 -0500 | [diff] [blame] | 9 | #ifndef LIBANGLE_RENDERER_WORKAROUNDS_H_ |
| 10 | #define LIBANGLE_RENDERER_WORKAROUNDS_H_ |
Jamie Madill | 7acae0a | 2014-09-24 17:10:51 -0400 | [diff] [blame] | 11 | |
| 12 | // TODO(jmadill,zmo,geofflang): make a workarounds library that can operate |
| 13 | // independent of ANGLE's renderer. Workarounds should also be accessible |
| 14 | // outside of the Renderer. |
| 15 | |
| 16 | namespace rx |
| 17 | { |
| 18 | |
| 19 | enum D3DWorkaroundType |
| 20 | { |
| 21 | ANGLE_D3D_WORKAROUND_NONE, |
| 22 | ANGLE_D3D_WORKAROUND_SKIP_OPTIMIZATION, |
| 23 | ANGLE_D3D_WORKAROUND_MAX_OPTIMIZATION |
| 24 | }; |
| 25 | |
| 26 | struct Workarounds |
| 27 | { |
| 28 | Workarounds() |
Jamie Madill | 9aca059 | 2014-10-06 16:26:59 -0400 | [diff] [blame] | 29 | : mrtPerfWorkaround(false), |
Austin Kinross | 215b37a | 2014-12-22 12:56:07 -0800 | [diff] [blame] | 30 | setDataFasterThanImageUpload(false), |
Cooper Partin | e6664f0 | 2015-01-09 16:22:24 -0800 | [diff] [blame^] | 31 | zeroMaxLodWorkaround(false), |
| 32 | useInstancedPointSpriteEmulation(false) |
Jamie Madill | 7acae0a | 2014-09-24 17:10:51 -0400 | [diff] [blame] | 33 | {} |
| 34 | |
| 35 | bool mrtPerfWorkaround; |
Jamie Madill | 9aca059 | 2014-10-06 16:26:59 -0400 | [diff] [blame] | 36 | bool setDataFasterThanImageUpload; |
Austin Kinross | 215b37a | 2014-12-22 12:56:07 -0800 | [diff] [blame] | 37 | |
| 38 | // Some renderers can't disable mipmaps on a mipmapped texture (i.e. solely sample from level zero, and ignore the other levels). |
| 39 | // D3D11 Feature Level 10+ does this by setting MaxLOD to 0.0f in the Sampler state. D3D9 sets D3DSAMP_MIPFILTER to D3DTEXF_NONE. |
| 40 | // There is no equivalent to this in D3D11 Feature Level 9_3. |
| 41 | // This causes problems when (for example) an application creates a mipmapped texture2D, but sets GL_TEXTURE_MIN_FILTER to GL_NEAREST (i.e disables mipmaps). |
| 42 | // To work around this, D3D11 FL9_3 has to create two copies of the texture. The textures' level zeros are identical, but only one texture has mips. |
| 43 | bool zeroMaxLodWorkaround; |
Cooper Partin | e6664f0 | 2015-01-09 16:22:24 -0800 | [diff] [blame^] | 44 | |
| 45 | // Some renderers do not support Geometry Shaders so the Geometry Shader-based |
| 46 | // PointSprite emulation will not work. |
| 47 | // To work around this, D3D11 FL9_3 has to use a different pointsprite |
| 48 | // emulation that is implemented using instanced quads. |
| 49 | bool useInstancedPointSpriteEmulation; |
Jamie Madill | 7acae0a | 2014-09-24 17:10:51 -0400 | [diff] [blame] | 50 | }; |
| 51 | |
| 52 | } |
| 53 | |
Geoff Lang | 0a73dd8 | 2014-11-19 16:18:08 -0500 | [diff] [blame] | 54 | #endif // LIBANGLE_RENDERER_WORKAROUNDS_H_ |