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