1 /**********************************************************
2 * Copyright 2011 VMware, Inc. All rights reserved.
3 *
4 * Permission is hereby granted, free of charge, to any person
5 * obtaining a copy of this software and associated documentation
6 * files (the "Software"), to deal in the Software without
7 * restriction, including without limitation the rights to use, copy,
8 * modify, merge, publish, distribute, sublicense, and/or sell copies
9 * of the Software, and to permit persons to whom the Software is
10 * furnished to do so, subject to the following conditions:
11 *
12 * The above copyright notice and this permission notice shall be
13 * included in all copies or substantial portions of the Software.
14 *
15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
17 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
19 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
20 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
21 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22 * SOFTWARE.
23 *
24 **********************************************************/
25
26
27 #include "pipe/p_format.h"
28 #include "util/u_debug.h"
29 #include "util/u_format.h"
30 #include "util/u_memory.h"
31
32 #include "svga_winsys.h"
33 #include "svga_screen.h"
34 #include "svga_format.h"
35
36
37 /** Describes mapping from gallium formats to SVGA vertex/pixel formats */
38 struct vgpu10_format_entry
39 {
40 enum pipe_format pformat;
41 SVGA3dSurfaceFormat vertex_format;
42 SVGA3dSurfaceFormat pixel_format;
43 unsigned flags;
44 };
45
46
47 static const struct vgpu10_format_entry format_conversion_table[] =
48 {
49 /* Gallium format SVGA3D vertex format SVGA3D pixel format Flags */
50 { PIPE_FORMAT_NONE, SVGA3D_FORMAT_INVALID, SVGA3D_FORMAT_INVALID, 0 },
51 { PIPE_FORMAT_B8G8R8A8_UNORM, SVGA3D_B8G8R8A8_UNORM, SVGA3D_B8G8R8A8_UNORM, TF_GEN_MIPS },
52 { PIPE_FORMAT_B8G8R8X8_UNORM, SVGA3D_FORMAT_INVALID, SVGA3D_B8G8R8X8_UNORM, TF_GEN_MIPS },
53 { PIPE_FORMAT_A8R8G8B8_UNORM, SVGA3D_FORMAT_INVALID, SVGA3D_FORMAT_INVALID, 0 },
54 { PIPE_FORMAT_X8R8G8B8_UNORM, SVGA3D_FORMAT_INVALID, SVGA3D_FORMAT_INVALID, 0 },
55 { PIPE_FORMAT_B5G5R5A1_UNORM, SVGA3D_FORMAT_INVALID, SVGA3D_B5G5R5A1_UNORM, TF_GEN_MIPS },
56 { PIPE_FORMAT_B4G4R4A4_UNORM, SVGA3D_FORMAT_INVALID, SVGA3D_FORMAT_INVALID, 0 },
57 { PIPE_FORMAT_B5G6R5_UNORM, SVGA3D_FORMAT_INVALID, SVGA3D_B5G6R5_UNORM, TF_GEN_MIPS },
58 { PIPE_FORMAT_R10G10B10A2_UNORM, SVGA3D_R10G10B10A2_UNORM, SVGA3D_R10G10B10A2_UNORM, TF_GEN_MIPS },
59 { PIPE_FORMAT_L8_UNORM, SVGA3D_FORMAT_INVALID, SVGA3D_FORMAT_INVALID, 0 },
60 { PIPE_FORMAT_A8_UNORM, SVGA3D_FORMAT_INVALID, SVGA3D_A8_UNORM, TF_GEN_MIPS },
61 { PIPE_FORMAT_I8_UNORM, SVGA3D_FORMAT_INVALID, SVGA3D_FORMAT_INVALID, 0 },
62 { PIPE_FORMAT_L8A8_UNORM, SVGA3D_FORMAT_INVALID, SVGA3D_FORMAT_INVALID, 0 },
63 { PIPE_FORMAT_L16_UNORM, SVGA3D_FORMAT_INVALID, SVGA3D_FORMAT_INVALID, 0 },
64 { PIPE_FORMAT_UYVY, SVGA3D_FORMAT_INVALID, SVGA3D_FORMAT_INVALID, 0 },
65 { PIPE_FORMAT_YUYV, SVGA3D_FORMAT_INVALID, SVGA3D_FORMAT_INVALID, 0 },
66 { PIPE_FORMAT_Z16_UNORM, SVGA3D_FORMAT_INVALID, SVGA3D_D16_UNORM, 0 },
67 { PIPE_FORMAT_Z32_UNORM, SVGA3D_FORMAT_INVALID, SVGA3D_FORMAT_INVALID, 0 },
68 { PIPE_FORMAT_Z32_FLOAT, SVGA3D_FORMAT_INVALID, SVGA3D_D32_FLOAT, 0 },
69 { PIPE_FORMAT_Z24_UNORM_S8_UINT, SVGA3D_FORMAT_INVALID, SVGA3D_D24_UNORM_S8_UINT, 0 },
70 { PIPE_FORMAT_S8_UINT_Z24_UNORM, SVGA3D_FORMAT_INVALID, SVGA3D_FORMAT_INVALID, 0 },
71 { PIPE_FORMAT_Z24X8_UNORM, SVGA3D_FORMAT_INVALID, SVGA3D_D24_UNORM_S8_UINT, 0 },
72 { PIPE_FORMAT_X8Z24_UNORM, SVGA3D_FORMAT_INVALID, SVGA3D_FORMAT_INVALID, 0 },
73 { PIPE_FORMAT_S8_UINT, SVGA3D_FORMAT_INVALID, SVGA3D_FORMAT_INVALID, 0 },
74 { PIPE_FORMAT_R64_FLOAT, SVGA3D_FORMAT_INVALID, SVGA3D_FORMAT_INVALID, 0 },
75 { PIPE_FORMAT_R64G64_FLOAT, SVGA3D_FORMAT_INVALID, SVGA3D_FORMAT_INVALID, 0 },
76 { PIPE_FORMAT_R64G64B64_FLOAT, SVGA3D_FORMAT_INVALID, SVGA3D_FORMAT_INVALID, 0 },
77 { PIPE_FORMAT_R64G64B64A64_FLOAT, SVGA3D_FORMAT_INVALID, SVGA3D_FORMAT_INVALID, 0 },
78 { PIPE_FORMAT_R32_FLOAT, SVGA3D_R32_FLOAT, SVGA3D_R32_FLOAT, TF_GEN_MIPS },
79 { PIPE_FORMAT_R32G32_FLOAT, SVGA3D_R32G32_FLOAT, SVGA3D_R32G32_FLOAT, TF_GEN_MIPS },
80 { PIPE_FORMAT_R32G32B32_FLOAT, SVGA3D_R32G32B32_FLOAT, SVGA3D_R32G32B32_FLOAT, TF_GEN_MIPS },
81 { PIPE_FORMAT_R32G32B32A32_FLOAT, SVGA3D_R32G32B32A32_FLOAT, SVGA3D_R32G32B32A32_FLOAT, TF_GEN_MIPS },
82 { PIPE_FORMAT_R32_UNORM, SVGA3D_FORMAT_INVALID, SVGA3D_FORMAT_INVALID, 0 },
83 { PIPE_FORMAT_R32G32_UNORM, SVGA3D_FORMAT_INVALID, SVGA3D_FORMAT_INVALID, 0 },
84 { PIPE_FORMAT_R32G32B32_UNORM, SVGA3D_FORMAT_INVALID, SVGA3D_FORMAT_INVALID, 0 },
85 { PIPE_FORMAT_R32G32B32A32_UNORM, SVGA3D_FORMAT_INVALID, SVGA3D_FORMAT_INVALID, 0 },
86 { PIPE_FORMAT_R32_USCALED, SVGA3D_R32_UINT, SVGA3D_FORMAT_INVALID, VF_U_TO_F_CAST },
87 { PIPE_FORMAT_R32G32_USCALED, SVGA3D_R32G32_UINT, SVGA3D_FORMAT_INVALID, VF_U_TO_F_CAST },
88 { PIPE_FORMAT_R32G32B32_USCALED, SVGA3D_R32G32B32_UINT, SVGA3D_FORMAT_INVALID, VF_U_TO_F_CAST },
89 { PIPE_FORMAT_R32G32B32A32_USCALED, SVGA3D_R32G32B32A32_UINT, SVGA3D_FORMAT_INVALID, VF_U_TO_F_CAST },
90 { PIPE_FORMAT_R32_SNORM, SVGA3D_FORMAT_INVALID, SVGA3D_FORMAT_INVALID, 0 },
91 { PIPE_FORMAT_R32G32_SNORM, SVGA3D_FORMAT_INVALID, SVGA3D_FORMAT_INVALID, 0 },
92 { PIPE_FORMAT_R32G32B32_SNORM, SVGA3D_FORMAT_INVALID, SVGA3D_FORMAT_INVALID, 0 },
93 { PIPE_FORMAT_R32G32B32A32_SNORM, SVGA3D_FORMAT_INVALID, SVGA3D_FORMAT_INVALID, 0 },
94 { PIPE_FORMAT_R32_SSCALED, SVGA3D_R32_SINT, SVGA3D_FORMAT_INVALID, VF_I_TO_F_CAST },
95 { PIPE_FORMAT_R32G32_SSCALED, SVGA3D_R32G32_SINT, SVGA3D_FORMAT_INVALID, VF_I_TO_F_CAST },
96 { PIPE_FORMAT_R32G32B32_SSCALED, SVGA3D_R32G32B32_SINT, SVGA3D_FORMAT_INVALID, VF_I_TO_F_CAST },
97 { PIPE_FORMAT_R32G32B32A32_SSCALED, SVGA3D_R32G32B32A32_SINT, SVGA3D_FORMAT_INVALID, VF_I_TO_F_CAST },
98 { PIPE_FORMAT_R16_UNORM, SVGA3D_R16_UNORM, SVGA3D_R16_UNORM, TF_GEN_MIPS },
99 { PIPE_FORMAT_R16G16_UNORM, SVGA3D_R16G16_UNORM, SVGA3D_R16G16_UNORM, TF_GEN_MIPS },
100 { PIPE_FORMAT_R16G16B16_UNORM, SVGA3D_R16G16B16A16_UNORM, SVGA3D_FORMAT_INVALID, VF_W_TO_1 },
101 { PIPE_FORMAT_R16G16B16A16_UNORM, SVGA3D_R16G16B16A16_UNORM, SVGA3D_R16G16B16A16_UNORM, TF_GEN_MIPS },
102 { PIPE_FORMAT_R16_USCALED, SVGA3D_R16_UINT, SVGA3D_FORMAT_INVALID, VF_U_TO_F_CAST },
103 { PIPE_FORMAT_R16G16_USCALED, SVGA3D_R16G16_UINT, SVGA3D_FORMAT_INVALID, VF_U_TO_F_CAST },
104 { PIPE_FORMAT_R16G16B16_USCALED, SVGA3D_R16G16B16A16_UINT, SVGA3D_FORMAT_INVALID, VF_W_TO_1 | VF_U_TO_F_CAST },
105 { PIPE_FORMAT_R16G16B16A16_USCALED, SVGA3D_R16G16B16A16_UINT, SVGA3D_FORMAT_INVALID, VF_U_TO_F_CAST },
106 { PIPE_FORMAT_R16_SNORM, SVGA3D_R16_SNORM, SVGA3D_R16_SNORM, 0 },
107 { PIPE_FORMAT_R16G16_SNORM, SVGA3D_R16G16_SNORM, SVGA3D_R16G16_SNORM, 0 },
108 { PIPE_FORMAT_R16G16B16_SNORM, SVGA3D_R16G16B16A16_SNORM, SVGA3D_FORMAT_INVALID, VF_W_TO_1 },
109 { PIPE_FORMAT_R16G16B16A16_SNORM, SVGA3D_R16G16B16A16_SNORM, SVGA3D_R16G16B16A16_SNORM, 0 },
110 { PIPE_FORMAT_R16_SSCALED, SVGA3D_R16_SINT, SVGA3D_FORMAT_INVALID, VF_I_TO_F_CAST },
111 { PIPE_FORMAT_R16G16_SSCALED, SVGA3D_R16G16_SINT, SVGA3D_FORMAT_INVALID, VF_I_TO_F_CAST },
112 { PIPE_FORMAT_R16G16B16_SSCALED, SVGA3D_R16G16B16A16_SINT, SVGA3D_FORMAT_INVALID, VF_W_TO_1 | VF_I_TO_F_CAST },
113 { PIPE_FORMAT_R16G16B16A16_SSCALED, SVGA3D_R16G16B16A16_SINT, SVGA3D_FORMAT_INVALID, VF_I_TO_F_CAST },
114 { PIPE_FORMAT_R8_UNORM, SVGA3D_R8_UNORM, SVGA3D_R8_UNORM, TF_GEN_MIPS },
115 { PIPE_FORMAT_R8G8_UNORM, SVGA3D_R8G8_UNORM, SVGA3D_R8G8_UNORM, TF_GEN_MIPS },
116 { PIPE_FORMAT_R8G8B8_UNORM, SVGA3D_R8G8B8A8_UNORM, SVGA3D_FORMAT_INVALID, VF_W_TO_1 },
117 { PIPE_FORMAT_R8G8B8A8_UNORM, SVGA3D_R8G8B8A8_UNORM, SVGA3D_R8G8B8A8_UNORM, TF_GEN_MIPS },
118 { PIPE_FORMAT_X8B8G8R8_UNORM, SVGA3D_FORMAT_INVALID, SVGA3D_FORMAT_INVALID, 0 },
119 { PIPE_FORMAT_R8_USCALED, SVGA3D_R8_UINT, SVGA3D_FORMAT_INVALID, VF_U_TO_F_CAST },
120 { PIPE_FORMAT_R8G8_USCALED, SVGA3D_R8G8_UINT, SVGA3D_FORMAT_INVALID, VF_U_TO_F_CAST },
121 { PIPE_FORMAT_R8G8B8_USCALED, SVGA3D_R8G8B8A8_UINT, SVGA3D_FORMAT_INVALID, VF_W_TO_1 | VF_U_TO_F_CAST },
122 { PIPE_FORMAT_R8G8B8A8_USCALED, SVGA3D_R8G8B8A8_UINT, SVGA3D_FORMAT_INVALID, VF_U_TO_F_CAST },
123 { 73, SVGA3D_FORMAT_INVALID, SVGA3D_FORMAT_INVALID, 0 },
124 { PIPE_FORMAT_R8_SNORM, SVGA3D_R8_SNORM, SVGA3D_R8_SNORM, 0 },
125 { PIPE_FORMAT_R8G8_SNORM, SVGA3D_R8G8_SNORM, SVGA3D_R8G8_SNORM, 0 },
126 { PIPE_FORMAT_R8G8B8_SNORM, SVGA3D_R8G8B8A8_SNORM, SVGA3D_FORMAT_INVALID, VF_W_TO_1 },
127 { PIPE_FORMAT_R8G8B8A8_SNORM, SVGA3D_R8G8B8A8_SNORM, SVGA3D_R8G8B8A8_SNORM, 0 },
128 { 78, SVGA3D_FORMAT_INVALID, SVGA3D_FORMAT_INVALID, 0 },
129 { 79, SVGA3D_FORMAT_INVALID, SVGA3D_FORMAT_INVALID, 0 },
130 { 80, SVGA3D_FORMAT_INVALID, SVGA3D_FORMAT_INVALID, 0 },
131 { 81, SVGA3D_FORMAT_INVALID, SVGA3D_FORMAT_INVALID, 0 },
132 { PIPE_FORMAT_R8_SSCALED, SVGA3D_R8_SINT, SVGA3D_FORMAT_INVALID, VF_I_TO_F_CAST },
133 { PIPE_FORMAT_R8G8_SSCALED, SVGA3D_R8G8_SINT, SVGA3D_FORMAT_INVALID, VF_I_TO_F_CAST },
134 { PIPE_FORMAT_R8G8B8_SSCALED, SVGA3D_R8G8B8A8_SINT, SVGA3D_FORMAT_INVALID, VF_W_TO_1 | VF_I_TO_F_CAST },
135 { PIPE_FORMAT_R8G8B8A8_SSCALED, SVGA3D_R8G8B8A8_SINT, SVGA3D_FORMAT_INVALID, VF_I_TO_F_CAST },
136 { 86, SVGA3D_FORMAT_INVALID, SVGA3D_FORMAT_INVALID, 0 },
137 { PIPE_FORMAT_R32_FIXED, SVGA3D_FORMAT_INVALID, SVGA3D_FORMAT_INVALID, 0 },
138 { PIPE_FORMAT_R32G32_FIXED, SVGA3D_FORMAT_INVALID, SVGA3D_FORMAT_INVALID, 0 },
139 { PIPE_FORMAT_R32G32B32_FIXED, SVGA3D_FORMAT_INVALID, SVGA3D_FORMAT_INVALID, 0 },
140 { PIPE_FORMAT_R32G32B32A32_FIXED, SVGA3D_FORMAT_INVALID, SVGA3D_FORMAT_INVALID, 0 },
141 { PIPE_FORMAT_R16_FLOAT, SVGA3D_R16_FLOAT, SVGA3D_R16_FLOAT, TF_GEN_MIPS },
142 { PIPE_FORMAT_R16G16_FLOAT, SVGA3D_R16G16_FLOAT, SVGA3D_R16G16_FLOAT, TF_GEN_MIPS },
143 { PIPE_FORMAT_R16G16B16_FLOAT, SVGA3D_R16G16B16A16_FLOAT, SVGA3D_FORMAT_INVALID, VF_W_TO_1 },
144 { PIPE_FORMAT_R16G16B16A16_FLOAT, SVGA3D_R16G16B16A16_FLOAT, SVGA3D_R16G16B16A16_FLOAT, TF_GEN_MIPS },
145 { PIPE_FORMAT_L8_SRGB, SVGA3D_FORMAT_INVALID, SVGA3D_FORMAT_INVALID, 0 },
146 { PIPE_FORMAT_L8A8_SRGB, SVGA3D_FORMAT_INVALID, SVGA3D_FORMAT_INVALID, 0 },
147 { PIPE_FORMAT_R8G8B8_SRGB, SVGA3D_FORMAT_INVALID, SVGA3D_FORMAT_INVALID, 0 },
148 { PIPE_FORMAT_A8B8G8R8_SRGB, SVGA3D_FORMAT_INVALID, SVGA3D_FORMAT_INVALID, 0 },
149 { PIPE_FORMAT_X8B8G8R8_SRGB, SVGA3D_FORMAT_INVALID, SVGA3D_FORMAT_INVALID, 0 },
150 { PIPE_FORMAT_B8G8R8A8_SRGB, SVGA3D_FORMAT_INVALID, SVGA3D_B8G8R8A8_UNORM_SRGB, TF_GEN_MIPS },
151 { PIPE_FORMAT_B8G8R8X8_SRGB, SVGA3D_FORMAT_INVALID, SVGA3D_B8G8R8X8_UNORM_SRGB, TF_GEN_MIPS },
152 { PIPE_FORMAT_A8R8G8B8_SRGB, SVGA3D_FORMAT_INVALID, SVGA3D_FORMAT_INVALID, 0 },
153 { PIPE_FORMAT_X8R8G8B8_SRGB, SVGA3D_FORMAT_INVALID, SVGA3D_FORMAT_INVALID, 0 },
154 { PIPE_FORMAT_R8G8B8A8_SRGB, SVGA3D_FORMAT_INVALID, SVGA3D_R8G8B8A8_UNORM_SRGB, TF_GEN_MIPS },
155 { PIPE_FORMAT_DXT1_RGB, SVGA3D_FORMAT_INVALID, SVGA3D_BC1_UNORM, 0 },
156 { PIPE_FORMAT_DXT1_RGBA, SVGA3D_FORMAT_INVALID, SVGA3D_BC1_UNORM, 0 },
157 { PIPE_FORMAT_DXT3_RGBA, SVGA3D_FORMAT_INVALID, SVGA3D_BC2_UNORM, 0 },
158 { PIPE_FORMAT_DXT5_RGBA, SVGA3D_FORMAT_INVALID, SVGA3D_BC3_UNORM, 0 },
159 { PIPE_FORMAT_DXT1_SRGB, SVGA3D_FORMAT_INVALID, SVGA3D_BC1_UNORM_SRGB, 0 },
160 { PIPE_FORMAT_DXT1_SRGBA, SVGA3D_FORMAT_INVALID, SVGA3D_BC1_UNORM_SRGB, 0 },
161 { PIPE_FORMAT_DXT3_SRGBA, SVGA3D_FORMAT_INVALID, SVGA3D_BC2_UNORM_SRGB, 0 },
162 { PIPE_FORMAT_DXT5_SRGBA, SVGA3D_FORMAT_INVALID, SVGA3D_BC3_UNORM_SRGB, 0 },
163 { PIPE_FORMAT_RGTC1_UNORM, SVGA3D_FORMAT_INVALID, SVGA3D_BC4_UNORM, 0 },
164 { PIPE_FORMAT_RGTC1_SNORM, SVGA3D_FORMAT_INVALID, SVGA3D_BC4_SNORM, 0 },
165 { PIPE_FORMAT_RGTC2_UNORM, SVGA3D_FORMAT_INVALID, SVGA3D_BC5_UNORM, 0 },
166 { PIPE_FORMAT_RGTC2_SNORM, SVGA3D_FORMAT_INVALID, SVGA3D_BC5_SNORM, 0 },
167 { PIPE_FORMAT_R8G8_B8G8_UNORM, SVGA3D_FORMAT_INVALID, SVGA3D_FORMAT_INVALID, 0 },
168 { PIPE_FORMAT_G8R8_G8B8_UNORM, SVGA3D_FORMAT_INVALID, SVGA3D_FORMAT_INVALID, 0 },
169 { PIPE_FORMAT_R8SG8SB8UX8U_NORM, SVGA3D_FORMAT_INVALID, SVGA3D_FORMAT_INVALID, 0 },
170 { PIPE_FORMAT_R5SG5SB6U_NORM, SVGA3D_FORMAT_INVALID, SVGA3D_FORMAT_INVALID, 0 },
171 { PIPE_FORMAT_A8B8G8R8_UNORM, SVGA3D_FORMAT_INVALID, SVGA3D_FORMAT_INVALID, 0 },
172 { PIPE_FORMAT_B5G5R5X1_UNORM, SVGA3D_FORMAT_INVALID, SVGA3D_FORMAT_INVALID, 0 },
173 { PIPE_FORMAT_R10G10B10A2_USCALED, SVGA3D_R10G10B10A2_UNORM, SVGA3D_FORMAT_INVALID, VF_PUINT_TO_USCALED },
174 { PIPE_FORMAT_R11G11B10_FLOAT, SVGA3D_FORMAT_INVALID, SVGA3D_R11G11B10_FLOAT, TF_GEN_MIPS },
175 { PIPE_FORMAT_R9G9B9E5_FLOAT, SVGA3D_FORMAT_INVALID, SVGA3D_R9G9B9E5_SHAREDEXP, 0 },
176 { PIPE_FORMAT_Z32_FLOAT_S8X24_UINT, SVGA3D_FORMAT_INVALID, SVGA3D_D32_FLOAT_S8X24_UINT, 0 },
177 { PIPE_FORMAT_R1_UNORM, SVGA3D_FORMAT_INVALID, SVGA3D_FORMAT_INVALID, 0 },
178 { PIPE_FORMAT_R10G10B10X2_USCALED, SVGA3D_FORMAT_INVALID, SVGA3D_FORMAT_INVALID, 0 },
179 { PIPE_FORMAT_R10G10B10X2_SNORM, SVGA3D_FORMAT_INVALID, SVGA3D_FORMAT_INVALID, 0 },
180 { PIPE_FORMAT_L4A4_UNORM, SVGA3D_FORMAT_INVALID, SVGA3D_FORMAT_INVALID, 0 },
181 { PIPE_FORMAT_B10G10R10A2_UNORM, SVGA3D_R10G10B10A2_UNORM, SVGA3D_FORMAT_INVALID, VF_BGRA },
182 { PIPE_FORMAT_R10SG10SB10SA2U_NORM, SVGA3D_FORMAT_INVALID, SVGA3D_FORMAT_INVALID, 0 },
183 { PIPE_FORMAT_R8G8Bx_SNORM, SVGA3D_FORMAT_INVALID, SVGA3D_FORMAT_INVALID, 0 },
184 { PIPE_FORMAT_R8G8B8X8_UNORM, SVGA3D_FORMAT_INVALID, SVGA3D_FORMAT_INVALID, 0 },
185 { PIPE_FORMAT_B4G4R4X4_UNORM, SVGA3D_FORMAT_INVALID, SVGA3D_FORMAT_INVALID, 0 },
186 { PIPE_FORMAT_X24S8_UINT, SVGA3D_FORMAT_INVALID, SVGA3D_FORMAT_INVALID, 0 },
187 { PIPE_FORMAT_S8X24_UINT, SVGA3D_FORMAT_INVALID, SVGA3D_FORMAT_INVALID, 0 },
188 { PIPE_FORMAT_X32_S8X24_UINT, SVGA3D_FORMAT_INVALID, SVGA3D_FORMAT_INVALID, 0 },
189 { PIPE_FORMAT_B2G3R3_UNORM, SVGA3D_FORMAT_INVALID, SVGA3D_FORMAT_INVALID, 0 },
190 { PIPE_FORMAT_L16A16_UNORM, SVGA3D_FORMAT_INVALID, SVGA3D_FORMAT_INVALID, 0 },
191 { PIPE_FORMAT_A16_UNORM, SVGA3D_FORMAT_INVALID, SVGA3D_FORMAT_INVALID, 0 },
192 { PIPE_FORMAT_I16_UNORM, SVGA3D_FORMAT_INVALID, SVGA3D_FORMAT_INVALID, 0 },
193 { PIPE_FORMAT_LATC1_UNORM, SVGA3D_FORMAT_INVALID, SVGA3D_FORMAT_INVALID, 0 },
194 { PIPE_FORMAT_LATC1_SNORM, SVGA3D_FORMAT_INVALID, SVGA3D_FORMAT_INVALID, 0 },
195 { PIPE_FORMAT_LATC2_UNORM, SVGA3D_FORMAT_INVALID, SVGA3D_FORMAT_INVALID, 0 },
196 { PIPE_FORMAT_LATC2_SNORM, SVGA3D_FORMAT_INVALID, SVGA3D_FORMAT_INVALID, 0 },
197 { PIPE_FORMAT_A8_SNORM, SVGA3D_FORMAT_INVALID, SVGA3D_FORMAT_INVALID, 0 },
198 { PIPE_FORMAT_L8_SNORM, SVGA3D_FORMAT_INVALID, SVGA3D_FORMAT_INVALID, 0 },
199 { PIPE_FORMAT_L8A8_SNORM, SVGA3D_FORMAT_INVALID, SVGA3D_FORMAT_INVALID, 0 },
200 { PIPE_FORMAT_I8_SNORM, SVGA3D_FORMAT_INVALID, SVGA3D_FORMAT_INVALID, 0 },
201 { PIPE_FORMAT_A16_SNORM, SVGA3D_FORMAT_INVALID, SVGA3D_FORMAT_INVALID, 0 },
202 { PIPE_FORMAT_L16_SNORM, SVGA3D_FORMAT_INVALID, SVGA3D_FORMAT_INVALID, 0 },
203 { PIPE_FORMAT_L16A16_SNORM, SVGA3D_FORMAT_INVALID, SVGA3D_FORMAT_INVALID, 0 },
204 { PIPE_FORMAT_I16_SNORM, SVGA3D_FORMAT_INVALID, SVGA3D_FORMAT_INVALID, 0 },
205 { PIPE_FORMAT_A16_FLOAT, SVGA3D_FORMAT_INVALID, SVGA3D_FORMAT_INVALID, 0 },
206 { PIPE_FORMAT_L16_FLOAT, SVGA3D_FORMAT_INVALID, SVGA3D_FORMAT_INVALID, 0 },
207 { PIPE_FORMAT_L16A16_FLOAT, SVGA3D_FORMAT_INVALID, SVGA3D_FORMAT_INVALID, 0 },
208 { PIPE_FORMAT_I16_FLOAT, SVGA3D_FORMAT_INVALID, SVGA3D_FORMAT_INVALID, 0 },
209 { PIPE_FORMAT_A32_FLOAT, SVGA3D_FORMAT_INVALID, SVGA3D_FORMAT_INVALID, 0 },
210 { PIPE_FORMAT_L32_FLOAT, SVGA3D_FORMAT_INVALID, SVGA3D_FORMAT_INVALID, 0 },
211 { PIPE_FORMAT_L32A32_FLOAT, SVGA3D_FORMAT_INVALID, SVGA3D_FORMAT_INVALID, 0 },
212 { PIPE_FORMAT_I32_FLOAT, SVGA3D_FORMAT_INVALID, SVGA3D_FORMAT_INVALID, 0 },
213 { PIPE_FORMAT_YV12, SVGA3D_FORMAT_INVALID, SVGA3D_FORMAT_INVALID, 0 },
214 { PIPE_FORMAT_YV16, SVGA3D_FORMAT_INVALID, SVGA3D_FORMAT_INVALID, 0 },
215 { PIPE_FORMAT_IYUV, SVGA3D_FORMAT_INVALID, SVGA3D_FORMAT_INVALID, 0 },
216 { PIPE_FORMAT_NV12, SVGA3D_FORMAT_INVALID, SVGA3D_FORMAT_INVALID, 0 },
217 { PIPE_FORMAT_NV21, SVGA3D_FORMAT_INVALID, SVGA3D_FORMAT_INVALID, 0 },
218 { PIPE_FORMAT_A4R4_UNORM, SVGA3D_FORMAT_INVALID, SVGA3D_FORMAT_INVALID, 0 },
219 { PIPE_FORMAT_R4A4_UNORM, SVGA3D_FORMAT_INVALID, SVGA3D_FORMAT_INVALID, 0 },
220 { PIPE_FORMAT_R8A8_UNORM, SVGA3D_FORMAT_INVALID, SVGA3D_FORMAT_INVALID, 0 },
221 { PIPE_FORMAT_A8R8_UNORM, SVGA3D_FORMAT_INVALID, SVGA3D_FORMAT_INVALID, 0 },
222 { PIPE_FORMAT_R10G10B10A2_SSCALED, SVGA3D_R32_UINT, SVGA3D_FORMAT_INVALID, VF_PUINT_TO_SSCALED },
223 { PIPE_FORMAT_R10G10B10A2_SNORM, SVGA3D_R10G10B10A2_UNORM, SVGA3D_FORMAT_INVALID, VF_PUINT_TO_SNORM },
224 { PIPE_FORMAT_B10G10R10A2_USCALED, SVGA3D_R10G10B10A2_UNORM, SVGA3D_FORMAT_INVALID, VF_BGRA | VF_PUINT_TO_USCALED },
225 { PIPE_FORMAT_B10G10R10A2_SSCALED, SVGA3D_R32_UINT, SVGA3D_FORMAT_INVALID, VF_BGRA | VF_PUINT_TO_SSCALED },
226 { PIPE_FORMAT_B10G10R10A2_SNORM, SVGA3D_R10G10B10A2_UNORM, SVGA3D_FORMAT_INVALID, VF_BGRA | VF_PUINT_TO_SNORM },
227 { PIPE_FORMAT_R8_UINT, SVGA3D_R8_UINT, SVGA3D_R8_UINT, 0 },
228 { PIPE_FORMAT_R8G8_UINT, SVGA3D_R8G8_UINT, SVGA3D_R8G8_UINT, 0 },
229 { PIPE_FORMAT_R8G8B8_UINT, SVGA3D_R8G8B8A8_UINT, SVGA3D_FORMAT_INVALID, VF_W_TO_1 },
230 { PIPE_FORMAT_R8G8B8A8_UINT, SVGA3D_R8G8B8A8_UINT, SVGA3D_R8G8B8A8_UINT, 0 },
231 { PIPE_FORMAT_R8_SINT, SVGA3D_R8_SINT, SVGA3D_R8_SINT, 0 },
232 { PIPE_FORMAT_R8G8_SINT, SVGA3D_R8G8_SINT, SVGA3D_R8G8_SINT, 0 },
233 { PIPE_FORMAT_R8G8B8_SINT, SVGA3D_R8G8B8A8_SINT, SVGA3D_FORMAT_INVALID, VF_W_TO_1 },
234 { PIPE_FORMAT_R8G8B8A8_SINT, SVGA3D_R8G8B8A8_SINT, SVGA3D_R8G8B8A8_SINT, 0 },
235 { PIPE_FORMAT_R16_UINT, SVGA3D_R16_UINT, SVGA3D_R16_UINT, 0 },
236 { PIPE_FORMAT_R16G16_UINT, SVGA3D_R16G16_UINT, SVGA3D_R16G16_UINT, 0 },
237 { PIPE_FORMAT_R16G16B16_UINT, SVGA3D_R16G16B16A16_UINT, SVGA3D_FORMAT_INVALID, VF_W_TO_1 },
238 { PIPE_FORMAT_R16G16B16A16_UINT, SVGA3D_R16G16B16A16_UINT, SVGA3D_R16G16B16A16_UINT, 0 },
239 { PIPE_FORMAT_R16_SINT, SVGA3D_R16_SINT, SVGA3D_R16_SINT, 0 },
240 { PIPE_FORMAT_R16G16_SINT, SVGA3D_R16G16_SINT, SVGA3D_R16G16_SINT, 0 },
241 { PIPE_FORMAT_R16G16B16_SINT, SVGA3D_R16G16B16A16_SINT, SVGA3D_FORMAT_INVALID, VF_W_TO_1 },
242 { PIPE_FORMAT_R16G16B16A16_SINT, SVGA3D_R16G16B16A16_SINT, SVGA3D_R16G16B16A16_SINT, 0 },
243 { PIPE_FORMAT_R32_UINT, SVGA3D_R32_UINT, SVGA3D_R32_UINT, 0 },
244 { PIPE_FORMAT_R32G32_UINT, SVGA3D_R32G32_UINT, SVGA3D_R32G32_UINT, 0 },
245 { PIPE_FORMAT_R32G32B32_UINT, SVGA3D_R32G32B32_UINT, SVGA3D_FORMAT_INVALID, 0 },
246 { PIPE_FORMAT_R32G32B32A32_UINT, SVGA3D_R32G32B32A32_UINT, SVGA3D_R32G32B32A32_UINT, 0 },
247 { PIPE_FORMAT_R32_SINT, SVGA3D_R32_SINT, SVGA3D_R32_SINT, 0 },
248 { PIPE_FORMAT_R32G32_SINT, SVGA3D_R32G32_SINT, SVGA3D_R32G32_SINT, 0 },
249 { PIPE_FORMAT_R32G32B32_SINT, SVGA3D_R32G32B32_SINT, SVGA3D_FORMAT_INVALID, 0 },
250 { PIPE_FORMAT_R32G32B32A32_SINT, SVGA3D_R32G32B32A32_SINT, SVGA3D_R32G32B32A32_SINT, 0 },
251 { PIPE_FORMAT_A8_UINT, SVGA3D_FORMAT_INVALID, SVGA3D_FORMAT_INVALID, 0 },
252 { PIPE_FORMAT_I8_UINT, SVGA3D_FORMAT_INVALID, SVGA3D_FORMAT_INVALID, 0 },
253 { PIPE_FORMAT_L8_UINT, SVGA3D_FORMAT_INVALID, SVGA3D_FORMAT_INVALID, 0 },
254 { PIPE_FORMAT_L8A8_UINT, SVGA3D_FORMAT_INVALID, SVGA3D_FORMAT_INVALID, 0 },
255 { PIPE_FORMAT_A8_SINT, SVGA3D_FORMAT_INVALID, SVGA3D_FORMAT_INVALID, 0 },
256 { PIPE_FORMAT_I8_SINT, SVGA3D_FORMAT_INVALID, SVGA3D_FORMAT_INVALID, 0 },
257 { PIPE_FORMAT_L8_SINT, SVGA3D_FORMAT_INVALID, SVGA3D_FORMAT_INVALID, 0 },
258 { PIPE_FORMAT_L8A8_SINT, SVGA3D_FORMAT_INVALID, SVGA3D_FORMAT_INVALID, 0 },
259 { PIPE_FORMAT_A16_UINT, SVGA3D_FORMAT_INVALID, SVGA3D_FORMAT_INVALID, 0 },
260 { PIPE_FORMAT_I16_UINT, SVGA3D_FORMAT_INVALID, SVGA3D_FORMAT_INVALID, 0 },
261 { PIPE_FORMAT_L16_UINT, SVGA3D_FORMAT_INVALID, SVGA3D_FORMAT_INVALID, 0 },
262 { PIPE_FORMAT_L16A16_UINT, SVGA3D_FORMAT_INVALID, SVGA3D_FORMAT_INVALID, 0 },
263 { PIPE_FORMAT_A16_SINT, SVGA3D_FORMAT_INVALID, SVGA3D_FORMAT_INVALID, 0 },
264 { PIPE_FORMAT_I16_SINT, SVGA3D_FORMAT_INVALID, SVGA3D_FORMAT_INVALID, 0 },
265 { PIPE_FORMAT_L16_SINT, SVGA3D_FORMAT_INVALID, SVGA3D_FORMAT_INVALID, 0 },
266 { PIPE_FORMAT_L16A16_SINT, SVGA3D_FORMAT_INVALID, SVGA3D_FORMAT_INVALID, 0 },
267 { PIPE_FORMAT_A32_UINT, SVGA3D_FORMAT_INVALID, SVGA3D_FORMAT_INVALID, 0 },
268 { PIPE_FORMAT_I32_UINT, SVGA3D_FORMAT_INVALID, SVGA3D_FORMAT_INVALID, 0 },
269 { PIPE_FORMAT_L32_UINT, SVGA3D_FORMAT_INVALID, SVGA3D_FORMAT_INVALID, 0 },
270 { PIPE_FORMAT_L32A32_UINT, SVGA3D_FORMAT_INVALID, SVGA3D_FORMAT_INVALID, 0 },
271 { PIPE_FORMAT_A32_SINT, SVGA3D_FORMAT_INVALID, SVGA3D_FORMAT_INVALID, 0 },
272 { PIPE_FORMAT_I32_SINT, SVGA3D_FORMAT_INVALID, SVGA3D_FORMAT_INVALID, 0 },
273 { PIPE_FORMAT_L32_SINT, SVGA3D_FORMAT_INVALID, SVGA3D_FORMAT_INVALID, 0 },
274 { PIPE_FORMAT_L32A32_SINT, SVGA3D_FORMAT_INVALID, SVGA3D_FORMAT_INVALID, 0 },
275 { PIPE_FORMAT_B10G10R10A2_UINT, SVGA3D_FORMAT_INVALID, SVGA3D_FORMAT_INVALID, 0 },
276 { PIPE_FORMAT_ETC1_RGB8, SVGA3D_FORMAT_INVALID, SVGA3D_FORMAT_INVALID, 0 },
277 { PIPE_FORMAT_R8G8_R8B8_UNORM, SVGA3D_FORMAT_INVALID, SVGA3D_FORMAT_INVALID, 0 },
278 { PIPE_FORMAT_G8R8_B8R8_UNORM, SVGA3D_FORMAT_INVALID, SVGA3D_FORMAT_INVALID, 0 },
279 { PIPE_FORMAT_R8G8B8X8_SNORM, SVGA3D_FORMAT_INVALID, SVGA3D_FORMAT_INVALID, 0 },
280 { PIPE_FORMAT_R8G8B8X8_SRGB, SVGA3D_FORMAT_INVALID, SVGA3D_FORMAT_INVALID, 0 },
281 { PIPE_FORMAT_R8G8B8X8_UINT, SVGA3D_FORMAT_INVALID, SVGA3D_FORMAT_INVALID, 0 },
282 { PIPE_FORMAT_R8G8B8X8_SINT, SVGA3D_FORMAT_INVALID, SVGA3D_FORMAT_INVALID, 0 },
283 { PIPE_FORMAT_B10G10R10X2_UNORM, SVGA3D_FORMAT_INVALID, SVGA3D_FORMAT_INVALID, 0 },
284 { PIPE_FORMAT_R16G16B16X16_UNORM, SVGA3D_FORMAT_INVALID, SVGA3D_FORMAT_INVALID, 0 },
285 { PIPE_FORMAT_R16G16B16X16_SNORM, SVGA3D_FORMAT_INVALID, SVGA3D_FORMAT_INVALID, 0 },
286 { PIPE_FORMAT_R16G16B16X16_FLOAT, SVGA3D_FORMAT_INVALID, SVGA3D_FORMAT_INVALID, 0 },
287 { PIPE_FORMAT_R16G16B16X16_UINT, SVGA3D_FORMAT_INVALID, SVGA3D_FORMAT_INVALID, 0 },
288 { PIPE_FORMAT_R16G16B16X16_SINT, SVGA3D_FORMAT_INVALID, SVGA3D_FORMAT_INVALID, 0 },
289 { PIPE_FORMAT_R32G32B32X32_FLOAT, SVGA3D_FORMAT_INVALID, SVGA3D_FORMAT_INVALID, 0 },
290 { PIPE_FORMAT_R32G32B32X32_UINT, SVGA3D_FORMAT_INVALID, SVGA3D_FORMAT_INVALID, 0 },
291 { PIPE_FORMAT_R32G32B32X32_SINT, SVGA3D_FORMAT_INVALID, SVGA3D_FORMAT_INVALID, 0 },
292 { PIPE_FORMAT_R8A8_SNORM, SVGA3D_FORMAT_INVALID, SVGA3D_FORMAT_INVALID, 0 },
293 { PIPE_FORMAT_R16A16_UNORM, SVGA3D_FORMAT_INVALID, SVGA3D_FORMAT_INVALID, 0 },
294 { PIPE_FORMAT_R16A16_SNORM, SVGA3D_FORMAT_INVALID, SVGA3D_FORMAT_INVALID, 0 },
295 { PIPE_FORMAT_R16A16_FLOAT, SVGA3D_FORMAT_INVALID, SVGA3D_FORMAT_INVALID, 0 },
296 { PIPE_FORMAT_R32A32_FLOAT, SVGA3D_FORMAT_INVALID, SVGA3D_FORMAT_INVALID, 0 },
297 { PIPE_FORMAT_R8A8_UINT, SVGA3D_FORMAT_INVALID, SVGA3D_FORMAT_INVALID, 0 },
298 { PIPE_FORMAT_R8A8_SINT, SVGA3D_FORMAT_INVALID, SVGA3D_FORMAT_INVALID, 0 },
299 { PIPE_FORMAT_R16A16_UINT, SVGA3D_FORMAT_INVALID, SVGA3D_FORMAT_INVALID, 0 },
300 { PIPE_FORMAT_R16A16_SINT, SVGA3D_FORMAT_INVALID, SVGA3D_FORMAT_INVALID, 0 },
301 { PIPE_FORMAT_R32A32_UINT, SVGA3D_FORMAT_INVALID, SVGA3D_FORMAT_INVALID, 0 },
302 { PIPE_FORMAT_R32A32_SINT, SVGA3D_FORMAT_INVALID, SVGA3D_FORMAT_INVALID, 0 },
303 { PIPE_FORMAT_R10G10B10A2_UINT, SVGA3D_R10G10B10A2_UINT, SVGA3D_R10G10B10A2_UINT, 0 },
304 { PIPE_FORMAT_B5G6R5_SRGB, SVGA3D_FORMAT_INVALID, SVGA3D_FORMAT_INVALID, 0 },
305 { PIPE_FORMAT_BPTC_RGBA_UNORM, SVGA3D_FORMAT_INVALID, SVGA3D_FORMAT_INVALID, 0 },
306 { PIPE_FORMAT_BPTC_SRGBA, SVGA3D_FORMAT_INVALID, SVGA3D_FORMAT_INVALID, 0 },
307 { PIPE_FORMAT_BPTC_RGB_FLOAT, SVGA3D_FORMAT_INVALID, SVGA3D_FORMAT_INVALID, 0 },
308 { PIPE_FORMAT_BPTC_RGB_UFLOAT, SVGA3D_FORMAT_INVALID, SVGA3D_FORMAT_INVALID, 0 },
309 { PIPE_FORMAT_A8L8_UNORM, SVGA3D_FORMAT_INVALID, SVGA3D_FORMAT_INVALID, 0 },
310 { PIPE_FORMAT_A8L8_SNORM, SVGA3D_FORMAT_INVALID, SVGA3D_FORMAT_INVALID, 0 },
311 { PIPE_FORMAT_A8L8_SRGB, SVGA3D_FORMAT_INVALID, SVGA3D_FORMAT_INVALID, 0 },
312 { PIPE_FORMAT_A16L16_UNORM, SVGA3D_FORMAT_INVALID, SVGA3D_FORMAT_INVALID, 0 },
313 { PIPE_FORMAT_G8R8_UNORM, SVGA3D_FORMAT_INVALID, SVGA3D_FORMAT_INVALID, 0 },
314 { PIPE_FORMAT_G8R8_SNORM, SVGA3D_FORMAT_INVALID, SVGA3D_FORMAT_INVALID, 0 },
315 { PIPE_FORMAT_G16R16_UNORM, SVGA3D_FORMAT_INVALID, SVGA3D_FORMAT_INVALID, 0 },
316 { PIPE_FORMAT_G16R16_SNORM, SVGA3D_FORMAT_INVALID, SVGA3D_FORMAT_INVALID, 0 },
317 { PIPE_FORMAT_A8B8G8R8_SNORM, SVGA3D_FORMAT_INVALID, SVGA3D_FORMAT_INVALID, 0 },
318 { PIPE_FORMAT_X8B8G8R8_SNORM, SVGA3D_FORMAT_INVALID, SVGA3D_FORMAT_INVALID, 0 },
319 { PIPE_FORMAT_ETC2_RGB8, SVGA3D_FORMAT_INVALID, SVGA3D_FORMAT_INVALID, 0 },
320 { PIPE_FORMAT_ETC2_SRGB8, SVGA3D_FORMAT_INVALID, SVGA3D_FORMAT_INVALID, 0 },
321 { PIPE_FORMAT_ETC2_RGB8A1, SVGA3D_FORMAT_INVALID, SVGA3D_FORMAT_INVALID, 0 },
322 { PIPE_FORMAT_ETC2_SRGB8A1, SVGA3D_FORMAT_INVALID, SVGA3D_FORMAT_INVALID, 0 },
323 { PIPE_FORMAT_ETC2_RGBA8, SVGA3D_FORMAT_INVALID, SVGA3D_FORMAT_INVALID, 0 },
324 { PIPE_FORMAT_ETC2_SRGBA8, SVGA3D_FORMAT_INVALID, SVGA3D_FORMAT_INVALID, 0 },
325 { PIPE_FORMAT_ETC2_R11_UNORM, SVGA3D_FORMAT_INVALID, SVGA3D_FORMAT_INVALID, 0 },
326 { PIPE_FORMAT_ETC2_R11_SNORM, SVGA3D_FORMAT_INVALID, SVGA3D_FORMAT_INVALID, 0 },
327 { PIPE_FORMAT_ETC2_RG11_UNORM, SVGA3D_FORMAT_INVALID, SVGA3D_FORMAT_INVALID, 0 },
328 { PIPE_FORMAT_ETC2_RG11_SNORM, SVGA3D_FORMAT_INVALID, SVGA3D_FORMAT_INVALID, 0 },
329 { PIPE_FORMAT_ASTC_4x4, SVGA3D_FORMAT_INVALID, SVGA3D_FORMAT_INVALID, 0 },
330 { PIPE_FORMAT_ASTC_5x4, SVGA3D_FORMAT_INVALID, SVGA3D_FORMAT_INVALID, 0 },
331 { PIPE_FORMAT_ASTC_5x5, SVGA3D_FORMAT_INVALID, SVGA3D_FORMAT_INVALID, 0 },
332 { PIPE_FORMAT_ASTC_6x5, SVGA3D_FORMAT_INVALID, SVGA3D_FORMAT_INVALID, 0 },
333 { PIPE_FORMAT_ASTC_6x6, SVGA3D_FORMAT_INVALID, SVGA3D_FORMAT_INVALID, 0 },
334 { PIPE_FORMAT_ASTC_8x5, SVGA3D_FORMAT_INVALID, SVGA3D_FORMAT_INVALID, 0 },
335 { PIPE_FORMAT_ASTC_8x6, SVGA3D_FORMAT_INVALID, SVGA3D_FORMAT_INVALID, 0 },
336 { PIPE_FORMAT_ASTC_8x8, SVGA3D_FORMAT_INVALID, SVGA3D_FORMAT_INVALID, 0 },
337 { PIPE_FORMAT_ASTC_10x5, SVGA3D_FORMAT_INVALID, SVGA3D_FORMAT_INVALID, 0 },
338 { PIPE_FORMAT_ASTC_10x6, SVGA3D_FORMAT_INVALID, SVGA3D_FORMAT_INVALID, 0 },
339 { PIPE_FORMAT_ASTC_10x8, SVGA3D_FORMAT_INVALID, SVGA3D_FORMAT_INVALID, 0 },
340 { PIPE_FORMAT_ASTC_10x10, SVGA3D_FORMAT_INVALID, SVGA3D_FORMAT_INVALID, 0 },
341 { PIPE_FORMAT_ASTC_12x10, SVGA3D_FORMAT_INVALID, SVGA3D_FORMAT_INVALID, 0 },
342 { PIPE_FORMAT_ASTC_12x12, SVGA3D_FORMAT_INVALID, SVGA3D_FORMAT_INVALID, 0 },
343 { PIPE_FORMAT_ASTC_4x4_SRGB, SVGA3D_FORMAT_INVALID, SVGA3D_FORMAT_INVALID, 0 },
344 { PIPE_FORMAT_ASTC_5x4_SRGB, SVGA3D_FORMAT_INVALID, SVGA3D_FORMAT_INVALID, 0 },
345 { PIPE_FORMAT_ASTC_5x5_SRGB, SVGA3D_FORMAT_INVALID, SVGA3D_FORMAT_INVALID, 0 },
346 { PIPE_FORMAT_ASTC_6x5_SRGB, SVGA3D_FORMAT_INVALID, SVGA3D_FORMAT_INVALID, 0 },
347 { PIPE_FORMAT_ASTC_6x6_SRGB, SVGA3D_FORMAT_INVALID, SVGA3D_FORMAT_INVALID, 0 },
348 { PIPE_FORMAT_ASTC_8x5_SRGB, SVGA3D_FORMAT_INVALID, SVGA3D_FORMAT_INVALID, 0 },
349 { PIPE_FORMAT_ASTC_8x6_SRGB, SVGA3D_FORMAT_INVALID, SVGA3D_FORMAT_INVALID, 0 },
350 { PIPE_FORMAT_ASTC_8x8_SRGB, SVGA3D_FORMAT_INVALID, SVGA3D_FORMAT_INVALID, 0 },
351 { PIPE_FORMAT_ASTC_10x5_SRGB, SVGA3D_FORMAT_INVALID, SVGA3D_FORMAT_INVALID, 0 },
352 { PIPE_FORMAT_ASTC_10x6_SRGB, SVGA3D_FORMAT_INVALID, SVGA3D_FORMAT_INVALID, 0 },
353 { PIPE_FORMAT_ASTC_10x8_SRGB, SVGA3D_FORMAT_INVALID, SVGA3D_FORMAT_INVALID, 0 },
354 { PIPE_FORMAT_ASTC_10x10_SRGB, SVGA3D_FORMAT_INVALID, SVGA3D_FORMAT_INVALID, 0 },
355 { PIPE_FORMAT_ASTC_12x10_SRGB, SVGA3D_FORMAT_INVALID, SVGA3D_FORMAT_INVALID, 0 },
356 { PIPE_FORMAT_ASTC_12x12_SRGB, SVGA3D_FORMAT_INVALID, SVGA3D_FORMAT_INVALID, 0 },
357 };
358
359
360 /**
361 * Translate a gallium vertex format to a vgpu10 vertex format.
362 * Also, return any special vertex format flags.
363 */
364 void
svga_translate_vertex_format_vgpu10(enum pipe_format format,SVGA3dSurfaceFormat * svga_format,unsigned * vf_flags)365 svga_translate_vertex_format_vgpu10(enum pipe_format format,
366 SVGA3dSurfaceFormat *svga_format,
367 unsigned *vf_flags)
368 {
369 assert(format < ARRAY_SIZE(format_conversion_table));
370 if (format >= ARRAY_SIZE(format_conversion_table)) {
371 format = PIPE_FORMAT_NONE;
372 }
373 *svga_format = format_conversion_table[format].vertex_format;
374 *vf_flags = format_conversion_table[format].flags;
375 }
376
377
378 /*
379 * Translate from gallium format to SVGA3D format.
380 */
381 SVGA3dSurfaceFormat
svga_translate_format(const struct svga_screen * ss,enum pipe_format format,unsigned bind)382 svga_translate_format(const struct svga_screen *ss,
383 enum pipe_format format,
384 unsigned bind)
385 {
386 if (ss->sws->have_vgpu10) {
387 if (bind & (PIPE_BIND_VERTEX_BUFFER | PIPE_BIND_INDEX_BUFFER)) {
388 return format_conversion_table[format].vertex_format;
389 }
390 else {
391 return format_conversion_table[format].pixel_format;
392 }
393 }
394
395 switch(format) {
396 case PIPE_FORMAT_B8G8R8A8_UNORM:
397 return SVGA3D_A8R8G8B8;
398 case PIPE_FORMAT_B8G8R8X8_UNORM:
399 return SVGA3D_X8R8G8B8;
400
401 /* sRGB required for GL2.1 */
402 case PIPE_FORMAT_B8G8R8A8_SRGB:
403 return SVGA3D_A8R8G8B8;
404 case PIPE_FORMAT_DXT1_SRGB:
405 case PIPE_FORMAT_DXT1_SRGBA:
406 return SVGA3D_DXT1;
407 case PIPE_FORMAT_DXT3_SRGBA:
408 return SVGA3D_DXT3;
409 case PIPE_FORMAT_DXT5_SRGBA:
410 return SVGA3D_DXT5;
411
412 case PIPE_FORMAT_B5G6R5_UNORM:
413 return SVGA3D_R5G6B5;
414 case PIPE_FORMAT_B5G5R5A1_UNORM:
415 return SVGA3D_A1R5G5B5;
416 case PIPE_FORMAT_B4G4R4A4_UNORM:
417 return SVGA3D_A4R4G4B4;
418
419 case PIPE_FORMAT_R16G16B16A16_UNORM:
420 return SVGA3D_A16B16G16R16;
421
422 case PIPE_FORMAT_Z16_UNORM:
423 assert(!ss->sws->have_vgpu10);
424 return bind & PIPE_BIND_SAMPLER_VIEW ? ss->depth.z16 : SVGA3D_Z_D16;
425 case PIPE_FORMAT_S8_UINT_Z24_UNORM:
426 assert(!ss->sws->have_vgpu10);
427 return bind & PIPE_BIND_SAMPLER_VIEW ? ss->depth.s8z24 : SVGA3D_Z_D24S8;
428 case PIPE_FORMAT_X8Z24_UNORM:
429 assert(!ss->sws->have_vgpu10);
430 return bind & PIPE_BIND_SAMPLER_VIEW ? ss->depth.x8z24 : SVGA3D_Z_D24X8;
431
432 case PIPE_FORMAT_A8_UNORM:
433 return SVGA3D_ALPHA8;
434 case PIPE_FORMAT_L8_UNORM:
435 return SVGA3D_LUMINANCE8;
436
437 case PIPE_FORMAT_DXT1_RGB:
438 case PIPE_FORMAT_DXT1_RGBA:
439 return SVGA3D_DXT1;
440 case PIPE_FORMAT_DXT3_RGBA:
441 return SVGA3D_DXT3;
442 case PIPE_FORMAT_DXT5_RGBA:
443 return SVGA3D_DXT5;
444
445 /* Float formats (only 1, 2 and 4-component formats supported) */
446 case PIPE_FORMAT_R32_FLOAT:
447 return SVGA3D_R_S23E8;
448 case PIPE_FORMAT_R32G32_FLOAT:
449 return SVGA3D_RG_S23E8;
450 case PIPE_FORMAT_R32G32B32A32_FLOAT:
451 return SVGA3D_ARGB_S23E8;
452 case PIPE_FORMAT_R16_FLOAT:
453 return SVGA3D_R_S10E5;
454 case PIPE_FORMAT_R16G16_FLOAT:
455 return SVGA3D_RG_S10E5;
456 case PIPE_FORMAT_R16G16B16A16_FLOAT:
457 return SVGA3D_ARGB_S10E5;
458
459 case PIPE_FORMAT_Z32_UNORM:
460 /* SVGA3D_Z_D32 is not yet unsupported */
461 /* fall-through */
462 default:
463 return SVGA3D_FORMAT_INVALID;
464 }
465 }
466
467
468 /*
469 * Format capability description entry.
470 */
471 struct format_cap {
472 const char *name;
473
474 SVGA3dSurfaceFormat format;
475
476 /*
477 * Capability index corresponding to the format.
478 */
479 SVGA3dDevCapIndex devcap;
480
481 /* size of each pixel/block */
482 unsigned block_width, block_height, block_bytes;
483
484 /*
485 * Mask of supported SVGA3dFormatOp operations, to be inferred when the
486 * capability is not explicitly present.
487 */
488 uint32 defaultOperations;
489 };
490
491
492 /*
493 * Format capability description table.
494 *
495 * Ordered by increasing SVGA3dSurfaceFormat value, but with gaps.
496 *
497 * Note: there are some special cases below where we set devcap=0 and
498 * avoid querying the host. In particular, depth/stencil formats which
499 * can be rendered to and sampled from. For example, the gallium format
500 * PIPE_FORMAT_Z24_UNORM_S8_UINT is converted to SVGA3D_D24_UNORM_S8_UINT
501 * for rendering but converted to SVGA3D_R24_UNORM_X8_TYPELESS for sampling.
502 * If we want to query if a format supports both rendering and sampling the
503 * host will tell us no for SVGA3D_D24_UNORM_S8_UINT, SVGA3D_D16_UNORM and
504 * SVGA3D_R24_UNORM_X8_TYPELESS. So we override the host query for those
505 * formats and report that both can do rendering and sampling.
506 */
507 static const struct format_cap format_cap_table[] = {
508 {
509 "SVGA3D_FORMAT_INVALID",
510 SVGA3D_FORMAT_INVALID, 0, 0, 0, 0, 0
511 },
512 {
513 "SVGA3D_X8R8G8B8",
514 SVGA3D_X8R8G8B8,
515 SVGA3D_DEVCAP_SURFACEFMT_X8R8G8B8,
516 1, 1, 4,
517 SVGA3DFORMAT_OP_TEXTURE |
518 SVGA3DFORMAT_OP_CUBETEXTURE |
519 SVGA3DFORMAT_OP_VOLUMETEXTURE |
520 SVGA3DFORMAT_OP_DISPLAYMODE |
521 SVGA3DFORMAT_OP_OFFSCREEN_RENDERTARGET
522 },
523 {
524 "SVGA3D_A8R8G8B8",
525 SVGA3D_A8R8G8B8,
526 SVGA3D_DEVCAP_SURFACEFMT_A8R8G8B8,
527 1, 1, 4,
528 SVGA3DFORMAT_OP_TEXTURE |
529 SVGA3DFORMAT_OP_CUBETEXTURE |
530 SVGA3DFORMAT_OP_VOLUMETEXTURE |
531 SVGA3DFORMAT_OP_OFFSCREEN_RENDERTARGET
532 },
533 {
534 "SVGA3D_R5G6B5",
535 SVGA3D_R5G6B5,
536 SVGA3D_DEVCAP_SURFACEFMT_R5G6B5,
537 1, 1, 2,
538 SVGA3DFORMAT_OP_TEXTURE |
539 SVGA3DFORMAT_OP_CUBETEXTURE |
540 SVGA3DFORMAT_OP_VOLUMETEXTURE |
541 SVGA3DFORMAT_OP_DISPLAYMODE |
542 SVGA3DFORMAT_OP_OFFSCREEN_RENDERTARGET
543 },
544 {
545 "SVGA3D_X1R5G5B5",
546 SVGA3D_X1R5G5B5,
547 SVGA3D_DEVCAP_SURFACEFMT_X1R5G5B5,
548 1, 1, 2,
549 SVGA3DFORMAT_OP_TEXTURE |
550 SVGA3DFORMAT_OP_CUBETEXTURE |
551 SVGA3DFORMAT_OP_VOLUMETEXTURE |
552 SVGA3DFORMAT_OP_OFFSCREEN_RENDERTARGET
553 },
554 {
555 "SVGA3D_A1R5G5B5",
556 SVGA3D_A1R5G5B5,
557 SVGA3D_DEVCAP_SURFACEFMT_A1R5G5B5,
558 1, 1, 2,
559 SVGA3DFORMAT_OP_TEXTURE |
560 SVGA3DFORMAT_OP_CUBETEXTURE |
561 SVGA3DFORMAT_OP_VOLUMETEXTURE |
562 SVGA3DFORMAT_OP_OFFSCREEN_RENDERTARGET
563 },
564 {
565 "SVGA3D_A4R4G4B4",
566 SVGA3D_A4R4G4B4,
567 SVGA3D_DEVCAP_SURFACEFMT_A4R4G4B4,
568 1, 1, 2,
569 SVGA3DFORMAT_OP_TEXTURE |
570 SVGA3DFORMAT_OP_CUBETEXTURE |
571 SVGA3DFORMAT_OP_VOLUMETEXTURE |
572 SVGA3DFORMAT_OP_OFFSCREEN_RENDERTARGET
573 },
574 {
575 /*
576 * SVGA3D_Z_D32 is not yet supported, and has no corresponding
577 * SVGA3D_DEVCAP_xxx.
578 */
579 "SVGA3D_Z_D32",
580 SVGA3D_Z_D32, 0, 0, 0, 0, 0
581 },
582 {
583 "SVGA3D_Z_D16",
584 SVGA3D_Z_D16,
585 SVGA3D_DEVCAP_SURFACEFMT_Z_D16,
586 1, 1, 2,
587 SVGA3DFORMAT_OP_ZSTENCIL
588 },
589 {
590 "SVGA3D_Z_D24S8",
591 SVGA3D_Z_D24S8,
592 SVGA3D_DEVCAP_SURFACEFMT_Z_D24S8,
593 1, 1, 4,
594 SVGA3DFORMAT_OP_ZSTENCIL
595 },
596 {
597 "SVGA3D_Z_D15S1",
598 SVGA3D_Z_D15S1,
599 SVGA3D_DEVCAP_MAX,
600 1, 1, 2,
601 SVGA3DFORMAT_OP_ZSTENCIL
602 },
603 {
604 "SVGA3D_LUMINANCE8",
605 SVGA3D_LUMINANCE8,
606 SVGA3D_DEVCAP_SURFACEFMT_LUMINANCE8,
607 1, 1, 1,
608 SVGA3DFORMAT_OP_TEXTURE |
609 SVGA3DFORMAT_OP_CUBETEXTURE |
610 SVGA3DFORMAT_OP_VOLUMETEXTURE
611 },
612 {
613 /*
614 * SVGA3D_LUMINANCE4_ALPHA4 is not supported, and has no corresponding
615 * SVGA3D_DEVCAP_xxx.
616 */
617 "SVGA3D_LUMINANCE4_ALPHA4",
618 SVGA3D_LUMINANCE4_ALPHA4, 0, 0, 0, 0, 0
619 },
620 {
621 "SVGA3D_LUMINANCE16",
622 SVGA3D_LUMINANCE16,
623 SVGA3D_DEVCAP_SURFACEFMT_LUMINANCE16,
624 1, 1, 2,
625 SVGA3DFORMAT_OP_TEXTURE |
626 SVGA3DFORMAT_OP_CUBETEXTURE |
627 SVGA3DFORMAT_OP_VOLUMETEXTURE
628 },
629 {
630 "SVGA3D_LUMINANCE8_ALPHA8",
631 SVGA3D_LUMINANCE8_ALPHA8,
632 SVGA3D_DEVCAP_SURFACEFMT_LUMINANCE8_ALPHA8,
633 1, 1, 2,
634 SVGA3DFORMAT_OP_TEXTURE |
635 SVGA3DFORMAT_OP_CUBETEXTURE |
636 SVGA3DFORMAT_OP_VOLUMETEXTURE
637 },
638 {
639 "SVGA3D_DXT1",
640 SVGA3D_DXT1,
641 SVGA3D_DEVCAP_SURFACEFMT_DXT1,
642 4, 4, 8,
643 SVGA3DFORMAT_OP_TEXTURE |
644 SVGA3DFORMAT_OP_CUBETEXTURE
645 },
646 {
647 "SVGA3D_DXT2",
648 SVGA3D_DXT2,
649 SVGA3D_DEVCAP_SURFACEFMT_DXT2,
650 4, 4, 8,
651 SVGA3DFORMAT_OP_TEXTURE |
652 SVGA3DFORMAT_OP_CUBETEXTURE
653 },
654 {
655 "SVGA3D_DXT3",
656 SVGA3D_DXT3,
657 SVGA3D_DEVCAP_SURFACEFMT_DXT3,
658 4, 4, 16,
659 SVGA3DFORMAT_OP_TEXTURE |
660 SVGA3DFORMAT_OP_CUBETEXTURE
661 },
662 {
663 "SVGA3D_DXT4",
664 SVGA3D_DXT4,
665 SVGA3D_DEVCAP_SURFACEFMT_DXT4,
666 4, 4, 16,
667 SVGA3DFORMAT_OP_TEXTURE |
668 SVGA3DFORMAT_OP_CUBETEXTURE
669 },
670 {
671 "SVGA3D_DXT5",
672 SVGA3D_DXT5,
673 SVGA3D_DEVCAP_SURFACEFMT_DXT5,
674 4, 4, 8,
675 SVGA3DFORMAT_OP_TEXTURE |
676 SVGA3DFORMAT_OP_CUBETEXTURE
677 },
678 {
679 "SVGA3D_BUMPU8V8",
680 SVGA3D_BUMPU8V8,
681 SVGA3D_DEVCAP_SURFACEFMT_BUMPU8V8,
682 1, 1, 2,
683 SVGA3DFORMAT_OP_TEXTURE |
684 SVGA3DFORMAT_OP_CUBETEXTURE |
685 SVGA3DFORMAT_OP_VOLUMETEXTURE
686 },
687 {
688 /*
689 * SVGA3D_BUMPL6V5U5 is unsupported; it has no corresponding
690 * SVGA3D_DEVCAP_xxx.
691 */
692 "SVGA3D_BUMPL6V5U5",
693 SVGA3D_BUMPL6V5U5, 0, 0, 0, 0, 0
694 },
695 {
696 "SVGA3D_BUMPX8L8V8U8",
697 SVGA3D_BUMPX8L8V8U8,
698 SVGA3D_DEVCAP_SURFACEFMT_BUMPX8L8V8U8,
699 1, 1, 4,
700 SVGA3DFORMAT_OP_TEXTURE |
701 SVGA3DFORMAT_OP_CUBETEXTURE
702 },
703 {
704 "SVGA3D_FORMAT_DEAD1",
705 SVGA3D_FORMAT_DEAD1, 0, 0, 0, 0, 0
706 },
707 {
708 "SVGA3D_ARGB_S10E5",
709 SVGA3D_ARGB_S10E5,
710 SVGA3D_DEVCAP_SURFACEFMT_ARGB_S10E5,
711 1, 1, 2,
712 SVGA3DFORMAT_OP_TEXTURE |
713 SVGA3DFORMAT_OP_CUBETEXTURE |
714 SVGA3DFORMAT_OP_VOLUMETEXTURE |
715 SVGA3DFORMAT_OP_OFFSCREEN_RENDERTARGET
716 },
717 {
718 "SVGA3D_ARGB_S23E8",
719 SVGA3D_ARGB_S23E8,
720 SVGA3D_DEVCAP_SURFACEFMT_ARGB_S23E8,
721 1, 1, 4,
722 SVGA3DFORMAT_OP_TEXTURE |
723 SVGA3DFORMAT_OP_CUBETEXTURE |
724 SVGA3DFORMAT_OP_VOLUMETEXTURE |
725 SVGA3DFORMAT_OP_OFFSCREEN_RENDERTARGET
726 },
727 {
728 "SVGA3D_A2R10G10B10",
729 SVGA3D_A2R10G10B10,
730 SVGA3D_DEVCAP_SURFACEFMT_A2R10G10B10,
731 1, 1, 4,
732 SVGA3DFORMAT_OP_TEXTURE |
733 SVGA3DFORMAT_OP_CUBETEXTURE |
734 SVGA3DFORMAT_OP_VOLUMETEXTURE |
735 SVGA3DFORMAT_OP_OFFSCREEN_RENDERTARGET
736 },
737 {
738 /*
739 * SVGA3D_V8U8 is unsupported; it has no corresponding
740 * SVGA3D_DEVCAP_xxx. SVGA3D_BUMPU8V8 should be used instead.
741 */
742 "SVGA3D_V8U8",
743 SVGA3D_V8U8, 0, 0, 0, 0, 0
744 },
745 {
746 "SVGA3D_Q8W8V8U8",
747 SVGA3D_Q8W8V8U8,
748 SVGA3D_DEVCAP_SURFACEFMT_Q8W8V8U8,
749 1, 1, 4,
750 SVGA3DFORMAT_OP_TEXTURE |
751 SVGA3DFORMAT_OP_CUBETEXTURE
752 },
753 {
754 "SVGA3D_CxV8U8",
755 SVGA3D_CxV8U8,
756 SVGA3D_DEVCAP_SURFACEFMT_CxV8U8,
757 1, 1, 2,
758 SVGA3DFORMAT_OP_TEXTURE
759 },
760 {
761 /*
762 * SVGA3D_X8L8V8U8 is unsupported; it has no corresponding
763 * SVGA3D_DEVCAP_xxx. SVGA3D_BUMPX8L8V8U8 should be used instead.
764 */
765 "SVGA3D_X8L8V8U8",
766 SVGA3D_X8L8V8U8, 0, 0, 0, 0, 0
767 },
768 {
769 "SVGA3D_A2W10V10U10",
770 SVGA3D_A2W10V10U10,
771 SVGA3D_DEVCAP_SURFACEFMT_A2W10V10U10,
772 1, 1, 4,
773 SVGA3DFORMAT_OP_TEXTURE
774 },
775 {
776 "SVGA3D_ALPHA8",
777 SVGA3D_ALPHA8,
778 SVGA3D_DEVCAP_SURFACEFMT_ALPHA8,
779 1, 1, 1,
780 SVGA3DFORMAT_OP_TEXTURE |
781 SVGA3DFORMAT_OP_CUBETEXTURE |
782 SVGA3DFORMAT_OP_VOLUMETEXTURE
783 },
784 {
785 "SVGA3D_R_S10E5",
786 SVGA3D_R_S10E5,
787 SVGA3D_DEVCAP_SURFACEFMT_R_S10E5,
788 1, 1, 2,
789 SVGA3DFORMAT_OP_TEXTURE |
790 SVGA3DFORMAT_OP_VOLUMETEXTURE |
791 SVGA3DFORMAT_OP_CUBETEXTURE |
792 SVGA3DFORMAT_OP_OFFSCREEN_RENDERTARGET
793 },
794 {
795 "SVGA3D_R_S23E8",
796 SVGA3D_R_S23E8,
797 SVGA3D_DEVCAP_SURFACEFMT_R_S23E8,
798 1, 1, 4,
799 SVGA3DFORMAT_OP_TEXTURE |
800 SVGA3DFORMAT_OP_VOLUMETEXTURE |
801 SVGA3DFORMAT_OP_CUBETEXTURE |
802 SVGA3DFORMAT_OP_OFFSCREEN_RENDERTARGET
803 },
804 {
805 "SVGA3D_RG_S10E5",
806 SVGA3D_RG_S10E5,
807 SVGA3D_DEVCAP_SURFACEFMT_RG_S10E5,
808 1, 1, 2,
809 SVGA3DFORMAT_OP_TEXTURE |
810 SVGA3DFORMAT_OP_VOLUMETEXTURE |
811 SVGA3DFORMAT_OP_CUBETEXTURE |
812 SVGA3DFORMAT_OP_OFFSCREEN_RENDERTARGET
813 },
814 {
815 "SVGA3D_RG_S23E8",
816 SVGA3D_RG_S23E8,
817 SVGA3D_DEVCAP_SURFACEFMT_RG_S23E8,
818 1, 1, 4,
819 SVGA3DFORMAT_OP_TEXTURE |
820 SVGA3DFORMAT_OP_VOLUMETEXTURE |
821 SVGA3DFORMAT_OP_CUBETEXTURE |
822 SVGA3DFORMAT_OP_OFFSCREEN_RENDERTARGET
823 },
824 {
825 /*
826 * SVGA3D_BUFFER is a placeholder format for index/vertex buffers.
827 */
828 "SVGA3D_BUFFER",
829 SVGA3D_BUFFER, 0, 1, 1, 1, 0
830 },
831 {
832 "SVGA3D_Z_D24X8",
833 SVGA3D_Z_D24X8,
834 SVGA3D_DEVCAP_SURFACEFMT_Z_D24X8,
835 1, 1, 4,
836 SVGA3DFORMAT_OP_ZSTENCIL
837 },
838 {
839 "SVGA3D_V16U16",
840 SVGA3D_V16U16,
841 SVGA3D_DEVCAP_SURFACEFMT_V16U16,
842 1, 1, 4,
843 SVGA3DFORMAT_OP_TEXTURE |
844 SVGA3DFORMAT_OP_CUBETEXTURE |
845 SVGA3DFORMAT_OP_VOLUMETEXTURE
846 },
847 {
848 "SVGA3D_G16R16",
849 SVGA3D_G16R16,
850 SVGA3D_DEVCAP_SURFACEFMT_G16R16,
851 1, 1, 4,
852 SVGA3DFORMAT_OP_TEXTURE |
853 SVGA3DFORMAT_OP_CUBETEXTURE |
854 SVGA3DFORMAT_OP_VOLUMETEXTURE |
855 SVGA3DFORMAT_OP_OFFSCREEN_RENDERTARGET
856 },
857 {
858 "SVGA3D_A16B16G16R16",
859 SVGA3D_A16B16G16R16,
860 SVGA3D_DEVCAP_SURFACEFMT_A16B16G16R16,
861 1, 1, 8,
862 SVGA3DFORMAT_OP_TEXTURE |
863 SVGA3DFORMAT_OP_CUBETEXTURE |
864 SVGA3DFORMAT_OP_VOLUMETEXTURE |
865 SVGA3DFORMAT_OP_OFFSCREEN_RENDERTARGET
866 },
867 {
868 "SVGA3D_UYVY",
869 SVGA3D_UYVY,
870 SVGA3D_DEVCAP_SURFACEFMT_UYVY,
871 0, 0, 0,
872 0
873 },
874 {
875 "SVGA3D_YUY2",
876 SVGA3D_YUY2,
877 SVGA3D_DEVCAP_SURFACEFMT_YUY2,
878 0, 0, 0,
879 0
880 },
881 {
882 "SVGA3D_NV12",
883 SVGA3D_NV12,
884 SVGA3D_DEVCAP_SURFACEFMT_NV12,
885 0, 0, 0,
886 0
887 },
888 {
889 "SVGA3D_AYUV",
890 SVGA3D_AYUV,
891 SVGA3D_DEVCAP_SURFACEFMT_AYUV,
892 0, 0, 0,
893 0
894 },
895 {
896 "SVGA3D_R32G32B32A32_TYPELESS",
897 SVGA3D_R32G32B32A32_TYPELESS,
898 SVGA3D_DEVCAP_DXFMT_R32G32B32A32_TYPELESS,
899 1, 1, 16,
900 SVGA3DFORMAT_OP_TEXTURE |
901 SVGA3DFORMAT_OP_CUBETEXTURE |
902 SVGA3DFORMAT_OP_VOLUMETEXTURE |
903 SVGA3DFORMAT_OP_OFFSCREEN_RENDERTARGET
904 },
905 {
906 "SVGA3D_R32G32B32A32_UINT",
907 SVGA3D_R32G32B32A32_UINT,
908 SVGA3D_DEVCAP_DXFMT_R32G32B32A32_UINT,
909 1, 1, 16,
910 SVGA3DFORMAT_OP_TEXTURE |
911 SVGA3DFORMAT_OP_CUBETEXTURE |
912 SVGA3DFORMAT_OP_VOLUMETEXTURE |
913 SVGA3DFORMAT_OP_OFFSCREEN_RENDERTARGET
914 },
915 {
916 "SVGA3D_R32G32B32A32_SINT",
917 SVGA3D_R32G32B32A32_SINT,
918 SVGA3D_DEVCAP_DXFMT_R32G32B32A32_SINT,
919 1, 1, 16,
920 SVGA3DFORMAT_OP_TEXTURE |
921 SVGA3DFORMAT_OP_CUBETEXTURE |
922 SVGA3DFORMAT_OP_VOLUMETEXTURE |
923 SVGA3DFORMAT_OP_OFFSCREEN_RENDERTARGET
924 },
925 {
926 "SVGA3D_R32G32B32_TYPELESS",
927 SVGA3D_R32G32B32_TYPELESS,
928 SVGA3D_DEVCAP_DXFMT_R32G32B32_TYPELESS,
929 1, 1, 12,
930 SVGA3DFORMAT_OP_TEXTURE |
931 SVGA3DFORMAT_OP_CUBETEXTURE |
932 SVGA3DFORMAT_OP_VOLUMETEXTURE |
933 SVGA3DFORMAT_OP_OFFSCREEN_RENDERTARGET
934 },
935 {
936 "SVGA3D_R32G32B32_FLOAT",
937 SVGA3D_R32G32B32_FLOAT,
938 SVGA3D_DEVCAP_DXFMT_R32G32B32_FLOAT,
939 1, 1, 12,
940 SVGA3DFORMAT_OP_TEXTURE |
941 SVGA3DFORMAT_OP_CUBETEXTURE |
942 SVGA3DFORMAT_OP_VOLUMETEXTURE |
943 SVGA3DFORMAT_OP_OFFSCREEN_RENDERTARGET
944 },
945 {
946 "SVGA3D_R32G32B32_UINT",
947 SVGA3D_R32G32B32_UINT,
948 SVGA3D_DEVCAP_DXFMT_R32G32B32_UINT,
949 1, 1, 12,
950 SVGA3DFORMAT_OP_TEXTURE |
951 SVGA3DFORMAT_OP_CUBETEXTURE |
952 SVGA3DFORMAT_OP_VOLUMETEXTURE |
953 SVGA3DFORMAT_OP_OFFSCREEN_RENDERTARGET
954 },
955 {
956 "SVGA3D_R32G32B32_SINT",
957 SVGA3D_R32G32B32_SINT,
958 SVGA3D_DEVCAP_DXFMT_R32G32B32_SINT,
959 1, 1, 12,
960 SVGA3DFORMAT_OP_TEXTURE |
961 SVGA3DFORMAT_OP_CUBETEXTURE |
962 SVGA3DFORMAT_OP_VOLUMETEXTURE |
963 SVGA3DFORMAT_OP_OFFSCREEN_RENDERTARGET
964 },
965 {
966 "SVGA3D_R16G16B16A16_TYPELESS",
967 SVGA3D_R16G16B16A16_TYPELESS,
968 SVGA3D_DEVCAP_DXFMT_R16G16B16A16_TYPELESS,
969 1, 1, 8,
970 SVGA3DFORMAT_OP_TEXTURE |
971 SVGA3DFORMAT_OP_CUBETEXTURE |
972 SVGA3DFORMAT_OP_VOLUMETEXTURE |
973 SVGA3DFORMAT_OP_OFFSCREEN_RENDERTARGET
974 },
975 {
976 "SVGA3D_R16G16B16A16_UINT",
977 SVGA3D_R16G16B16A16_UINT,
978 SVGA3D_DEVCAP_DXFMT_R16G16B16A16_UINT,
979 1, 1, 8,
980 SVGA3DFORMAT_OP_TEXTURE |
981 SVGA3DFORMAT_OP_CUBETEXTURE |
982 SVGA3DFORMAT_OP_VOLUMETEXTURE |
983 SVGA3DFORMAT_OP_OFFSCREEN_RENDERTARGET
984 },
985 {
986 "SVGA3D_R16G16B16A16_SNORM",
987 SVGA3D_R16G16B16A16_SNORM,
988 SVGA3D_DEVCAP_DXFMT_R16G16B16A16_SNORM,
989 1, 1, 8,
990 SVGA3DFORMAT_OP_TEXTURE |
991 SVGA3DFORMAT_OP_CUBETEXTURE |
992 SVGA3DFORMAT_OP_VOLUMETEXTURE |
993 SVGA3DFORMAT_OP_OFFSCREEN_RENDERTARGET
994 },
995 {
996 "SVGA3D_R16G16B16A16_SINT",
997 SVGA3D_R16G16B16A16_SINT,
998 SVGA3D_DEVCAP_DXFMT_R16G16B16A16_SINT,
999 1, 1, 8,
1000 SVGA3DFORMAT_OP_TEXTURE |
1001 SVGA3DFORMAT_OP_CUBETEXTURE |
1002 SVGA3DFORMAT_OP_VOLUMETEXTURE |
1003 SVGA3DFORMAT_OP_OFFSCREEN_RENDERTARGET
1004 },
1005 {
1006 "SVGA3D_R32G32_TYPELESS",
1007 SVGA3D_R32G32_TYPELESS,
1008 SVGA3D_DEVCAP_DXFMT_R32G32_TYPELESS,
1009 1, 1, 8,
1010 SVGA3DFORMAT_OP_TEXTURE |
1011 SVGA3DFORMAT_OP_CUBETEXTURE |
1012 SVGA3DFORMAT_OP_VOLUMETEXTURE |
1013 SVGA3DFORMAT_OP_OFFSCREEN_RENDERTARGET
1014 },
1015 {
1016 "SVGA3D_R32G32_UINT",
1017 SVGA3D_R32G32_UINT,
1018 SVGA3D_DEVCAP_DXFMT_R32G32_UINT,
1019 1, 1, 8,
1020 SVGA3DFORMAT_OP_TEXTURE |
1021 SVGA3DFORMAT_OP_CUBETEXTURE |
1022 SVGA3DFORMAT_OP_VOLUMETEXTURE |
1023 SVGA3DFORMAT_OP_OFFSCREEN_RENDERTARGET
1024 },
1025 {
1026 "SVGA3D_R32G32_SINT",
1027 SVGA3D_R32G32_SINT,
1028 SVGA3D_DEVCAP_DXFMT_R32G32_SINT,
1029 1, 1, 8,
1030 SVGA3DFORMAT_OP_TEXTURE |
1031 SVGA3DFORMAT_OP_CUBETEXTURE |
1032 SVGA3DFORMAT_OP_VOLUMETEXTURE |
1033 SVGA3DFORMAT_OP_OFFSCREEN_RENDERTARGET
1034 },
1035 {
1036 "SVGA3D_R32G8X24_TYPELESS",
1037 SVGA3D_R32G8X24_TYPELESS,
1038 SVGA3D_DEVCAP_DXFMT_R32G8X24_TYPELESS,
1039 1, 1, 8,
1040 SVGA3DFORMAT_OP_TEXTURE |
1041 SVGA3DFORMAT_OP_CUBETEXTURE |
1042 SVGA3DFORMAT_OP_VOLUMETEXTURE |
1043 SVGA3DFORMAT_OP_ZSTENCIL
1044 },
1045 {
1046 /* Special case: no devcap / report sampler and depth/stencil ability
1047 */
1048 "SVGA3D_D32_FLOAT_S8X24_UINT",
1049 SVGA3D_D32_FLOAT_S8X24_UINT,
1050 0, /*SVGA3D_DEVCAP_DXFMT_D32_FLOAT_S8X24_UINT*/
1051 1, 1, 8,
1052 SVGA3DFORMAT_OP_TEXTURE |
1053 SVGA3DFORMAT_OP_CUBETEXTURE |
1054 SVGA3DFORMAT_OP_VOLUMETEXTURE |
1055 SVGA3DFORMAT_OP_ZSTENCIL
1056 },
1057 {
1058 /* Special case: no devcap / report sampler and depth/stencil ability
1059 */
1060 "SVGA3D_R32_FLOAT_X8X24_TYPELESS",
1061 SVGA3D_R32_FLOAT_X8X24_TYPELESS,
1062 0, /*SVGA3D_DEVCAP_DXFMT_R32_FLOAT_X8X24_TYPELESS*/
1063 1, 1, 8,
1064 SVGA3DFORMAT_OP_TEXTURE |
1065 SVGA3DFORMAT_OP_CUBETEXTURE |
1066 SVGA3DFORMAT_OP_VOLUMETEXTURE |
1067 SVGA3DFORMAT_OP_ZSTENCIL
1068 },
1069 {
1070 "SVGA3D_X32_TYPELESS_G8X24_UINT",
1071 SVGA3D_X32_TYPELESS_G8X24_UINT,
1072 SVGA3D_DEVCAP_DXFMT_X32_TYPELESS_G8X24_UINT,
1073 1, 1, 4,
1074 SVGA3DFORMAT_OP_TEXTURE |
1075 SVGA3DFORMAT_OP_VOLUMETEXTURE |
1076 SVGA3DFORMAT_OP_CUBETEXTURE |
1077 SVGA3DFORMAT_OP_OFFSCREEN_RENDERTARGET
1078 },
1079 {
1080 "SVGA3D_R10G10B10A2_TYPELESS",
1081 SVGA3D_R10G10B10A2_TYPELESS,
1082 SVGA3D_DEVCAP_DXFMT_R10G10B10A2_TYPELESS,
1083 1, 1, 4,
1084 SVGA3DFORMAT_OP_TEXTURE |
1085 SVGA3DFORMAT_OP_VOLUMETEXTURE |
1086 SVGA3DFORMAT_OP_CUBETEXTURE |
1087 SVGA3DFORMAT_OP_OFFSCREEN_RENDERTARGET
1088 },
1089 {
1090 "SVGA3D_R10G10B10A2_UINT",
1091 SVGA3D_R10G10B10A2_UINT,
1092 SVGA3D_DEVCAP_DXFMT_R10G10B10A2_UINT,
1093 1, 1, 4,
1094 SVGA3DFORMAT_OP_TEXTURE |
1095 SVGA3DFORMAT_OP_VOLUMETEXTURE |
1096 SVGA3DFORMAT_OP_CUBETEXTURE |
1097 SVGA3DFORMAT_OP_OFFSCREEN_RENDERTARGET
1098 },
1099 {
1100 "SVGA3D_R11G11B10_FLOAT",
1101 SVGA3D_R11G11B10_FLOAT,
1102 SVGA3D_DEVCAP_DXFMT_R11G11B10_FLOAT,
1103 1, 1, 4,
1104 SVGA3DFORMAT_OP_TEXTURE |
1105 SVGA3DFORMAT_OP_VOLUMETEXTURE |
1106 SVGA3DFORMAT_OP_CUBETEXTURE |
1107 SVGA3DFORMAT_OP_OFFSCREEN_RENDERTARGET
1108 },
1109 {
1110 "SVGA3D_R8G8B8A8_TYPELESS",
1111 SVGA3D_R8G8B8A8_TYPELESS,
1112 SVGA3D_DEVCAP_DXFMT_R8G8B8A8_TYPELESS,
1113 1, 1, 4,
1114 SVGA3DFORMAT_OP_TEXTURE |
1115 SVGA3DFORMAT_OP_VOLUMETEXTURE |
1116 SVGA3DFORMAT_OP_CUBETEXTURE |
1117 SVGA3DFORMAT_OP_OFFSCREEN_RENDERTARGET
1118 },
1119 {
1120 "SVGA3D_R8G8B8A8_UNORM",
1121 SVGA3D_R8G8B8A8_UNORM,
1122 SVGA3D_DEVCAP_DXFMT_R8G8B8A8_UNORM,
1123 1, 1, 4,
1124 SVGA3DFORMAT_OP_TEXTURE |
1125 SVGA3DFORMAT_OP_CUBETEXTURE |
1126 SVGA3DFORMAT_OP_VOLUMETEXTURE |
1127 SVGA3DFORMAT_OP_OFFSCREEN_RENDERTARGET
1128 },
1129 {
1130 "SVGA3D_R8G8B8A8_UNORM_SRGB",
1131 SVGA3D_R8G8B8A8_UNORM_SRGB,
1132 SVGA3D_DEVCAP_DXFMT_R8G8B8A8_UNORM_SRGB,
1133 1, 1, 4,
1134 SVGA3DFORMAT_OP_TEXTURE |
1135 SVGA3DFORMAT_OP_CUBETEXTURE |
1136 SVGA3DFORMAT_OP_VOLUMETEXTURE |
1137 SVGA3DFORMAT_OP_OFFSCREEN_RENDERTARGET
1138 },
1139 {
1140 "SVGA3D_R8G8B8A8_UINT",
1141 SVGA3D_R8G8B8A8_UINT,
1142 SVGA3D_DEVCAP_DXFMT_R8G8B8A8_UINT,
1143 1, 1, 4,
1144 SVGA3DFORMAT_OP_TEXTURE |
1145 SVGA3DFORMAT_OP_CUBETEXTURE |
1146 SVGA3DFORMAT_OP_VOLUMETEXTURE |
1147 SVGA3DFORMAT_OP_OFFSCREEN_RENDERTARGET
1148 },
1149 {
1150 "SVGA3D_R8G8B8A8_SINT",
1151 SVGA3D_R8G8B8A8_SINT,
1152 SVGA3D_DEVCAP_DXFMT_R8G8B8A8_SINT,
1153 1, 1, 4,
1154 SVGA3DFORMAT_OP_TEXTURE |
1155 SVGA3DFORMAT_OP_CUBETEXTURE |
1156 SVGA3DFORMAT_OP_VOLUMETEXTURE |
1157 SVGA3DFORMAT_OP_OFFSCREEN_RENDERTARGET
1158 },
1159 {
1160 "SVGA3D_R16G16_TYPELESS",
1161 SVGA3D_R16G16_TYPELESS,
1162 SVGA3D_DEVCAP_DXFMT_R16G16_TYPELESS,
1163 1, 1, 4,
1164 SVGA3DFORMAT_OP_TEXTURE |
1165 SVGA3DFORMAT_OP_CUBETEXTURE |
1166 SVGA3DFORMAT_OP_VOLUMETEXTURE |
1167 SVGA3DFORMAT_OP_OFFSCREEN_RENDERTARGET
1168 },
1169 {
1170 "SVGA3D_R16G16_UINT",
1171 SVGA3D_R16G16_UINT,
1172 SVGA3D_DEVCAP_DXFMT_R16G16_UINT,
1173 1, 1, 4,
1174 SVGA3DFORMAT_OP_TEXTURE |
1175 SVGA3DFORMAT_OP_CUBETEXTURE |
1176 SVGA3DFORMAT_OP_VOLUMETEXTURE |
1177 SVGA3DFORMAT_OP_OFFSCREEN_RENDERTARGET
1178 },
1179 {
1180 "SVGA3D_R16G16_SINT",
1181 SVGA3D_R16G16_SINT,
1182 SVGA3D_DEVCAP_DXFMT_R16G16_SINT,
1183 1, 1, 4,
1184 SVGA3DFORMAT_OP_TEXTURE |
1185 SVGA3DFORMAT_OP_CUBETEXTURE |
1186 SVGA3DFORMAT_OP_VOLUMETEXTURE |
1187 SVGA3DFORMAT_OP_OFFSCREEN_RENDERTARGET
1188 },
1189 {
1190 "SVGA3D_R32_TYPELESS",
1191 SVGA3D_R32_TYPELESS,
1192 SVGA3D_DEVCAP_DXFMT_R32_TYPELESS,
1193 1, 1, 4,
1194 SVGA3DFORMAT_OP_TEXTURE |
1195 SVGA3DFORMAT_OP_CUBETEXTURE |
1196 SVGA3DFORMAT_OP_VOLUMETEXTURE |
1197 SVGA3DFORMAT_OP_ZSTENCIL |
1198 SVGA3DFORMAT_OP_OFFSCREEN_RENDERTARGET
1199 },
1200 {
1201 /* Special case: no devcap / report sampler and depth/stencil ability
1202 */
1203 "SVGA3D_D32_FLOAT",
1204 SVGA3D_D32_FLOAT,
1205 0, /*SVGA3D_DEVCAP_DXFMT_D32_FLOAT*/
1206 1, 1, 4,
1207 SVGA3DFORMAT_OP_TEXTURE |
1208 SVGA3DFORMAT_OP_CUBETEXTURE |
1209 SVGA3DFORMAT_OP_VOLUMETEXTURE |
1210 SVGA3DFORMAT_OP_ZSTENCIL
1211 },
1212 {
1213 "SVGA3D_R32_UINT",
1214 SVGA3D_R32_UINT,
1215 SVGA3D_DEVCAP_DXFMT_R32_UINT,
1216 1, 1, 4,
1217 SVGA3DFORMAT_OP_TEXTURE |
1218 SVGA3DFORMAT_OP_CUBETEXTURE |
1219 SVGA3DFORMAT_OP_VOLUMETEXTURE |
1220 SVGA3DFORMAT_OP_OFFSCREEN_RENDERTARGET
1221 },
1222 {
1223 "SVGA3D_R32_SINT",
1224 SVGA3D_R32_SINT,
1225 SVGA3D_DEVCAP_DXFMT_R32_SINT,
1226 1, 1, 4,
1227 SVGA3DFORMAT_OP_TEXTURE |
1228 SVGA3DFORMAT_OP_CUBETEXTURE |
1229 SVGA3DFORMAT_OP_VOLUMETEXTURE |
1230 SVGA3DFORMAT_OP_OFFSCREEN_RENDERTARGET
1231 },
1232 {
1233 "SVGA3D_R24G8_TYPELESS",
1234 SVGA3D_R24G8_TYPELESS,
1235 SVGA3D_DEVCAP_DXFMT_R24G8_TYPELESS,
1236 1, 1, 4,
1237 SVGA3DFORMAT_OP_TEXTURE |
1238 SVGA3DFORMAT_OP_CUBETEXTURE |
1239 SVGA3DFORMAT_OP_VOLUMETEXTURE |
1240 SVGA3DFORMAT_OP_ZSTENCIL
1241 },
1242 {
1243 /* Special case: no devcap / report sampler and depth/stencil ability
1244 */
1245 "SVGA3D_D24_UNORM_S8_UINT",
1246 SVGA3D_D24_UNORM_S8_UINT,
1247 0, /*SVGA3D_DEVCAP_DXFMT_D24_UNORM_S8_UINT*/
1248 1, 1, 4,
1249 SVGA3DFORMAT_OP_TEXTURE |
1250 SVGA3DFORMAT_OP_CUBETEXTURE |
1251 SVGA3DFORMAT_OP_VOLUMETEXTURE |
1252 SVGA3DFORMAT_OP_ZSTENCIL
1253 },
1254 {
1255 /* Special case: no devcap / report sampler and depth/stencil ability
1256 */
1257 "SVGA3D_R24_UNORM_X8_TYPELESS",
1258 SVGA3D_R24_UNORM_X8_TYPELESS,
1259 0, /*SVGA3D_DEVCAP_DXFMT_R24_UNORM_X8_TYPELESS*/
1260 1, 1, 4,
1261 SVGA3DFORMAT_OP_TEXTURE |
1262 SVGA3DFORMAT_OP_CUBETEXTURE |
1263 SVGA3DFORMAT_OP_VOLUMETEXTURE |
1264 SVGA3DFORMAT_OP_ZSTENCIL
1265 },
1266 {
1267 "SVGA3D_X24_TYPELESS_G8_UINT",
1268 SVGA3D_X24_TYPELESS_G8_UINT,
1269 SVGA3D_DEVCAP_DXFMT_X24_TYPELESS_G8_UINT,
1270 1, 1, 4,
1271 SVGA3DFORMAT_OP_TEXTURE |
1272 SVGA3DFORMAT_OP_CUBETEXTURE |
1273 SVGA3DFORMAT_OP_VOLUMETEXTURE |
1274 SVGA3DFORMAT_OP_ZSTENCIL
1275 },
1276 {
1277 "SVGA3D_R8G8_TYPELESS",
1278 SVGA3D_R8G8_TYPELESS,
1279 SVGA3D_DEVCAP_DXFMT_R8G8_TYPELESS,
1280 1, 1, 2,
1281 SVGA3DFORMAT_OP_TEXTURE |
1282 SVGA3DFORMAT_OP_CUBETEXTURE |
1283 SVGA3DFORMAT_OP_VOLUMETEXTURE |
1284 SVGA3DFORMAT_OP_OFFSCREEN_RENDERTARGET
1285 },
1286 {
1287 "SVGA3D_R8G8_UNORM",
1288 SVGA3D_R8G8_UNORM,
1289 SVGA3D_DEVCAP_DXFMT_R8G8_UNORM,
1290 1, 1, 2,
1291 SVGA3DFORMAT_OP_TEXTURE |
1292 SVGA3DFORMAT_OP_CUBETEXTURE |
1293 SVGA3DFORMAT_OP_VOLUMETEXTURE |
1294 SVGA3DFORMAT_OP_OFFSCREEN_RENDERTARGET
1295 },
1296 {
1297 "SVGA3D_R8G8_UINT",
1298 SVGA3D_R8G8_UINT,
1299 SVGA3D_DEVCAP_DXFMT_R8G8_UINT,
1300 1, 1, 2,
1301 SVGA3DFORMAT_OP_TEXTURE |
1302 SVGA3DFORMAT_OP_CUBETEXTURE |
1303 SVGA3DFORMAT_OP_VOLUMETEXTURE |
1304 SVGA3DFORMAT_OP_OFFSCREEN_RENDERTARGET
1305 },
1306 {
1307 "SVGA3D_R8G8_SINT",
1308 SVGA3D_R8G8_SINT,
1309 SVGA3D_DEVCAP_DXFMT_R8G8_SINT,
1310 1, 1, 2,
1311 SVGA3DFORMAT_OP_TEXTURE |
1312 SVGA3DFORMAT_OP_CUBETEXTURE |
1313 SVGA3DFORMAT_OP_VOLUMETEXTURE |
1314 SVGA3DFORMAT_OP_OFFSCREEN_RENDERTARGET
1315 },
1316 {
1317 "SVGA3D_R16_TYPELESS",
1318 SVGA3D_R16_TYPELESS,
1319 SVGA3D_DEVCAP_DXFMT_R16_TYPELESS,
1320 1, 1, 2,
1321 SVGA3DFORMAT_OP_ZSTENCIL |
1322 SVGA3DFORMAT_OP_TEXTURE |
1323 SVGA3DFORMAT_OP_CUBETEXTURE |
1324 SVGA3DFORMAT_OP_VOLUMETEXTURE |
1325 SVGA3DFORMAT_OP_OFFSCREEN_RENDERTARGET
1326 },
1327 {
1328 "SVGA3D_R16_UNORM",
1329 SVGA3D_R16_UNORM,
1330 SVGA3D_DEVCAP_DXFMT_R16_UNORM,
1331 1, 1, 2,
1332 SVGA3DFORMAT_OP_TEXTURE |
1333 SVGA3DFORMAT_OP_CUBETEXTURE |
1334 SVGA3DFORMAT_OP_VOLUMETEXTURE |
1335 SVGA3DFORMAT_OP_OFFSCREEN_RENDERTARGET
1336 },
1337 {
1338 "SVGA3D_R16_UINT",
1339 SVGA3D_R16_UINT,
1340 SVGA3D_DEVCAP_DXFMT_R16_UINT,
1341 1, 1, 2,
1342 SVGA3DFORMAT_OP_TEXTURE |
1343 SVGA3DFORMAT_OP_CUBETEXTURE |
1344 SVGA3DFORMAT_OP_VOLUMETEXTURE |
1345 SVGA3DFORMAT_OP_OFFSCREEN_RENDERTARGET
1346 },
1347 {
1348 "SVGA3D_R16_SNORM",
1349 SVGA3D_R16_SNORM,
1350 SVGA3D_DEVCAP_DXFMT_R16_SNORM,
1351 1, 1, 2,
1352 SVGA3DFORMAT_OP_TEXTURE |
1353 SVGA3DFORMAT_OP_CUBETEXTURE |
1354 SVGA3DFORMAT_OP_VOLUMETEXTURE |
1355 SVGA3DFORMAT_OP_OFFSCREEN_RENDERTARGET
1356 },
1357 {
1358 "SVGA3D_R16_SINT",
1359 SVGA3D_R16_SINT,
1360 SVGA3D_DEVCAP_DXFMT_R16_SINT,
1361 1, 1, 2,
1362 SVGA3DFORMAT_OP_TEXTURE |
1363 SVGA3DFORMAT_OP_CUBETEXTURE |
1364 SVGA3DFORMAT_OP_VOLUMETEXTURE |
1365 SVGA3DFORMAT_OP_OFFSCREEN_RENDERTARGET
1366 },
1367 {
1368 "SVGA3D_R8_TYPELESS",
1369 SVGA3D_R8_TYPELESS,
1370 SVGA3D_DEVCAP_DXFMT_R8_TYPELESS,
1371 1, 1, 1,
1372 SVGA3DFORMAT_OP_TEXTURE |
1373 SVGA3DFORMAT_OP_CUBETEXTURE |
1374 SVGA3DFORMAT_OP_VOLUMETEXTURE |
1375 SVGA3DFORMAT_OP_OFFSCREEN_RENDERTARGET
1376 },
1377 {
1378 "SVGA3D_R8_UNORM",
1379 SVGA3D_R8_UNORM,
1380 SVGA3D_DEVCAP_DXFMT_R8_UNORM,
1381 1, 1, 1,
1382 SVGA3DFORMAT_OP_TEXTURE |
1383 SVGA3DFORMAT_OP_CUBETEXTURE |
1384 SVGA3DFORMAT_OP_VOLUMETEXTURE |
1385 SVGA3DFORMAT_OP_OFFSCREEN_RENDERTARGET
1386 },
1387 {
1388 "SVGA3D_R8_UINT",
1389 SVGA3D_R8_UINT,
1390 SVGA3D_DEVCAP_DXFMT_R8_UINT,
1391 1, 1, 1,
1392 SVGA3DFORMAT_OP_TEXTURE |
1393 SVGA3DFORMAT_OP_CUBETEXTURE |
1394 SVGA3DFORMAT_OP_VOLUMETEXTURE |
1395 SVGA3DFORMAT_OP_OFFSCREEN_RENDERTARGET
1396 },
1397 {
1398 "SVGA3D_R8_SNORM",
1399 SVGA3D_R8_SNORM,
1400 SVGA3D_DEVCAP_DXFMT_R8_SNORM,
1401 1, 1, 1,
1402 SVGA3DFORMAT_OP_TEXTURE |
1403 SVGA3DFORMAT_OP_CUBETEXTURE |
1404 SVGA3DFORMAT_OP_VOLUMETEXTURE |
1405 SVGA3DFORMAT_OP_OFFSCREEN_RENDERTARGET
1406 },
1407 {
1408 "SVGA3D_R8_SINT",
1409 SVGA3D_R8_SINT,
1410 SVGA3D_DEVCAP_DXFMT_R8_SINT,
1411 1, 1, 1,
1412 SVGA3DFORMAT_OP_TEXTURE |
1413 SVGA3DFORMAT_OP_CUBETEXTURE |
1414 SVGA3DFORMAT_OP_VOLUMETEXTURE |
1415 SVGA3DFORMAT_OP_OFFSCREEN_RENDERTARGET
1416 },
1417 {
1418 "SVGA3D_P8",
1419 SVGA3D_P8, 0, 0, 0, 0, 0
1420 },
1421 {
1422 "SVGA3D_R9G9B9E5_SHAREDEXP",
1423 SVGA3D_R9G9B9E5_SHAREDEXP,
1424 SVGA3D_DEVCAP_DXFMT_R9G9B9E5_SHAREDEXP,
1425 1, 1, 4,
1426 SVGA3DFORMAT_OP_TEXTURE |
1427 SVGA3DFORMAT_OP_VOLUMETEXTURE |
1428 SVGA3DFORMAT_OP_CUBETEXTURE |
1429 SVGA3DFORMAT_OP_OFFSCREEN_RENDERTARGET
1430 },
1431 {
1432 "SVGA3D_R8G8_B8G8_UNORM",
1433 SVGA3D_R8G8_B8G8_UNORM, 0, 0, 0, 0, 0
1434 },
1435 {
1436 "SVGA3D_G8R8_G8B8_UNORM",
1437 SVGA3D_G8R8_G8B8_UNORM, 0, 0, 0, 0, 0
1438 },
1439 {
1440 "SVGA3D_BC1_TYPELESS",
1441 SVGA3D_BC1_TYPELESS,
1442 SVGA3D_DEVCAP_DXFMT_BC1_TYPELESS,
1443 4, 4, 8,
1444 SVGA3DFORMAT_OP_TEXTURE |
1445 SVGA3DFORMAT_OP_CUBETEXTURE
1446 },
1447 {
1448 "SVGA3D_BC1_UNORM_SRGB",
1449 SVGA3D_BC1_UNORM_SRGB,
1450 SVGA3D_DEVCAP_DXFMT_BC1_UNORM_SRGB,
1451 4, 4, 8,
1452 SVGA3DFORMAT_OP_TEXTURE |
1453 SVGA3DFORMAT_OP_CUBETEXTURE
1454 },
1455 {
1456 "SVGA3D_BC2_TYPELESS",
1457 SVGA3D_BC2_TYPELESS,
1458 SVGA3D_DEVCAP_DXFMT_BC2_TYPELESS,
1459 4, 4, 16,
1460 SVGA3DFORMAT_OP_TEXTURE |
1461 SVGA3DFORMAT_OP_CUBETEXTURE
1462 },
1463 {
1464 "SVGA3D_BC2_UNORM_SRGB",
1465 SVGA3D_BC2_UNORM_SRGB,
1466 SVGA3D_DEVCAP_DXFMT_BC2_UNORM_SRGB,
1467 4, 4, 16,
1468 SVGA3DFORMAT_OP_TEXTURE |
1469 SVGA3DFORMAT_OP_CUBETEXTURE
1470 },
1471 {
1472 "SVGA3D_BC3_TYPELESS",
1473 SVGA3D_BC3_TYPELESS,
1474 SVGA3D_DEVCAP_DXFMT_BC3_TYPELESS,
1475 4, 4, 16,
1476 SVGA3DFORMAT_OP_TEXTURE |
1477 SVGA3DFORMAT_OP_CUBETEXTURE
1478 },
1479 {
1480 "SVGA3D_BC3_UNORM_SRGB",
1481 SVGA3D_BC3_UNORM_SRGB,
1482 4, 4, 16,
1483 SVGA3DFORMAT_OP_TEXTURE |
1484 SVGA3DFORMAT_OP_CUBETEXTURE
1485 },
1486 {
1487 "SVGA3D_BC4_TYPELESS",
1488 SVGA3D_BC4_TYPELESS,
1489 SVGA3D_DEVCAP_DXFMT_BC4_TYPELESS,
1490 4, 4, 8,
1491 SVGA3DFORMAT_OP_TEXTURE |
1492 SVGA3DFORMAT_OP_CUBETEXTURE
1493 },
1494 {
1495 "SVGA3D_ATI1",
1496 SVGA3D_ATI1, 0, 0, 0, 0, 0
1497 },
1498 {
1499 "SVGA3D_BC4_SNORM",
1500 SVGA3D_BC4_SNORM,
1501 SVGA3D_DEVCAP_DXFMT_BC4_SNORM,
1502 4, 4, 8,
1503 SVGA3DFORMAT_OP_TEXTURE |
1504 SVGA3DFORMAT_OP_CUBETEXTURE
1505 },
1506 {
1507 "SVGA3D_BC5_TYPELESS",
1508 SVGA3D_BC5_TYPELESS,
1509 SVGA3D_DEVCAP_DXFMT_BC5_TYPELESS,
1510 4, 4, 16,
1511 SVGA3DFORMAT_OP_TEXTURE |
1512 SVGA3DFORMAT_OP_CUBETEXTURE
1513 },
1514 {
1515 "SVGA3D_ATI2",
1516 SVGA3D_ATI2, 0, 0, 0, 0, 0
1517 },
1518 {
1519 "SVGA3D_BC5_SNORM",
1520 SVGA3D_BC5_SNORM,
1521 SVGA3D_DEVCAP_DXFMT_BC5_SNORM,
1522 4, 4, 16,
1523 SVGA3DFORMAT_OP_TEXTURE |
1524 SVGA3DFORMAT_OP_CUBETEXTURE
1525 },
1526 {
1527 "SVGA3D_R10G10B10_XR_BIAS_A2_UNORM",
1528 SVGA3D_R10G10B10_XR_BIAS_A2_UNORM, 0, 0, 0, 0, 0
1529 },
1530 {
1531 "SVGA3D_B8G8R8A8_TYPELESS",
1532 SVGA3D_B8G8R8A8_TYPELESS,
1533 SVGA3D_DEVCAP_DXFMT_B8G8R8A8_TYPELESS,
1534 1, 1, 4,
1535 SVGA3DFORMAT_OP_TEXTURE |
1536 SVGA3DFORMAT_OP_CUBETEXTURE |
1537 SVGA3DFORMAT_OP_VOLUMETEXTURE |
1538 SVGA3DFORMAT_OP_OFFSCREEN_RENDERTARGET
1539 },
1540 {
1541 "SVGA3D_B8G8R8A8_UNORM_SRGB",
1542 SVGA3D_B8G8R8A8_UNORM_SRGB,
1543 SVGA3D_DEVCAP_DXFMT_B8G8R8A8_UNORM_SRGB,
1544 1, 1, 4,
1545 SVGA3DFORMAT_OP_TEXTURE |
1546 SVGA3DFORMAT_OP_CUBETEXTURE |
1547 SVGA3DFORMAT_OP_VOLUMETEXTURE |
1548 SVGA3DFORMAT_OP_OFFSCREEN_RENDERTARGET
1549 },
1550 {
1551 "SVGA3D_B8G8R8X8_TYPELESS",
1552 SVGA3D_B8G8R8X8_TYPELESS,
1553 SVGA3D_DEVCAP_DXFMT_B8G8R8X8_TYPELESS,
1554 1, 1, 4,
1555 SVGA3DFORMAT_OP_TEXTURE |
1556 SVGA3DFORMAT_OP_CUBETEXTURE |
1557 SVGA3DFORMAT_OP_VOLUMETEXTURE |
1558 SVGA3DFORMAT_OP_OFFSCREEN_RENDERTARGET
1559 },
1560 {
1561 "SVGA3D_B8G8R8X8_UNORM_SRGB",
1562 SVGA3D_B8G8R8X8_UNORM_SRGB,
1563 SVGA3D_DEVCAP_DXFMT_B8G8R8X8_UNORM_SRGB,
1564 1, 1, 4,
1565 SVGA3DFORMAT_OP_TEXTURE |
1566 SVGA3DFORMAT_OP_CUBETEXTURE |
1567 SVGA3DFORMAT_OP_VOLUMETEXTURE |
1568 SVGA3DFORMAT_OP_OFFSCREEN_RENDERTARGET
1569 },
1570 {
1571 "SVGA3D_Z_DF16",
1572 SVGA3D_Z_DF16,
1573 SVGA3D_DEVCAP_SURFACEFMT_Z_DF16,
1574 1, 1, 2,
1575 0
1576 },
1577 {
1578 "SVGA3D_Z_DF24",
1579 SVGA3D_Z_DF24,
1580 SVGA3D_DEVCAP_SURFACEFMT_Z_DF24,
1581 1, 1, 4,
1582 0
1583 },
1584 {
1585 "SVGA3D_Z_D24S8_INT",
1586 SVGA3D_Z_D24S8_INT,
1587 SVGA3D_DEVCAP_SURFACEFMT_Z_D24S8_INT,
1588 1, 1, 4,
1589 SVGA3DFORMAT_OP_TEXTURE |
1590 SVGA3DFORMAT_OP_CUBETEXTURE |
1591 SVGA3DFORMAT_OP_VOLUMETEXTURE |
1592 SVGA3DFORMAT_OP_ZSTENCIL
1593 },
1594 {
1595 "SVGA3D_YV12",
1596 SVGA3D_YV12, 0, 0, 0, 0, 0
1597 },
1598 {
1599 "SVGA3D_R32G32B32A32_FLOAT",
1600 SVGA3D_R32G32B32A32_FLOAT,
1601 SVGA3D_DEVCAP_DXFMT_R32G32B32A32_FLOAT,
1602 1, 1, 16,
1603 SVGA3DFORMAT_OP_TEXTURE |
1604 SVGA3DFORMAT_OP_VOLUMETEXTURE |
1605 SVGA3DFORMAT_OP_CUBETEXTURE |
1606 SVGA3DFORMAT_OP_OFFSCREEN_RENDERTARGET
1607 },
1608 {
1609 "SVGA3D_R16G16B16A16_FLOAT",
1610 SVGA3D_R16G16B16A16_FLOAT,
1611 SVGA3D_DEVCAP_DXFMT_R16G16B16A16_FLOAT,
1612 1, 1, 8,
1613 SVGA3DFORMAT_OP_TEXTURE |
1614 SVGA3DFORMAT_OP_VOLUMETEXTURE |
1615 SVGA3DFORMAT_OP_CUBETEXTURE |
1616 SVGA3DFORMAT_OP_OFFSCREEN_RENDERTARGET
1617 },
1618 {
1619 "SVGA3D_R16G16B16A16_UNORM",
1620 SVGA3D_R16G16B16A16_UNORM,
1621 SVGA3D_DEVCAP_DXFMT_R16G16B16A16_UNORM,
1622 1, 1, 8,
1623 SVGA3DFORMAT_OP_TEXTURE |
1624 SVGA3DFORMAT_OP_VOLUMETEXTURE |
1625 SVGA3DFORMAT_OP_CUBETEXTURE |
1626 SVGA3DFORMAT_OP_OFFSCREEN_RENDERTARGET
1627 },
1628 {
1629 "SVGA3D_R32G32_FLOAT",
1630 SVGA3D_R32G32_FLOAT,
1631 SVGA3D_DEVCAP_DXFMT_R32G32_FLOAT,
1632 1, 1, 8,
1633 SVGA3DFORMAT_OP_TEXTURE |
1634 SVGA3DFORMAT_OP_VOLUMETEXTURE |
1635 SVGA3DFORMAT_OP_CUBETEXTURE |
1636 SVGA3DFORMAT_OP_OFFSCREEN_RENDERTARGET
1637 },
1638 {
1639 "SVGA3D_R10G10B10A2_UNORM",
1640 SVGA3D_R10G10B10A2_UNORM,
1641 SVGA3D_DEVCAP_DXFMT_R10G10B10A2_UNORM,
1642 1, 1, 4,
1643 SVGA3DFORMAT_OP_TEXTURE |
1644 SVGA3DFORMAT_OP_CUBETEXTURE |
1645 SVGA3DFORMAT_OP_VOLUMETEXTURE |
1646 SVGA3DFORMAT_OP_OFFSCREEN_RENDERTARGET
1647 },
1648 {
1649 "SVGA3D_R8G8B8A8_SNORM",
1650 SVGA3D_R8G8B8A8_SNORM,
1651 SVGA3D_DEVCAP_DXFMT_R8G8B8A8_SNORM,
1652 1, 1, 4,
1653 SVGA3DFORMAT_OP_TEXTURE |
1654 SVGA3DFORMAT_OP_CUBETEXTURE |
1655 SVGA3DFORMAT_OP_VOLUMETEXTURE |
1656 SVGA3DFORMAT_OP_OFFSCREEN_RENDERTARGET
1657 },
1658 {
1659 "SVGA3D_R16G16_FLOAT",
1660 SVGA3D_R16G16_FLOAT,
1661 SVGA3D_DEVCAP_DXFMT_R16G16_FLOAT,
1662 1, 1, 4,
1663 SVGA3DFORMAT_OP_TEXTURE |
1664 SVGA3DFORMAT_OP_VOLUMETEXTURE |
1665 SVGA3DFORMAT_OP_CUBETEXTURE |
1666 SVGA3DFORMAT_OP_OFFSCREEN_RENDERTARGET
1667 },
1668 {
1669 "SVGA3D_R16G16_UNORM",
1670 SVGA3D_R16G16_UNORM,
1671 SVGA3D_DEVCAP_DXFMT_R16G16_UNORM,
1672 1, 1, 4,
1673 SVGA3DFORMAT_OP_TEXTURE |
1674 SVGA3DFORMAT_OP_CUBETEXTURE |
1675 SVGA3DFORMAT_OP_VOLUMETEXTURE |
1676 SVGA3DFORMAT_OP_OFFSCREEN_RENDERTARGET
1677 },
1678 {
1679 "SVGA3D_R16G16_SNORM",
1680 SVGA3D_R16G16_SNORM,
1681 SVGA3D_DEVCAP_DXFMT_R16G16_SNORM,
1682 1, 1, 4,
1683 SVGA3DFORMAT_OP_TEXTURE |
1684 SVGA3DFORMAT_OP_CUBETEXTURE |
1685 SVGA3DFORMAT_OP_VOLUMETEXTURE |
1686 SVGA3DFORMAT_OP_OFFSCREEN_RENDERTARGET
1687 },
1688 {
1689 "SVGA3D_R32_FLOAT",
1690 SVGA3D_R32_FLOAT,
1691 SVGA3D_DEVCAP_DXFMT_R32_FLOAT,
1692 1, 1, 4,
1693 SVGA3DFORMAT_OP_TEXTURE |
1694 SVGA3DFORMAT_OP_VOLUMETEXTURE |
1695 SVGA3DFORMAT_OP_CUBETEXTURE |
1696 SVGA3DFORMAT_OP_OFFSCREEN_RENDERTARGET
1697 },
1698 {
1699 "SVGA3D_R8G8_SNORM",
1700 SVGA3D_R8G8_SNORM,
1701 SVGA3D_DEVCAP_DXFMT_R8G8_SNORM,
1702 1, 1, 2,
1703 SVGA3DFORMAT_OP_TEXTURE |
1704 SVGA3DFORMAT_OP_CUBETEXTURE |
1705 SVGA3DFORMAT_OP_VOLUMETEXTURE |
1706 SVGA3DFORMAT_OP_OFFSCREEN_RENDERTARGET
1707 },
1708 {
1709 "SVGA3D_R16_FLOAT",
1710 SVGA3D_R16_FLOAT,
1711 SVGA3D_DEVCAP_DXFMT_R16_FLOAT,
1712 1, 1, 2,
1713 SVGA3DFORMAT_OP_TEXTURE |
1714 SVGA3DFORMAT_OP_VOLUMETEXTURE |
1715 SVGA3DFORMAT_OP_CUBETEXTURE |
1716 SVGA3DFORMAT_OP_OFFSCREEN_RENDERTARGET
1717 },
1718 {
1719 "SVGA3D_D16_UNORM",
1720 SVGA3D_D16_UNORM,
1721 0, /*SVGA3D_DEVCAP_DXFMT_D16_UNORM*/
1722 1, 1, 2,
1723 SVGA3DFORMAT_OP_TEXTURE |
1724 SVGA3DFORMAT_OP_CUBETEXTURE |
1725 SVGA3DFORMAT_OP_VOLUMETEXTURE |
1726 SVGA3DFORMAT_OP_ZSTENCIL
1727 },
1728 {
1729 "SVGA3D_A8_UNORM",
1730 SVGA3D_A8_UNORM,
1731 SVGA3D_DEVCAP_DXFMT_A8_UNORM,
1732 1, 1, 1,
1733 SVGA3DFORMAT_OP_TEXTURE |
1734 SVGA3DFORMAT_OP_CUBETEXTURE |
1735 SVGA3DFORMAT_OP_VOLUMETEXTURE |
1736 SVGA3DFORMAT_OP_OFFSCREEN_RENDERTARGET
1737 },
1738 {
1739 "SVGA3D_BC1_UNORM",
1740 SVGA3D_BC1_UNORM,
1741 SVGA3D_DEVCAP_DXFMT_BC1_UNORM,
1742 4, 4, 8,
1743 SVGA3DFORMAT_OP_TEXTURE |
1744 SVGA3DFORMAT_OP_CUBETEXTURE
1745 },
1746 {
1747 "SVGA3D_BC2_UNORM",
1748 SVGA3D_BC2_UNORM,
1749 SVGA3D_DEVCAP_DXFMT_BC2_UNORM,
1750 4, 4, 16,
1751 SVGA3DFORMAT_OP_TEXTURE |
1752 SVGA3DFORMAT_OP_CUBETEXTURE
1753 },
1754 {
1755 "SVGA3D_BC3_UNORM",
1756 SVGA3D_BC3_UNORM,
1757 SVGA3D_DEVCAP_DXFMT_BC3_UNORM,
1758 4, 4, 16,
1759 SVGA3DFORMAT_OP_TEXTURE |
1760 SVGA3DFORMAT_OP_CUBETEXTURE
1761 },
1762 {
1763 "SVGA3D_B5G6R5_UNORM",
1764 SVGA3D_B5G6R5_UNORM,
1765 SVGA3D_DEVCAP_DXFMT_B5G6R5_UNORM,
1766 1, 1, 2,
1767 SVGA3DFORMAT_OP_TEXTURE |
1768 SVGA3DFORMAT_OP_CUBETEXTURE |
1769 SVGA3DFORMAT_OP_VOLUMETEXTURE |
1770 SVGA3DFORMAT_OP_DISPLAYMODE |
1771 SVGA3DFORMAT_OP_OFFSCREEN_RENDERTARGET
1772 },
1773 {
1774 "SVGA3D_B5G5R5A1_UNORM",
1775 SVGA3D_B5G5R5A1_UNORM,
1776 SVGA3D_DEVCAP_DXFMT_B5G5R5A1_UNORM,
1777 1, 1, 2,
1778 SVGA3DFORMAT_OP_TEXTURE |
1779 SVGA3DFORMAT_OP_CUBETEXTURE |
1780 SVGA3DFORMAT_OP_VOLUMETEXTURE |
1781 SVGA3DFORMAT_OP_DISPLAYMODE |
1782 SVGA3DFORMAT_OP_OFFSCREEN_RENDERTARGET
1783 },
1784 {
1785 "SVGA3D_B8G8R8A8_UNORM",
1786 SVGA3D_B8G8R8A8_UNORM,
1787 SVGA3D_DEVCAP_DXFMT_B8G8R8A8_UNORM,
1788 1, 1, 4,
1789 SVGA3DFORMAT_OP_TEXTURE |
1790 SVGA3DFORMAT_OP_CUBETEXTURE |
1791 SVGA3DFORMAT_OP_VOLUMETEXTURE |
1792 SVGA3DFORMAT_OP_OFFSCREEN_RENDERTARGET
1793 },
1794 {
1795 "SVGA3D_B8G8R8X8_UNORM",
1796 SVGA3D_B8G8R8X8_UNORM,
1797 SVGA3D_DEVCAP_DXFMT_B8G8R8X8_UNORM,
1798 1, 1, 4,
1799 SVGA3DFORMAT_OP_TEXTURE |
1800 SVGA3DFORMAT_OP_CUBETEXTURE |
1801 SVGA3DFORMAT_OP_VOLUMETEXTURE |
1802 SVGA3DFORMAT_OP_DISPLAYMODE |
1803 SVGA3DFORMAT_OP_OFFSCREEN_RENDERTARGET
1804 },
1805 {
1806 "SVGA3D_BC4_UNORM",
1807 SVGA3D_BC4_UNORM,
1808 SVGA3D_DEVCAP_DXFMT_BC4_UNORM,
1809 4, 4, 8,
1810 SVGA3DFORMAT_OP_TEXTURE |
1811 SVGA3DFORMAT_OP_CUBETEXTURE
1812 },
1813 {
1814 "SVGA3D_BC5_UNORM",
1815 SVGA3D_BC5_UNORM,
1816 SVGA3D_DEVCAP_DXFMT_BC5_UNORM,
1817 4, 4, 16,
1818 SVGA3DFORMAT_OP_TEXTURE |
1819 SVGA3DFORMAT_OP_CUBETEXTURE
1820 }
1821 };
1822
1823
1824 /**
1825 * Debug only:
1826 * 1. check that format_cap_table[i] matches the i-th SVGA3D format.
1827 * 2. check that format_conversion_table[i].pformat == i.
1828 */
1829 static void
check_format_tables(void)1830 check_format_tables(void)
1831 {
1832 static boolean first_call = TRUE;
1833
1834 if (first_call) {
1835 unsigned i;
1836
1837 STATIC_ASSERT(ARRAY_SIZE(format_cap_table) == SVGA3D_FORMAT_MAX);
1838 for (i = 0; i < ARRAY_SIZE(format_cap_table); i++) {
1839 assert(format_cap_table[i].format == i);
1840 }
1841
1842 STATIC_ASSERT(ARRAY_SIZE(format_conversion_table) == PIPE_FORMAT_COUNT);
1843 for (i = 0; i < ARRAY_SIZE(format_conversion_table); i++) {
1844 assert(format_conversion_table[i].pformat == i);
1845 }
1846
1847 first_call = FALSE;
1848 }
1849 }
1850
1851
1852 /*
1853 * Get format capabilities from the host. It takes in consideration
1854 * deprecated/unsupported formats, and formats which are implicitely assumed to
1855 * be supported when the host does not provide an explicit capability entry.
1856 */
1857 void
svga_get_format_cap(struct svga_screen * ss,SVGA3dSurfaceFormat format,SVGA3dSurfaceFormatCaps * caps)1858 svga_get_format_cap(struct svga_screen *ss,
1859 SVGA3dSurfaceFormat format,
1860 SVGA3dSurfaceFormatCaps *caps)
1861 {
1862 struct svga_winsys_screen *sws = ss->sws;
1863 SVGA3dDevCapResult result;
1864 const struct format_cap *entry;
1865
1866 #ifdef DEBUG
1867 check_format_tables();
1868 #else
1869 (void) check_format_tables;
1870 #endif
1871
1872 assert(format < ARRAY_SIZE(format_cap_table));
1873 entry = &format_cap_table[format];
1874 assert(entry->format == format);
1875
1876 if (entry->devcap && sws->get_cap(sws, entry->devcap, &result)) {
1877 /* Explicitly advertised format */
1878 if (entry->devcap > SVGA3D_DEVCAP_DX) {
1879 /* Translate DX/VGPU10 format cap to VGPU9 cap */
1880 caps->value = 0;
1881 if (result.u & SVGA3D_DXFMT_COLOR_RENDERTARGET)
1882 caps->value |= SVGA3DFORMAT_OP_OFFSCREEN_RENDERTARGET;
1883 if (!(result.u & SVGA3D_DXFMT_BLENDABLE))
1884 caps->value |= SVGA3DFORMAT_OP_NOALPHABLEND;
1885 if (result.u & SVGA3D_DXFMT_DEPTH_RENDERTARGET)
1886 caps->value |= SVGA3DFORMAT_OP_ZSTENCIL;
1887 if (result.u & SVGA3D_DXFMT_SHADER_SAMPLE)
1888 caps->value |= (SVGA3DFORMAT_OP_TEXTURE |
1889 SVGA3DFORMAT_OP_CUBETEXTURE);
1890 if (result.u & SVGA3D_DXFMT_VOLUME)
1891 caps->value |= SVGA3DFORMAT_OP_VOLUMETEXTURE;
1892 }
1893 else {
1894 /* Return VGPU9 format cap as-is */
1895 caps->value = result.u;
1896 }
1897
1898 } else {
1899 /* Implicitly advertised format -- use default caps */
1900 caps->value = entry->defaultOperations;
1901 }
1902 }
1903
1904
1905 void
svga_format_size(SVGA3dSurfaceFormat format,unsigned * block_width,unsigned * block_height,unsigned * bytes_per_block)1906 svga_format_size(SVGA3dSurfaceFormat format,
1907 unsigned *block_width,
1908 unsigned *block_height,
1909 unsigned *bytes_per_block)
1910 {
1911 assert(format < ARRAY_SIZE(format_cap_table));
1912 *block_width = format_cap_table[format].block_width;
1913 *block_height = format_cap_table[format].block_height;
1914 *bytes_per_block = format_cap_table[format].block_bytes;
1915 /* Make sure the table entry was valid */
1916 if (*block_width == 0)
1917 debug_printf("Bad table entry for %s\n", svga_format_name(format));
1918 assert(*block_width);
1919 assert(*block_height);
1920 assert(*bytes_per_block);
1921 }
1922
1923
1924 const char *
svga_format_name(SVGA3dSurfaceFormat format)1925 svga_format_name(SVGA3dSurfaceFormat format)
1926 {
1927 assert(format < ARRAY_SIZE(format_cap_table));
1928 return format_cap_table[format].name;
1929 }
1930
1931
1932 /**
1933 * Is the given SVGA3dSurfaceFormat a signed or unsigned integer color format?
1934 */
1935 boolean
svga_format_is_integer(SVGA3dSurfaceFormat format)1936 svga_format_is_integer(SVGA3dSurfaceFormat format)
1937 {
1938 switch (format) {
1939 case SVGA3D_R32G32B32A32_SINT:
1940 case SVGA3D_R32G32B32_SINT:
1941 case SVGA3D_R32G32_SINT:
1942 case SVGA3D_R32_SINT:
1943 case SVGA3D_R16G16B16A16_SINT:
1944 case SVGA3D_R16G16_SINT:
1945 case SVGA3D_R16_SINT:
1946 case SVGA3D_R8G8B8A8_SINT:
1947 case SVGA3D_R8G8_SINT:
1948 case SVGA3D_R8_SINT:
1949 case SVGA3D_R32G32B32A32_UINT:
1950 case SVGA3D_R32G32B32_UINT:
1951 case SVGA3D_R32G32_UINT:
1952 case SVGA3D_R32_UINT:
1953 case SVGA3D_R16G16B16A16_UINT:
1954 case SVGA3D_R16G16_UINT:
1955 case SVGA3D_R16_UINT:
1956 case SVGA3D_R8G8B8A8_UINT:
1957 case SVGA3D_R8G8_UINT:
1958 case SVGA3D_R8_UINT:
1959 case SVGA3D_R10G10B10A2_UINT:
1960 return TRUE;
1961 default:
1962 return FALSE;
1963 }
1964 }
1965
1966 boolean
svga_format_support_gen_mips(enum pipe_format format)1967 svga_format_support_gen_mips(enum pipe_format format)
1968 {
1969 assert(format < ARRAY_SIZE(format_conversion_table));
1970 return ((format_conversion_table[format].flags & TF_GEN_MIPS) > 0);
1971 }
1972
1973
1974 /**
1975 * Given a texture format, return the expected data type returned from
1976 * the texture sampler. For example, UNORM8 formats return floating point
1977 * values while SINT formats returned signed integer values.
1978 * Note: this function could be moved into the gallum u_format.[ch] code
1979 * if it's useful to anyone else.
1980 */
1981 enum tgsi_return_type
svga_get_texture_datatype(enum pipe_format format)1982 svga_get_texture_datatype(enum pipe_format format)
1983 {
1984 const struct util_format_description *desc = util_format_description(format);
1985 enum tgsi_return_type t;
1986
1987 if (desc->layout == UTIL_FORMAT_LAYOUT_PLAIN ) {
1988 if (util_format_is_depth_or_stencil(format)) {
1989 t = TGSI_RETURN_TYPE_FLOAT; /* XXX revisit this */
1990 }
1991 else if (desc->channel[0].type == UTIL_FORMAT_TYPE_FLOAT) {
1992 t = TGSI_RETURN_TYPE_FLOAT;
1993 }
1994 else if (desc->channel[0].type == UTIL_FORMAT_TYPE_UNSIGNED) {
1995 t = desc->channel[0].normalized ? TGSI_RETURN_TYPE_UNORM : TGSI_RETURN_TYPE_UINT;
1996 }
1997 else if (desc->channel[0].type == UTIL_FORMAT_TYPE_SIGNED) {
1998 t = desc->channel[0].normalized ? TGSI_RETURN_TYPE_SNORM : TGSI_RETURN_TYPE_SINT;
1999 }
2000 else {
2001 assert(!"Unexpected channel type in svga_get_texture_datatype()");
2002 t = TGSI_RETURN_TYPE_FLOAT;
2003 }
2004 }
2005 else {
2006 /* compressed format, shared exponent format, etc. */
2007 switch (format) {
2008 case PIPE_FORMAT_DXT1_RGB:
2009 case PIPE_FORMAT_DXT1_RGBA:
2010 case PIPE_FORMAT_DXT3_RGBA:
2011 case PIPE_FORMAT_DXT5_RGBA:
2012 case PIPE_FORMAT_DXT1_SRGB:
2013 case PIPE_FORMAT_DXT1_SRGBA:
2014 case PIPE_FORMAT_DXT3_SRGBA:
2015 case PIPE_FORMAT_DXT5_SRGBA:
2016 case PIPE_FORMAT_RGTC1_UNORM:
2017 case PIPE_FORMAT_RGTC2_UNORM:
2018 case PIPE_FORMAT_LATC1_UNORM:
2019 case PIPE_FORMAT_LATC2_UNORM:
2020 case PIPE_FORMAT_ETC1_RGB8:
2021 t = TGSI_RETURN_TYPE_UNORM;
2022 break;
2023 case PIPE_FORMAT_RGTC1_SNORM:
2024 case PIPE_FORMAT_RGTC2_SNORM:
2025 case PIPE_FORMAT_LATC1_SNORM:
2026 case PIPE_FORMAT_LATC2_SNORM:
2027 case PIPE_FORMAT_R10G10B10X2_SNORM:
2028 t = TGSI_RETURN_TYPE_SNORM;
2029 break;
2030 case PIPE_FORMAT_R11G11B10_FLOAT:
2031 case PIPE_FORMAT_R9G9B9E5_FLOAT:
2032 t = TGSI_RETURN_TYPE_FLOAT;
2033 break;
2034 default:
2035 assert(!"Unexpected channel type in svga_get_texture_datatype()");
2036 t = TGSI_RETURN_TYPE_FLOAT;
2037 }
2038 }
2039
2040 return t;
2041 }
2042
2043
2044 /**
2045 * Given an svga context, return true iff there are currently any integer color
2046 * buffers attached to the framebuffer.
2047 */
2048 boolean
svga_has_any_integer_cbufs(const struct svga_context * svga)2049 svga_has_any_integer_cbufs(const struct svga_context *svga)
2050 {
2051 unsigned i;
2052 for (i = 0; i < PIPE_MAX_COLOR_BUFS; ++i) {
2053 struct pipe_surface *cbuf = svga->curr.framebuffer.cbufs[i];
2054
2055 if (cbuf && util_format_is_pure_integer(cbuf->format)) {
2056 return TRUE;
2057 }
2058 }
2059 return FALSE;
2060 }
2061
2062
2063 /**
2064 * Given an SVGA format, return the corresponding typeless format.
2065 * If there is no typeless format, return the format unchanged.
2066 */
2067 SVGA3dSurfaceFormat
svga_typeless_format(SVGA3dSurfaceFormat format)2068 svga_typeless_format(SVGA3dSurfaceFormat format)
2069 {
2070 switch (format) {
2071 case SVGA3D_R32G32B32A32_UINT:
2072 case SVGA3D_R32G32B32A32_SINT:
2073 case SVGA3D_R32G32B32A32_FLOAT:
2074 return SVGA3D_R32G32B32A32_TYPELESS;
2075 case SVGA3D_R32G32B32_FLOAT:
2076 case SVGA3D_R32G32B32_UINT:
2077 case SVGA3D_R32G32B32_SINT:
2078 return SVGA3D_R32G32B32_TYPELESS;
2079 case SVGA3D_R16G16B16A16_UINT:
2080 case SVGA3D_R16G16B16A16_UNORM:
2081 case SVGA3D_R16G16B16A16_SNORM:
2082 case SVGA3D_R16G16B16A16_SINT:
2083 case SVGA3D_R16G16B16A16_FLOAT:
2084 return SVGA3D_R16G16B16A16_TYPELESS;
2085 case SVGA3D_R32G32_UINT:
2086 case SVGA3D_R32G32_SINT:
2087 case SVGA3D_R32G32_FLOAT:
2088 return SVGA3D_R32G32_TYPELESS;
2089 case SVGA3D_D32_FLOAT_S8X24_UINT:
2090 return SVGA3D_R32G8X24_TYPELESS;
2091 case SVGA3D_X32_TYPELESS_G8X24_UINT:
2092 return SVGA3D_R32_FLOAT_X8X24_TYPELESS;
2093 case SVGA3D_R10G10B10A2_UINT:
2094 case SVGA3D_R10G10B10A2_UNORM:
2095 return SVGA3D_R10G10B10A2_TYPELESS;
2096 case SVGA3D_R8G8B8A8_UNORM:
2097 case SVGA3D_R8G8B8A8_SNORM:
2098 case SVGA3D_R8G8B8A8_UNORM_SRGB:
2099 case SVGA3D_R8G8B8A8_UINT:
2100 case SVGA3D_R8G8B8A8_SINT:
2101 return SVGA3D_R8G8B8A8_TYPELESS;
2102 case SVGA3D_R16G16_UINT:
2103 case SVGA3D_R16G16_SINT:
2104 case SVGA3D_R16G16_UNORM:
2105 case SVGA3D_R16G16_SNORM:
2106 case SVGA3D_R16G16_FLOAT:
2107 return SVGA3D_R16G16_TYPELESS;
2108 case SVGA3D_D32_FLOAT:
2109 case SVGA3D_R32_FLOAT:
2110 case SVGA3D_R32_UINT:
2111 case SVGA3D_R32_SINT:
2112 return SVGA3D_R32_TYPELESS;
2113 case SVGA3D_D24_UNORM_S8_UINT:
2114 return SVGA3D_R24G8_TYPELESS;
2115 case SVGA3D_X24_TYPELESS_G8_UINT:
2116 return SVGA3D_R24_UNORM_X8_TYPELESS;
2117 case SVGA3D_R8G8_UNORM:
2118 case SVGA3D_R8G8_SNORM:
2119 case SVGA3D_R8G8_UINT:
2120 case SVGA3D_R8G8_SINT:
2121 return SVGA3D_R8G8_TYPELESS;
2122 case SVGA3D_D16_UNORM:
2123 case SVGA3D_R16_UNORM:
2124 case SVGA3D_R16_UINT:
2125 case SVGA3D_R16_SNORM:
2126 case SVGA3D_R16_SINT:
2127 case SVGA3D_R16_FLOAT:
2128 return SVGA3D_R16_TYPELESS;
2129 case SVGA3D_R8_UNORM:
2130 case SVGA3D_R8_UINT:
2131 case SVGA3D_R8_SNORM:
2132 case SVGA3D_R8_SINT:
2133 return SVGA3D_R8_TYPELESS;
2134 case SVGA3D_B8G8R8A8_UNORM_SRGB:
2135 case SVGA3D_B8G8R8A8_UNORM:
2136 return SVGA3D_B8G8R8A8_TYPELESS;
2137 case SVGA3D_B8G8R8X8_UNORM_SRGB:
2138 case SVGA3D_B8G8R8X8_UNORM:
2139 return SVGA3D_B8G8R8X8_TYPELESS;
2140 case SVGA3D_BC1_UNORM:
2141 case SVGA3D_BC1_UNORM_SRGB:
2142 return SVGA3D_BC1_TYPELESS;
2143 case SVGA3D_BC2_UNORM:
2144 case SVGA3D_BC2_UNORM_SRGB:
2145 return SVGA3D_BC2_TYPELESS;
2146 case SVGA3D_BC3_UNORM:
2147 case SVGA3D_BC3_UNORM_SRGB:
2148 return SVGA3D_BC3_TYPELESS;
2149 case SVGA3D_BC4_UNORM:
2150 case SVGA3D_BC4_SNORM:
2151 return SVGA3D_BC4_TYPELESS;
2152 case SVGA3D_BC5_UNORM:
2153 case SVGA3D_BC5_SNORM:
2154 return SVGA3D_BC5_TYPELESS;
2155
2156 /* Special cases (no corresponding _TYPELESS formats) */
2157 case SVGA3D_A8_UNORM:
2158 case SVGA3D_B5G5R5A1_UNORM:
2159 case SVGA3D_B5G6R5_UNORM:
2160 case SVGA3D_R11G11B10_FLOAT:
2161 case SVGA3D_R9G9B9E5_SHAREDEXP:
2162 return format;
2163 default:
2164 debug_printf("Unexpected format %s in %s\n",
2165 svga_format_name(format), __FUNCTION__);
2166 return format;
2167 }
2168 }
2169
2170
2171 /**
2172 * Given a surface format, return the corresponding format to use for
2173 * a texture sampler. In most cases, it's the format unchanged, but there
2174 * are some special cases.
2175 */
2176 SVGA3dSurfaceFormat
svga_sampler_format(SVGA3dSurfaceFormat format)2177 svga_sampler_format(SVGA3dSurfaceFormat format)
2178 {
2179 switch (format) {
2180 case SVGA3D_D16_UNORM:
2181 return SVGA3D_R16_UNORM;
2182 case SVGA3D_D24_UNORM_S8_UINT:
2183 return SVGA3D_R24_UNORM_X8_TYPELESS;
2184 case SVGA3D_D32_FLOAT:
2185 return SVGA3D_R32_FLOAT;
2186 case SVGA3D_D32_FLOAT_S8X24_UINT:
2187 return SVGA3D_R32_FLOAT_X8X24_TYPELESS;
2188 default:
2189 return format;
2190 }
2191 }
2192
2193
2194 /**
2195 * Is the given format an uncompressed snorm format?
2196 */
2197 bool
svga_format_is_uncompressed_snorm(SVGA3dSurfaceFormat format)2198 svga_format_is_uncompressed_snorm(SVGA3dSurfaceFormat format)
2199 {
2200 switch (format) {
2201 case SVGA3D_R8G8B8A8_SNORM:
2202 case SVGA3D_R8G8_SNORM:
2203 case SVGA3D_R8_SNORM:
2204 case SVGA3D_R16G16B16A16_SNORM:
2205 case SVGA3D_R16G16_SNORM:
2206 case SVGA3D_R16_SNORM:
2207 return true;
2208 default:
2209 return false;
2210 }
2211 }
2212
2213
2214 bool
svga_format_is_typeless(SVGA3dSurfaceFormat format)2215 svga_format_is_typeless(SVGA3dSurfaceFormat format)
2216 {
2217 switch (format) {
2218 case SVGA3D_R32G32B32A32_TYPELESS:
2219 case SVGA3D_R32G32B32_TYPELESS:
2220 case SVGA3D_R16G16B16A16_TYPELESS:
2221 case SVGA3D_R32G32_TYPELESS:
2222 case SVGA3D_R32G8X24_TYPELESS:
2223 case SVGA3D_R10G10B10A2_TYPELESS:
2224 case SVGA3D_R8G8B8A8_TYPELESS:
2225 case SVGA3D_R16G16_TYPELESS:
2226 case SVGA3D_R32_TYPELESS:
2227 case SVGA3D_R24G8_TYPELESS:
2228 case SVGA3D_R8G8_TYPELESS:
2229 case SVGA3D_R16_TYPELESS:
2230 case SVGA3D_R8_TYPELESS:
2231 case SVGA3D_BC1_TYPELESS:
2232 case SVGA3D_BC2_TYPELESS:
2233 case SVGA3D_BC3_TYPELESS:
2234 case SVGA3D_BC4_TYPELESS:
2235 case SVGA3D_BC5_TYPELESS:
2236 case SVGA3D_B8G8R8A8_TYPELESS:
2237 case SVGA3D_B8G8R8X8_TYPELESS:
2238 return true;
2239 default:
2240 return false;
2241 }
2242 }
2243