1 /* SPDX-License-Identifier: GPL-2.0 OR MIT */
2 /**********************************************************
3 * Copyright 2007-2019 VMware, Inc.
5 * Permission is hereby granted, free of charge, to any person
6 * obtaining a copy of this software and associated documentation
7 * files (the "Software"), to deal in the Software without
8 * restriction, including without limitation the rights to use, copy,
9 * modify, merge, publish, distribute, sublicense, and/or sell copies
10 * of the Software, and to permit persons to whom the Software is
11 * furnished to do so, subject to the following conditions:
13 * The above copyright notice and this permission notice shall be
14 * included in all copies or substantial portions of the Software.
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
20 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
21 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
22 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
25 **********************************************************/
30 * SVGA 3d hardware limits
33 #ifndef _SVGA3D_LIMITS_H_
34 #define _SVGA3D_LIMITS_H_
36 #define INCLUDE_ALLOW_MODULE
37 #define INCLUDE_ALLOW_USERLEVEL
38 #define INCLUDE_ALLOW_VMCORE
40 #include "includeCheck.h"
42 #define SVGA3D_NUM_CLIPPLANES 6
43 #define SVGA3D_MAX_CONTEXT_IDS 256
44 #define SVGA3D_MAX_SURFACE_IDS (32 * 1024)
47 * While there are separate bind-points for RenderTargetViews and
48 * UnorderedAccessViews in a DXContext, there is in fact one shared
49 * semantic space that the guest-driver can use on any given draw call.
50 * So there are really only 8 slots that can be spilt up between them, with the
51 * spliceIndex controlling where the UAV's sit in the collapsed array.
53 #define SVGA3D_MAX_RENDER_TARGETS 8
54 #define SVGA3D_MAX_SIMULTANEOUS_RENDER_TARGETS (SVGA3D_MAX_RENDER_TARGETS)
55 #define SVGA3D_MAX_UAVIEWS 8
56 #define SVGA3D_DX11_1_MAX_UAVIEWS 64
59 * Maximum canonical size of a surface in host-backed mode (pre-GBObjects).
61 #define SVGA3D_HB_MAX_SURFACE_SIZE MBYTES_2_BYTES(128)
64 * Maximum ID a shader can be assigned on a given context.
66 #define SVGA3D_MAX_SHADERIDS 5000
68 * Maximum number of shaders of a given type that can be defined
69 * (including all contexts).
71 #define SVGA3D_MAX_SIMULTANEOUS_SHADERS 20000
73 #define SVGA3D_NUM_TEXTURE_UNITS 32
74 #define SVGA3D_NUM_LIGHTS 8
76 #define SVGA3D_MAX_VIDEOPROCESSOR_SAMPLERS 32
79 * Maximum size in dwords of shader text the SVGA device will allow.
82 #define SVGA3D_MAX_SHADER_MEMORY_BYTES (8 * 1024 * 1024)
83 #define SVGA3D_MAX_SHADER_MEMORY (SVGA3D_MAX_SHADER_MEMORY_BYTES / \
87 * The maximum value of threadGroupCount in each dimension
89 #define SVGA3D_MAX_SHADER_THREAD_GROUPS 65535
91 #define SVGA3D_MAX_CLIP_PLANES 6
94 * This is the limit to the number of fixed-function texture
95 * transforms and texture coordinates we can support. It does *not*
96 * correspond to the number of texture image units (samplers) we
99 #define SVGA3D_MAX_TEXTURE_COORDS 8
102 * Number of faces in a cubemap.
104 #define SVGA3D_MAX_SURFACE_FACES 6
107 * Maximum number of array indexes in a GB surface (with DX enabled).
109 #define SVGA3D_SM4_MAX_SURFACE_ARRAYSIZE 512
110 #define SVGA3D_SM5_MAX_SURFACE_ARRAYSIZE 2048
111 #define SVGA3D_MAX_SURFACE_ARRAYSIZE SVGA3D_SM5_MAX_SURFACE_ARRAYSIZE
114 * The maximum number of vertex arrays we're guaranteed to support in
115 * SVGA_3D_CMD_DRAWPRIMITIVES.
117 #define SVGA3D_MAX_VERTEX_ARRAYS 32
120 * The maximum number of primitive ranges we're guaranteed to support
121 * in SVGA_3D_CMD_DRAWPRIMITIVES.
123 #define SVGA3D_MAX_DRAW_PRIMITIVE_RANGES 32
126 * The maximum number of samples that can be contained in a surface.
128 #define SVGA3D_MAX_SAMPLES 8
130 #endif /* _SVGA3D_LIMITS_H_ */