1bf215546Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 OR MIT */
2bf215546Sopenharmony_ci/*
3bf215546Sopenharmony_ci * Copyright 2012-2019 VMware, Inc.
4bf215546Sopenharmony_ci *
5bf215546Sopenharmony_ci * Permission is hereby granted, free of charge, to any person
6bf215546Sopenharmony_ci * obtaining a copy of this software and associated documentation
7bf215546Sopenharmony_ci * files (the "Software"), to deal in the Software without
8bf215546Sopenharmony_ci * restriction, including without limitation the rights to use, copy,
9bf215546Sopenharmony_ci * modify, merge, publish, distribute, sublicense, and/or sell copies
10bf215546Sopenharmony_ci * of the Software, and to permit persons to whom the Software is
11bf215546Sopenharmony_ci * furnished to do so, subject to the following conditions:
12bf215546Sopenharmony_ci *
13bf215546Sopenharmony_ci * The above copyright notice and this permission notice shall be
14bf215546Sopenharmony_ci * included in all copies or substantial portions of the Software.
15bf215546Sopenharmony_ci *
16bf215546Sopenharmony_ci * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17bf215546Sopenharmony_ci * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18bf215546Sopenharmony_ci * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19bf215546Sopenharmony_ci * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
20bf215546Sopenharmony_ci * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
21bf215546Sopenharmony_ci * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
22bf215546Sopenharmony_ci * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23bf215546Sopenharmony_ci * SOFTWARE.
24bf215546Sopenharmony_ci *
25bf215546Sopenharmony_ci */
26bf215546Sopenharmony_ci
27bf215546Sopenharmony_ci/*
28bf215546Sopenharmony_ci * svga3d_limits.h --
29bf215546Sopenharmony_ci *
30bf215546Sopenharmony_ci *    SVGA 3d hardware limits
31bf215546Sopenharmony_ci */
32bf215546Sopenharmony_ci
33bf215546Sopenharmony_ci
34bf215546Sopenharmony_ci
35bf215546Sopenharmony_ci
36bf215546Sopenharmony_ci
37bf215546Sopenharmony_ci#ifndef _SVGA3D_LIMITS_H_
38bf215546Sopenharmony_ci#define _SVGA3D_LIMITS_H_
39bf215546Sopenharmony_ci
40bf215546Sopenharmony_ci
41bf215546Sopenharmony_ci
42bf215546Sopenharmony_ci
43bf215546Sopenharmony_ci
44bf215546Sopenharmony_ci
45bf215546Sopenharmony_ci
46bf215546Sopenharmony_ci#define SVGA3D_NUM_CLIPPLANES                   6
47bf215546Sopenharmony_ci#define SVGA3D_MAX_CONTEXT_IDS                  256
48bf215546Sopenharmony_ci#define SVGA3D_MAX_SURFACE_IDS                  (32 * 1024)
49bf215546Sopenharmony_ci
50bf215546Sopenharmony_ci
51bf215546Sopenharmony_ci#define SVGA3D_MAX_RENDER_TARGETS               8
52bf215546Sopenharmony_ci#define SVGA3D_MAX_SIMULTANEOUS_RENDER_TARGETS  (SVGA3D_MAX_RENDER_TARGETS)
53bf215546Sopenharmony_ci#define SVGA3D_MAX_UAVIEWS                      8
54bf215546Sopenharmony_ci#define SVGA3D_DX11_1_MAX_UAVIEWS               64
55bf215546Sopenharmony_ci
56bf215546Sopenharmony_ci
57bf215546Sopenharmony_ci#define SVGA3D_HB_MAX_SURFACE_SIZE MBYTES_2_BYTES(128)
58bf215546Sopenharmony_ci
59bf215546Sopenharmony_ci
60bf215546Sopenharmony_ci#define SVGA3D_MAX_SHADERIDS                    5000
61bf215546Sopenharmony_ci
62bf215546Sopenharmony_ci#define SVGA3D_MAX_SIMULTANEOUS_SHADERS         20000
63bf215546Sopenharmony_ci
64bf215546Sopenharmony_ci#define SVGA3D_NUM_TEXTURE_UNITS                32
65bf215546Sopenharmony_ci#define SVGA3D_NUM_LIGHTS                       8
66bf215546Sopenharmony_ci
67bf215546Sopenharmony_ci
68bf215546Sopenharmony_ci#define SVGA3D_MAX_VIDEOPROCESSOR_SAMPLERS      32
69bf215546Sopenharmony_ci
70bf215546Sopenharmony_ci
71bf215546Sopenharmony_ci#define SVGA3D_MAX_SHADER_MEMORY_BYTES (8 * 1024 * 1024)
72bf215546Sopenharmony_ci#define SVGA3D_MAX_SHADER_MEMORY  (SVGA3D_MAX_SHADER_MEMORY_BYTES / \
73bf215546Sopenharmony_ci                                   sizeof(uint32))
74bf215546Sopenharmony_ci
75bf215546Sopenharmony_ci#define SVGA3D_MAX_SHADER_THREAD_GROUPS 65535
76bf215546Sopenharmony_ci
77bf215546Sopenharmony_ci#define SVGA3D_MAX_CLIP_PLANES    6
78bf215546Sopenharmony_ci
79bf215546Sopenharmony_ci
80bf215546Sopenharmony_ci#define SVGA3D_MAX_TEXTURE_COORDS 8
81bf215546Sopenharmony_ci
82bf215546Sopenharmony_ci
83bf215546Sopenharmony_ci#define SVGA3D_MAX_SURFACE_FACES 6
84bf215546Sopenharmony_ci
85bf215546Sopenharmony_ci
86bf215546Sopenharmony_ci#define SVGA3D_SM4_MAX_SURFACE_ARRAYSIZE 512
87bf215546Sopenharmony_ci#define SVGA3D_SM5_MAX_SURFACE_ARRAYSIZE 2048
88bf215546Sopenharmony_ci#define SVGA3D_MAX_SURFACE_ARRAYSIZE SVGA3D_SM5_MAX_SURFACE_ARRAYSIZE
89bf215546Sopenharmony_ci
90bf215546Sopenharmony_ci
91bf215546Sopenharmony_ci#define SVGA3D_MAX_VERTEX_ARRAYS   32
92bf215546Sopenharmony_ci
93bf215546Sopenharmony_ci
94bf215546Sopenharmony_ci#define SVGA3D_MAX_DRAW_PRIMITIVE_RANGES 32
95bf215546Sopenharmony_ci
96bf215546Sopenharmony_ci
97bf215546Sopenharmony_ci#define SVGA3D_MAX_SAMPLES 8
98bf215546Sopenharmony_ci
99bf215546Sopenharmony_ci#endif
100