1 /********************************************************** 2 * Copyright 2012-2021 VMware, Inc. 3 * SPDX-License-Identifier: GPL-2.0 OR MIT 4 * 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: 12 * 13 * The above copyright notice and this permission notice shall be 14 * included in all copies or substantial portions of the Software. 15 * 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 23 * SOFTWARE. 24 * 25 **********************************************************/ 26 27 /* 28 * svga3d_types.h -- 29 * 30 * SVGA 3d hardware definitions for basic types 31 */ 32 33 34 35 #ifndef _SVGA3D_TYPES_H_ 36 #define _SVGA3D_TYPES_H_ 37 38 #include "vm_basic_types.h" 39 40 #define SVGA3D_INVALID_ID ((uint32)-1) 41 42 #define SVGA3D_RESOURCE_TYPE_MIN 1 43 #define SVGA3D_RESOURCE_BUFFER 1 44 #define SVGA3D_RESOURCE_TEXTURE1D 2 45 #define SVGA3D_RESOURCE_TEXTURE2D 3 46 #define SVGA3D_RESOURCE_TEXTURE3D 4 47 #define SVGA3D_RESOURCE_TEXTURECUBE 5 48 #define SVGA3D_RESOURCE_TYPE_DX10_MAX 6 49 #define SVGA3D_RESOURCE_BUFFEREX 6 50 #define SVGA3D_RESOURCE_TYPE_MAX 7 51 typedef uint32 SVGA3dResourceType; 52 53 typedef uint8 SVGABool8; 54 typedef uint32 SVGA3dBool; 55 typedef uint32 SVGA3dColor; 56 57 typedef uint32 SVGA3dSurfaceId; 58 59 #pragma pack(push, 1) 60 typedef struct { 61 uint32 numerator; 62 uint32 denominator; 63 } SVGA3dFraction64; 64 #pragma pack(pop) 65 66 #pragma pack(push, 1) 67 typedef struct SVGA3dCopyRect { 68 uint32 x; 69 uint32 y; 70 uint32 w; 71 uint32 h; 72 uint32 srcx; 73 uint32 srcy; 74 } SVGA3dCopyRect; 75 #pragma pack(pop) 76 77 #pragma pack(push, 1) 78 typedef struct SVGA3dCopyBox { 79 uint32 x; 80 uint32 y; 81 uint32 z; 82 uint32 w; 83 uint32 h; 84 uint32 d; 85 uint32 srcx; 86 uint32 srcy; 87 uint32 srcz; 88 } SVGA3dCopyBox; 89 #pragma pack(pop) 90 91 #pragma pack(push, 1) 92 typedef struct SVGA3dRect { 93 uint32 x; 94 uint32 y; 95 uint32 w; 96 uint32 h; 97 } SVGA3dRect; 98 #pragma pack(pop) 99 100 #pragma pack(push, 1) 101 typedef struct { 102 uint32 x; 103 uint32 y; 104 uint32 z; 105 uint32 w; 106 uint32 h; 107 uint32 d; 108 } SVGA3dBox; 109 #pragma pack(pop) 110 111 #pragma pack(push, 1) 112 typedef struct { 113 int32 x; 114 int32 y; 115 int32 z; 116 int32 w; 117 int32 h; 118 int32 d; 119 } SVGA3dSignedBox; 120 #pragma pack(pop) 121 122 #pragma pack(push, 1) 123 typedef struct { 124 uint32 x; 125 uint32 y; 126 uint32 z; 127 } SVGA3dPoint; 128 #pragma pack(pop) 129 130 #pragma pack(push, 1) 131 typedef union { 132 struct { 133 float r; 134 float g; 135 float b; 136 float a; 137 }; 138 139 float value[4]; 140 } SVGA3dRGBAFloat; 141 #pragma pack(pop) 142 143 typedef enum SVGA3dSurfaceFormat { 144 SVGA3D_FORMAT_INVALID = 0, 145 146 SVGA3D_X8R8G8B8 = 1, 147 SVGA3D_FORMAT_MIN = 1, 148 149 SVGA3D_A8R8G8B8 = 2, 150 151 SVGA3D_R5G6B5 = 3, 152 SVGA3D_X1R5G5B5 = 4, 153 SVGA3D_A1R5G5B5 = 5, 154 SVGA3D_A4R4G4B4 = 6, 155 156 SVGA3D_Z_D32 = 7, 157 SVGA3D_Z_D16 = 8, 158 SVGA3D_Z_D24S8 = 9, 159 SVGA3D_Z_D15S1 = 10, 160 161 SVGA3D_LUMINANCE8 = 11, 162 SVGA3D_LUMINANCE4_ALPHA4 = 12, 163 SVGA3D_LUMINANCE16 = 13, 164 SVGA3D_LUMINANCE8_ALPHA8 = 14, 165 166 SVGA3D_DXT1 = 15, 167 SVGA3D_DXT2 = 16, 168 SVGA3D_DXT3 = 17, 169 SVGA3D_DXT4 = 18, 170 SVGA3D_DXT5 = 19, 171 172 SVGA3D_BUMPU8V8 = 20, 173 SVGA3D_BUMPL6V5U5 = 21, 174 SVGA3D_BUMPX8L8V8U8 = 22, 175 SVGA3D_FORMAT_DEAD1 = 23, 176 177 SVGA3D_ARGB_S10E5 = 24, 178 SVGA3D_ARGB_S23E8 = 25, 179 180 SVGA3D_A2R10G10B10 = 26, 181 182 SVGA3D_V8U8 = 27, 183 SVGA3D_Q8W8V8U8 = 28, 184 SVGA3D_CxV8U8 = 29, 185 186 SVGA3D_X8L8V8U8 = 30, 187 SVGA3D_A2W10V10U10 = 31, 188 189 SVGA3D_ALPHA8 = 32, 190 191 SVGA3D_R_S10E5 = 33, 192 SVGA3D_R_S23E8 = 34, 193 SVGA3D_RG_S10E5 = 35, 194 SVGA3D_RG_S23E8 = 36, 195 196 SVGA3D_BUFFER = 37, 197 198 SVGA3D_Z_D24X8 = 38, 199 200 SVGA3D_V16U16 = 39, 201 202 SVGA3D_G16R16 = 40, 203 SVGA3D_A16B16G16R16 = 41, 204 205 SVGA3D_UYVY = 42, 206 SVGA3D_YUY2 = 43, 207 208 SVGA3D_NV12 = 44, 209 210 SVGA3D_FORMAT_DEAD2 = 45, 211 212 SVGA3D_R32G32B32A32_TYPELESS = 46, 213 SVGA3D_R32G32B32A32_UINT = 47, 214 SVGA3D_R32G32B32A32_SINT = 48, 215 SVGA3D_R32G32B32_TYPELESS = 49, 216 SVGA3D_R32G32B32_FLOAT = 50, 217 SVGA3D_R32G32B32_UINT = 51, 218 SVGA3D_R32G32B32_SINT = 52, 219 SVGA3D_R16G16B16A16_TYPELESS = 53, 220 SVGA3D_R16G16B16A16_UINT = 54, 221 SVGA3D_R16G16B16A16_SNORM = 55, 222 SVGA3D_R16G16B16A16_SINT = 56, 223 SVGA3D_R32G32_TYPELESS = 57, 224 SVGA3D_R32G32_UINT = 58, 225 SVGA3D_R32G32_SINT = 59, 226 SVGA3D_R32G8X24_TYPELESS = 60, 227 SVGA3D_D32_FLOAT_S8X24_UINT = 61, 228 SVGA3D_R32_FLOAT_X8X24 = 62, 229 SVGA3D_X32_G8X24_UINT = 63, 230 SVGA3D_R10G10B10A2_TYPELESS = 64, 231 SVGA3D_R10G10B10A2_UINT = 65, 232 SVGA3D_R11G11B10_FLOAT = 66, 233 SVGA3D_R8G8B8A8_TYPELESS = 67, 234 SVGA3D_R8G8B8A8_UNORM = 68, 235 SVGA3D_R8G8B8A8_UNORM_SRGB = 69, 236 SVGA3D_R8G8B8A8_UINT = 70, 237 SVGA3D_R8G8B8A8_SINT = 71, 238 SVGA3D_R16G16_TYPELESS = 72, 239 SVGA3D_R16G16_UINT = 73, 240 SVGA3D_R16G16_SINT = 74, 241 SVGA3D_R32_TYPELESS = 75, 242 SVGA3D_D32_FLOAT = 76, 243 SVGA3D_R32_UINT = 77, 244 SVGA3D_R32_SINT = 78, 245 SVGA3D_R24G8_TYPELESS = 79, 246 SVGA3D_D24_UNORM_S8_UINT = 80, 247 SVGA3D_R24_UNORM_X8 = 81, 248 SVGA3D_X24_G8_UINT = 82, 249 SVGA3D_R8G8_TYPELESS = 83, 250 SVGA3D_R8G8_UNORM = 84, 251 SVGA3D_R8G8_UINT = 85, 252 SVGA3D_R8G8_SINT = 86, 253 SVGA3D_R16_TYPELESS = 87, 254 SVGA3D_R16_UNORM = 88, 255 SVGA3D_R16_UINT = 89, 256 SVGA3D_R16_SNORM = 90, 257 SVGA3D_R16_SINT = 91, 258 SVGA3D_R8_TYPELESS = 92, 259 SVGA3D_R8_UNORM = 93, 260 SVGA3D_R8_UINT = 94, 261 SVGA3D_R8_SNORM = 95, 262 SVGA3D_R8_SINT = 96, 263 SVGA3D_P8 = 97, 264 SVGA3D_R9G9B9E5_SHAREDEXP = 98, 265 SVGA3D_R8G8_B8G8_UNORM = 99, 266 SVGA3D_G8R8_G8B8_UNORM = 100, 267 SVGA3D_BC1_TYPELESS = 101, 268 SVGA3D_BC1_UNORM_SRGB = 102, 269 SVGA3D_BC2_TYPELESS = 103, 270 SVGA3D_BC2_UNORM_SRGB = 104, 271 SVGA3D_BC3_TYPELESS = 105, 272 SVGA3D_BC3_UNORM_SRGB = 106, 273 SVGA3D_BC4_TYPELESS = 107, 274 SVGA3D_ATI1 = 108, 275 SVGA3D_BC4_SNORM = 109, 276 SVGA3D_BC5_TYPELESS = 110, 277 SVGA3D_ATI2 = 111, 278 SVGA3D_BC5_SNORM = 112, 279 SVGA3D_R10G10B10_XR_BIAS_A2_UNORM = 113, 280 SVGA3D_B8G8R8A8_TYPELESS = 114, 281 SVGA3D_B8G8R8A8_UNORM_SRGB = 115, 282 SVGA3D_B8G8R8X8_TYPELESS = 116, 283 SVGA3D_B8G8R8X8_UNORM_SRGB = 117, 284 285 SVGA3D_Z_DF16 = 118, 286 SVGA3D_Z_DF24 = 119, 287 SVGA3D_Z_D24S8_INT = 120, 288 289 SVGA3D_YV12 = 121, 290 291 SVGA3D_R32G32B32A32_FLOAT = 122, 292 SVGA3D_R16G16B16A16_FLOAT = 123, 293 SVGA3D_R16G16B16A16_UNORM = 124, 294 SVGA3D_R32G32_FLOAT = 125, 295 SVGA3D_R10G10B10A2_UNORM = 126, 296 SVGA3D_R8G8B8A8_SNORM = 127, 297 SVGA3D_R16G16_FLOAT = 128, 298 SVGA3D_R16G16_UNORM = 129, 299 SVGA3D_R16G16_SNORM = 130, 300 SVGA3D_R32_FLOAT = 131, 301 SVGA3D_R8G8_SNORM = 132, 302 SVGA3D_R16_FLOAT = 133, 303 SVGA3D_D16_UNORM = 134, 304 SVGA3D_A8_UNORM = 135, 305 SVGA3D_BC1_UNORM = 136, 306 SVGA3D_BC2_UNORM = 137, 307 SVGA3D_BC3_UNORM = 138, 308 SVGA3D_B5G6R5_UNORM = 139, 309 SVGA3D_B5G5R5A1_UNORM = 140, 310 SVGA3D_B8G8R8A8_UNORM = 141, 311 SVGA3D_B8G8R8X8_UNORM = 142, 312 SVGA3D_BC4_UNORM = 143, 313 SVGA3D_BC5_UNORM = 144, 314 SVGA3D_B4G4R4A4_UNORM = 145, 315 316 SVGA3D_BC6H_TYPELESS = 146, 317 SVGA3D_BC6H_UF16 = 147, 318 SVGA3D_BC6H_SF16 = 148, 319 SVGA3D_BC7_TYPELESS = 149, 320 SVGA3D_BC7_UNORM = 150, 321 SVGA3D_BC7_UNORM_SRGB = 151, 322 323 SVGA3D_AYUV = 152, 324 325 SVGA3D_R11G11B10_TYPELESS = 153, 326 327 SVGA3D_FORMAT_MAX 328 } SVGA3dSurfaceFormat; 329 330 #define SVGA3D_SURFACE_CUBEMAP (1 << 0) 331 332 #define SVGA3D_SURFACE_HINT_STATIC (CONST64U(1) << 1) 333 #define SVGA3D_SURFACE_HINT_DYNAMIC (CONST64U(1) << 2) 334 #define SVGA3D_SURFACE_HINT_INDEXBUFFER (CONST64U(1) << 3) 335 #define SVGA3D_SURFACE_HINT_VERTEXBUFFER (CONST64U(1) << 4) 336 #define SVGA3D_SURFACE_HINT_TEXTURE (CONST64U(1) << 5) 337 #define SVGA3D_SURFACE_HINT_RENDERTARGET (CONST64U(1) << 6) 338 #define SVGA3D_SURFACE_HINT_DEPTHSTENCIL (CONST64U(1) << 7) 339 #define SVGA3D_SURFACE_HINT_WRITEONLY (CONST64U(1) << 8) 340 #define SVGA3D_SURFACE_DEAD2 (CONST64U(1) << 9) 341 #define SVGA3D_SURFACE_AUTOGENMIPMAPS (CONST64U(1) << 10) 342 343 #define SVGA3D_SURFACE_DEAD1 (CONST64U(1) << 11) 344 345 #define SVGA3D_SURFACE_MOB_PITCH (CONST64U(1) << 12) 346 347 #define SVGA3D_SURFACE_INACTIVE (CONST64U(1) << 13) 348 #define SVGA3D_SURFACE_HINT_RT_LOCKABLE (CONST64U(1) << 14) 349 #define SVGA3D_SURFACE_VOLUME (CONST64U(1) << 15) 350 351 #define SVGA3D_SURFACE_SCREENTARGET (CONST64U(1) << 16) 352 353 #define SVGA3D_SURFACE_ALIGN16 (CONST64U(1) << 17) 354 355 #define SVGA3D_SURFACE_1D (CONST64U(1) << 18) 356 #define SVGA3D_SURFACE_ARRAY (CONST64U(1) << 19) 357 358 #define SVGA3D_SURFACE_BIND_VERTEX_BUFFER (CONST64U(1) << 20) 359 #define SVGA3D_SURFACE_BIND_INDEX_BUFFER (CONST64U(1) << 21) 360 #define SVGA3D_SURFACE_BIND_CONSTANT_BUFFER (CONST64U(1) << 22) 361 #define SVGA3D_SURFACE_BIND_SHADER_RESOURCE (CONST64U(1) << 23) 362 #define SVGA3D_SURFACE_BIND_RENDER_TARGET (CONST64U(1) << 24) 363 #define SVGA3D_SURFACE_BIND_DEPTH_STENCIL (CONST64U(1) << 25) 364 #define SVGA3D_SURFACE_BIND_STREAM_OUTPUT (CONST64U(1) << 26) 365 366 #define SVGA3D_SURFACE_STAGING_UPLOAD (CONST64U(1) << 27) 367 #define SVGA3D_SURFACE_STAGING_DOWNLOAD (CONST64U(1) << 28) 368 #define SVGA3D_SURFACE_HINT_INDIRECT_UPDATE (CONST64U(1) << 29) 369 370 #define SVGA3D_SURFACE_TRANSFER_FROM_BUFFER (CONST64U(1) << 30) 371 372 #define SVGA3D_SURFACE_RESERVED1 (CONST64U(1) << 31) 373 #define SVGA3D_SURFACE_VADECODE SVGA3D_SURFACE_RESERVED1 374 375 #define SVGA3D_SURFACE_MULTISAMPLE (CONST64U(1) << 32) 376 377 #define SVGA3D_SURFACE_BIND_UAVIEW (CONST64U(1) << 33) 378 379 #define SVGA3D_SURFACE_TRANSFER_TO_BUFFER (CONST64U(1) << 34) 380 381 #define SVGA3D_SURFACE_BIND_LOGICOPS (CONST64U(1) << 35) 382 383 #define SVGA3D_SURFACE_BIND_RAW_VIEWS (CONST64U(1) << 36) 384 #define SVGA3D_SURFACE_BUFFER_STRUCTURED (CONST64U(1) << 37) 385 386 #define SVGA3D_SURFACE_DRAWINDIRECT_ARGS (CONST64U(1) << 38) 387 #define SVGA3D_SURFACE_RESOURCE_CLAMP (CONST64U(1) << 39) 388 389 #define SVGA3D_SURFACE_STAGING_COPY (CONST64U(1) << 40) 390 391 #define SVGA3D_SURFACE_FLAG_MAX (CONST64U(1) << 44) 392 393 typedef uint32 SVGA3dSurface1Flags; 394 typedef uint32 SVGA3dSurface2Flags; 395 typedef uint64 SVGA3dSurfaceAllFlags; 396 397 #define SVGA3D_SURFACE_FLAGS1_MASK ((uint64)MAX_UINT32) 398 #define SVGA3D_SURFACE_FLAGS2_MASK (MAX_UINT64 & ~SVGA3D_SURFACE_FLAGS1_MASK) 399 400 #define SVGA3D_SURFACE_HB_DISALLOWED_MASK \ 401 (SVGA3D_SURFACE_MOB_PITCH | SVGA3D_SURFACE_SCREENTARGET | \ 402 SVGA3D_SURFACE_ALIGN16 | SVGA3D_SURFACE_BIND_CONSTANT_BUFFER | \ 403 SVGA3D_SURFACE_BIND_STREAM_OUTPUT | SVGA3D_SURFACE_STAGING_UPLOAD | \ 404 SVGA3D_SURFACE_STAGING_DOWNLOAD | \ 405 SVGA3D_SURFACE_HINT_INDIRECT_UPDATE | \ 406 SVGA3D_SURFACE_TRANSFER_FROM_BUFFER | SVGA3D_SURFACE_MULTISAMPLE | \ 407 SVGA3D_SURFACE_BIND_UAVIEW | SVGA3D_SURFACE_TRANSFER_TO_BUFFER | \ 408 SVGA3D_SURFACE_BIND_LOGICOPS | SVGA3D_SURFACE_BIND_RAW_VIEWS | \ 409 SVGA3D_SURFACE_BUFFER_STRUCTURED | SVGA3D_SURFACE_DRAWINDIRECT_ARGS | \ 410 SVGA3D_SURFACE_RESOURCE_CLAMP | SVGA3D_SURFACE_STAGING_COPY | \ 411 SVGA3D_SURFACE_RESTRICT_UPDATE | SVGA3D_SURFACE_BIND_TENSOR | \ 412 SVGA3D_SURFACE_LO_STAGING) 413 414 #define SVGA3D_SURFACE_HB_PRESENT_DISALLOWED_MASK \ 415 (SVGA3D_SURFACE_1D | SVGA3D_SURFACE_MULTISAMPLE | \ 416 SVGA3D_SURFACE_STAGING_COPY) 417 418 #define SVGA3D_SURFACE_2D_DISALLOWED_MASK \ 419 (SVGA3D_SURFACE_CUBEMAP | SVGA3D_SURFACE_AUTOGENMIPMAPS | \ 420 SVGA3D_SURFACE_VOLUME | SVGA3D_SURFACE_1D | \ 421 SVGA3D_SURFACE_BIND_VERTEX_BUFFER | \ 422 SVGA3D_SURFACE_BIND_INDEX_BUFFER | \ 423 SVGA3D_SURFACE_BIND_CONSTANT_BUFFER | \ 424 SVGA3D_SURFACE_BIND_DEPTH_STENCIL | \ 425 SVGA3D_SURFACE_BIND_STREAM_OUTPUT | \ 426 SVGA3D_SURFACE_TRANSFER_FROM_BUFFER | SVGA3D_SURFACE_MULTISAMPLE | \ 427 SVGA3D_SURFACE_BIND_UAVIEW | SVGA3D_SURFACE_TRANSFER_TO_BUFFER | \ 428 SVGA3D_SURFACE_BIND_RAW_VIEWS | SVGA3D_SURFACE_BUFFER_STRUCTURED | \ 429 SVGA3D_SURFACE_DRAWINDIRECT_ARGS | SVGA3D_SURFACE_RESOURCE_CLAMP | \ 430 SVGA3D_SURFACE_BIND_TENSOR) 431 432 #define SVGA3D_SURFACE_BASICOPS_DISALLOWED_MASK \ 433 (SVGA3D_SURFACE_CUBEMAP | SVGA3D_SURFACE_AUTOGENMIPMAPS | \ 434 SVGA3D_SURFACE_VOLUME | SVGA3D_SURFACE_1D | \ 435 SVGA3D_SURFACE_MULTISAMPLE) 436 437 #define SVGA3D_SURFACE_SCREENTARGET_DISALLOWED_MASK \ 438 (SVGA3D_SURFACE_CUBEMAP | SVGA3D_SURFACE_AUTOGENMIPMAPS | \ 439 SVGA3D_SURFACE_VOLUME | SVGA3D_SURFACE_1D | \ 440 SVGA3D_SURFACE_BIND_VERTEX_BUFFER | \ 441 SVGA3D_SURFACE_BIND_INDEX_BUFFER | \ 442 SVGA3D_SURFACE_BIND_CONSTANT_BUFFER | \ 443 SVGA3D_SURFACE_BIND_DEPTH_STENCIL | \ 444 SVGA3D_SURFACE_BIND_STREAM_OUTPUT | SVGA3D_SURFACE_INACTIVE | \ 445 SVGA3D_SURFACE_STAGING_UPLOAD | SVGA3D_SURFACE_STAGING_DOWNLOAD | \ 446 SVGA3D_SURFACE_HINT_INDIRECT_UPDATE | \ 447 SVGA3D_SURFACE_TRANSFER_FROM_BUFFER | SVGA3D_SURFACE_MULTISAMPLE | \ 448 SVGA3D_SURFACE_TRANSFER_TO_BUFFER | SVGA3D_SURFACE_BIND_RAW_VIEWS | \ 449 SVGA3D_SURFACE_BUFFER_STRUCTURED | SVGA3D_SURFACE_DRAWINDIRECT_ARGS | \ 450 SVGA3D_SURFACE_RESOURCE_CLAMP | SVGA3D_SURFACE_STAGING_COPY | \ 451 SVGA3D_SURFACE_BIND_TENSOR | SVGA3D_SURFACE_LO_STAGING) 452 453 #define SVGA3D_SURFACE_BUFFER_DISALLOWED_MASK \ 454 (SVGA3D_SURFACE_CUBEMAP | SVGA3D_SURFACE_AUTOGENMIPMAPS | \ 455 SVGA3D_SURFACE_VOLUME | SVGA3D_SURFACE_1D | SVGA3D_SURFACE_DEAD2 | \ 456 SVGA3D_SURFACE_ARRAY | SVGA3D_SURFACE_MULTISAMPLE | \ 457 SVGA3D_SURFACE_MOB_PITCH | SVGA3D_SURFACE_RESOURCE_CLAMP) 458 459 #define SVGA3D_SURFACE_MULTISAMPLE_DISALLOWED_MASK \ 460 (SVGA3D_SURFACE_CUBEMAP | SVGA3D_SURFACE_AUTOGENMIPMAPS | \ 461 SVGA3D_SURFACE_VOLUME | SVGA3D_SURFACE_1D | \ 462 SVGA3D_SURFACE_SCREENTARGET | SVGA3D_SURFACE_MOB_PITCH | \ 463 SVGA3D_SURFACE_TRANSFER_FROM_BUFFER | SVGA3D_SURFACE_BIND_UAVIEW | \ 464 SVGA3D_SURFACE_TRANSFER_TO_BUFFER | SVGA3D_SURFACE_BIND_LOGICOPS | \ 465 SVGA3D_SURFACE_BIND_RAW_VIEWS | SVGA3D_SURFACE_BUFFER_STRUCTURED | \ 466 SVGA3D_SURFACE_DRAWINDIRECT_ARGS | SVGA3D_SURFACE_STAGING_COPY) 467 468 #define SVGA3D_SURFACE_DX_ONLY_MASK \ 469 (SVGA3D_SURFACE_BIND_STREAM_OUTPUT | SVGA3D_SURFACE_STAGING_UPLOAD | \ 470 SVGA3D_SURFACE_STAGING_DOWNLOAD | \ 471 SVGA3D_SURFACE_TRANSFER_FROM_BUFFER | \ 472 SVGA3D_SURFACE_TRANSFER_TO_BUFFER) 473 474 #define SVGA3D_SURFACE_ANY_STAGING_MASK \ 475 (SVGA3D_SURFACE_STAGING_UPLOAD | SVGA3D_SURFACE_STAGING_DOWNLOAD | \ 476 SVGA3D_SURFACE_STAGING_COPY | SVGA3D_SURFACE_LO_STAGING) 477 478 #define SVGA3D_SURFACE_ANY_NONHINT_STAGING_MASK \ 479 (SVGA3D_SURFACE_ANY_STAGING_MASK & ~(SVGA3D_SURFACE_LO_STAGING)) 480 481 #define SVGA3D_SURFACE_BIND_MASK \ 482 (SVGA3D_SURFACE_BIND_VERTEX_BUFFER | \ 483 SVGA3D_SURFACE_BIND_INDEX_BUFFER | \ 484 SVGA3D_SURFACE_BIND_CONSTANT_BUFFER | \ 485 SVGA3D_SURFACE_BIND_SHADER_RESOURCE | \ 486 SVGA3D_SURFACE_BIND_RENDER_TARGET | \ 487 SVGA3D_SURFACE_BIND_DEPTH_STENCIL | \ 488 SVGA3D_SURFACE_BIND_STREAM_OUTPUT | SVGA3D_SURFACE_BIND_UAVIEW | \ 489 SVGA3D_SURFACE_BIND_LOGICOPS | SVGA3D_SURFACE_BIND_RAW_VIEWS | \ 490 SVGA3D_SURFACE_BIND_TENSOR) 491 492 #define SVGA3D_SURFACE_STAGING_DISALLOWED_MASK \ 493 (SVGA3D_SURFACE_BIND_MASK | SVGA3D_SURFACE_AUTOGENMIPMAPS | \ 494 SVGA3D_SURFACE_SCREENTARGET | SVGA3D_SURFACE_HINT_RENDERTARGET | \ 495 SVGA3D_SURFACE_HINT_INDIRECT_UPDATE | SVGA3D_SURFACE_MULTISAMPLE | \ 496 SVGA3D_SURFACE_DRAWINDIRECT_ARGS | SVGA3D_SURFACE_RESOURCE_CLAMP | \ 497 SVGA3D_SURFACE_BIND_TENSOR) 498 499 #define SVGA3D_SURFACE_STAGING_COPY_DISALLOWED_MASK \ 500 (SVGA3D_SURFACE_STAGING_DISALLOWED_MASK | \ 501 SVGA3D_SURFACE_TRANSFER_TO_BUFFER | \ 502 SVGA3D_SURFACE_TRANSFER_FROM_BUFFER) 503 504 #define SVGA3D_SURFACE_LOGICOPS_DISALLOWED_MASK \ 505 (SVGA3D_SURFACE_CUBEMAP | SVGA3D_SURFACE_DEAD2 | \ 506 SVGA3D_SURFACE_AUTOGENMIPMAPS | SVGA3D_SURFACE_VOLUME | \ 507 SVGA3D_SURFACE_1D | SVGA3D_SURFACE_BIND_VERTEX_BUFFER | \ 508 SVGA3D_SURFACE_BIND_INDEX_BUFFER | \ 509 SVGA3D_SURFACE_BIND_CONSTANT_BUFFER | \ 510 SVGA3D_SURFACE_BIND_DEPTH_STENCIL | \ 511 SVGA3D_SURFACE_BIND_STREAM_OUTPUT | \ 512 SVGA3D_SURFACE_TRANSFER_FROM_BUFFER | SVGA3D_SURFACE_MULTISAMPLE | \ 513 SVGA3D_SURFACE_BIND_UAVIEW | SVGA3D_SURFACE_TRANSFER_TO_BUFFER | \ 514 SVGA3D_SURFACE_BIND_RAW_VIEWS | SVGA3D_SURFACE_BUFFER_STRUCTURED | \ 515 SVGA3D_SURFACE_DRAWINDIRECT_ARGS | SVGA3D_SURFACE_RESOURCE_CLAMP | \ 516 SVGA3D_SURFACE_STAGING_COPY) 517 518 #define SVGA3D_SURFACE_SM5_MASK \ 519 (SVGA3D_SURFACE_DRAWINDIRECT_ARGS | SVGA3D_SURFACE_BUFFER_STRUCTURED | \ 520 SVGA3D_SURFACE_BIND_RAW_VIEWS | SVGA3D_SURFACE_BIND_UAVIEW | \ 521 SVGA3D_SURFACE_RESOURCE_CLAMP) 522 523 #define SVGA3D_BUFFER_STRUCTURED_STRIDE_MAX 2048 524 525 typedef enum { 526 SVGA3DFORMAT_OP_TEXTURE = 0x00000001, 527 SVGA3DFORMAT_OP_VOLUMETEXTURE = 0x00000002, 528 SVGA3DFORMAT_OP_CUBETEXTURE = 0x00000004, 529 SVGA3DFORMAT_OP_OFFSCREEN_RENDERTARGET = 0x00000008, 530 SVGA3DFORMAT_OP_SAME_FORMAT_RENDERTARGET = 0x00000010, 531 SVGA3DFORMAT_OP_ZSTENCIL = 0x00000040, 532 SVGA3DFORMAT_OP_ZSTENCIL_WITH_ARBITRARY_COLOR_DEPTH = 0x00000080, 533 534 SVGA3DFORMAT_OP_SAME_FORMAT_UP_TO_ALPHA_RENDERTARGET = 0x00000100, 535 536 SVGA3DFORMAT_OP_DISPLAYMODE = 0x00000400, 537 538 SVGA3DFORMAT_OP_3DACCELERATION = 0x00000800, 539 540 SVGA3DFORMAT_OP_PIXELSIZE = 0x00001000, 541 542 SVGA3DFORMAT_OP_CONVERT_TO_ARGB = 0x00002000, 543 544 SVGA3DFORMAT_OP_OFFSCREENPLAIN = 0x00004000, 545 546 SVGA3DFORMAT_OP_SRGBREAD = 0x00008000, 547 548 SVGA3DFORMAT_OP_BUMPMAP = 0x00010000, 549 550 SVGA3DFORMAT_OP_DMAP = 0x00020000, 551 552 SVGA3DFORMAT_OP_NOFILTER = 0x00040000, 553 554 SVGA3DFORMAT_OP_MEMBEROFGROUP_ARGB = 0x00080000, 555 556 SVGA3DFORMAT_OP_SRGBWRITE = 0x00100000, 557 558 SVGA3DFORMAT_OP_NOALPHABLEND = 0x00200000, 559 560 SVGA3DFORMAT_OP_AUTOGENMIPMAP = 0x00400000, 561 562 SVGA3DFORMAT_OP_VERTEXTEXTURE = 0x00800000, 563 564 SVGA3DFORMAT_OP_NOTEXCOORDWRAPNORMIP = 0x01000000 565 } SVGA3dFormatOp; 566 567 #define SVGA3D_FORMAT_POSITIVE \ 568 (SVGA3DFORMAT_OP_TEXTURE | SVGA3DFORMAT_OP_VOLUMETEXTURE | \ 569 SVGA3DFORMAT_OP_CUBETEXTURE | \ 570 SVGA3DFORMAT_OP_OFFSCREEN_RENDERTARGET | \ 571 SVGA3DFORMAT_OP_SAME_FORMAT_RENDERTARGET | SVGA3DFORMAT_OP_ZSTENCIL | \ 572 SVGA3DFORMAT_OP_ZSTENCIL_WITH_ARBITRARY_COLOR_DEPTH | \ 573 SVGA3DFORMAT_OP_SAME_FORMAT_UP_TO_ALPHA_RENDERTARGET | \ 574 SVGA3DFORMAT_OP_DISPLAYMODE | SVGA3DFORMAT_OP_3DACCELERATION | \ 575 SVGA3DFORMAT_OP_PIXELSIZE | SVGA3DFORMAT_OP_CONVERT_TO_ARGB | \ 576 SVGA3DFORMAT_OP_OFFSCREENPLAIN | SVGA3DFORMAT_OP_SRGBREAD | \ 577 SVGA3DFORMAT_OP_BUMPMAP | SVGA3DFORMAT_OP_DMAP | \ 578 SVGA3DFORMAT_OP_MEMBEROFGROUP_ARGB | SVGA3DFORMAT_OP_SRGBWRITE | \ 579 SVGA3DFORMAT_OP_AUTOGENMIPMAP | SVGA3DFORMAT_OP_VERTEXTEXTURE) 580 581 #define SVGA3D_FORMAT_NEGATIVE \ 582 (SVGA3DFORMAT_OP_NOFILTER | SVGA3DFORMAT_OP_NOALPHABLEND | \ 583 SVGA3DFORMAT_OP_NOTEXCOORDWRAPNORMIP) 584 585 typedef union { 586 uint32 value; 587 struct { 588 uint32 texture : 1; 589 uint32 volumeTexture : 1; 590 uint32 cubeTexture : 1; 591 uint32 offscreenRenderTarget : 1; 592 uint32 sameFormatRenderTarget : 1; 593 uint32 unknown1 : 1; 594 uint32 zStencil : 1; 595 uint32 zStencilArbitraryDepth : 1; 596 uint32 sameFormatUpToAlpha : 1; 597 uint32 unknown2 : 1; 598 uint32 displayMode : 1; 599 uint32 acceleration3d : 1; 600 uint32 pixelSize : 1; 601 uint32 convertToARGB : 1; 602 uint32 offscreenPlain : 1; 603 uint32 sRGBRead : 1; 604 uint32 bumpMap : 1; 605 uint32 dmap : 1; 606 uint32 noFilter : 1; 607 uint32 memberOfGroupARGB : 1; 608 uint32 sRGBWrite : 1; 609 uint32 noAlphaBlend : 1; 610 uint32 autoGenMipMap : 1; 611 uint32 vertexTexture : 1; 612 uint32 noTexCoordWrapNorMip : 1; 613 }; 614 } SVGA3dSurfaceFormatCaps; 615 616 typedef enum { 617 SVGA3D_RS_INVALID = 0, 618 SVGA3D_RS_MIN = 1, 619 SVGA3D_RS_ZENABLE = 1, 620 SVGA3D_RS_ZWRITEENABLE = 2, 621 SVGA3D_RS_ALPHATESTENABLE = 3, 622 SVGA3D_RS_DITHERENABLE = 4, 623 SVGA3D_RS_BLENDENABLE = 5, 624 SVGA3D_RS_FOGENABLE = 6, 625 SVGA3D_RS_SPECULARENABLE = 7, 626 SVGA3D_RS_STENCILENABLE = 8, 627 SVGA3D_RS_LIGHTINGENABLE = 9, 628 SVGA3D_RS_NORMALIZENORMALS = 10, 629 SVGA3D_RS_POINTSPRITEENABLE = 11, 630 SVGA3D_RS_POINTSCALEENABLE = 12, 631 SVGA3D_RS_STENCILREF = 13, 632 SVGA3D_RS_STENCILMASK = 14, 633 SVGA3D_RS_STENCILWRITEMASK = 15, 634 SVGA3D_RS_FOGSTART = 16, 635 SVGA3D_RS_FOGEND = 17, 636 SVGA3D_RS_FOGDENSITY = 18, 637 SVGA3D_RS_POINTSIZE = 19, 638 SVGA3D_RS_POINTSIZEMIN = 20, 639 SVGA3D_RS_POINTSIZEMAX = 21, 640 SVGA3D_RS_POINTSCALE_A = 22, 641 SVGA3D_RS_POINTSCALE_B = 23, 642 SVGA3D_RS_POINTSCALE_C = 24, 643 SVGA3D_RS_FOGCOLOR = 25, 644 SVGA3D_RS_AMBIENT = 26, 645 SVGA3D_RS_CLIPPLANEENABLE = 27, 646 SVGA3D_RS_FOGMODE = 28, 647 SVGA3D_RS_FILLMODE = 29, 648 SVGA3D_RS_SHADEMODE = 30, 649 SVGA3D_RS_LINEPATTERN = 31, 650 SVGA3D_RS_SRCBLEND = 32, 651 SVGA3D_RS_DSTBLEND = 33, 652 SVGA3D_RS_BLENDEQUATION = 34, 653 SVGA3D_RS_CULLMODE = 35, 654 SVGA3D_RS_ZFUNC = 36, 655 SVGA3D_RS_ALPHAFUNC = 37, 656 SVGA3D_RS_STENCILFUNC = 38, 657 SVGA3D_RS_STENCILFAIL = 39, 658 SVGA3D_RS_STENCILZFAIL = 40, 659 SVGA3D_RS_STENCILPASS = 41, 660 SVGA3D_RS_ALPHAREF = 42, 661 SVGA3D_RS_FRONTWINDING = 43, 662 SVGA3D_RS_COORDINATETYPE = 44, 663 SVGA3D_RS_ZBIAS = 45, 664 SVGA3D_RS_RANGEFOGENABLE = 46, 665 SVGA3D_RS_COLORWRITEENABLE = 47, 666 SVGA3D_RS_VERTEXMATERIALENABLE = 48, 667 SVGA3D_RS_DIFFUSEMATERIALSOURCE = 49, 668 SVGA3D_RS_SPECULARMATERIALSOURCE = 50, 669 SVGA3D_RS_AMBIENTMATERIALSOURCE = 51, 670 SVGA3D_RS_EMISSIVEMATERIALSOURCE = 52, 671 SVGA3D_RS_TEXTUREFACTOR = 53, 672 SVGA3D_RS_LOCALVIEWER = 54, 673 SVGA3D_RS_SCISSORTESTENABLE = 55, 674 SVGA3D_RS_BLENDCOLOR = 56, 675 SVGA3D_RS_STENCILENABLE2SIDED = 57, 676 SVGA3D_RS_CCWSTENCILFUNC = 58, 677 SVGA3D_RS_CCWSTENCILFAIL = 59, 678 SVGA3D_RS_CCWSTENCILZFAIL = 60, 679 SVGA3D_RS_CCWSTENCILPASS = 61, 680 SVGA3D_RS_VERTEXBLEND = 62, 681 SVGA3D_RS_SLOPESCALEDEPTHBIAS = 63, 682 SVGA3D_RS_DEPTHBIAS = 64, 683 684 SVGA3D_RS_OUTPUTGAMMA = 65, 685 SVGA3D_RS_ZVISIBLE = 66, 686 SVGA3D_RS_LASTPIXEL = 67, 687 SVGA3D_RS_CLIPPING = 68, 688 SVGA3D_RS_WRAP0 = 69, 689 SVGA3D_RS_WRAP1 = 70, 690 SVGA3D_RS_WRAP2 = 71, 691 SVGA3D_RS_WRAP3 = 72, 692 SVGA3D_RS_WRAP4 = 73, 693 SVGA3D_RS_WRAP5 = 74, 694 SVGA3D_RS_WRAP6 = 75, 695 SVGA3D_RS_WRAP7 = 76, 696 SVGA3D_RS_WRAP8 = 77, 697 SVGA3D_RS_WRAP9 = 78, 698 SVGA3D_RS_WRAP10 = 79, 699 SVGA3D_RS_WRAP11 = 80, 700 SVGA3D_RS_WRAP12 = 81, 701 SVGA3D_RS_WRAP13 = 82, 702 SVGA3D_RS_WRAP14 = 83, 703 SVGA3D_RS_WRAP15 = 84, 704 SVGA3D_RS_MULTISAMPLEANTIALIAS = 85, 705 SVGA3D_RS_MULTISAMPLEMASK = 86, 706 SVGA3D_RS_INDEXEDVERTEXBLENDENABLE = 87, 707 SVGA3D_RS_TWEENFACTOR = 88, 708 SVGA3D_RS_ANTIALIASEDLINEENABLE = 89, 709 SVGA3D_RS_COLORWRITEENABLE1 = 90, 710 SVGA3D_RS_COLORWRITEENABLE2 = 91, 711 SVGA3D_RS_COLORWRITEENABLE3 = 92, 712 SVGA3D_RS_SEPARATEALPHABLENDENABLE = 93, 713 SVGA3D_RS_SRCBLENDALPHA = 94, 714 SVGA3D_RS_DSTBLENDALPHA = 95, 715 SVGA3D_RS_BLENDEQUATIONALPHA = 96, 716 SVGA3D_RS_TRANSPARENCYANTIALIAS = 97, 717 SVGA3D_RS_LINEWIDTH = 98, 718 SVGA3D_RS_MAX 719 } SVGA3dRenderStateName; 720 721 typedef enum { 722 SVGA3D_TRANSPARENCYANTIALIAS_NORMAL = 0, 723 SVGA3D_TRANSPARENCYANTIALIAS_ALPHATOCOVERAGE = 1, 724 SVGA3D_TRANSPARENCYANTIALIAS_SUPERSAMPLE = 2, 725 SVGA3D_TRANSPARENCYANTIALIAS_MAX 726 } SVGA3dTransparencyAntialiasType; 727 728 typedef enum { 729 SVGA3D_VERTEXMATERIAL_NONE = 0, 730 SVGA3D_VERTEXMATERIAL_DIFFUSE = 1, 731 SVGA3D_VERTEXMATERIAL_SPECULAR = 2, 732 SVGA3D_VERTEXMATERIAL_MAX = 3, 733 } SVGA3dVertexMaterial; 734 735 typedef enum { 736 SVGA3D_FILLMODE_INVALID = 0, 737 SVGA3D_FILLMODE_MIN = 1, 738 SVGA3D_FILLMODE_POINT = 1, 739 SVGA3D_FILLMODE_LINE = 2, 740 SVGA3D_FILLMODE_FILL = 3, 741 SVGA3D_FILLMODE_MAX 742 } SVGA3dFillModeType; 743 744 #pragma pack(push, 1) 745 typedef union { 746 struct { 747 uint16 mode; 748 uint16 face; 749 }; 750 uint32 uintValue; 751 } SVGA3dFillMode; 752 #pragma pack(pop) 753 754 typedef enum { 755 SVGA3D_SHADEMODE_INVALID = 0, 756 SVGA3D_SHADEMODE_FLAT = 1, 757 SVGA3D_SHADEMODE_SMOOTH = 2, 758 SVGA3D_SHADEMODE_PHONG = 3, 759 SVGA3D_SHADEMODE_MAX 760 } SVGA3dShadeMode; 761 762 #pragma pack(push, 1) 763 typedef union { 764 struct { 765 uint16 repeat; 766 uint16 pattern; 767 }; 768 uint32 uintValue; 769 } SVGA3dLinePattern; 770 #pragma pack(pop) 771 772 typedef enum { 773 SVGA3D_BLENDOP_INVALID = 0, 774 SVGA3D_BLENDOP_MIN = 1, 775 SVGA3D_BLENDOP_ZERO = 1, 776 SVGA3D_BLENDOP_ONE = 2, 777 SVGA3D_BLENDOP_SRCCOLOR = 3, 778 SVGA3D_BLENDOP_INVSRCCOLOR = 4, 779 SVGA3D_BLENDOP_SRCALPHA = 5, 780 SVGA3D_BLENDOP_INVSRCALPHA = 6, 781 SVGA3D_BLENDOP_DESTALPHA = 7, 782 SVGA3D_BLENDOP_INVDESTALPHA = 8, 783 SVGA3D_BLENDOP_DESTCOLOR = 9, 784 SVGA3D_BLENDOP_INVDESTCOLOR = 10, 785 SVGA3D_BLENDOP_SRCALPHASAT = 11, 786 SVGA3D_BLENDOP_BLENDFACTOR = 12, 787 SVGA3D_BLENDOP_INVBLENDFACTOR = 13, 788 SVGA3D_BLENDOP_SRC1COLOR = 14, 789 SVGA3D_BLENDOP_INVSRC1COLOR = 15, 790 SVGA3D_BLENDOP_SRC1ALPHA = 16, 791 SVGA3D_BLENDOP_INVSRC1ALPHA = 17, 792 SVGA3D_BLENDOP_BLENDFACTORALPHA = 18, 793 SVGA3D_BLENDOP_INVBLENDFACTORALPHA = 19, 794 SVGA3D_BLENDOP_MAX 795 } SVGA3dBlendOp; 796 797 typedef enum { 798 SVGA3D_BLENDEQ_INVALID = 0, 799 SVGA3D_BLENDEQ_MIN = 1, 800 SVGA3D_BLENDEQ_ADD = 1, 801 SVGA3D_BLENDEQ_SUBTRACT = 2, 802 SVGA3D_BLENDEQ_REVSUBTRACT = 3, 803 SVGA3D_BLENDEQ_MINIMUM = 4, 804 SVGA3D_BLENDEQ_MAXIMUM = 5, 805 SVGA3D_BLENDEQ_MAX 806 } SVGA3dBlendEquation; 807 808 typedef enum { 809 SVGA3D_DX11_LOGICOP_MIN = 0, 810 SVGA3D_DX11_LOGICOP_CLEAR = 0, 811 SVGA3D_DX11_LOGICOP_SET = 1, 812 SVGA3D_DX11_LOGICOP_COPY = 2, 813 SVGA3D_DX11_LOGICOP_COPY_INVERTED = 3, 814 SVGA3D_DX11_LOGICOP_NOOP = 4, 815 SVGA3D_DX11_LOGICOP_INVERT = 5, 816 SVGA3D_DX11_LOGICOP_AND = 6, 817 SVGA3D_DX11_LOGICOP_NAND = 7, 818 SVGA3D_DX11_LOGICOP_OR = 8, 819 SVGA3D_DX11_LOGICOP_NOR = 9, 820 SVGA3D_DX11_LOGICOP_XOR = 10, 821 SVGA3D_DX11_LOGICOP_EQUIV = 11, 822 SVGA3D_DX11_LOGICOP_AND_REVERSE = 12, 823 SVGA3D_DX11_LOGICOP_AND_INVERTED = 13, 824 SVGA3D_DX11_LOGICOP_OR_REVERSE = 14, 825 SVGA3D_DX11_LOGICOP_OR_INVERTED = 15, 826 SVGA3D_DX11_LOGICOP_MAX 827 } SVGA3dDX11LogicOp; 828 829 typedef enum { 830 SVGA3D_FRONTWINDING_INVALID = 0, 831 SVGA3D_FRONTWINDING_CW = 1, 832 SVGA3D_FRONTWINDING_MIN = 1, 833 SVGA3D_FRONTWINDING_CCW = 2, 834 SVGA3D_FRONTWINDING_MAX 835 } SVGA3dFrontWinding; 836 837 typedef enum { 838 SVGA3D_FACE_INVALID = 0, 839 SVGA3D_FACE_NONE = 1, 840 SVGA3D_FACE_MIN = 1, 841 SVGA3D_FACE_FRONT = 2, 842 SVGA3D_FACE_BACK = 3, 843 SVGA3D_FACE_FRONT_BACK = 4, 844 SVGA3D_FACE_MAX 845 } SVGA3dFace; 846 847 typedef enum { 848 SVGA3D_CMP_INVALID = 0, 849 SVGA3D_CMP_NEVER = 1, 850 SVGA3D_CMP_LESS = 2, 851 SVGA3D_CMP_EQUAL = 3, 852 SVGA3D_CMP_LESSEQUAL = 4, 853 SVGA3D_CMP_GREATER = 5, 854 SVGA3D_CMP_NOTEQUAL = 6, 855 SVGA3D_CMP_GREATEREQUAL = 7, 856 SVGA3D_CMP_ALWAYS = 8, 857 SVGA3D_CMP_MAX 858 } SVGA3dCmpFunc; 859 860 typedef enum { 861 SVGA3D_FOGFUNC_INVALID = 0, 862 SVGA3D_FOGFUNC_EXP = 1, 863 SVGA3D_FOGFUNC_EXP2 = 2, 864 SVGA3D_FOGFUNC_LINEAR = 3, 865 SVGA3D_FOGFUNC_PER_VERTEX = 4 866 } SVGA3dFogFunction; 867 868 typedef enum { 869 SVGA3D_FOGTYPE_INVALID = 0, 870 SVGA3D_FOGTYPE_VERTEX = 1, 871 SVGA3D_FOGTYPE_PIXEL = 2, 872 SVGA3D_FOGTYPE_MAX = 3 873 } SVGA3dFogType; 874 875 typedef enum { 876 SVGA3D_FOGBASE_INVALID = 0, 877 SVGA3D_FOGBASE_DEPTHBASED = 1, 878 SVGA3D_FOGBASE_RANGEBASED = 2, 879 SVGA3D_FOGBASE_MAX = 3 880 } SVGA3dFogBase; 881 882 typedef enum { 883 SVGA3D_STENCILOP_INVALID = 0, 884 SVGA3D_STENCILOP_MIN = 1, 885 SVGA3D_STENCILOP_KEEP = 1, 886 SVGA3D_STENCILOP_ZERO = 2, 887 SVGA3D_STENCILOP_REPLACE = 3, 888 SVGA3D_STENCILOP_INCRSAT = 4, 889 SVGA3D_STENCILOP_DECRSAT = 5, 890 SVGA3D_STENCILOP_INVERT = 6, 891 SVGA3D_STENCILOP_INCR = 7, 892 SVGA3D_STENCILOP_DECR = 8, 893 SVGA3D_STENCILOP_MAX 894 } SVGA3dStencilOp; 895 896 typedef enum { 897 SVGA3D_CLIPPLANE_0 = (1 << 0), 898 SVGA3D_CLIPPLANE_1 = (1 << 1), 899 SVGA3D_CLIPPLANE_2 = (1 << 2), 900 SVGA3D_CLIPPLANE_3 = (1 << 3), 901 SVGA3D_CLIPPLANE_4 = (1 << 4), 902 SVGA3D_CLIPPLANE_5 = (1 << 5), 903 } SVGA3dClipPlanes; 904 905 typedef enum { 906 SVGA3D_CLEAR_COLOR = 0x1, 907 SVGA3D_CLEAR_DEPTH = 0x2, 908 SVGA3D_CLEAR_STENCIL = 0x4, 909 910 SVGA3D_CLEAR_COLORFILL = 0x8 911 } SVGA3dClearFlag; 912 913 typedef enum { 914 SVGA3D_RT_DEPTH = 0, 915 SVGA3D_RT_MIN = 0, 916 SVGA3D_RT_STENCIL = 1, 917 SVGA3D_RT_COLOR0 = 2, 918 SVGA3D_RT_COLOR1 = 3, 919 SVGA3D_RT_COLOR2 = 4, 920 SVGA3D_RT_COLOR3 = 5, 921 SVGA3D_RT_COLOR4 = 6, 922 SVGA3D_RT_COLOR5 = 7, 923 SVGA3D_RT_COLOR6 = 8, 924 SVGA3D_RT_COLOR7 = 9, 925 SVGA3D_RT_MAX, 926 SVGA3D_RT_INVALID = ((uint32)-1), 927 } SVGA3dRenderTargetType; 928 929 #define SVGA3D_MAX_RT_COLOR (SVGA3D_RT_COLOR7 - SVGA3D_RT_COLOR0 + 1) 930 931 #pragma pack(push, 1) 932 typedef union { 933 struct { 934 uint32 red : 1; 935 uint32 green : 1; 936 uint32 blue : 1; 937 uint32 alpha : 1; 938 }; 939 uint32 uintValue; 940 } SVGA3dColorMask; 941 #pragma pack(pop) 942 943 typedef enum { 944 SVGA3D_VBLEND_DISABLE = 0, 945 SVGA3D_VBLEND_1WEIGHT = 1, 946 SVGA3D_VBLEND_2WEIGHT = 2, 947 SVGA3D_VBLEND_3WEIGHT = 3, 948 SVGA3D_VBLEND_MAX = 4, 949 } SVGA3dVertexBlendFlags; 950 951 typedef enum { 952 SVGA3D_WRAPCOORD_0 = 1 << 0, 953 SVGA3D_WRAPCOORD_1 = 1 << 1, 954 SVGA3D_WRAPCOORD_2 = 1 << 2, 955 SVGA3D_WRAPCOORD_3 = 1 << 3, 956 SVGA3D_WRAPCOORD_ALL = 0xF, 957 } SVGA3dWrapFlags; 958 959 typedef enum { 960 SVGA3D_TS_INVALID = 0, 961 SVGA3D_TS_MIN = 1, 962 SVGA3D_TS_BIND_TEXTURE = 1, 963 SVGA3D_TS_COLOROP = 2, 964 SVGA3D_TS_COLORARG1 = 3, 965 SVGA3D_TS_COLORARG2 = 4, 966 SVGA3D_TS_ALPHAOP = 5, 967 SVGA3D_TS_ALPHAARG1 = 6, 968 SVGA3D_TS_ALPHAARG2 = 7, 969 SVGA3D_TS_ADDRESSU = 8, 970 SVGA3D_TS_ADDRESSV = 9, 971 SVGA3D_TS_MIPFILTER = 10, 972 SVGA3D_TS_MAGFILTER = 11, 973 SVGA3D_TS_MINFILTER = 12, 974 SVGA3D_TS_BORDERCOLOR = 13, 975 SVGA3D_TS_TEXCOORDINDEX = 14, 976 SVGA3D_TS_TEXTURETRANSFORMFLAGS = 15, 977 SVGA3D_TS_TEXCOORDGEN = 16, 978 SVGA3D_TS_BUMPENVMAT00 = 17, 979 SVGA3D_TS_BUMPENVMAT01 = 18, 980 SVGA3D_TS_BUMPENVMAT10 = 19, 981 SVGA3D_TS_BUMPENVMAT11 = 20, 982 SVGA3D_TS_TEXTURE_MIPMAP_LEVEL = 21, 983 SVGA3D_TS_TEXTURE_LOD_BIAS = 22, 984 SVGA3D_TS_TEXTURE_ANISOTROPIC_LEVEL = 23, 985 SVGA3D_TS_ADDRESSW = 24, 986 987 SVGA3D_TS_GAMMA = 25, 988 SVGA3D_TS_BUMPENVLSCALE = 26, 989 SVGA3D_TS_BUMPENVLOFFSET = 27, 990 SVGA3D_TS_COLORARG0 = 28, 991 SVGA3D_TS_ALPHAARG0 = 29, 992 SVGA3D_TS_PREGB_MAX = 30, 993 SVGA3D_TS_CONSTANT = 30, 994 SVGA3D_TS_COLOR_KEY_ENABLE = 31, 995 SVGA3D_TS_COLOR_KEY = 32, 996 SVGA3D_TS_MAX 997 } SVGA3dTextureStateName; 998 999 typedef enum { 1000 SVGA3D_TC_INVALID = 0, 1001 SVGA3D_TC_DISABLE = 1, 1002 SVGA3D_TC_SELECTARG1 = 2, 1003 SVGA3D_TC_SELECTARG2 = 3, 1004 SVGA3D_TC_MODULATE = 4, 1005 SVGA3D_TC_ADD = 5, 1006 SVGA3D_TC_ADDSIGNED = 6, 1007 SVGA3D_TC_SUBTRACT = 7, 1008 SVGA3D_TC_BLENDTEXTUREALPHA = 8, 1009 SVGA3D_TC_BLENDDIFFUSEALPHA = 9, 1010 SVGA3D_TC_BLENDCURRENTALPHA = 10, 1011 SVGA3D_TC_BLENDFACTORALPHA = 11, 1012 SVGA3D_TC_MODULATE2X = 12, 1013 SVGA3D_TC_MODULATE4X = 13, 1014 SVGA3D_TC_DSDT = 14, 1015 SVGA3D_TC_DOTPRODUCT3 = 15, 1016 SVGA3D_TC_BLENDTEXTUREALPHAPM = 16, 1017 SVGA3D_TC_ADDSIGNED2X = 17, 1018 SVGA3D_TC_ADDSMOOTH = 18, 1019 SVGA3D_TC_PREMODULATE = 19, 1020 SVGA3D_TC_MODULATEALPHA_ADDCOLOR = 20, 1021 SVGA3D_TC_MODULATECOLOR_ADDALPHA = 21, 1022 SVGA3D_TC_MODULATEINVALPHA_ADDCOLOR = 22, 1023 SVGA3D_TC_MODULATEINVCOLOR_ADDALPHA = 23, 1024 SVGA3D_TC_BUMPENVMAPLUMINANCE = 24, 1025 SVGA3D_TC_MULTIPLYADD = 25, 1026 SVGA3D_TC_LERP = 26, 1027 SVGA3D_TC_MAX 1028 } SVGA3dTextureCombiner; 1029 1030 #define SVGA3D_TC_CAP_BIT(svga3d_tc_op) \ 1031 (svga3d_tc_op ? (1 << (svga3d_tc_op - 1)) : 0) 1032 1033 typedef enum { 1034 SVGA3D_TEX_ADDRESS_INVALID = 0, 1035 SVGA3D_TEX_ADDRESS_MIN = 1, 1036 SVGA3D_TEX_ADDRESS_WRAP = 1, 1037 SVGA3D_TEX_ADDRESS_MIRROR = 2, 1038 SVGA3D_TEX_ADDRESS_CLAMP = 3, 1039 SVGA3D_TEX_ADDRESS_BORDER = 4, 1040 SVGA3D_TEX_ADDRESS_MIRRORONCE = 5, 1041 SVGA3D_TEX_ADDRESS_EDGE = 6, 1042 SVGA3D_TEX_ADDRESS_MAX 1043 } SVGA3dTextureAddress; 1044 1045 typedef enum { 1046 SVGA3D_TEX_FILTER_NONE = 0, 1047 SVGA3D_TEX_FILTER_MIN = 0, 1048 SVGA3D_TEX_FILTER_NEAREST = 1, 1049 SVGA3D_TEX_FILTER_LINEAR = 2, 1050 SVGA3D_TEX_FILTER_ANISOTROPIC = 3, 1051 SVGA3D_TEX_FILTER_FLATCUBIC = 4, 1052 SVGA3D_TEX_FILTER_GAUSSIANCUBIC = 5, 1053 SVGA3D_TEX_FILTER_PYRAMIDALQUAD = 6, 1054 SVGA3D_TEX_FILTER_GAUSSIANQUAD = 7, 1055 SVGA3D_TEX_FILTER_MAX 1056 } SVGA3dTextureFilter; 1057 1058 typedef enum { 1059 SVGA3D_TEX_TRANSFORM_OFF = 0, 1060 SVGA3D_TEX_TRANSFORM_S = (1 << 0), 1061 SVGA3D_TEX_TRANSFORM_T = (1 << 1), 1062 SVGA3D_TEX_TRANSFORM_R = (1 << 2), 1063 SVGA3D_TEX_TRANSFORM_Q = (1 << 3), 1064 SVGA3D_TEX_PROJECTED = (1 << 15), 1065 } SVGA3dTexTransformFlags; 1066 1067 typedef enum { 1068 SVGA3D_TEXCOORD_GEN_OFF = 0, 1069 SVGA3D_TEXCOORD_GEN_EYE_POSITION = 1, 1070 SVGA3D_TEXCOORD_GEN_EYE_NORMAL = 2, 1071 SVGA3D_TEXCOORD_GEN_REFLECTIONVECTOR = 3, 1072 SVGA3D_TEXCOORD_GEN_SPHERE = 4, 1073 SVGA3D_TEXCOORD_GEN_MAX 1074 } SVGA3dTextureCoordGen; 1075 1076 typedef enum { 1077 SVGA3D_TA_INVALID = 0, 1078 SVGA3D_TA_TFACTOR = 1, 1079 SVGA3D_TA_PREVIOUS = 2, 1080 SVGA3D_TA_DIFFUSE = 3, 1081 SVGA3D_TA_TEXTURE = 4, 1082 SVGA3D_TA_SPECULAR = 5, 1083 SVGA3D_TA_CONSTANT = 6, 1084 SVGA3D_TA_MAX 1085 } SVGA3dTextureArgData; 1086 1087 #define SVGA3D_TM_MASK_LEN 4 1088 1089 typedef enum { 1090 SVGA3D_TM_NONE = 0, 1091 SVGA3D_TM_ALPHA = (1 << SVGA3D_TM_MASK_LEN), 1092 SVGA3D_TM_ONE_MINUS = (2 << SVGA3D_TM_MASK_LEN), 1093 } SVGA3dTextureArgModifier; 1094 1095 typedef enum { 1096 SVGA3D_DECLUSAGE_POSITION = 0, 1097 SVGA3D_DECLUSAGE_BLENDWEIGHT, 1098 SVGA3D_DECLUSAGE_BLENDINDICES, 1099 SVGA3D_DECLUSAGE_NORMAL, 1100 SVGA3D_DECLUSAGE_PSIZE, 1101 SVGA3D_DECLUSAGE_TEXCOORD, 1102 SVGA3D_DECLUSAGE_TANGENT, 1103 SVGA3D_DECLUSAGE_BINORMAL, 1104 SVGA3D_DECLUSAGE_TESSFACTOR, 1105 SVGA3D_DECLUSAGE_POSITIONT, 1106 SVGA3D_DECLUSAGE_COLOR, 1107 SVGA3D_DECLUSAGE_FOG, 1108 SVGA3D_DECLUSAGE_DEPTH, 1109 SVGA3D_DECLUSAGE_SAMPLE, 1110 SVGA3D_DECLUSAGE_MAX 1111 } SVGA3dDeclUsage; 1112 1113 typedef enum { 1114 SVGA3D_DECLMETHOD_DEFAULT = 0, 1115 SVGA3D_DECLMETHOD_PARTIALU, 1116 SVGA3D_DECLMETHOD_PARTIALV, 1117 SVGA3D_DECLMETHOD_CROSSUV, 1118 SVGA3D_DECLMETHOD_UV, 1119 SVGA3D_DECLMETHOD_LOOKUP, 1120 SVGA3D_DECLMETHOD_LOOKUPPRESAMPLED, 1121 } SVGA3dDeclMethod; 1122 1123 typedef enum { 1124 SVGA3D_DECLTYPE_FLOAT1 = 0, 1125 SVGA3D_DECLTYPE_FLOAT2 = 1, 1126 SVGA3D_DECLTYPE_FLOAT3 = 2, 1127 SVGA3D_DECLTYPE_FLOAT4 = 3, 1128 SVGA3D_DECLTYPE_D3DCOLOR = 4, 1129 SVGA3D_DECLTYPE_UBYTE4 = 5, 1130 SVGA3D_DECLTYPE_SHORT2 = 6, 1131 SVGA3D_DECLTYPE_SHORT4 = 7, 1132 SVGA3D_DECLTYPE_UBYTE4N = 8, 1133 SVGA3D_DECLTYPE_SHORT2N = 9, 1134 SVGA3D_DECLTYPE_SHORT4N = 10, 1135 SVGA3D_DECLTYPE_USHORT2N = 11, 1136 SVGA3D_DECLTYPE_USHORT4N = 12, 1137 SVGA3D_DECLTYPE_UDEC3 = 13, 1138 SVGA3D_DECLTYPE_DEC3N = 14, 1139 SVGA3D_DECLTYPE_FLOAT16_2 = 15, 1140 SVGA3D_DECLTYPE_FLOAT16_4 = 16, 1141 SVGA3D_DECLTYPE_MAX, 1142 } SVGA3dDeclType; 1143 1144 typedef union { 1145 struct { 1146 uint32 count : 30; 1147 1148 uint32 indexedData : 1; 1149 1150 uint32 instanceData : 1; 1151 }; 1152 1153 uint32 value; 1154 } SVGA3dVertexDivisor; 1155 1156 typedef enum { 1157 1158 SVGA3D_PRIMITIVE_INVALID = 0, 1159 SVGA3D_PRIMITIVE_MIN = 0, 1160 SVGA3D_PRIMITIVE_TRIANGLELIST = 1, 1161 SVGA3D_PRIMITIVE_POINTLIST = 2, 1162 SVGA3D_PRIMITIVE_LINELIST = 3, 1163 SVGA3D_PRIMITIVE_LINESTRIP = 4, 1164 SVGA3D_PRIMITIVE_TRIANGLESTRIP = 5, 1165 SVGA3D_PRIMITIVE_TRIANGLEFAN = 6, 1166 SVGA3D_PRIMITIVE_LINELIST_ADJ = 7, 1167 SVGA3D_PRIMITIVE_PREDX_MAX = 7, 1168 SVGA3D_PRIMITIVE_LINESTRIP_ADJ = 8, 1169 SVGA3D_PRIMITIVE_TRIANGLELIST_ADJ = 9, 1170 SVGA3D_PRIMITIVE_TRIANGLESTRIP_ADJ = 10, 1171 SVGA3D_PRIMITIVE_DX10_MAX = 11, 1172 SVGA3D_PRIMITIVE_1_CONTROL_POINT_PATCH = 11, 1173 SVGA3D_PRIMITIVE_2_CONTROL_POINT_PATCH = 12, 1174 SVGA3D_PRIMITIVE_3_CONTROL_POINT_PATCH = 13, 1175 SVGA3D_PRIMITIVE_4_CONTROL_POINT_PATCH = 14, 1176 SVGA3D_PRIMITIVE_5_CONTROL_POINT_PATCH = 15, 1177 SVGA3D_PRIMITIVE_6_CONTROL_POINT_PATCH = 16, 1178 SVGA3D_PRIMITIVE_7_CONTROL_POINT_PATCH = 17, 1179 SVGA3D_PRIMITIVE_8_CONTROL_POINT_PATCH = 18, 1180 SVGA3D_PRIMITIVE_9_CONTROL_POINT_PATCH = 19, 1181 SVGA3D_PRIMITIVE_10_CONTROL_POINT_PATCH = 20, 1182 SVGA3D_PRIMITIVE_11_CONTROL_POINT_PATCH = 21, 1183 SVGA3D_PRIMITIVE_12_CONTROL_POINT_PATCH = 22, 1184 SVGA3D_PRIMITIVE_13_CONTROL_POINT_PATCH = 23, 1185 SVGA3D_PRIMITIVE_14_CONTROL_POINT_PATCH = 24, 1186 SVGA3D_PRIMITIVE_15_CONTROL_POINT_PATCH = 25, 1187 SVGA3D_PRIMITIVE_16_CONTROL_POINT_PATCH = 26, 1188 SVGA3D_PRIMITIVE_17_CONTROL_POINT_PATCH = 27, 1189 SVGA3D_PRIMITIVE_18_CONTROL_POINT_PATCH = 28, 1190 SVGA3D_PRIMITIVE_19_CONTROL_POINT_PATCH = 29, 1191 SVGA3D_PRIMITIVE_20_CONTROL_POINT_PATCH = 30, 1192 SVGA3D_PRIMITIVE_21_CONTROL_POINT_PATCH = 31, 1193 SVGA3D_PRIMITIVE_22_CONTROL_POINT_PATCH = 32, 1194 SVGA3D_PRIMITIVE_23_CONTROL_POINT_PATCH = 33, 1195 SVGA3D_PRIMITIVE_24_CONTROL_POINT_PATCH = 34, 1196 SVGA3D_PRIMITIVE_25_CONTROL_POINT_PATCH = 35, 1197 SVGA3D_PRIMITIVE_26_CONTROL_POINT_PATCH = 36, 1198 SVGA3D_PRIMITIVE_27_CONTROL_POINT_PATCH = 37, 1199 SVGA3D_PRIMITIVE_28_CONTROL_POINT_PATCH = 38, 1200 SVGA3D_PRIMITIVE_29_CONTROL_POINT_PATCH = 39, 1201 SVGA3D_PRIMITIVE_30_CONTROL_POINT_PATCH = 40, 1202 SVGA3D_PRIMITIVE_31_CONTROL_POINT_PATCH = 41, 1203 SVGA3D_PRIMITIVE_32_CONTROL_POINT_PATCH = 42, 1204 SVGA3D_PRIMITIVE_MAX = 43 1205 } SVGA3dPrimitiveType; 1206 1207 typedef enum { 1208 SVGA3D_COORDINATE_INVALID = 0, 1209 SVGA3D_COORDINATE_LEFTHANDED = 1, 1210 SVGA3D_COORDINATE_RIGHTHANDED = 2, 1211 SVGA3D_COORDINATE_MAX 1212 } SVGA3dCoordinateType; 1213 1214 typedef enum { 1215 SVGA3D_TRANSFORM_INVALID = 0, 1216 SVGA3D_TRANSFORM_WORLD = 1, 1217 SVGA3D_TRANSFORM_MIN = 1, 1218 SVGA3D_TRANSFORM_VIEW = 2, 1219 SVGA3D_TRANSFORM_PROJECTION = 3, 1220 SVGA3D_TRANSFORM_TEXTURE0 = 4, 1221 SVGA3D_TRANSFORM_TEXTURE1 = 5, 1222 SVGA3D_TRANSFORM_TEXTURE2 = 6, 1223 SVGA3D_TRANSFORM_TEXTURE3 = 7, 1224 SVGA3D_TRANSFORM_TEXTURE4 = 8, 1225 SVGA3D_TRANSFORM_TEXTURE5 = 9, 1226 SVGA3D_TRANSFORM_TEXTURE6 = 10, 1227 SVGA3D_TRANSFORM_TEXTURE7 = 11, 1228 SVGA3D_TRANSFORM_WORLD1 = 12, 1229 SVGA3D_TRANSFORM_WORLD2 = 13, 1230 SVGA3D_TRANSFORM_WORLD3 = 14, 1231 SVGA3D_TRANSFORM_MAX 1232 } SVGA3dTransformType; 1233 1234 typedef enum { 1235 SVGA3D_LIGHTTYPE_INVALID = 0, 1236 SVGA3D_LIGHTTYPE_MIN = 1, 1237 SVGA3D_LIGHTTYPE_POINT = 1, 1238 SVGA3D_LIGHTTYPE_SPOT1 = 2, 1239 SVGA3D_LIGHTTYPE_SPOT2 = 3, 1240 SVGA3D_LIGHTTYPE_DIRECTIONAL = 4, 1241 SVGA3D_LIGHTTYPE_MAX 1242 } SVGA3dLightType; 1243 1244 typedef enum { 1245 SVGA3D_CUBEFACE_POSX = 0, 1246 SVGA3D_CUBEFACE_NEGX = 1, 1247 SVGA3D_CUBEFACE_POSY = 2, 1248 SVGA3D_CUBEFACE_NEGY = 3, 1249 SVGA3D_CUBEFACE_POSZ = 4, 1250 SVGA3D_CUBEFACE_NEGZ = 5, 1251 } SVGA3dCubeFace; 1252 1253 typedef enum { 1254 SVGA3D_SHADERTYPE_INVALID = 0, 1255 SVGA3D_SHADERTYPE_MIN = 1, 1256 SVGA3D_SHADERTYPE_VS = 1, 1257 SVGA3D_SHADERTYPE_PS = 2, 1258 SVGA3D_SHADERTYPE_PREDX_MAX = 3, 1259 SVGA3D_SHADERTYPE_GS = 3, 1260 SVGA3D_SHADERTYPE_DX10_MAX = 4, 1261 SVGA3D_SHADERTYPE_HS = 4, 1262 SVGA3D_SHADERTYPE_DS = 5, 1263 SVGA3D_SHADERTYPE_CS = 6, 1264 SVGA3D_SHADERTYPE_MAX = 7 1265 } SVGA3dShaderType; 1266 1267 #define SVGA3D_NUM_SHADERTYPE_PREDX \ 1268 (SVGA3D_SHADERTYPE_PREDX_MAX - SVGA3D_SHADERTYPE_MIN) 1269 1270 #define SVGA3D_NUM_SHADERTYPE_DX10 \ 1271 (SVGA3D_SHADERTYPE_DX10_MAX - SVGA3D_SHADERTYPE_MIN) 1272 1273 #define SVGA3D_NUM_SHADERTYPE (SVGA3D_SHADERTYPE_MAX - SVGA3D_SHADERTYPE_MIN) 1274 1275 typedef enum { 1276 SVGA3D_CONST_TYPE_MIN = 0, 1277 SVGA3D_CONST_TYPE_FLOAT = 0, 1278 SVGA3D_CONST_TYPE_INT = 1, 1279 SVGA3D_CONST_TYPE_BOOL = 2, 1280 SVGA3D_CONST_TYPE_MAX = 3, 1281 } SVGA3dShaderConstType; 1282 1283 #define SVGA3D_CONSTREG_MAX 256 1284 #define SVGA3D_CONSTINTREG_MAX 16 1285 #define SVGA3D_CONSTBOOLREG_MAX 16 1286 1287 typedef enum { 1288 SVGA3D_STRETCH_BLT_POINT = 0, 1289 SVGA3D_STRETCH_BLT_LINEAR = 1, 1290 SVGA3D_STRETCH_BLT_MAX 1291 } SVGA3dStretchBltMode; 1292 1293 typedef enum { 1294 SVGA3D_QUERYTYPE_INVALID = ((uint8)-1), 1295 SVGA3D_QUERYTYPE_MIN = 0, 1296 SVGA3D_QUERYTYPE_OCCLUSION = 0, 1297 SVGA3D_QUERYTYPE_TIMESTAMP = 1, 1298 SVGA3D_QUERYTYPE_TIMESTAMPDISJOINT = 2, 1299 SVGA3D_QUERYTYPE_PIPELINESTATS = 3, 1300 SVGA3D_QUERYTYPE_OCCLUSIONPREDICATE = 4, 1301 SVGA3D_QUERYTYPE_STREAMOUTPUTSTATS = 5, 1302 SVGA3D_QUERYTYPE_STREAMOVERFLOWPREDICATE = 6, 1303 SVGA3D_QUERYTYPE_OCCLUSION64 = 7, 1304 SVGA3D_QUERYTYPE_DX10_MAX = 8, 1305 SVGA3D_QUERYTYPE_SOSTATS_STREAM0 = 8, 1306 SVGA3D_QUERYTYPE_SOSTATS_STREAM1 = 9, 1307 SVGA3D_QUERYTYPE_SOSTATS_STREAM2 = 10, 1308 SVGA3D_QUERYTYPE_SOSTATS_STREAM3 = 11, 1309 SVGA3D_QUERYTYPE_SOP_STREAM0 = 12, 1310 SVGA3D_QUERYTYPE_SOP_STREAM1 = 13, 1311 SVGA3D_QUERYTYPE_SOP_STREAM2 = 14, 1312 SVGA3D_QUERYTYPE_SOP_STREAM3 = 15, 1313 SVGA3D_QUERYTYPE_MAX 1314 } SVGA3dQueryType; 1315 1316 typedef uint8 SVGA3dQueryTypeUint8; 1317 1318 #define SVGA3D_NUM_QUERYTYPE (SVGA3D_QUERYTYPE_MAX - SVGA3D_QUERYTYPE_MIN) 1319 1320 #define SVGA3D_MAX_QUERY 64 1321 1322 #pragma pack(push, 1) 1323 typedef struct { 1324 uint32 samplesRendered; 1325 } SVGADXOcclusionQueryResult; 1326 #pragma pack(pop) 1327 1328 #pragma pack(push, 1) 1329 typedef struct { 1330 uint32 passed; 1331 } SVGADXEventQueryResult; 1332 #pragma pack(pop) 1333 1334 #pragma pack(push, 1) 1335 typedef struct { 1336 uint64 timestamp; 1337 } SVGADXTimestampQueryResult; 1338 #pragma pack(pop) 1339 1340 #pragma pack(push, 1) 1341 typedef struct { 1342 uint64 realFrequency; 1343 uint32 disjoint; 1344 } SVGADXTimestampDisjointQueryResult; 1345 #pragma pack(pop) 1346 1347 #pragma pack(push, 1) 1348 typedef struct { 1349 uint64 inputAssemblyVertices; 1350 uint64 inputAssemblyPrimitives; 1351 uint64 vertexShaderInvocations; 1352 uint64 geometryShaderInvocations; 1353 uint64 geometryShaderPrimitives; 1354 uint64 clipperInvocations; 1355 uint64 clipperPrimitives; 1356 uint64 pixelShaderInvocations; 1357 uint64 hullShaderInvocations; 1358 uint64 domainShaderInvocations; 1359 uint64 computeShaderInvocations; 1360 } SVGADXPipelineStatisticsQueryResult; 1361 #pragma pack(pop) 1362 1363 #pragma pack(push, 1) 1364 typedef struct { 1365 uint32 anySamplesRendered; 1366 } SVGADXOcclusionPredicateQueryResult; 1367 #pragma pack(pop) 1368 1369 #pragma pack(push, 1) 1370 typedef struct { 1371 uint64 numPrimitivesWritten; 1372 uint64 numPrimitivesRequired; 1373 } SVGADXStreamOutStatisticsQueryResult; 1374 #pragma pack(pop) 1375 1376 #pragma pack(push, 1) 1377 typedef struct { 1378 uint32 overflowed; 1379 } SVGADXStreamOutPredicateQueryResult; 1380 #pragma pack(pop) 1381 1382 #pragma pack(push, 1) 1383 typedef struct { 1384 uint64 samplesRendered; 1385 } SVGADXOcclusion64QueryResult; 1386 #pragma pack(pop) 1387 1388 #pragma pack(push, 1) 1389 typedef union SVGADXQueryResultUnion { 1390 SVGADXOcclusionQueryResult occ; 1391 SVGADXEventQueryResult event; 1392 SVGADXTimestampQueryResult ts; 1393 SVGADXTimestampDisjointQueryResult tsDisjoint; 1394 SVGADXPipelineStatisticsQueryResult pipelineStats; 1395 SVGADXOcclusionPredicateQueryResult occPred; 1396 SVGADXStreamOutStatisticsQueryResult soStats; 1397 SVGADXStreamOutPredicateQueryResult soPred; 1398 SVGADXOcclusion64QueryResult occ64; 1399 } SVGADXQueryResultUnion; 1400 #pragma pack(pop) 1401 1402 typedef enum { 1403 SVGA3D_QUERYSTATE_PENDING = 0, 1404 SVGA3D_QUERYSTATE_SUCCEEDED = 1, 1405 SVGA3D_QUERYSTATE_FAILED = 2, 1406 SVGA3D_QUERYSTATE_NEW = 3, 1407 } SVGA3dQueryState; 1408 1409 typedef enum { 1410 SVGA3D_WRITE_HOST_VRAM = 1, 1411 SVGA3D_READ_HOST_VRAM = 2, 1412 } SVGA3dTransferType; 1413 1414 #define SVGA3D_LOGICOP_INVALID 0 1415 #define SVGA3D_LOGICOP_COPY 1 1416 1417 #define SVGA3D_LOGICOP_MIN 1 1418 #define SVGA3D_LOGICOP_NOT 2 1419 #define SVGA3D_LOGICOP_AND 3 1420 #define SVGA3D_LOGICOP_OR 4 1421 #define SVGA3D_LOGICOP_XOR 5 1422 #define SVGA3D_LOGICOP_NXOR 6 1423 #define SVGA3D_LOGICOP_ROP3 7 1424 1425 #define SVGA3D_LOGICOP_MAX 8 1426 1427 typedef uint16 SVGA3dLogicOp; 1428 1429 #define SVGA3D_LOGICOP_ROP3_INVALID ((uint16)-1) 1430 #define SVGA3D_LOGICOP_ROP3_MIN 0 1431 #define SVGA3D_LOGICOP_ROP3_MAX 256 1432 1433 typedef uint16 SVGA3dLogicOpRop3; 1434 1435 #pragma pack(push, 1) 1436 typedef struct { 1437 union { 1438 struct { 1439 uint16 function; 1440 uint8 type; 1441 uint8 base; 1442 }; 1443 uint32 uintValue; 1444 }; 1445 } SVGA3dFogMode; 1446 #pragma pack(pop) 1447 1448 #pragma pack(push, 1) 1449 typedef struct SVGA3dSurfaceImageId { 1450 uint32 sid; 1451 uint32 face; 1452 uint32 mipmap; 1453 } SVGA3dSurfaceImageId; 1454 #pragma pack(pop) 1455 1456 #pragma pack(push, 1) 1457 typedef struct SVGA3dSubSurfaceId { 1458 uint32 sid; 1459 uint32 subResourceId; 1460 } SVGA3dSubSurfaceId; 1461 #pragma pack(pop) 1462 1463 #pragma pack(push, 1) 1464 typedef struct { 1465 uint32 width; 1466 uint32 height; 1467 uint32 depth; 1468 } SVGA3dSize; 1469 #pragma pack(pop) 1470 1471 typedef enum { 1472 SVGA_OTABLE_MOB = 0, 1473 SVGA_OTABLE_MIN = 0, 1474 SVGA_OTABLE_SURFACE = 1, 1475 SVGA_OTABLE_CONTEXT = 2, 1476 SVGA_OTABLE_SHADER = 3, 1477 SVGA_OTABLE_SCREENTARGET = 4, 1478 1479 SVGA_OTABLE_DX9_MAX = 5, 1480 1481 SVGA_OTABLE_DXCONTEXT = 5, 1482 SVGA_OTABLE_DX_MAX = 6, 1483 1484 SVGA_OTABLE_DEVEL_MAX = 6, 1485 SVGA_OTABLE_MAX = 6, 1486 1487 SVGA_OTABLE_RESERVED1 = 6, 1488 SVGA_OTABLE_RESERVED2 = 7, 1489 SVGA_OTABLE_BUG_1952836_MAX = 8, 1490 } SVGAOTableType; 1491 1492 typedef enum { 1493 SVGA_COTABLE_MIN = 0, 1494 SVGA_COTABLE_RTVIEW = 0, 1495 SVGA_COTABLE_DSVIEW = 1, 1496 SVGA_COTABLE_SRVIEW = 2, 1497 SVGA_COTABLE_ELEMENTLAYOUT = 3, 1498 SVGA_COTABLE_BLENDSTATE = 4, 1499 SVGA_COTABLE_DEPTHSTENCIL = 5, 1500 SVGA_COTABLE_RASTERIZERSTATE = 6, 1501 SVGA_COTABLE_SAMPLER = 7, 1502 SVGA_COTABLE_STREAMOUTPUT = 8, 1503 SVGA_COTABLE_DXQUERY = 9, 1504 SVGA_COTABLE_DXSHADER = 10, 1505 SVGA_COTABLE_DX10_MAX = 11, 1506 SVGA_COTABLE_UAVIEW = 11, 1507 SVGA_COTABLE_MAX = 12, 1508 } SVGACOTableType; 1509 1510 #define SVGA_COTABLE_MAX_IDS (MAX_UINT16 - 2) 1511 1512 typedef enum SVGAMobFormat { 1513 SVGA3D_MOBFMT_INVALID = SVGA3D_INVALID_ID, 1514 SVGA3D_MOBFMT_PT_0 = 0, 1515 SVGA3D_MOBFMT_MIN = 0, 1516 SVGA3D_MOBFMT_PT_1 = 1, 1517 SVGA3D_MOBFMT_PT_2 = 2, 1518 SVGA3D_MOBFMT_RANGE = 3, 1519 SVGA3D_MOBFMT_PT64_0 = 4, 1520 SVGA3D_MOBFMT_PT64_1 = 5, 1521 SVGA3D_MOBFMT_PT64_2 = 6, 1522 SVGA3D_MOBFMT_PREDX_MAX = 7, 1523 SVGA3D_MOBFMT_EMPTY = 7, 1524 1525 SVGA3D_MOBFMT_MAX, 1526 1527 SVGA3D_MOBFMT_HB, 1528 } SVGAMobFormat; 1529 1530 #define SVGA3D_MOB_EMPTY_BASE 1 1531 1532 typedef enum SVGA3dMSPattern { 1533 SVGA3D_MS_PATTERN_NONE = 0, 1534 SVGA3D_MS_PATTERN_MIN = 0, 1535 SVGA3D_MS_PATTERN_STANDARD = 1, 1536 SVGA3D_MS_PATTERN_CENTER = 2, 1537 SVGA3D_MS_PATTERN_MAX = 3, 1538 } SVGA3dMSPattern; 1539 1540 typedef enum SVGA3dMSQualityLevel { 1541 SVGA3D_MS_QUALITY_NONE = 0, 1542 SVGA3D_MS_QUALITY_MIN = 0, 1543 SVGA3D_MS_QUALITY_FULL = 1, 1544 SVGA3D_MS_QUALITY_RESOLVED = 2, 1545 SVGA3D_MS_QUALITY_MAX = 3, 1546 } SVGA3dMSQualityLevel; 1547 1548 typedef enum SVGA3dFrameUpdateType { 1549 SVGA3D_FRAME_END = 0, 1550 SVGA3D_FRAME_MIN = 0, 1551 SVGA3D_FRAME_PARTIAL = 1, 1552 SVGA3D_FRAME_UNKNOWN = 2, 1553 SVGA3D_FRAME_MAX = 3, 1554 } SVGA3dFrameUpdateType; 1555 1556 #endif 1557