1 /********************************************************** 2 * Copyright 2012-2015 VMware, Inc. All rights reserved. 3 * 4 * Permission is hereby granted, free of charge, to any person 5 * obtaining a copy of this software and associated documentation 6 * files (the "Software"), to deal in the Software without 7 * restriction, including without limitation the rights to use, copy, 8 * modify, merge, publish, distribute, sublicense, and/or sell copies 9 * of the Software, and to permit persons to whom the Software is 10 * furnished to do so, subject to the following conditions: 11 * 12 * The above copyright notice and this permission notice shall be 13 * included in all copies or substantial portions of the Software. 14 * 15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 18 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 19 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 20 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 * SOFTWARE. 23 * 24 **********************************************************/ 25 26 /* 27 * svga3d_types.h -- 28 * 29 * SVGA 3d hardware definitions for basic types 30 */ 31 32 #ifndef _SVGA3D_TYPES_H_ 33 #define _SVGA3D_TYPES_H_ 34 35 #define INCLUDE_ALLOW_MODULE 36 #define INCLUDE_ALLOW_USERLEVEL 37 #define INCLUDE_ALLOW_VMCORE 38 39 #include "includeCheck.h" 40 41 /* 42 * Generic Types 43 */ 44 45 #define SVGA3D_INVALID_ID ((uint32)-1) 46 47 typedef uint32 SVGA3dBool; /* 32-bit Bool definition */ 48 typedef uint32 SVGA3dColor; /* a, r, g, b */ 49 50 typedef 51 #include "vmware_pack_begin.h" 52 struct SVGA3dCopyRect { 53 uint32 x; 54 uint32 y; 55 uint32 w; 56 uint32 h; 57 uint32 srcx; 58 uint32 srcy; 59 } 60 #include "vmware_pack_end.h" 61 SVGA3dCopyRect; 62 63 typedef 64 #include "vmware_pack_begin.h" 65 struct SVGA3dCopyBox { 66 uint32 x; 67 uint32 y; 68 uint32 z; 69 uint32 w; 70 uint32 h; 71 uint32 d; 72 uint32 srcx; 73 uint32 srcy; 74 uint32 srcz; 75 } 76 #include "vmware_pack_end.h" 77 SVGA3dCopyBox; 78 79 typedef 80 #include "vmware_pack_begin.h" 81 struct SVGA3dRect { 82 uint32 x; 83 uint32 y; 84 uint32 w; 85 uint32 h; 86 } 87 #include "vmware_pack_end.h" 88 SVGA3dRect; 89 90 typedef 91 #include "vmware_pack_begin.h" 92 struct { 93 uint32 x; 94 uint32 y; 95 uint32 z; 96 uint32 w; 97 uint32 h; 98 uint32 d; 99 } 100 #include "vmware_pack_end.h" 101 SVGA3dBox; 102 103 typedef 104 #include "vmware_pack_begin.h" 105 struct { 106 uint32 x; 107 uint32 y; 108 uint32 z; 109 } 110 #include "vmware_pack_end.h" 111 SVGA3dPoint; 112 113 /* 114 * Surface formats. 115 */ 116 typedef enum SVGA3dSurfaceFormat { 117 SVGA3D_FORMAT_INVALID = 0, 118 119 SVGA3D_X8R8G8B8 = 1, 120 SVGA3D_FORMAT_MIN = 1, 121 122 SVGA3D_A8R8G8B8 = 2, 123 124 SVGA3D_R5G6B5 = 3, 125 SVGA3D_X1R5G5B5 = 4, 126 SVGA3D_A1R5G5B5 = 5, 127 SVGA3D_A4R4G4B4 = 6, 128 129 SVGA3D_Z_D32 = 7, 130 SVGA3D_Z_D16 = 8, 131 SVGA3D_Z_D24S8 = 9, 132 SVGA3D_Z_D15S1 = 10, 133 134 SVGA3D_LUMINANCE8 = 11, 135 SVGA3D_LUMINANCE4_ALPHA4 = 12, 136 SVGA3D_LUMINANCE16 = 13, 137 SVGA3D_LUMINANCE8_ALPHA8 = 14, 138 139 SVGA3D_DXT1 = 15, 140 SVGA3D_DXT2 = 16, 141 SVGA3D_DXT3 = 17, 142 SVGA3D_DXT4 = 18, 143 SVGA3D_DXT5 = 19, 144 145 SVGA3D_BUMPU8V8 = 20, 146 SVGA3D_BUMPL6V5U5 = 21, 147 SVGA3D_BUMPX8L8V8U8 = 22, 148 SVGA3D_BUMPL8V8U8 = 23, 149 150 SVGA3D_ARGB_S10E5 = 24, /* 16-bit floating-point ARGB */ 151 SVGA3D_ARGB_S23E8 = 25, /* 32-bit floating-point ARGB */ 152 153 SVGA3D_A2R10G10B10 = 26, 154 155 /* signed formats */ 156 SVGA3D_V8U8 = 27, 157 SVGA3D_Q8W8V8U8 = 28, 158 SVGA3D_CxV8U8 = 29, 159 160 /* mixed formats */ 161 SVGA3D_X8L8V8U8 = 30, 162 SVGA3D_A2W10V10U10 = 31, 163 164 SVGA3D_ALPHA8 = 32, 165 166 /* Single- and dual-component floating point formats */ 167 SVGA3D_R_S10E5 = 33, 168 SVGA3D_R_S23E8 = 34, 169 SVGA3D_RG_S10E5 = 35, 170 SVGA3D_RG_S23E8 = 36, 171 172 SVGA3D_BUFFER = 37, 173 174 SVGA3D_Z_D24X8 = 38, 175 176 SVGA3D_V16U16 = 39, 177 178 SVGA3D_G16R16 = 40, 179 SVGA3D_A16B16G16R16 = 41, 180 181 /* Packed Video formats */ 182 SVGA3D_UYVY = 42, 183 SVGA3D_YUY2 = 43, 184 185 /* Planar video formats */ 186 SVGA3D_NV12 = 44, 187 188 /* Video format with alpha */ 189 SVGA3D_AYUV = 45, 190 191 SVGA3D_R32G32B32A32_TYPELESS = 46, 192 SVGA3D_R32G32B32A32_UINT = 47, 193 SVGA3D_R32G32B32A32_SINT = 48, 194 SVGA3D_R32G32B32_TYPELESS = 49, 195 SVGA3D_R32G32B32_FLOAT = 50, 196 SVGA3D_R32G32B32_UINT = 51, 197 SVGA3D_R32G32B32_SINT = 52, 198 SVGA3D_R16G16B16A16_TYPELESS = 53, 199 SVGA3D_R16G16B16A16_UINT = 54, 200 SVGA3D_R16G16B16A16_SNORM = 55, 201 SVGA3D_R16G16B16A16_SINT = 56, 202 SVGA3D_R32G32_TYPELESS = 57, 203 SVGA3D_R32G32_UINT = 58, 204 SVGA3D_R32G32_SINT = 59, 205 SVGA3D_R32G8X24_TYPELESS = 60, 206 SVGA3D_D32_FLOAT_S8X24_UINT = 61, 207 SVGA3D_R32_FLOAT_X8X24_TYPELESS = 62, 208 SVGA3D_X32_TYPELESS_G8X24_UINT = 63, 209 SVGA3D_R10G10B10A2_TYPELESS = 64, 210 SVGA3D_R10G10B10A2_UINT = 65, 211 SVGA3D_R11G11B10_FLOAT = 66, 212 SVGA3D_R8G8B8A8_TYPELESS = 67, 213 SVGA3D_R8G8B8A8_UNORM = 68, 214 SVGA3D_R8G8B8A8_UNORM_SRGB = 69, 215 SVGA3D_R8G8B8A8_UINT = 70, 216 SVGA3D_R8G8B8A8_SINT = 71, 217 SVGA3D_R16G16_TYPELESS = 72, 218 SVGA3D_R16G16_UINT = 73, 219 SVGA3D_R16G16_SINT = 74, 220 SVGA3D_R32_TYPELESS = 75, 221 SVGA3D_D32_FLOAT = 76, 222 SVGA3D_R32_UINT = 77, 223 SVGA3D_R32_SINT = 78, 224 SVGA3D_R24G8_TYPELESS = 79, 225 SVGA3D_D24_UNORM_S8_UINT = 80, 226 SVGA3D_R24_UNORM_X8_TYPELESS = 81, 227 SVGA3D_X24_TYPELESS_G8_UINT = 82, 228 SVGA3D_R8G8_TYPELESS = 83, 229 SVGA3D_R8G8_UNORM = 84, 230 SVGA3D_R8G8_UINT = 85, 231 SVGA3D_R8G8_SINT = 86, 232 SVGA3D_R16_TYPELESS = 87, 233 SVGA3D_R16_UNORM = 88, 234 SVGA3D_R16_UINT = 89, 235 SVGA3D_R16_SNORM = 90, 236 SVGA3D_R16_SINT = 91, 237 SVGA3D_R8_TYPELESS = 92, 238 SVGA3D_R8_UNORM = 93, 239 SVGA3D_R8_UINT = 94, 240 SVGA3D_R8_SNORM = 95, 241 SVGA3D_R8_SINT = 96, 242 SVGA3D_P8 = 97, 243 SVGA3D_R9G9B9E5_SHAREDEXP = 98, 244 SVGA3D_R8G8_B8G8_UNORM = 99, 245 SVGA3D_G8R8_G8B8_UNORM = 100, 246 SVGA3D_BC1_TYPELESS = 101, 247 SVGA3D_BC1_UNORM_SRGB = 102, 248 SVGA3D_BC2_TYPELESS = 103, 249 SVGA3D_BC2_UNORM_SRGB = 104, 250 SVGA3D_BC3_TYPELESS = 105, 251 SVGA3D_BC3_UNORM_SRGB = 106, 252 SVGA3D_BC4_TYPELESS = 107, 253 SVGA3D_ATI1 = 108, /* DX9-specific BC4_UNORM */ 254 SVGA3D_BC4_SNORM = 109, 255 SVGA3D_BC5_TYPELESS = 110, 256 SVGA3D_ATI2 = 111, /* DX9-specific BC5_UNORM */ 257 SVGA3D_BC5_SNORM = 112, 258 SVGA3D_R10G10B10_XR_BIAS_A2_UNORM = 113, 259 SVGA3D_B8G8R8A8_TYPELESS = 114, 260 SVGA3D_B8G8R8A8_UNORM_SRGB = 115, 261 SVGA3D_B8G8R8X8_TYPELESS = 116, 262 SVGA3D_B8G8R8X8_UNORM_SRGB = 117, 263 264 /* Advanced depth formats. */ 265 SVGA3D_Z_DF16 = 118, 266 SVGA3D_Z_DF24 = 119, 267 SVGA3D_Z_D24S8_INT = 120, 268 269 /* Planar video formats. */ 270 SVGA3D_YV12 = 121, 271 272 SVGA3D_R32G32B32A32_FLOAT = 122, 273 SVGA3D_R16G16B16A16_FLOAT = 123, 274 SVGA3D_R16G16B16A16_UNORM = 124, 275 SVGA3D_R32G32_FLOAT = 125, 276 SVGA3D_R10G10B10A2_UNORM = 126, 277 SVGA3D_R8G8B8A8_SNORM = 127, 278 SVGA3D_R16G16_FLOAT = 128, 279 SVGA3D_R16G16_UNORM = 129, 280 SVGA3D_R16G16_SNORM = 130, 281 SVGA3D_R32_FLOAT = 131, 282 SVGA3D_R8G8_SNORM = 132, 283 SVGA3D_R16_FLOAT = 133, 284 SVGA3D_D16_UNORM = 134, 285 SVGA3D_A8_UNORM = 135, 286 SVGA3D_BC1_UNORM = 136, 287 SVGA3D_BC2_UNORM = 137, 288 SVGA3D_BC3_UNORM = 138, 289 SVGA3D_B5G6R5_UNORM = 139, 290 SVGA3D_B5G5R5A1_UNORM = 140, 291 SVGA3D_B8G8R8A8_UNORM = 141, 292 SVGA3D_B8G8R8X8_UNORM = 142, 293 SVGA3D_BC4_UNORM = 143, 294 SVGA3D_BC5_UNORM = 144, 295 296 SVGA3D_FORMAT_MAX 297 } SVGA3dSurfaceFormat; 298 299 typedef enum SVGA3dSurfaceFlags { 300 SVGA3D_SURFACE_CUBEMAP = (1 << 0), 301 302 /* 303 * HINT flags are not enforced by the device but are useful for 304 * performance. 305 */ 306 SVGA3D_SURFACE_HINT_STATIC = (1 << 1), 307 SVGA3D_SURFACE_HINT_DYNAMIC = (1 << 2), 308 SVGA3D_SURFACE_HINT_INDEXBUFFER = (1 << 3), 309 SVGA3D_SURFACE_HINT_VERTEXBUFFER = (1 << 4), 310 SVGA3D_SURFACE_HINT_TEXTURE = (1 << 5), 311 SVGA3D_SURFACE_HINT_RENDERTARGET = (1 << 6), 312 SVGA3D_SURFACE_HINT_DEPTHSTENCIL = (1 << 7), 313 SVGA3D_SURFACE_HINT_WRITEONLY = (1 << 8), 314 SVGA3D_SURFACE_MASKABLE_ANTIALIAS = (1 << 9), 315 SVGA3D_SURFACE_AUTOGENMIPMAPS = (1 << 10), 316 SVGA3D_SURFACE_DECODE_RENDERTARGET = (1 << 11), 317 318 /* 319 * Is this surface using a base-level pitch for it's mob backing? 320 * 321 * This flag is not intended to be set by guest-drivers, but is instead 322 * set by the device when the surface is bound to a mob with a specified 323 * pitch. 324 */ 325 SVGA3D_SURFACE_MOB_PITCH = (1 << 12), 326 327 SVGA3D_SURFACE_INACTIVE = (1 << 13), 328 SVGA3D_SURFACE_HINT_RT_LOCKABLE = (1 << 14), 329 SVGA3D_SURFACE_VOLUME = (1 << 15), 330 331 /* 332 * Required to be set on a surface to bind it to a screen target. 333 */ 334 SVGA3D_SURFACE_SCREENTARGET = (1 << 16), 335 336 /* 337 * Align images in the guest-backing mob to 16-bytes. 338 */ 339 SVGA3D_SURFACE_ALIGN16 = (1 << 17), 340 341 SVGA3D_SURFACE_1D = (1 << 18), 342 SVGA3D_SURFACE_ARRAY = (1 << 19), 343 344 /* 345 * Bind flags. 346 * These are enforced for any surface defined with DefineGBSurface_v2. 347 */ 348 SVGA3D_SURFACE_BIND_VERTEX_BUFFER = (1 << 20), 349 SVGA3D_SURFACE_BIND_INDEX_BUFFER = (1 << 21), 350 SVGA3D_SURFACE_BIND_CONSTANT_BUFFER = (1 << 22), 351 SVGA3D_SURFACE_BIND_SHADER_RESOURCE = (1 << 23), 352 SVGA3D_SURFACE_BIND_RENDER_TARGET = (1 << 24), 353 SVGA3D_SURFACE_BIND_DEPTH_STENCIL = (1 << 25), 354 SVGA3D_SURFACE_BIND_STREAM_OUTPUT = (1 << 26), 355 356 /* 357 * A note on staging flags: 358 * 359 * The STAGING flags notes that the surface will not be used directly by the 360 * drawing pipeline, i.e. that it will not be bound to any bind point. 361 * Staging surfaces may be used by copy operations to move data in and out 362 * of other surfaces. 363 * 364 * The HINT_INDIRECT_UPDATE flag suggests that the surface will receive 365 * updates indirectly, i.e. the surface will not be updated directly, but 366 * will receive copies from staging surfaces. 367 */ 368 SVGA3D_SURFACE_STAGING_UPLOAD = (1 << 27), 369 SVGA3D_SURFACE_STAGING_DOWNLOAD = (1 << 28), 370 SVGA3D_SURFACE_HINT_INDIRECT_UPDATE = (1 << 29), 371 372 /* 373 * Setting this flag allow this surface to be used with the 374 * SVGA_3D_CMD_DX_TRANSFER_FROM_BUFFER command. It is only valid for 375 * buffer surfaces, an no bind flags are allowed to be set on surfaces 376 * with this flag. 377 */ 378 SVGA3D_SURFACE_TRANSFER_FROM_BUFFER = (1 << 30), 379 380 /* 381 * Marker for the last defined bit. 382 */ 383 SVGA3D_SURFACE_FLAG_MAX = (1 << 31), 384 } SVGA3dSurfaceFlags; 385 386 #define SVGA3D_SURFACE_HB_DISALLOWED_MASK \ 387 ( SVGA3D_SURFACE_MOB_PITCH | \ 388 SVGA3D_SURFACE_SCREENTARGET | \ 389 SVGA3D_SURFACE_ALIGN16 | \ 390 SVGA3D_SURFACE_BIND_CONSTANT_BUFFER | \ 391 SVGA3D_SURFACE_BIND_STREAM_OUTPUT | \ 392 SVGA3D_SURFACE_STAGING_UPLOAD | \ 393 SVGA3D_SURFACE_STAGING_DOWNLOAD | \ 394 SVGA3D_SURFACE_HINT_INDIRECT_UPDATE | \ 395 SVGA3D_SURFACE_TRANSFER_FROM_BUFFER \ 396 ) 397 398 #define SVGA3D_SURFACE_2D_DISALLOWED_MASK \ 399 ( SVGA3D_SURFACE_CUBEMAP | \ 400 SVGA3D_SURFACE_MASKABLE_ANTIALIAS | \ 401 SVGA3D_SURFACE_AUTOGENMIPMAPS | \ 402 SVGA3D_SURFACE_DECODE_RENDERTARGET | \ 403 SVGA3D_SURFACE_VOLUME | \ 404 SVGA3D_SURFACE_1D | \ 405 SVGA3D_SURFACE_ARRAY | \ 406 SVGA3D_SURFACE_BIND_VERTEX_BUFFER | \ 407 SVGA3D_SURFACE_BIND_INDEX_BUFFER | \ 408 SVGA3D_SURFACE_BIND_CONSTANT_BUFFER | \ 409 SVGA3D_SURFACE_BIND_DEPTH_STENCIL | \ 410 SVGA3D_SURFACE_BIND_STREAM_OUTPUT | \ 411 SVGA3D_SURFACE_TRANSFER_FROM_BUFFER \ 412 ) 413 414 #define SVGA3D_SURFACE_SCREENTARGET_DISALLOWED_MASK \ 415 ( SVGA3D_SURFACE_CUBEMAP | \ 416 SVGA3D_SURFACE_AUTOGENMIPMAPS | \ 417 SVGA3D_SURFACE_DECODE_RENDERTARGET | \ 418 SVGA3D_SURFACE_VOLUME | \ 419 SVGA3D_SURFACE_1D | \ 420 SVGA3D_SURFACE_BIND_VERTEX_BUFFER | \ 421 SVGA3D_SURFACE_BIND_INDEX_BUFFER | \ 422 SVGA3D_SURFACE_BIND_CONSTANT_BUFFER | \ 423 SVGA3D_SURFACE_BIND_DEPTH_STENCIL | \ 424 SVGA3D_SURFACE_BIND_STREAM_OUTPUT | \ 425 SVGA3D_SURFACE_INACTIVE | \ 426 SVGA3D_SURFACE_STAGING_UPLOAD | \ 427 SVGA3D_SURFACE_STAGING_DOWNLOAD | \ 428 SVGA3D_SURFACE_HINT_INDIRECT_UPDATE | \ 429 SVGA3D_SURFACE_TRANSFER_FROM_BUFFER \ 430 ) 431 432 #define SVGA3D_SURFACE_DX_ONLY_MASK \ 433 ( SVGA3D_SURFACE_BIND_STREAM_OUTPUT | \ 434 SVGA3D_SURFACE_TRANSFER_FROM_BUFFER \ 435 436 #define SVGA3D_SURFACE_STAGING_MASK \ 437 ( SVGA3D_SURFACE_STAGING_UPLOAD | \ 438 SVGA3D_SURFACE_STAGING_DOWNLOAD \ 439 ) 440 441 #define SVGA3D_SURFACE_BIND_MASK \ 442 ( SVGA3D_SURFACE_BIND_VERTEX_BUFFER | \ 443 SVGA3D_SURFACE_BIND_INDEX_BUFFER | \ 444 SVGA3D_SURFACE_BIND_CONSTANT_BUFFER | \ 445 SVGA3D_SURFACE_BIND_SHADER_RESOURCE | \ 446 SVGA3D_SURFACE_BIND_RENDER_TARGET | \ 447 SVGA3D_SURFACE_BIND_DEPTH_STENCIL | \ 448 SVGA3D_SURFACE_BIND_STREAM_OUTPUT \ 449 ) 450 451 typedef enum { 452 SVGA3DFORMAT_OP_TEXTURE = 0x00000001, 453 SVGA3DFORMAT_OP_VOLUMETEXTURE = 0x00000002, 454 SVGA3DFORMAT_OP_CUBETEXTURE = 0x00000004, 455 SVGA3DFORMAT_OP_OFFSCREEN_RENDERTARGET = 0x00000008, 456 SVGA3DFORMAT_OP_SAME_FORMAT_RENDERTARGET = 0x00000010, 457 SVGA3DFORMAT_OP_ZSTENCIL = 0x00000040, 458 SVGA3DFORMAT_OP_ZSTENCIL_WITH_ARBITRARY_COLOR_DEPTH = 0x00000080, 459 460 /* 461 * This format can be used as a render target if the current display mode 462 * is the same depth if the alpha channel is ignored. e.g. if the device 463 * can render to A8R8G8B8 when the display mode is X8R8G8B8, then the 464 * format op list entry for A8R8G8B8 should have this cap. 465 */ 466 SVGA3DFORMAT_OP_SAME_FORMAT_UP_TO_ALPHA_RENDERTARGET = 0x00000100, 467 468 /* 469 * This format contains DirectDraw support (including Flip). This flag 470 * should not to be set on alpha formats. 471 */ 472 SVGA3DFORMAT_OP_DISPLAYMODE = 0x00000400, 473 474 /* 475 * The rasterizer can support some level of Direct3D support in this format 476 * and implies that the driver can create a Context in this mode (for some 477 * render target format). When this flag is set, the SVGA3DFORMAT_OP_DISPLAYMODE 478 * flag must also be set. 479 */ 480 SVGA3DFORMAT_OP_3DACCELERATION = 0x00000800, 481 482 /* 483 * This is set for a private format when the driver has put the bpp in 484 * the structure. 485 */ 486 SVGA3DFORMAT_OP_PIXELSIZE = 0x00001000, 487 488 /* 489 * Indicates that this format can be converted to any RGB format for which 490 * SVGA3DFORMAT_OP_MEMBEROFGROUP_ARGB is specified 491 */ 492 SVGA3DFORMAT_OP_CONVERT_TO_ARGB = 0x00002000, 493 494 /* 495 * Indicates that this format can be used to create offscreen plain surfaces. 496 */ 497 SVGA3DFORMAT_OP_OFFSCREENPLAIN = 0x00004000, 498 499 /* 500 * Indicated that this format can be read as an SRGB texture (meaning that the 501 * sampler will linearize the looked up data) 502 */ 503 SVGA3DFORMAT_OP_SRGBREAD = 0x00008000, 504 505 /* 506 * Indicates that this format can be used in the bumpmap instructions 507 */ 508 SVGA3DFORMAT_OP_BUMPMAP = 0x00010000, 509 510 /* 511 * Indicates that this format can be sampled by the displacement map sampler 512 */ 513 SVGA3DFORMAT_OP_DMAP = 0x00020000, 514 515 /* 516 * Indicates that this format cannot be used with texture filtering 517 */ 518 SVGA3DFORMAT_OP_NOFILTER = 0x00040000, 519 520 /* 521 * Indicates that format conversions are supported to this RGB format if 522 * SVGA3DFORMAT_OP_CONVERT_TO_ARGB is specified in the source format. 523 */ 524 SVGA3DFORMAT_OP_MEMBEROFGROUP_ARGB = 0x00080000, 525 526 /* 527 * Indicated that this format can be written as an SRGB target 528 * (meaning that the pixel pipe will DE-linearize data on output to format) 529 */ 530 SVGA3DFORMAT_OP_SRGBWRITE = 0x00100000, 531 532 /* 533 * Indicates that this format cannot be used with alpha blending 534 */ 535 SVGA3DFORMAT_OP_NOALPHABLEND = 0x00200000, 536 537 /* 538 * Indicates that the device can auto-generated sublevels for resources 539 * of this format 540 */ 541 SVGA3DFORMAT_OP_AUTOGENMIPMAP = 0x00400000, 542 543 /* 544 * Indicates that this format can be used by vertex texture sampler 545 */ 546 SVGA3DFORMAT_OP_VERTEXTEXTURE = 0x00800000, 547 548 /* 549 * Indicates that this format supports neither texture coordinate 550 * wrap modes, nor mipmapping. 551 */ 552 SVGA3DFORMAT_OP_NOTEXCOORDWRAPNORMIP = 0x01000000 553 } SVGA3dFormatOp; 554 555 #define SVGA3D_FORMAT_POSITIVE \ 556 (SVGA3DFORMAT_OP_TEXTURE | \ 557 SVGA3DFORMAT_OP_VOLUMETEXTURE | \ 558 SVGA3DFORMAT_OP_CUBETEXTURE | \ 559 SVGA3DFORMAT_OP_OFFSCREEN_RENDERTARGET | \ 560 SVGA3DFORMAT_OP_SAME_FORMAT_RENDERTARGET | \ 561 SVGA3DFORMAT_OP_ZSTENCIL | \ 562 SVGA3DFORMAT_OP_ZSTENCIL_WITH_ARBITRARY_COLOR_DEPTH | \ 563 SVGA3DFORMAT_OP_SAME_FORMAT_UP_TO_ALPHA_RENDERTARGET | \ 564 SVGA3DFORMAT_OP_DISPLAYMODE | \ 565 SVGA3DFORMAT_OP_3DACCELERATION | \ 566 SVGA3DFORMAT_OP_PIXELSIZE | \ 567 SVGA3DFORMAT_OP_CONVERT_TO_ARGB | \ 568 SVGA3DFORMAT_OP_OFFSCREENPLAIN | \ 569 SVGA3DFORMAT_OP_SRGBREAD | \ 570 SVGA3DFORMAT_OP_BUMPMAP | \ 571 SVGA3DFORMAT_OP_DMAP | \ 572 SVGA3DFORMAT_OP_MEMBEROFGROUP_ARGB | \ 573 SVGA3DFORMAT_OP_SRGBWRITE | \ 574 SVGA3DFORMAT_OP_AUTOGENMIPMAP | \ 575 SVGA3DFORMAT_OP_VERTEXTEXTURE) 576 577 #define SVGA3D_FORMAT_NEGATIVE \ 578 (SVGA3DFORMAT_OP_NOFILTER | \ 579 SVGA3DFORMAT_OP_NOALPHABLEND | \ 580 SVGA3DFORMAT_OP_NOTEXCOORDWRAPNORMIP) 581 582 /* 583 * This structure is a conversion of SVGA3DFORMAT_OP_* 584 * Entries must be located at the same position. 585 */ 586 typedef union { 587 uint32 value; 588 struct { 589 uint32 texture : 1; 590 uint32 volumeTexture : 1; 591 uint32 cubeTexture : 1; 592 uint32 offscreenRenderTarget : 1; 593 uint32 sameFormatRenderTarget : 1; 594 uint32 unknown1 : 1; 595 uint32 zStencil : 1; 596 uint32 zStencilArbitraryDepth : 1; 597 uint32 sameFormatUpToAlpha : 1; 598 uint32 unknown2 : 1; 599 uint32 displayMode : 1; 600 uint32 acceleration3d : 1; 601 uint32 pixelSize : 1; 602 uint32 convertToARGB : 1; 603 uint32 offscreenPlain : 1; 604 uint32 sRGBRead : 1; 605 uint32 bumpMap : 1; 606 uint32 dmap : 1; 607 uint32 noFilter : 1; 608 uint32 memberOfGroupARGB : 1; 609 uint32 sRGBWrite : 1; 610 uint32 noAlphaBlend : 1; 611 uint32 autoGenMipMap : 1; 612 uint32 vertexTexture : 1; 613 uint32 noTexCoordWrapNorMip : 1; 614 }; 615 } SVGA3dSurfaceFormatCaps; 616 617 /* 618 * SVGA_3D_CMD_SETRENDERSTATE Types. All value types 619 * must fit in a uint32. 620 */ 621 622 typedef enum { 623 SVGA3D_RS_INVALID = 0, 624 SVGA3D_RS_MIN = 1, 625 SVGA3D_RS_ZENABLE = 1, /* SVGA3dBool */ 626 SVGA3D_RS_ZWRITEENABLE = 2, /* SVGA3dBool */ 627 SVGA3D_RS_ALPHATESTENABLE = 3, /* SVGA3dBool */ 628 SVGA3D_RS_DITHERENABLE = 4, /* SVGA3dBool */ 629 SVGA3D_RS_BLENDENABLE = 5, /* SVGA3dBool */ 630 SVGA3D_RS_FOGENABLE = 6, /* SVGA3dBool */ 631 SVGA3D_RS_SPECULARENABLE = 7, /* SVGA3dBool */ 632 SVGA3D_RS_STENCILENABLE = 8, /* SVGA3dBool */ 633 SVGA3D_RS_LIGHTINGENABLE = 9, /* SVGA3dBool */ 634 SVGA3D_RS_NORMALIZENORMALS = 10, /* SVGA3dBool */ 635 SVGA3D_RS_POINTSPRITEENABLE = 11, /* SVGA3dBool */ 636 SVGA3D_RS_POINTSCALEENABLE = 12, /* SVGA3dBool */ 637 SVGA3D_RS_STENCILREF = 13, /* uint32 */ 638 SVGA3D_RS_STENCILMASK = 14, /* uint32 */ 639 SVGA3D_RS_STENCILWRITEMASK = 15, /* uint32 */ 640 SVGA3D_RS_FOGSTART = 16, /* float */ 641 SVGA3D_RS_FOGEND = 17, /* float */ 642 SVGA3D_RS_FOGDENSITY = 18, /* float */ 643 SVGA3D_RS_POINTSIZE = 19, /* float */ 644 SVGA3D_RS_POINTSIZEMIN = 20, /* float */ 645 SVGA3D_RS_POINTSIZEMAX = 21, /* float */ 646 SVGA3D_RS_POINTSCALE_A = 22, /* float */ 647 SVGA3D_RS_POINTSCALE_B = 23, /* float */ 648 SVGA3D_RS_POINTSCALE_C = 24, /* float */ 649 SVGA3D_RS_FOGCOLOR = 25, /* SVGA3dColor */ 650 SVGA3D_RS_AMBIENT = 26, /* SVGA3dColor */ 651 SVGA3D_RS_CLIPPLANEENABLE = 27, /* SVGA3dClipPlanes */ 652 SVGA3D_RS_FOGMODE = 28, /* SVGA3dFogMode */ 653 SVGA3D_RS_FILLMODE = 29, /* SVGA3dFillMode */ 654 SVGA3D_RS_SHADEMODE = 30, /* SVGA3dShadeMode */ 655 SVGA3D_RS_LINEPATTERN = 31, /* SVGA3dLinePattern */ 656 SVGA3D_RS_SRCBLEND = 32, /* SVGA3dBlendOp */ 657 SVGA3D_RS_DSTBLEND = 33, /* SVGA3dBlendOp */ 658 SVGA3D_RS_BLENDEQUATION = 34, /* SVGA3dBlendEquation */ 659 SVGA3D_RS_CULLMODE = 35, /* SVGA3dFace */ 660 SVGA3D_RS_ZFUNC = 36, /* SVGA3dCmpFunc */ 661 SVGA3D_RS_ALPHAFUNC = 37, /* SVGA3dCmpFunc */ 662 SVGA3D_RS_STENCILFUNC = 38, /* SVGA3dCmpFunc */ 663 SVGA3D_RS_STENCILFAIL = 39, /* SVGA3dStencilOp */ 664 SVGA3D_RS_STENCILZFAIL = 40, /* SVGA3dStencilOp */ 665 SVGA3D_RS_STENCILPASS = 41, /* SVGA3dStencilOp */ 666 SVGA3D_RS_ALPHAREF = 42, /* float (0.0 .. 1.0) */ 667 SVGA3D_RS_FRONTWINDING = 43, /* SVGA3dFrontWinding */ 668 SVGA3D_RS_COORDINATETYPE = 44, /* SVGA3dCoordinateType */ 669 SVGA3D_RS_ZBIAS = 45, /* float */ 670 SVGA3D_RS_RANGEFOGENABLE = 46, /* SVGA3dBool */ 671 SVGA3D_RS_COLORWRITEENABLE = 47, /* SVGA3dColorMask */ 672 SVGA3D_RS_VERTEXMATERIALENABLE = 48, /* SVGA3dBool */ 673 SVGA3D_RS_DIFFUSEMATERIALSOURCE = 49, /* SVGA3dVertexMaterial */ 674 SVGA3D_RS_SPECULARMATERIALSOURCE = 50, /* SVGA3dVertexMaterial */ 675 SVGA3D_RS_AMBIENTMATERIALSOURCE = 51, /* SVGA3dVertexMaterial */ 676 SVGA3D_RS_EMISSIVEMATERIALSOURCE = 52, /* SVGA3dVertexMaterial */ 677 SVGA3D_RS_TEXTUREFACTOR = 53, /* SVGA3dColor */ 678 SVGA3D_RS_LOCALVIEWER = 54, /* SVGA3dBool */ 679 SVGA3D_RS_SCISSORTESTENABLE = 55, /* SVGA3dBool */ 680 SVGA3D_RS_BLENDCOLOR = 56, /* SVGA3dColor */ 681 SVGA3D_RS_STENCILENABLE2SIDED = 57, /* SVGA3dBool */ 682 SVGA3D_RS_CCWSTENCILFUNC = 58, /* SVGA3dCmpFunc */ 683 SVGA3D_RS_CCWSTENCILFAIL = 59, /* SVGA3dStencilOp */ 684 SVGA3D_RS_CCWSTENCILZFAIL = 60, /* SVGA3dStencilOp */ 685 SVGA3D_RS_CCWSTENCILPASS = 61, /* SVGA3dStencilOp */ 686 SVGA3D_RS_VERTEXBLEND = 62, /* SVGA3dVertexBlendFlags */ 687 SVGA3D_RS_SLOPESCALEDEPTHBIAS = 63, /* float */ 688 SVGA3D_RS_DEPTHBIAS = 64, /* float */ 689 690 691 /* 692 * Output Gamma Level 693 * 694 * Output gamma effects the gamma curve of colors that are output from the 695 * rendering pipeline. A value of 1.0 specifies a linear color space. If the 696 * value is <= 0.0, gamma correction is ignored and linear color space is 697 * used. 698 */ 699 700 SVGA3D_RS_OUTPUTGAMMA = 65, /* float */ 701 SVGA3D_RS_ZVISIBLE = 66, /* SVGA3dBool */ 702 SVGA3D_RS_LASTPIXEL = 67, /* SVGA3dBool */ 703 SVGA3D_RS_CLIPPING = 68, /* SVGA3dBool */ 704 SVGA3D_RS_WRAP0 = 69, /* SVGA3dWrapFlags */ 705 SVGA3D_RS_WRAP1 = 70, /* SVGA3dWrapFlags */ 706 SVGA3D_RS_WRAP2 = 71, /* SVGA3dWrapFlags */ 707 SVGA3D_RS_WRAP3 = 72, /* SVGA3dWrapFlags */ 708 SVGA3D_RS_WRAP4 = 73, /* SVGA3dWrapFlags */ 709 SVGA3D_RS_WRAP5 = 74, /* SVGA3dWrapFlags */ 710 SVGA3D_RS_WRAP6 = 75, /* SVGA3dWrapFlags */ 711 SVGA3D_RS_WRAP7 = 76, /* SVGA3dWrapFlags */ 712 SVGA3D_RS_WRAP8 = 77, /* SVGA3dWrapFlags */ 713 SVGA3D_RS_WRAP9 = 78, /* SVGA3dWrapFlags */ 714 SVGA3D_RS_WRAP10 = 79, /* SVGA3dWrapFlags */ 715 SVGA3D_RS_WRAP11 = 80, /* SVGA3dWrapFlags */ 716 SVGA3D_RS_WRAP12 = 81, /* SVGA3dWrapFlags */ 717 SVGA3D_RS_WRAP13 = 82, /* SVGA3dWrapFlags */ 718 SVGA3D_RS_WRAP14 = 83, /* SVGA3dWrapFlags */ 719 SVGA3D_RS_WRAP15 = 84, /* SVGA3dWrapFlags */ 720 SVGA3D_RS_MULTISAMPLEANTIALIAS = 85, /* SVGA3dBool */ 721 SVGA3D_RS_MULTISAMPLEMASK = 86, /* uint32 */ 722 SVGA3D_RS_INDEXEDVERTEXBLENDENABLE = 87, /* SVGA3dBool */ 723 SVGA3D_RS_TWEENFACTOR = 88, /* float */ 724 SVGA3D_RS_ANTIALIASEDLINEENABLE = 89, /* SVGA3dBool */ 725 SVGA3D_RS_COLORWRITEENABLE1 = 90, /* SVGA3dColorMask */ 726 SVGA3D_RS_COLORWRITEENABLE2 = 91, /* SVGA3dColorMask */ 727 SVGA3D_RS_COLORWRITEENABLE3 = 92, /* SVGA3dColorMask */ 728 SVGA3D_RS_SEPARATEALPHABLENDENABLE = 93, /* SVGA3dBool */ 729 SVGA3D_RS_SRCBLENDALPHA = 94, /* SVGA3dBlendOp */ 730 SVGA3D_RS_DSTBLENDALPHA = 95, /* SVGA3dBlendOp */ 731 SVGA3D_RS_BLENDEQUATIONALPHA = 96, /* SVGA3dBlendEquation */ 732 SVGA3D_RS_TRANSPARENCYANTIALIAS = 97, /* SVGA3dTransparencyAntialiasType */ 733 SVGA3D_RS_LINEWIDTH = 98, /* float */ 734 SVGA3D_RS_MAX 735 } SVGA3dRenderStateName; 736 737 typedef enum { 738 SVGA3D_TRANSPARENCYANTIALIAS_NORMAL = 0, 739 SVGA3D_TRANSPARENCYANTIALIAS_ALPHATOCOVERAGE = 1, 740 SVGA3D_TRANSPARENCYANTIALIAS_SUPERSAMPLE = 2, 741 SVGA3D_TRANSPARENCYANTIALIAS_MAX 742 } SVGA3dTransparencyAntialiasType; 743 744 typedef enum { 745 SVGA3D_VERTEXMATERIAL_NONE = 0, /* Use the value in the current material */ 746 SVGA3D_VERTEXMATERIAL_DIFFUSE = 1, /* Use the value in the diffuse component */ 747 SVGA3D_VERTEXMATERIAL_SPECULAR = 2, /* Use the value in the specular component */ 748 SVGA3D_VERTEXMATERIAL_MAX = 3, 749 } SVGA3dVertexMaterial; 750 751 typedef enum { 752 SVGA3D_FILLMODE_INVALID = 0, 753 SVGA3D_FILLMODE_MIN = 1, 754 SVGA3D_FILLMODE_POINT = 1, 755 SVGA3D_FILLMODE_LINE = 2, 756 SVGA3D_FILLMODE_FILL = 3, 757 SVGA3D_FILLMODE_MAX 758 } SVGA3dFillModeType; 759 760 761 typedef 762 #include "vmware_pack_begin.h" 763 union { 764 struct { 765 uint16 mode; /* SVGA3dFillModeType */ 766 uint16 face; /* SVGA3dFace */ 767 }; 768 uint32 uintValue; 769 } 770 #include "vmware_pack_end.h" 771 SVGA3dFillMode; 772 773 typedef enum { 774 SVGA3D_SHADEMODE_INVALID = 0, 775 SVGA3D_SHADEMODE_FLAT = 1, 776 SVGA3D_SHADEMODE_SMOOTH = 2, 777 SVGA3D_SHADEMODE_PHONG = 3, /* Not supported */ 778 SVGA3D_SHADEMODE_MAX 779 } SVGA3dShadeMode; 780 781 typedef 782 #include "vmware_pack_begin.h" 783 union { 784 struct { 785 uint16 repeat; 786 uint16 pattern; 787 }; 788 uint32 uintValue; 789 } 790 #include "vmware_pack_end.h" 791 SVGA3dLinePattern; 792 793 typedef enum { 794 SVGA3D_BLENDOP_INVALID = 0, 795 SVGA3D_BLENDOP_MIN = 1, 796 SVGA3D_BLENDOP_ZERO = 1, 797 SVGA3D_BLENDOP_ONE = 2, 798 SVGA3D_BLENDOP_SRCCOLOR = 3, 799 SVGA3D_BLENDOP_INVSRCCOLOR = 4, 800 SVGA3D_BLENDOP_SRCALPHA = 5, 801 SVGA3D_BLENDOP_INVSRCALPHA = 6, 802 SVGA3D_BLENDOP_DESTALPHA = 7, 803 SVGA3D_BLENDOP_INVDESTALPHA = 8, 804 SVGA3D_BLENDOP_DESTCOLOR = 9, 805 SVGA3D_BLENDOP_INVDESTCOLOR = 10, 806 SVGA3D_BLENDOP_SRCALPHASAT = 11, 807 SVGA3D_BLENDOP_BLENDFACTOR = 12, 808 SVGA3D_BLENDOP_INVBLENDFACTOR = 13, 809 SVGA3D_BLENDOP_SRC1COLOR = 14, 810 SVGA3D_BLENDOP_INVSRC1COLOR = 15, 811 SVGA3D_BLENDOP_SRC1ALPHA = 16, 812 SVGA3D_BLENDOP_INVSRC1ALPHA = 17, 813 SVGA3D_BLENDOP_BLENDFACTORALPHA = 18, 814 SVGA3D_BLENDOP_INVBLENDFACTORALPHA = 19, 815 SVGA3D_BLENDOP_MAX 816 } SVGA3dBlendOp; 817 818 typedef enum { 819 SVGA3D_BLENDEQ_INVALID = 0, 820 SVGA3D_BLENDEQ_MIN = 1, 821 SVGA3D_BLENDEQ_ADD = 1, 822 SVGA3D_BLENDEQ_SUBTRACT = 2, 823 SVGA3D_BLENDEQ_REVSUBTRACT = 3, 824 SVGA3D_BLENDEQ_MINIMUM = 4, 825 SVGA3D_BLENDEQ_MAXIMUM = 5, 826 SVGA3D_BLENDEQ_MAX 827 } SVGA3dBlendEquation; 828 829 typedef enum { 830 SVGA3D_DX11_LOGICOP_MIN = 0, 831 SVGA3D_DX11_LOGICOP_CLEAR = 0, 832 SVGA3D_DX11_LOGICOP_SET = 1, 833 SVGA3D_DX11_LOGICOP_COPY = 2, 834 SVGA3D_DX11_LOGICOP_COPY_INVERTED = 3, 835 SVGA3D_DX11_LOGICOP_NOOP = 4, 836 SVGA3D_DX11_LOGICOP_INVERT = 5, 837 SVGA3D_DX11_LOGICOP_AND = 6, 838 SVGA3D_DX11_LOGICOP_NAND = 7, 839 SVGA3D_DX11_LOGICOP_OR = 8, 840 SVGA3D_DX11_LOGICOP_NOR = 9, 841 SVGA3D_DX11_LOGICOP_XOR = 10, 842 SVGA3D_DX11_LOGICOP_EQUIV = 11, 843 SVGA3D_DX11_LOGICOP_AND_REVERSE = 12, 844 SVGA3D_DX11_LOGICOP_AND_INVERTED = 13, 845 SVGA3D_DX11_LOGICOP_OR_REVERSE = 14, 846 SVGA3D_DX11_LOGICOP_OR_INVERTED = 15, 847 SVGA3D_DX11_LOGICOP_MAX 848 } SVGA3dDX11LogicOp; 849 850 typedef enum { 851 SVGA3D_FRONTWINDING_INVALID = 0, 852 SVGA3D_FRONTWINDING_CW = 1, 853 SVGA3D_FRONTWINDING_CCW = 2, 854 SVGA3D_FRONTWINDING_MAX 855 } SVGA3dFrontWinding; 856 857 typedef enum { 858 SVGA3D_FACE_INVALID = 0, 859 SVGA3D_FACE_NONE = 1, 860 SVGA3D_FACE_MIN = 1, 861 SVGA3D_FACE_FRONT = 2, 862 SVGA3D_FACE_BACK = 3, 863 SVGA3D_FACE_FRONT_BACK = 4, 864 SVGA3D_FACE_MAX 865 } SVGA3dFace; 866 867 /* 868 * The order and the values should not be changed 869 */ 870 871 typedef enum { 872 SVGA3D_CMP_INVALID = 0, 873 SVGA3D_CMP_NEVER = 1, 874 SVGA3D_CMP_LESS = 2, 875 SVGA3D_CMP_EQUAL = 3, 876 SVGA3D_CMP_LESSEQUAL = 4, 877 SVGA3D_CMP_GREATER = 5, 878 SVGA3D_CMP_NOTEQUAL = 6, 879 SVGA3D_CMP_GREATEREQUAL = 7, 880 SVGA3D_CMP_ALWAYS = 8, 881 SVGA3D_CMP_MAX 882 } SVGA3dCmpFunc; 883 884 /* 885 * SVGA3D_FOGFUNC_* specifies the fog equation, or PER_VERTEX which allows 886 * the fog factor to be specified in the alpha component of the specular 887 * (a.k.a. secondary) vertex color. 888 */ 889 typedef enum { 890 SVGA3D_FOGFUNC_INVALID = 0, 891 SVGA3D_FOGFUNC_EXP = 1, 892 SVGA3D_FOGFUNC_EXP2 = 2, 893 SVGA3D_FOGFUNC_LINEAR = 3, 894 SVGA3D_FOGFUNC_PER_VERTEX = 4 895 } SVGA3dFogFunction; 896 897 /* 898 * SVGA3D_FOGTYPE_* specifies if fog factors are computed on a per-vertex 899 * or per-pixel basis. 900 */ 901 typedef enum { 902 SVGA3D_FOGTYPE_INVALID = 0, 903 SVGA3D_FOGTYPE_VERTEX = 1, 904 SVGA3D_FOGTYPE_PIXEL = 2, 905 SVGA3D_FOGTYPE_MAX = 3 906 } SVGA3dFogType; 907 908 /* 909 * SVGA3D_FOGBASE_* selects depth or range-based fog. Depth-based fog is 910 * computed using the eye Z value of each pixel (or vertex), whereas range- 911 * based fog is computed using the actual distance (range) to the eye. 912 */ 913 typedef enum { 914 SVGA3D_FOGBASE_INVALID = 0, 915 SVGA3D_FOGBASE_DEPTHBASED = 1, 916 SVGA3D_FOGBASE_RANGEBASED = 2, 917 SVGA3D_FOGBASE_MAX = 3 918 } SVGA3dFogBase; 919 920 typedef enum { 921 SVGA3D_STENCILOP_INVALID = 0, 922 SVGA3D_STENCILOP_MIN = 1, 923 SVGA3D_STENCILOP_KEEP = 1, 924 SVGA3D_STENCILOP_ZERO = 2, 925 SVGA3D_STENCILOP_REPLACE = 3, 926 SVGA3D_STENCILOP_INCRSAT = 4, 927 SVGA3D_STENCILOP_DECRSAT = 5, 928 SVGA3D_STENCILOP_INVERT = 6, 929 SVGA3D_STENCILOP_INCR = 7, 930 SVGA3D_STENCILOP_DECR = 8, 931 SVGA3D_STENCILOP_MAX 932 } SVGA3dStencilOp; 933 934 typedef enum { 935 SVGA3D_CLIPPLANE_0 = (1 << 0), 936 SVGA3D_CLIPPLANE_1 = (1 << 1), 937 SVGA3D_CLIPPLANE_2 = (1 << 2), 938 SVGA3D_CLIPPLANE_3 = (1 << 3), 939 SVGA3D_CLIPPLANE_4 = (1 << 4), 940 SVGA3D_CLIPPLANE_5 = (1 << 5), 941 } SVGA3dClipPlanes; 942 943 typedef enum { 944 SVGA3D_CLEAR_COLOR = 0x1, 945 SVGA3D_CLEAR_DEPTH = 0x2, 946 SVGA3D_CLEAR_STENCIL = 0x4, 947 948 /* 949 * Hint only, must be used together with SVGA3D_CLEAR_COLOR. If 950 * SVGA3D_CLEAR_DEPTH or SVGA3D_CLEAR_STENCIL bit is set, this 951 * bit will be ignored. 952 */ 953 SVGA3D_CLEAR_COLORFILL = 0x8 954 } SVGA3dClearFlag; 955 956 typedef enum { 957 SVGA3D_RT_DEPTH = 0, 958 SVGA3D_RT_MIN = 0, 959 SVGA3D_RT_STENCIL = 1, 960 SVGA3D_RT_COLOR0 = 2, 961 SVGA3D_RT_COLOR1 = 3, 962 SVGA3D_RT_COLOR2 = 4, 963 SVGA3D_RT_COLOR3 = 5, 964 SVGA3D_RT_COLOR4 = 6, 965 SVGA3D_RT_COLOR5 = 7, 966 SVGA3D_RT_COLOR6 = 8, 967 SVGA3D_RT_COLOR7 = 9, 968 SVGA3D_RT_MAX, 969 SVGA3D_RT_INVALID = ((uint32)-1), 970 } SVGA3dRenderTargetType; 971 972 #define SVGA3D_MAX_RT_COLOR (SVGA3D_RT_COLOR7 - SVGA3D_RT_COLOR0 + 1) 973 974 typedef 975 #include "vmware_pack_begin.h" 976 union { 977 struct { 978 uint32 red : 1; 979 uint32 green : 1; 980 uint32 blue : 1; 981 uint32 alpha : 1; 982 }; 983 uint32 uintValue; 984 } 985 #include "vmware_pack_end.h" 986 SVGA3dColorMask; 987 988 typedef enum { 989 SVGA3D_VBLEND_DISABLE = 0, 990 SVGA3D_VBLEND_1WEIGHT = 1, 991 SVGA3D_VBLEND_2WEIGHT = 2, 992 SVGA3D_VBLEND_3WEIGHT = 3, 993 SVGA3D_VBLEND_MAX = 4, 994 } SVGA3dVertexBlendFlags; 995 996 typedef enum { 997 SVGA3D_WRAPCOORD_0 = 1 << 0, 998 SVGA3D_WRAPCOORD_1 = 1 << 1, 999 SVGA3D_WRAPCOORD_2 = 1 << 2, 1000 SVGA3D_WRAPCOORD_3 = 1 << 3, 1001 SVGA3D_WRAPCOORD_ALL = 0xF, 1002 } SVGA3dWrapFlags; 1003 1004 /* 1005 * SVGA_3D_CMD_TEXTURESTATE Types. All value types 1006 * must fit in a uint32. 1007 */ 1008 1009 typedef enum { 1010 SVGA3D_TS_INVALID = 0, 1011 SVGA3D_TS_MIN = 1, 1012 SVGA3D_TS_BIND_TEXTURE = 1, /* SVGA3dSurfaceId */ 1013 SVGA3D_TS_COLOROP = 2, /* SVGA3dTextureCombiner */ 1014 SVGA3D_TS_COLORARG1 = 3, /* SVGA3dTextureArgData */ 1015 SVGA3D_TS_COLORARG2 = 4, /* SVGA3dTextureArgData */ 1016 SVGA3D_TS_ALPHAOP = 5, /* SVGA3dTextureCombiner */ 1017 SVGA3D_TS_ALPHAARG1 = 6, /* SVGA3dTextureArgData */ 1018 SVGA3D_TS_ALPHAARG2 = 7, /* SVGA3dTextureArgData */ 1019 SVGA3D_TS_ADDRESSU = 8, /* SVGA3dTextureAddress */ 1020 SVGA3D_TS_ADDRESSV = 9, /* SVGA3dTextureAddress */ 1021 SVGA3D_TS_MIPFILTER = 10, /* SVGA3dTextureFilter */ 1022 SVGA3D_TS_MAGFILTER = 11, /* SVGA3dTextureFilter */ 1023 SVGA3D_TS_MINFILTER = 12, /* SVGA3dTextureFilter */ 1024 SVGA3D_TS_BORDERCOLOR = 13, /* SVGA3dColor */ 1025 SVGA3D_TS_TEXCOORDINDEX = 14, /* uint32 */ 1026 SVGA3D_TS_TEXTURETRANSFORMFLAGS = 15, /* SVGA3dTexTransformFlags */ 1027 SVGA3D_TS_TEXCOORDGEN = 16, /* SVGA3dTextureCoordGen */ 1028 SVGA3D_TS_BUMPENVMAT00 = 17, /* float */ 1029 SVGA3D_TS_BUMPENVMAT01 = 18, /* float */ 1030 SVGA3D_TS_BUMPENVMAT10 = 19, /* float */ 1031 SVGA3D_TS_BUMPENVMAT11 = 20, /* float */ 1032 SVGA3D_TS_TEXTURE_MIPMAP_LEVEL = 21, /* uint32 */ 1033 SVGA3D_TS_TEXTURE_LOD_BIAS = 22, /* float */ 1034 SVGA3D_TS_TEXTURE_ANISOTROPIC_LEVEL = 23, /* uint32 */ 1035 SVGA3D_TS_ADDRESSW = 24, /* SVGA3dTextureAddress */ 1036 1037 1038 /* 1039 * Sampler Gamma Level 1040 * 1041 * Sampler gamma effects the color of samples taken from the sampler. A 1042 * value of 1.0 will produce linear samples. If the value is <= 0.0 the 1043 * gamma value is ignored and a linear space is used. 1044 */ 1045 1046 SVGA3D_TS_GAMMA = 25, /* float */ 1047 SVGA3D_TS_BUMPENVLSCALE = 26, /* float */ 1048 SVGA3D_TS_BUMPENVLOFFSET = 27, /* float */ 1049 SVGA3D_TS_COLORARG0 = 28, /* SVGA3dTextureArgData */ 1050 SVGA3D_TS_ALPHAARG0 = 29, /* SVGA3dTextureArgData */ 1051 SVGA3D_TS_PREGB_MAX = 30, /* Max value before GBObjects */ 1052 SVGA3D_TS_CONSTANT = 30, /* SVGA3dColor */ 1053 SVGA3D_TS_COLOR_KEY_ENABLE = 31, /* SVGA3dBool */ 1054 SVGA3D_TS_COLOR_KEY = 32, /* SVGA3dColor */ 1055 SVGA3D_TS_MAX 1056 } SVGA3dTextureStateName; 1057 1058 typedef enum { 1059 SVGA3D_TC_INVALID = 0, 1060 SVGA3D_TC_DISABLE = 1, 1061 SVGA3D_TC_SELECTARG1 = 2, 1062 SVGA3D_TC_SELECTARG2 = 3, 1063 SVGA3D_TC_MODULATE = 4, 1064 SVGA3D_TC_ADD = 5, 1065 SVGA3D_TC_ADDSIGNED = 6, 1066 SVGA3D_TC_SUBTRACT = 7, 1067 SVGA3D_TC_BLENDTEXTUREALPHA = 8, 1068 SVGA3D_TC_BLENDDIFFUSEALPHA = 9, 1069 SVGA3D_TC_BLENDCURRENTALPHA = 10, 1070 SVGA3D_TC_BLENDFACTORALPHA = 11, 1071 SVGA3D_TC_MODULATE2X = 12, 1072 SVGA3D_TC_MODULATE4X = 13, 1073 SVGA3D_TC_DSDT = 14, 1074 SVGA3D_TC_DOTPRODUCT3 = 15, 1075 SVGA3D_TC_BLENDTEXTUREALPHAPM = 16, 1076 SVGA3D_TC_ADDSIGNED2X = 17, 1077 SVGA3D_TC_ADDSMOOTH = 18, 1078 SVGA3D_TC_PREMODULATE = 19, 1079 SVGA3D_TC_MODULATEALPHA_ADDCOLOR = 20, 1080 SVGA3D_TC_MODULATECOLOR_ADDALPHA = 21, 1081 SVGA3D_TC_MODULATEINVALPHA_ADDCOLOR = 22, 1082 SVGA3D_TC_MODULATEINVCOLOR_ADDALPHA = 23, 1083 SVGA3D_TC_BUMPENVMAPLUMINANCE = 24, 1084 SVGA3D_TC_MULTIPLYADD = 25, 1085 SVGA3D_TC_LERP = 26, 1086 SVGA3D_TC_MAX 1087 } SVGA3dTextureCombiner; 1088 1089 #define SVGA3D_TC_CAP_BIT(svga3d_tc_op) (svga3d_tc_op ? (1 << (svga3d_tc_op - 1)) : 0) 1090 1091 typedef enum { 1092 SVGA3D_TEX_ADDRESS_INVALID = 0, 1093 SVGA3D_TEX_ADDRESS_MIN = 1, 1094 SVGA3D_TEX_ADDRESS_WRAP = 1, 1095 SVGA3D_TEX_ADDRESS_MIRROR = 2, 1096 SVGA3D_TEX_ADDRESS_CLAMP = 3, 1097 SVGA3D_TEX_ADDRESS_BORDER = 4, 1098 SVGA3D_TEX_ADDRESS_MIRRORONCE = 5, 1099 SVGA3D_TEX_ADDRESS_EDGE = 6, 1100 SVGA3D_TEX_ADDRESS_MAX 1101 } SVGA3dTextureAddress; 1102 1103 /* 1104 * SVGA3D_TEX_FILTER_NONE as the minification filter means mipmapping is 1105 * disabled, and the rasterizer should use the magnification filter instead. 1106 */ 1107 typedef enum { 1108 SVGA3D_TEX_FILTER_NONE = 0, 1109 SVGA3D_TEX_FILTER_MIN = 0, 1110 SVGA3D_TEX_FILTER_NEAREST = 1, 1111 SVGA3D_TEX_FILTER_LINEAR = 2, 1112 SVGA3D_TEX_FILTER_ANISOTROPIC = 3, 1113 SVGA3D_TEX_FILTER_FLATCUBIC = 4, /* Deprecated, not implemented */ 1114 SVGA3D_TEX_FILTER_GAUSSIANCUBIC = 5, /* Deprecated, not implemented */ 1115 SVGA3D_TEX_FILTER_PYRAMIDALQUAD = 6, /* Not currently implemented */ 1116 SVGA3D_TEX_FILTER_GAUSSIANQUAD = 7, /* Not currently implemented */ 1117 SVGA3D_TEX_FILTER_MAX 1118 } SVGA3dTextureFilter; 1119 1120 typedef enum { 1121 SVGA3D_TEX_TRANSFORM_OFF = 0, 1122 SVGA3D_TEX_TRANSFORM_S = (1 << 0), 1123 SVGA3D_TEX_TRANSFORM_T = (1 << 1), 1124 SVGA3D_TEX_TRANSFORM_R = (1 << 2), 1125 SVGA3D_TEX_TRANSFORM_Q = (1 << 3), 1126 SVGA3D_TEX_PROJECTED = (1 << 15), 1127 } SVGA3dTexTransformFlags; 1128 1129 typedef enum { 1130 SVGA3D_TEXCOORD_GEN_OFF = 0, 1131 SVGA3D_TEXCOORD_GEN_EYE_POSITION = 1, 1132 SVGA3D_TEXCOORD_GEN_EYE_NORMAL = 2, 1133 SVGA3D_TEXCOORD_GEN_REFLECTIONVECTOR = 3, 1134 SVGA3D_TEXCOORD_GEN_SPHERE = 4, 1135 SVGA3D_TEXCOORD_GEN_MAX 1136 } SVGA3dTextureCoordGen; 1137 1138 /* 1139 * Texture argument constants for texture combiner 1140 */ 1141 typedef enum { 1142 SVGA3D_TA_INVALID = 0, 1143 SVGA3D_TA_TFACTOR = 1, 1144 SVGA3D_TA_PREVIOUS = 2, 1145 SVGA3D_TA_DIFFUSE = 3, 1146 SVGA3D_TA_TEXTURE = 4, 1147 SVGA3D_TA_SPECULAR = 5, 1148 SVGA3D_TA_CONSTANT = 6, 1149 SVGA3D_TA_MAX 1150 } SVGA3dTextureArgData; 1151 1152 #define SVGA3D_TM_MASK_LEN 4 1153 1154 /* Modifiers for texture argument constants defined above. */ 1155 typedef enum { 1156 SVGA3D_TM_NONE = 0, 1157 SVGA3D_TM_ALPHA = (1 << SVGA3D_TM_MASK_LEN), 1158 SVGA3D_TM_ONE_MINUS = (2 << SVGA3D_TM_MASK_LEN), 1159 } SVGA3dTextureArgModifier; 1160 1161 /* 1162 * Vertex declarations 1163 * 1164 * Notes: 1165 * 1166 * SVGA3D_DECLUSAGE_POSITIONT is for pre-transformed vertices. If you 1167 * draw with any POSITIONT vertex arrays, the programmable vertex 1168 * pipeline will be implicitly disabled. Drawing will take place as if 1169 * no vertex shader was bound. 1170 */ 1171 1172 typedef enum { 1173 SVGA3D_DECLUSAGE_POSITION = 0, 1174 SVGA3D_DECLUSAGE_BLENDWEIGHT, 1175 SVGA3D_DECLUSAGE_BLENDINDICES, 1176 SVGA3D_DECLUSAGE_NORMAL, 1177 SVGA3D_DECLUSAGE_PSIZE, 1178 SVGA3D_DECLUSAGE_TEXCOORD, 1179 SVGA3D_DECLUSAGE_TANGENT, 1180 SVGA3D_DECLUSAGE_BINORMAL, 1181 SVGA3D_DECLUSAGE_TESSFACTOR, 1182 SVGA3D_DECLUSAGE_POSITIONT, 1183 SVGA3D_DECLUSAGE_COLOR, 1184 SVGA3D_DECLUSAGE_FOG, 1185 SVGA3D_DECLUSAGE_DEPTH, 1186 SVGA3D_DECLUSAGE_SAMPLE, 1187 SVGA3D_DECLUSAGE_MAX 1188 } SVGA3dDeclUsage; 1189 1190 typedef enum { 1191 SVGA3D_DECLMETHOD_DEFAULT = 0, 1192 SVGA3D_DECLMETHOD_PARTIALU, 1193 SVGA3D_DECLMETHOD_PARTIALV, 1194 SVGA3D_DECLMETHOD_CROSSUV, /* Normal */ 1195 SVGA3D_DECLMETHOD_UV, 1196 SVGA3D_DECLMETHOD_LOOKUP, /* Lookup a displacement map */ 1197 SVGA3D_DECLMETHOD_LOOKUPPRESAMPLED, /* Lookup a pre-sampled displacement */ 1198 /* map */ 1199 } SVGA3dDeclMethod; 1200 1201 typedef enum { 1202 SVGA3D_DECLTYPE_FLOAT1 = 0, 1203 SVGA3D_DECLTYPE_FLOAT2 = 1, 1204 SVGA3D_DECLTYPE_FLOAT3 = 2, 1205 SVGA3D_DECLTYPE_FLOAT4 = 3, 1206 SVGA3D_DECLTYPE_D3DCOLOR = 4, 1207 SVGA3D_DECLTYPE_UBYTE4 = 5, 1208 SVGA3D_DECLTYPE_SHORT2 = 6, 1209 SVGA3D_DECLTYPE_SHORT4 = 7, 1210 SVGA3D_DECLTYPE_UBYTE4N = 8, 1211 SVGA3D_DECLTYPE_SHORT2N = 9, 1212 SVGA3D_DECLTYPE_SHORT4N = 10, 1213 SVGA3D_DECLTYPE_USHORT2N = 11, 1214 SVGA3D_DECLTYPE_USHORT4N = 12, 1215 SVGA3D_DECLTYPE_UDEC3 = 13, 1216 SVGA3D_DECLTYPE_DEC3N = 14, 1217 SVGA3D_DECLTYPE_FLOAT16_2 = 15, 1218 SVGA3D_DECLTYPE_FLOAT16_4 = 16, 1219 SVGA3D_DECLTYPE_MAX, 1220 } SVGA3dDeclType; 1221 1222 /* 1223 * This structure is used for the divisor for geometry instancing; 1224 * it's a direct translation of the Direct3D equivalent. 1225 */ 1226 typedef union { 1227 struct { 1228 /* 1229 * For index data, this number represents the number of instances to draw. 1230 * For instance data, this number represents the number of 1231 * instances/vertex in this stream 1232 */ 1233 uint32 count : 30; 1234 1235 /* 1236 * This is 1 if this is supposed to be the data that is repeated for 1237 * every instance. 1238 */ 1239 uint32 indexedData : 1; 1240 1241 /* 1242 * This is 1 if this is supposed to be the per-instance data. 1243 */ 1244 uint32 instanceData : 1; 1245 }; 1246 1247 uint32 value; 1248 } SVGA3dVertexDivisor; 1249 1250 typedef enum { 1251 /* 1252 * SVGA3D_PRIMITIVE_INVALID is a valid primitive type. 1253 * 1254 * List MIN second so debuggers will think INVALID is 1255 * the correct name. 1256 */ 1257 SVGA3D_PRIMITIVE_INVALID = 0, 1258 SVGA3D_PRIMITIVE_MIN = 0, 1259 SVGA3D_PRIMITIVE_TRIANGLELIST = 1, 1260 SVGA3D_PRIMITIVE_POINTLIST = 2, 1261 SVGA3D_PRIMITIVE_LINELIST = 3, 1262 SVGA3D_PRIMITIVE_LINESTRIP = 4, 1263 SVGA3D_PRIMITIVE_TRIANGLESTRIP = 5, 1264 SVGA3D_PRIMITIVE_TRIANGLEFAN = 6, 1265 SVGA3D_PRIMITIVE_LINELIST_ADJ = 7, 1266 SVGA3D_PRIMITIVE_PREDX_MAX = 7, 1267 SVGA3D_PRIMITIVE_LINESTRIP_ADJ = 8, 1268 SVGA3D_PRIMITIVE_TRIANGLELIST_ADJ = 9, 1269 SVGA3D_PRIMITIVE_TRIANGLESTRIP_ADJ = 10, 1270 SVGA3D_PRIMITIVE_MAX 1271 } SVGA3dPrimitiveType; 1272 1273 typedef enum { 1274 SVGA3D_COORDINATE_INVALID = 0, 1275 SVGA3D_COORDINATE_LEFTHANDED = 1, 1276 SVGA3D_COORDINATE_RIGHTHANDED = 2, 1277 SVGA3D_COORDINATE_MAX 1278 } SVGA3dCoordinateType; 1279 1280 typedef enum { 1281 SVGA3D_TRANSFORM_INVALID = 0, 1282 SVGA3D_TRANSFORM_WORLD = 1, 1283 SVGA3D_TRANSFORM_MIN = 1, 1284 SVGA3D_TRANSFORM_VIEW = 2, 1285 SVGA3D_TRANSFORM_PROJECTION = 3, 1286 SVGA3D_TRANSFORM_TEXTURE0 = 4, 1287 SVGA3D_TRANSFORM_TEXTURE1 = 5, 1288 SVGA3D_TRANSFORM_TEXTURE2 = 6, 1289 SVGA3D_TRANSFORM_TEXTURE3 = 7, 1290 SVGA3D_TRANSFORM_TEXTURE4 = 8, 1291 SVGA3D_TRANSFORM_TEXTURE5 = 9, 1292 SVGA3D_TRANSFORM_TEXTURE6 = 10, 1293 SVGA3D_TRANSFORM_TEXTURE7 = 11, 1294 SVGA3D_TRANSFORM_WORLD1 = 12, 1295 SVGA3D_TRANSFORM_WORLD2 = 13, 1296 SVGA3D_TRANSFORM_WORLD3 = 14, 1297 SVGA3D_TRANSFORM_MAX 1298 } SVGA3dTransformType; 1299 1300 typedef enum { 1301 SVGA3D_LIGHTTYPE_INVALID = 0, 1302 SVGA3D_LIGHTTYPE_MIN = 1, 1303 SVGA3D_LIGHTTYPE_POINT = 1, 1304 SVGA3D_LIGHTTYPE_SPOT1 = 2, /* 1-cone, in degrees */ 1305 SVGA3D_LIGHTTYPE_SPOT2 = 3, /* 2-cone, in radians */ 1306 SVGA3D_LIGHTTYPE_DIRECTIONAL = 4, 1307 SVGA3D_LIGHTTYPE_MAX 1308 } SVGA3dLightType; 1309 1310 typedef enum { 1311 SVGA3D_CUBEFACE_POSX = 0, 1312 SVGA3D_CUBEFACE_NEGX = 1, 1313 SVGA3D_CUBEFACE_POSY = 2, 1314 SVGA3D_CUBEFACE_NEGY = 3, 1315 SVGA3D_CUBEFACE_POSZ = 4, 1316 SVGA3D_CUBEFACE_NEGZ = 5, 1317 } SVGA3dCubeFace; 1318 1319 typedef enum { 1320 SVGA3D_SHADERTYPE_INVALID = 0, 1321 SVGA3D_SHADERTYPE_MIN = 1, 1322 SVGA3D_SHADERTYPE_VS = 1, 1323 SVGA3D_SHADERTYPE_PS = 2, 1324 SVGA3D_SHADERTYPE_PREDX_MAX = 3, 1325 SVGA3D_SHADERTYPE_GS = 3, 1326 SVGA3D_SHADERTYPE_DX10_MAX = 4, 1327 SVGA3D_SHADERTYPE_HS = 4, 1328 SVGA3D_SHADERTYPE_DS = 5, 1329 SVGA3D_SHADERTYPE_CS = 6, 1330 SVGA3D_SHADERTYPE_MAX = 7 1331 } SVGA3dShaderType; 1332 1333 #define SVGA3D_NUM_SHADERTYPE_PREDX \ 1334 (SVGA3D_SHADERTYPE_PREDX_MAX - SVGA3D_SHADERTYPE_MIN) 1335 1336 #define SVGA3D_NUM_SHADERTYPE_DX10 \ 1337 (SVGA3D_SHADERTYPE_DX10_MAX - SVGA3D_SHADERTYPE_MIN) 1338 1339 #define SVGA3D_NUM_SHADERTYPE \ 1340 (SVGA3D_SHADERTYPE_MAX - SVGA3D_SHADERTYPE_MIN) 1341 1342 typedef enum { 1343 SVGA3D_CONST_TYPE_MIN = 0, 1344 SVGA3D_CONST_TYPE_FLOAT = 0, 1345 SVGA3D_CONST_TYPE_INT = 1, 1346 SVGA3D_CONST_TYPE_BOOL = 2, 1347 SVGA3D_CONST_TYPE_MAX = 3, 1348 } SVGA3dShaderConstType; 1349 1350 /* 1351 * Register limits for shader consts. 1352 */ 1353 #define SVGA3D_CONSTREG_MAX 256 1354 #define SVGA3D_CONSTINTREG_MAX 16 1355 #define SVGA3D_CONSTBOOLREG_MAX 16 1356 1357 typedef enum { 1358 SVGA3D_STRETCH_BLT_POINT = 0, 1359 SVGA3D_STRETCH_BLT_LINEAR = 1, 1360 SVGA3D_STRETCH_BLT_MAX 1361 } SVGA3dStretchBltMode; 1362 1363 typedef enum { 1364 SVGA3D_QUERYTYPE_INVALID = ((uint8)-1), 1365 SVGA3D_QUERYTYPE_MIN = 0, 1366 SVGA3D_QUERYTYPE_OCCLUSION = 0, 1367 SVGA3D_QUERYTYPE_TIMESTAMP = 1, 1368 SVGA3D_QUERYTYPE_TIMESTAMPDISJOINT = 2, 1369 SVGA3D_QUERYTYPE_PIPELINESTATS = 3, 1370 SVGA3D_QUERYTYPE_OCCLUSIONPREDICATE = 4, 1371 SVGA3D_QUERYTYPE_STREAMOUTPUTSTATS = 5, 1372 SVGA3D_QUERYTYPE_STREAMOVERFLOWPREDICATE = 6, 1373 SVGA3D_QUERYTYPE_OCCLUSION64 = 7, 1374 SVGA3D_QUERYTYPE_EVENT = 8, 1375 SVGA3D_QUERYTYPE_DX10_MAX = 9, 1376 SVGA3D_QUERYTYPE_SOSTATS_STREAM0 = 9, 1377 SVGA3D_QUERYTYPE_SOSTATS_STREAM1 = 10, 1378 SVGA3D_QUERYTYPE_SOSTATS_STREAM2 = 11, 1379 SVGA3D_QUERYTYPE_SOSTATS_STREAM3 = 12, 1380 SVGA3D_QUERYTYPE_SOP_STREAM0 = 13, 1381 SVGA3D_QUERYTYPE_SOP_STREAM1 = 14, 1382 SVGA3D_QUERYTYPE_SOP_STREAM2 = 15, 1383 SVGA3D_QUERYTYPE_SOP_STREAM3 = 16, 1384 SVGA3D_QUERYTYPE_MAX 1385 } SVGA3dQueryType; 1386 1387 typedef uint8 SVGA3dQueryTypeUint8; 1388 1389 #define SVGA3D_NUM_QUERYTYPE (SVGA3D_QUERYTYPE_MAX - SVGA3D_QUERYTYPE_MIN) 1390 1391 /* 1392 * This is the maximum number of queries per context that can be active 1393 * simultaneously between a beginQuery and endQuery. 1394 */ 1395 #define SVGA3D_MAX_QUERY 64 1396 1397 /* 1398 * Query result buffer formats 1399 */ 1400 typedef 1401 #include "vmware_pack_begin.h" 1402 struct { 1403 uint32 samplesRendered; 1404 } 1405 #include "vmware_pack_end.h" 1406 SVGADXOcclusionQueryResult; 1407 1408 typedef 1409 #include "vmware_pack_begin.h" 1410 struct { 1411 uint32 passed; 1412 } 1413 #include "vmware_pack_end.h" 1414 SVGADXEventQueryResult; 1415 1416 typedef 1417 #include "vmware_pack_begin.h" 1418 struct { 1419 uint64 timestamp; 1420 } 1421 #include "vmware_pack_end.h" 1422 SVGADXTimestampQueryResult; 1423 1424 typedef 1425 #include "vmware_pack_begin.h" 1426 struct { 1427 uint64 realFrequency; 1428 uint32 disjoint; 1429 } 1430 #include "vmware_pack_end.h" 1431 SVGADXTimestampDisjointQueryResult; 1432 1433 typedef 1434 #include "vmware_pack_begin.h" 1435 struct { 1436 uint64 inputAssemblyVertices; 1437 uint64 inputAssemblyPrimitives; 1438 uint64 vertexShaderInvocations; 1439 uint64 geometryShaderInvocations; 1440 uint64 geometryShaderPrimitives; 1441 uint64 clipperInvocations; 1442 uint64 clipperPrimitives; 1443 uint64 pixelShaderInvocations; 1444 uint64 hullShaderInvocations; 1445 uint64 domainShaderInvocations; 1446 uint64 computeShaderInvocations; 1447 } 1448 #include "vmware_pack_end.h" 1449 SVGADXPipelineStatisticsQueryResult; 1450 1451 typedef 1452 #include "vmware_pack_begin.h" 1453 struct { 1454 uint32 anySamplesRendered; 1455 } 1456 #include "vmware_pack_end.h" 1457 SVGADXOcclusionPredicateQueryResult; 1458 1459 typedef 1460 #include "vmware_pack_begin.h" 1461 struct { 1462 uint64 numPrimitivesWritten; 1463 uint64 numPrimitivesRequired; 1464 } 1465 #include "vmware_pack_end.h" 1466 SVGADXStreamOutStatisticsQueryResult; 1467 1468 typedef 1469 #include "vmware_pack_begin.h" 1470 struct { 1471 uint32 overflowed; 1472 } 1473 #include "vmware_pack_end.h" 1474 SVGADXStreamOutPredicateQueryResult; 1475 1476 typedef 1477 #include "vmware_pack_begin.h" 1478 struct { 1479 uint64 samplesRendered; 1480 } 1481 #include "vmware_pack_end.h" 1482 SVGADXOcclusion64QueryResult; 1483 1484 /* 1485 * SVGADXQueryResultUnion is not intended for use in the protocol, but is 1486 * very helpful when working with queries generically. 1487 */ 1488 typedef 1489 #include "vmware_pack_begin.h" 1490 union SVGADXQueryResultUnion { 1491 SVGADXOcclusionQueryResult occ; 1492 SVGADXEventQueryResult event; 1493 SVGADXTimestampQueryResult ts; 1494 SVGADXTimestampDisjointQueryResult tsDisjoint; 1495 SVGADXPipelineStatisticsQueryResult pipelineStats; 1496 SVGADXOcclusionPredicateQueryResult occPred; 1497 SVGADXStreamOutStatisticsQueryResult soStats; 1498 SVGADXStreamOutPredicateQueryResult soPred; 1499 SVGADXOcclusion64QueryResult occ64; 1500 } 1501 #include "vmware_pack_end.h" 1502 SVGADXQueryResultUnion; 1503 1504 1505 typedef enum { 1506 SVGA3D_QUERYSTATE_PENDING = 0, /* Query is not finished yet */ 1507 SVGA3D_QUERYSTATE_SUCCEEDED = 1, /* Completed successfully */ 1508 SVGA3D_QUERYSTATE_FAILED = 2, /* Completed unsuccessfully */ 1509 SVGA3D_QUERYSTATE_NEW = 3, /* Never submitted (guest only) */ 1510 } SVGA3dQueryState; 1511 1512 typedef enum { 1513 SVGA3D_WRITE_HOST_VRAM = 1, 1514 SVGA3D_READ_HOST_VRAM = 2, 1515 } SVGA3dTransferType; 1516 1517 typedef enum { 1518 SVGA3D_LOGICOP_INVALID = 0, 1519 SVGA3D_LOGICOP_MIN = 1, 1520 SVGA3D_LOGICOP_COPY = 1, 1521 SVGA3D_LOGICOP_NOT = 2, 1522 SVGA3D_LOGICOP_AND = 3, 1523 SVGA3D_LOGICOP_OR = 4, 1524 SVGA3D_LOGICOP_XOR = 5, 1525 SVGA3D_LOGICOP_NXOR = 6, 1526 SVGA3D_LOGICOP_ROP3MIN = 30, /* 7-29 are reserved for future logic ops. */ 1527 SVGA3D_LOGICOP_ROP3MAX = (SVGA3D_LOGICOP_ROP3MIN + 255), 1528 SVGA3D_LOGICOP_MAX = (SVGA3D_LOGICOP_ROP3MAX + 1), 1529 } SVGA3dLogicOp; 1530 1531 typedef 1532 #include "vmware_pack_begin.h" 1533 struct { 1534 union { 1535 struct { 1536 uint16 function; /* SVGA3dFogFunction */ 1537 uint8 type; /* SVGA3dFogType */ 1538 uint8 base; /* SVGA3dFogBase */ 1539 }; 1540 uint32 uintValue; 1541 }; 1542 } 1543 #include "vmware_pack_end.h" 1544 SVGA3dFogMode; 1545 1546 /* 1547 * Uniquely identify one image (a 1D/2D/3D array) from a surface. This 1548 * is a surface ID as well as face/mipmap indices. 1549 */ 1550 1551 typedef 1552 #include "vmware_pack_begin.h" 1553 struct SVGA3dSurfaceImageId { 1554 uint32 sid; 1555 uint32 face; 1556 uint32 mipmap; 1557 } 1558 #include "vmware_pack_end.h" 1559 SVGA3dSurfaceImageId; 1560 1561 typedef 1562 #include "vmware_pack_begin.h" 1563 struct { 1564 uint32 width; 1565 uint32 height; 1566 uint32 depth; 1567 } 1568 #include "vmware_pack_end.h" 1569 SVGA3dSize; 1570 1571 /* 1572 * Guest-backed objects definitions. 1573 */ 1574 typedef enum { 1575 SVGA_OTABLE_MOB = 0, 1576 SVGA_OTABLE_MIN = 0, 1577 SVGA_OTABLE_SURFACE = 1, 1578 SVGA_OTABLE_CONTEXT = 2, 1579 SVGA_OTABLE_SHADER = 3, 1580 SVGA_OTABLE_SCREENTARGET = 4, 1581 1582 SVGA_OTABLE_DX9_MAX = 5, 1583 1584 SVGA_OTABLE_DXCONTEXT = 5, 1585 SVGA_OTABLE_MAX = 6 1586 } SVGAOTableType; 1587 1588 /* 1589 * Deprecated. 1590 */ 1591 #define SVGA_OTABLE_COUNT 4 1592 1593 typedef enum { 1594 SVGA_COTABLE_MIN = 0, 1595 SVGA_COTABLE_RTVIEW = 0, 1596 SVGA_COTABLE_DSVIEW = 1, 1597 SVGA_COTABLE_SRVIEW = 2, 1598 SVGA_COTABLE_ELEMENTLAYOUT = 3, 1599 SVGA_COTABLE_BLENDSTATE = 4, 1600 SVGA_COTABLE_DEPTHSTENCIL = 5, 1601 SVGA_COTABLE_RASTERIZERSTATE = 6, 1602 SVGA_COTABLE_SAMPLER = 7, 1603 SVGA_COTABLE_STREAMOUTPUT = 8, 1604 SVGA_COTABLE_DXQUERY = 9, 1605 SVGA_COTABLE_DXSHADER = 10, 1606 SVGA_COTABLE_DX10_MAX = 11, 1607 SVGA_COTABLE_UAVIEW = 11, 1608 SVGA_COTABLE_MAX 1609 } SVGACOTableType; 1610 1611 /* 1612 * The largest size (number of entries) allowed in a COTable. 1613 */ 1614 #define SVGA_COTABLE_MAX_IDS (MAX_UINT16 - 2) 1615 1616 typedef enum SVGAMobFormat { 1617 SVGA3D_MOBFMT_INVALID = SVGA3D_INVALID_ID, 1618 SVGA3D_MOBFMT_PTDEPTH_0 = 0, 1619 SVGA3D_MOBFMT_MIN = 0, 1620 SVGA3D_MOBFMT_PTDEPTH_1 = 1, 1621 SVGA3D_MOBFMT_PTDEPTH_2 = 2, 1622 SVGA3D_MOBFMT_RANGE = 3, 1623 SVGA3D_MOBFMT_PTDEPTH64_0 = 4, 1624 SVGA3D_MOBFMT_PTDEPTH64_1 = 5, 1625 SVGA3D_MOBFMT_PTDEPTH64_2 = 6, 1626 SVGA3D_MOBFMT_PREDX_MAX = 7, 1627 SVGA3D_MOBFMT_EMPTY = 7, 1628 SVGA3D_MOBFMT_MAX, 1629 } SVGAMobFormat; 1630 1631 #define SVGA3D_MOB_EMPTY_BASE 1 1632 1633 #endif /* _SVGA3D_TYPES_H_ */ 1634