blob: bfb1ba1f93fd00231f79a72d07c0be13bc0b1564 [file] [log] [blame]
Jamie Madill7acae0a2014-09-24 17:10:51 -04001//
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 Lang0a73dd82014-11-19 16:18:08 -05009#ifndef LIBANGLE_RENDERER_WORKAROUNDS_H_
10#define LIBANGLE_RENDERER_WORKAROUNDS_H_
Jamie Madill7acae0a2014-09-24 17:10:51 -040011
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
16namespace rx
17{
18
19enum D3DWorkaroundType
20{
21 ANGLE_D3D_WORKAROUND_NONE,
22 ANGLE_D3D_WORKAROUND_SKIP_OPTIMIZATION,
23 ANGLE_D3D_WORKAROUND_MAX_OPTIMIZATION
24};
25
26struct Workarounds
27{
28 Workarounds()
Jamie Madill9aca0592014-10-06 16:26:59 -040029 : mrtPerfWorkaround(false),
Austin Kinross215b37a2014-12-22 12:56:07 -080030 setDataFasterThanImageUpload(false),
Cooper Partine6664f02015-01-09 16:22:24 -080031 zeroMaxLodWorkaround(false),
32 useInstancedPointSpriteEmulation(false)
Jamie Madill7acae0a2014-09-24 17:10:51 -040033 {}
34
35 bool mrtPerfWorkaround;
Jamie Madill9aca0592014-10-06 16:26:59 -040036 bool setDataFasterThanImageUpload;
Austin Kinross215b37a2014-12-22 12:56:07 -080037
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 Partine6664f02015-01-09 16:22:24 -080044
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 Madill7acae0a2014-09-24 17:10:51 -040050};
51
52}
53
Geoff Lang0a73dd82014-11-19 16:18:08 -050054#endif // LIBANGLE_RENDERER_WORKAROUNDS_H_