1// Copyright 2016 The SwiftShader Authors. All Rights Reserved.
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15#ifndef sw_Config_hpp
16#define sw_Config_hpp
17
18#include "System/Types.hpp"
19
20namespace sw
21{
22 enum
23 {
24 PERF_PIXEL,
25 PERF_PIPE,
26 PERF_INTERP,
27 PERF_SHADER,
28 PERF_TEX,
29 PERF_ROP,
30
31 PERF_TIMERS
32 };
33
34 struct Profiler
35 {
36 Profiler();
37
38 void reset();
39 void nextFrame();
40
41 int framesSec;
42 int framesTotal;
43 double FPS;
44 };
45
46 extern Profiler profiler;
47
48 enum
49 {
50 OUTLINE_RESOLUTION = 8192, // Maximum vertical resolution of the render target
51 MIPMAP_LEVELS = 14,
52 MAX_UNIFORM_BLOCK_SIZE = 16384,
53 MAX_CLIP_PLANES = 6,
54 MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS = 64,
55 MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS = 64,
56 MIN_TEXEL_OFFSET = -8,
57 MAX_TEXEL_OFFSET = 7,
58 MAX_TEXTURE_LOD = MIPMAP_LEVELS - 2, // Trilinear accesses lod+1
59 RENDERTARGETS = 8,
60 MAX_INTERFACE_COMPONENTS = 32 * 4, // Must be multiple of 4 for 16-byte alignment.
61 };
62}
63
64#endif // sw_Config_hpp
65