1 //
2 // Copyright 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 #ifndef LIBANGLE_FEATURES_H_
8 #define LIBANGLE_FEATURES_H_
9 
10 #include "common/platform.h"
11 
12 #define ANGLE_DISABLED 0
13 #define ANGLE_ENABLED 1
14 
15 // Feature defaults
16 
17 // Direct3D9EX
18 // The "Debug This Pixel..." feature in PIX often fails when using the
19 // D3D9Ex interfaces.  In order to get debug pixel to work on a Vista/Win 7
20 // machine, define "ANGLE_D3D9EX=0" in your project file.
21 #if !defined(ANGLE_D3D9EX)
22 #    define ANGLE_D3D9EX ANGLE_ENABLED
23 #endif
24 
25 // Vsync
26 // ENABLED allows Vsync to be configured at runtime
27 // DISABLED disallows Vsync
28 #if !defined(ANGLE_VSYNC)
29 #    define ANGLE_VSYNC ANGLE_ENABLED
30 #endif
31 
32 // Program binary loading
33 #if !defined(ANGLE_PROGRAM_BINARY_LOAD)
34 #    define ANGLE_PROGRAM_BINARY_LOAD ANGLE_ENABLED
35 #endif
36 
37 // Append HLSL assembly to shader debug info. Defaults to enabled in Debug and off in Release.
38 #if !defined(ANGLE_APPEND_ASSEMBLY_TO_SHADER_DEBUG_INFO)
39 #    if !defined(NDEBUG)
40 #        define ANGLE_APPEND_ASSEMBLY_TO_SHADER_DEBUG_INFO ANGLE_ENABLED
41 #    else
42 #        define ANGLE_APPEND_ASSEMBLY_TO_SHADER_DEBUG_INFO ANGLE_DISABLED
43 #    endif  // !defined(NDEBUG)
44 #endif      // !defined(ANGLE_APPEND_ASSEMBLY_TO_SHADER_DEBUG_INFO)
45 
46 // Program link validation of precisions for uniforms. This feature was
47 // requested by developers to allow non-conformant shaders to be used which
48 // contain mismatched precisions.
49 // ENABLED validate that precision for uniforms match between vertex and fragment shaders
50 // DISABLED allow precision for uniforms to differ between vertex and fragment shaders
51 #if !defined(ANGLE_PROGRAM_LINK_VALIDATE_UNIFORM_PRECISION)
52 #    define ANGLE_PROGRAM_LINK_VALIDATE_UNIFORM_PRECISION ANGLE_ENABLED
53 #endif
54 
55 // Controls if our threading code uses std::async or falls back to single-threaded operations.
56 // Note that we can't easily use std::async in UWPs due to UWP threading restrictions.
57 #if !defined(ANGLE_STD_ASYNC_WORKERS) && !defined(ANGLE_ENABLE_WINDOWS_UWP)
58 #    define ANGLE_STD_ASYNC_WORKERS ANGLE_ENABLED
59 #endif  // !defined(ANGLE_STD_ASYNC_WORKERS) && & !defined(ANGLE_ENABLE_WINDOWS_UWP)
60 
61 #endif  // LIBANGLE_FEATURES_H_
62