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