1 /*	$NetBSD: svga3d_limits.h,v 1.3 2021/12/18 23:45:45 riastradh Exp $	*/
2 
3 /* SPDX-License-Identifier: GPL-2.0 OR MIT */
4 /**********************************************************
5  * Copyright 2007-2015 VMware, Inc.
6  *
7  * Permission is hereby granted, free of charge, to any person
8  * obtaining a copy of this software and associated documentation
9  * files (the "Software"), to deal in the Software without
10  * restriction, including without limitation the rights to use, copy,
11  * modify, merge, publish, distribute, sublicense, and/or sell copies
12  * of the Software, and to permit persons to whom the Software is
13  * furnished to do so, subject to the following conditions:
14  *
15  * The above copyright notice and this permission notice shall be
16  * included in all copies or substantial portions of the Software.
17  *
18  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
19  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
20  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
21  * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
22  * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
23  * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
24  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
25  * SOFTWARE.
26  *
27  **********************************************************/
28 
29 /*
30  * svga3d_limits.h --
31  *
32  *       SVGA 3d hardware limits
33  */
34 
35 #ifndef _SVGA3D_LIMITS_H_
36 #define _SVGA3D_LIMITS_H_
37 
38 #define INCLUDE_ALLOW_MODULE
39 #define INCLUDE_ALLOW_USERLEVEL
40 #define INCLUDE_ALLOW_VMCORE
41 
42 #include "includeCheck.h"
43 
44 #define SVGA3D_NUM_CLIPPLANES                   6
45 #define SVGA3D_MAX_RENDER_TARGETS               8
46 #define SVGA3D_MAX_SIMULTANEOUS_RENDER_TARGETS  (SVGA3D_MAX_RENDER_TARGETS)
47 #define SVGA3D_MAX_UAVIEWS                      8
48 #define SVGA3D_MAX_CONTEXT_IDS                  256
49 #define SVGA3D_MAX_SURFACE_IDS                  (32 * 1024)
50 
51 /*
52  * Maximum ID a shader can be assigned on a given context.
53  */
54 #define SVGA3D_MAX_SHADERIDS                    5000
55 /*
56  * Maximum number of shaders of a given type that can be defined
57  * (including all contexts).
58  */
59 #define SVGA3D_MAX_SIMULTANEOUS_SHADERS         20000
60 
61 #define SVGA3D_NUM_TEXTURE_UNITS                32
62 #define SVGA3D_NUM_LIGHTS                       8
63 
64 /*
65  * Maximum size in dwords of shader text the SVGA device will allow.
66  * Currently 8 MB.
67  */
68 #define SVGA3D_MAX_SHADER_MEMORY_BYTES (8 * 1024 * 1024)
69 #define SVGA3D_MAX_SHADER_MEMORY  (SVGA3D_MAX_SHADER_MEMORY_BYTES / \
70                                    sizeof(uint32))
71 
72 #define SVGA3D_MAX_CLIP_PLANES    6
73 
74 /*
75  * This is the limit to the number of fixed-function texture
76  * transforms and texture coordinates we can support. It does *not*
77  * correspond to the number of texture image units (samplers) we
78  * support!
79  */
80 #define SVGA3D_MAX_TEXTURE_COORDS 8
81 
82 /*
83  * Number of faces in a cubemap.
84  */
85 #define SVGA3D_MAX_SURFACE_FACES 6
86 
87 /*
88  * Maximum number of array indexes in a GB surface (with DX enabled).
89  */
90 #define SVGA3D_MAX_SURFACE_ARRAYSIZE 512
91 
92 /*
93  * The maximum number of vertex arrays we're guaranteed to support in
94  * SVGA_3D_CMD_DRAWPRIMITIVES.
95  */
96 #define SVGA3D_MAX_VERTEX_ARRAYS   32
97 
98 /*
99  * The maximum number of primitive ranges we're guaranteed to support
100  * in SVGA_3D_CMD_DRAWPRIMITIVES.
101  */
102 #define SVGA3D_MAX_DRAW_PRIMITIVE_RANGES 32
103 
104 #endif /* _SVGA3D_LIMITS_H_ */
105