.. | .. |
---|
1 | 1 | /* SPDX-License-Identifier: GPL-2.0 OR MIT */ |
---|
2 | 2 | /********************************************************** |
---|
3 | | - * Copyright 2012-2015 VMware, Inc. |
---|
| 3 | + * Copyright 2012-2019 VMware, Inc. |
---|
4 | 4 | * |
---|
5 | 5 | * Permission is hereby granted, free of charge, to any person |
---|
6 | 6 | * obtaining a copy of this software and associated documentation |
---|
.. | .. |
---|
118 | 118 | #define SVGA3D_DX_MAX_SRVIEWS 128 |
---|
119 | 119 | #define SVGA3D_DX_MAX_CONSTBUFFERS 16 |
---|
120 | 120 | #define SVGA3D_DX_MAX_SAMPLERS 16 |
---|
| 121 | +#define SVGA3D_DX_MAX_CLASS_INSTANCES 253 |
---|
121 | 122 | |
---|
122 | 123 | #define SVGA3D_DX_MAX_CONSTBUF_BINDING_SIZE (4096 * 4 * (uint32)sizeof(uint32)) |
---|
123 | 124 | |
---|
124 | 125 | typedef uint32 SVGA3dShaderResourceViewId; |
---|
125 | 126 | typedef uint32 SVGA3dRenderTargetViewId; |
---|
126 | 127 | typedef uint32 SVGA3dDepthStencilViewId; |
---|
| 128 | +typedef uint32 SVGA3dUAViewId; |
---|
127 | 129 | |
---|
128 | 130 | typedef uint32 SVGA3dShaderId; |
---|
129 | 131 | typedef uint32 SVGA3dElementLayoutId; |
---|
.. | .. |
---|
144 | 146 | |
---|
145 | 147 | float value[4]; |
---|
146 | 148 | } SVGA3dRGBAFloat; |
---|
| 149 | + |
---|
| 150 | +typedef union { |
---|
| 151 | + struct { |
---|
| 152 | + uint32 r; |
---|
| 153 | + uint32 g; |
---|
| 154 | + uint32 b; |
---|
| 155 | + uint32 a; |
---|
| 156 | + }; |
---|
| 157 | + |
---|
| 158 | + uint32 value[4]; |
---|
| 159 | +} SVGA3dRGBAUint32; |
---|
147 | 160 | |
---|
148 | 161 | typedef |
---|
149 | 162 | #include "vmware_pack_begin.h" |
---|
.. | .. |
---|
249 | 262 | #include "vmware_pack_end.h" |
---|
250 | 263 | SVGA3dCmdDXSetShader; /* SVGA_3D_CMD_DX_SET_SHADER */ |
---|
251 | 264 | |
---|
| 265 | +typedef union { |
---|
| 266 | + struct { |
---|
| 267 | + uint32 cbOffset : 12; |
---|
| 268 | + uint32 cbId : 4; |
---|
| 269 | + uint32 baseSamp : 4; |
---|
| 270 | + uint32 baseTex : 7; |
---|
| 271 | + uint32 reserved : 5; |
---|
| 272 | + }; |
---|
| 273 | + uint32 value; |
---|
| 274 | +} SVGA3dIfaceData; |
---|
| 275 | + |
---|
| 276 | +typedef |
---|
| 277 | +#include "vmware_pack_begin.h" |
---|
| 278 | +struct SVGA3dCmdDXSetShaderIface { |
---|
| 279 | + SVGA3dShaderType type; |
---|
| 280 | + uint32 numClassInstances; |
---|
| 281 | + uint32 index; |
---|
| 282 | + uint32 iface; |
---|
| 283 | + SVGA3dIfaceData data; |
---|
| 284 | +} |
---|
| 285 | +#include "vmware_pack_end.h" |
---|
| 286 | +SVGA3dCmdDXSetShaderIface; /* SVGA_3D_CMD_DX_SET_SHADER_IFACE */ |
---|
| 287 | + |
---|
| 288 | +typedef |
---|
| 289 | +#include "vmware_pack_begin.h" |
---|
| 290 | +struct SVGA3dCmdDXBindShaderIface { |
---|
| 291 | + uint32 cid; |
---|
| 292 | + SVGAMobId mobid; |
---|
| 293 | + uint32 offsetInBytes; |
---|
| 294 | +} |
---|
| 295 | +#include "vmware_pack_end.h" |
---|
| 296 | +SVGA3dCmdDXBindShaderIface; /* SVGA_3D_CMD_DX_BIND_SHADER_IFACE */ |
---|
| 297 | + |
---|
252 | 298 | typedef |
---|
253 | 299 | #include "vmware_pack_begin.h" |
---|
254 | 300 | struct SVGA3dCmdDXSetSamplers { |
---|
.. | .. |
---|
306 | 352 | |
---|
307 | 353 | typedef |
---|
308 | 354 | #include "vmware_pack_begin.h" |
---|
| 355 | +struct SVGA3dCmdDXDrawIndexedInstancedIndirect { |
---|
| 356 | + SVGA3dSurfaceId argsBufferSid; |
---|
| 357 | + uint32 byteOffsetForArgs; |
---|
| 358 | +} |
---|
| 359 | +#include "vmware_pack_end.h" |
---|
| 360 | +SVGA3dCmdDXDrawIndexedInstancedIndirect; |
---|
| 361 | +/* SVGA_3D_CMD_DX_DRAW_INDEXED_INSTANCED_INDIRECT */ |
---|
| 362 | + |
---|
| 363 | +typedef |
---|
| 364 | +#include "vmware_pack_begin.h" |
---|
| 365 | +struct SVGA3dCmdDXDrawInstancedIndirect { |
---|
| 366 | + SVGA3dSurfaceId argsBufferSid; |
---|
| 367 | + uint32 byteOffsetForArgs; |
---|
| 368 | +} |
---|
| 369 | +#include "vmware_pack_end.h" |
---|
| 370 | +SVGA3dCmdDXDrawInstancedIndirect; |
---|
| 371 | +/* SVGA_3D_CMD_DX_DRAW_INSTANCED_INDIRECT */ |
---|
| 372 | + |
---|
| 373 | +typedef |
---|
| 374 | +#include "vmware_pack_begin.h" |
---|
309 | 375 | struct SVGA3dCmdDXDrawAuto { |
---|
310 | 376 | uint32 pad0; |
---|
311 | 377 | } |
---|
312 | 378 | #include "vmware_pack_end.h" |
---|
313 | 379 | SVGA3dCmdDXDrawAuto; /* SVGA_3D_CMD_DX_DRAW_AUTO */ |
---|
| 380 | + |
---|
| 381 | +typedef |
---|
| 382 | +#include "vmware_pack_begin.h" |
---|
| 383 | +struct SVGA3dCmdDXDispatch { |
---|
| 384 | + uint32 threadGroupCountX; |
---|
| 385 | + uint32 threadGroupCountY; |
---|
| 386 | + uint32 threadGroupCountZ; |
---|
| 387 | +} |
---|
| 388 | +#include "vmware_pack_end.h" |
---|
| 389 | +SVGA3dCmdDXDispatch; |
---|
| 390 | +/* SVGA_3D_CMD_DX_DISPATCH */ |
---|
| 391 | + |
---|
| 392 | +typedef |
---|
| 393 | +#include "vmware_pack_begin.h" |
---|
| 394 | +struct SVGA3dCmdDXDispatchIndirect { |
---|
| 395 | + SVGA3dSurfaceId argsBufferSid; |
---|
| 396 | + uint32 byteOffsetForArgs; |
---|
| 397 | +} |
---|
| 398 | +#include "vmware_pack_end.h" |
---|
| 399 | +SVGA3dCmdDXDispatchIndirect; |
---|
| 400 | +/* SVGA_3D_CMD_DX_DISPATCH_INDIRECT */ |
---|
314 | 401 | |
---|
315 | 402 | typedef |
---|
316 | 403 | #include "vmware_pack_begin.h" |
---|
.. | .. |
---|
525 | 612 | uint32 offset; /* Starting offset */ |
---|
526 | 613 | uint32 intOffset; /* Internal offset */ |
---|
527 | 614 | uint32 vertexCount; /* vertices written */ |
---|
528 | | - uint32 sizeInBytes; /* max bytes to write */ |
---|
| 615 | + uint32 dead; |
---|
529 | 616 | } |
---|
530 | 617 | #include "vmware_pack_end.h" |
---|
531 | 618 | SVGA3dDXSOState; |
---|
.. | .. |
---|
786 | 873 | SVGA3dCmdDXTransferFromBuffer; /* SVGA_3D_CMD_DX_TRANSFER_FROM_BUFFER */ |
---|
787 | 874 | |
---|
788 | 875 | |
---|
| 876 | +#define SVGA3D_TRANSFER_TO_BUFFER_READBACK (1 << 0) |
---|
| 877 | +#define SVGA3D_TRANSFER_TO_BUFFER_FLAGS_MASK (1 << 0) |
---|
| 878 | +typedef uint32 SVGA3dTransferToBufferFlags; |
---|
| 879 | + |
---|
| 880 | +/* |
---|
| 881 | + * Raw byte wise transfer to a buffer surface from another surface |
---|
| 882 | + * of the requested box. Supported if SVGA_CAP_DX2 is set. This |
---|
| 883 | + * command does not take a context. |
---|
| 884 | + */ |
---|
| 885 | +typedef |
---|
| 886 | +#include "vmware_pack_begin.h" |
---|
| 887 | +struct SVGA3dCmdDXTransferToBuffer { |
---|
| 888 | + SVGA3dSurfaceId srcSid; |
---|
| 889 | + uint32 srcSubResource; |
---|
| 890 | + SVGA3dBox srcBox; |
---|
| 891 | + SVGA3dSurfaceId destSid; |
---|
| 892 | + uint32 destOffset; |
---|
| 893 | + uint32 destPitch; |
---|
| 894 | + uint32 destSlicePitch; |
---|
| 895 | + SVGA3dTransferToBufferFlags flags; |
---|
| 896 | +} |
---|
| 897 | +#include "vmware_pack_end.h" |
---|
| 898 | +SVGA3dCmdDXTransferToBuffer; /* SVGA_3D_CMD_DX_TRANSFER_TO_BUFFER */ |
---|
| 899 | + |
---|
| 900 | + |
---|
789 | 901 | /* |
---|
790 | 902 | * Raw byte wise transfer from a buffer surface into another surface |
---|
791 | 903 | * of the requested box. Supported if SVGA3D_DEVCAP_DXCONTEXT is set. |
---|
.. | .. |
---|
905 | 1017 | typedef SVGA3dCmdDXSetConstantBufferOffset SVGA3dCmdDXSetGSConstantBufferOffset; |
---|
906 | 1018 | /* SVGA_3D_CMD_DX_SET_GS_CONSTANT_BUFFER_OFFSET */ |
---|
907 | 1019 | |
---|
| 1020 | +typedef SVGA3dCmdDXSetConstantBufferOffset SVGA3dCmdDXSetHSConstantBufferOffset; |
---|
| 1021 | +/* SVGA_3D_CMD_DX_SET_HS_CONSTANT_BUFFER_OFFSET */ |
---|
| 1022 | + |
---|
| 1023 | +typedef SVGA3dCmdDXSetConstantBufferOffset SVGA3dCmdDXSetDSConstantBufferOffset; |
---|
| 1024 | +/* SVGA_3D_CMD_DX_SET_DS_CONSTANT_BUFFER_OFFSET */ |
---|
| 1025 | + |
---|
| 1026 | +typedef SVGA3dCmdDXSetConstantBufferOffset SVGA3dCmdDXSetCSConstantBufferOffset; |
---|
| 1027 | +/* SVGA_3D_CMD_DX_SET_CS_CONSTANT_BUFFER_OFFSET */ |
---|
| 1028 | + |
---|
| 1029 | + |
---|
| 1030 | +#define SVGA3D_BUFFEREX_SRV_RAW (1 << 0) |
---|
| 1031 | +#define SVGA3D_BUFFEREX_SRV_FLAGS_MAX (1 << 1) |
---|
| 1032 | +#define SVGA3D_BUFFEREX_SRV_FLAGS_MASK (SVGA3D_BUFFEREX_SRV_FLAGS_MAX - 1) |
---|
| 1033 | +typedef uint32 SVGA3dBufferExFlags; |
---|
908 | 1034 | |
---|
909 | 1035 | typedef |
---|
910 | 1036 | #include "vmware_pack_begin.h" |
---|
.. | .. |
---|
925 | 1051 | struct { |
---|
926 | 1052 | uint32 firstElement; |
---|
927 | 1053 | uint32 numElements; |
---|
928 | | - uint32 flags; |
---|
| 1054 | + SVGA3dBufferExFlags flags; |
---|
929 | 1055 | uint32 pad0; |
---|
930 | 1056 | } bufferex; |
---|
931 | 1057 | }; |
---|
.. | .. |
---|
1072 | 1198 | SVGA3dCmdDXDefineDepthStencilView; |
---|
1073 | 1199 | /* SVGA_3D_CMD_DX_DEFINE_DEPTHSTENCIL_VIEW */ |
---|
1074 | 1200 | |
---|
| 1201 | +/* |
---|
| 1202 | + * Version 2 needed in order to start validating and using the flags |
---|
| 1203 | + * field. Unfortunately the device wasn't validating or using the |
---|
| 1204 | + * flags field and the driver wasn't initializing it in shipped code, |
---|
| 1205 | + * so a new version of the command is needed to allow that code to |
---|
| 1206 | + * continue to work. |
---|
| 1207 | + */ |
---|
| 1208 | +typedef |
---|
| 1209 | +#include "vmware_pack_begin.h" |
---|
| 1210 | +struct SVGA3dCmdDXDefineDepthStencilView_v2 { |
---|
| 1211 | + SVGA3dDepthStencilViewId depthStencilViewId; |
---|
| 1212 | + |
---|
| 1213 | + SVGA3dSurfaceId sid; |
---|
| 1214 | + SVGA3dSurfaceFormat format; |
---|
| 1215 | + SVGA3dResourceType resourceDimension; |
---|
| 1216 | + uint32 mipSlice; |
---|
| 1217 | + uint32 firstArraySlice; |
---|
| 1218 | + uint32 arraySize; |
---|
| 1219 | + SVGA3DCreateDSViewFlags flags; |
---|
| 1220 | + uint8 pad0; |
---|
| 1221 | + uint16 pad1; |
---|
| 1222 | +} |
---|
| 1223 | +#include "vmware_pack_end.h" |
---|
| 1224 | +SVGA3dCmdDXDefineDepthStencilView_v2; |
---|
| 1225 | +/* SVGA_3D_CMD_DX_DEFINE_DEPTHSTENCIL_VIEW_V2 */ |
---|
| 1226 | + |
---|
1075 | 1227 | typedef |
---|
1076 | 1228 | #include "vmware_pack_begin.h" |
---|
1077 | 1229 | struct SVGA3dCmdDXDestroyDepthStencilView { |
---|
.. | .. |
---|
1080 | 1232 | #include "vmware_pack_end.h" |
---|
1081 | 1233 | SVGA3dCmdDXDestroyDepthStencilView; |
---|
1082 | 1234 | /* SVGA_3D_CMD_DX_DESTROY_DEPTHSTENCIL_VIEW */ |
---|
| 1235 | + |
---|
| 1236 | + |
---|
| 1237 | +#define SVGA3D_UABUFFER_RAW (1 << 0) |
---|
| 1238 | +#define SVGA3D_UABUFFER_APPEND (1 << 1) |
---|
| 1239 | +#define SVGA3D_UABUFFER_COUNTER (1 << 2) |
---|
| 1240 | +typedef uint32 SVGA3dUABufferFlags; |
---|
| 1241 | + |
---|
| 1242 | +typedef |
---|
| 1243 | +#include "vmware_pack_begin.h" |
---|
| 1244 | +struct { |
---|
| 1245 | + union { |
---|
| 1246 | + struct { |
---|
| 1247 | + uint32 firstElement; |
---|
| 1248 | + uint32 numElements; |
---|
| 1249 | + SVGA3dUABufferFlags flags; |
---|
| 1250 | + uint32 padding0; |
---|
| 1251 | + uint32 padding1; |
---|
| 1252 | + } buffer; |
---|
| 1253 | + struct { |
---|
| 1254 | + uint32 mipSlice; |
---|
| 1255 | + uint32 firstArraySlice; |
---|
| 1256 | + uint32 arraySize; |
---|
| 1257 | + uint32 padding0; |
---|
| 1258 | + uint32 padding1; |
---|
| 1259 | + } tex; /* 1d, 2d */ |
---|
| 1260 | + struct { |
---|
| 1261 | + uint32 mipSlice; |
---|
| 1262 | + uint32 firstW; |
---|
| 1263 | + uint32 wSize; |
---|
| 1264 | + uint32 padding0; |
---|
| 1265 | + uint32 padding1; |
---|
| 1266 | + } tex3D; |
---|
| 1267 | + }; |
---|
| 1268 | +} |
---|
| 1269 | +#include "vmware_pack_end.h" |
---|
| 1270 | +SVGA3dUAViewDesc; |
---|
| 1271 | + |
---|
| 1272 | +typedef |
---|
| 1273 | +#include "vmware_pack_begin.h" |
---|
| 1274 | +struct { |
---|
| 1275 | + SVGA3dSurfaceId sid; |
---|
| 1276 | + SVGA3dSurfaceFormat format; |
---|
| 1277 | + SVGA3dResourceType resourceDimension; |
---|
| 1278 | + SVGA3dUAViewDesc desc; |
---|
| 1279 | + uint32 structureCount; |
---|
| 1280 | + uint32 pad[7]; |
---|
| 1281 | +} |
---|
| 1282 | +#include "vmware_pack_end.h" |
---|
| 1283 | +SVGACOTableDXUAViewEntry; |
---|
| 1284 | + |
---|
| 1285 | +typedef |
---|
| 1286 | +#include "vmware_pack_begin.h" |
---|
| 1287 | +struct SVGA3dCmdDXDefineUAView { |
---|
| 1288 | + SVGA3dUAViewId uaViewId; |
---|
| 1289 | + |
---|
| 1290 | + SVGA3dSurfaceId sid; |
---|
| 1291 | + SVGA3dSurfaceFormat format; |
---|
| 1292 | + SVGA3dResourceType resourceDimension; |
---|
| 1293 | + |
---|
| 1294 | + SVGA3dUAViewDesc desc; |
---|
| 1295 | +} |
---|
| 1296 | +#include "vmware_pack_end.h" |
---|
| 1297 | +SVGA3dCmdDXDefineUAView; |
---|
| 1298 | +/* SVGA_3D_CMD_DX_DEFINE_UA_VIEW */ |
---|
| 1299 | + |
---|
| 1300 | +typedef |
---|
| 1301 | +#include "vmware_pack_begin.h" |
---|
| 1302 | +struct SVGA3dCmdDXDestroyUAView { |
---|
| 1303 | + SVGA3dUAViewId uaViewId; |
---|
| 1304 | +} |
---|
| 1305 | +#include "vmware_pack_end.h" |
---|
| 1306 | +SVGA3dCmdDXDestroyUAView; |
---|
| 1307 | +/* SVGA_3D_CMD_DX_DESTROY_UA_VIEW */ |
---|
| 1308 | + |
---|
| 1309 | +typedef |
---|
| 1310 | +#include "vmware_pack_begin.h" |
---|
| 1311 | +struct SVGA3dCmdDXClearUAViewUint { |
---|
| 1312 | + SVGA3dUAViewId uaViewId; |
---|
| 1313 | + SVGA3dRGBAUint32 value; |
---|
| 1314 | +} |
---|
| 1315 | +#include "vmware_pack_end.h" |
---|
| 1316 | +SVGA3dCmdDXClearUAViewUint; |
---|
| 1317 | +/* SVGA_3D_CMD_DX_CLEAR_UA_VIEW_UINT */ |
---|
| 1318 | + |
---|
| 1319 | +typedef |
---|
| 1320 | +#include "vmware_pack_begin.h" |
---|
| 1321 | +struct SVGA3dCmdDXClearUAViewFloat { |
---|
| 1322 | + SVGA3dUAViewId uaViewId; |
---|
| 1323 | + SVGA3dRGBAFloat value; |
---|
| 1324 | +} |
---|
| 1325 | +#include "vmware_pack_end.h" |
---|
| 1326 | +SVGA3dCmdDXClearUAViewFloat; |
---|
| 1327 | +/* SVGA_3D_CMD_DX_CLEAR_UA_VIEW_FLOAT */ |
---|
| 1328 | + |
---|
| 1329 | +typedef |
---|
| 1330 | +#include "vmware_pack_begin.h" |
---|
| 1331 | +struct SVGA3dCmdDXCopyStructureCount { |
---|
| 1332 | + SVGA3dUAViewId srcUAViewId; |
---|
| 1333 | + SVGA3dSurfaceId destSid; |
---|
| 1334 | + uint32 destByteOffset; |
---|
| 1335 | +} |
---|
| 1336 | +#include "vmware_pack_end.h" |
---|
| 1337 | +SVGA3dCmdDXCopyStructureCount; |
---|
| 1338 | +/* SVGA_3D_CMD_DX_COPY_STRUCTURE_COUNT */ |
---|
| 1339 | + |
---|
| 1340 | +typedef |
---|
| 1341 | +#include "vmware_pack_begin.h" |
---|
| 1342 | +struct SVGA3dCmdDXSetStructureCount { |
---|
| 1343 | + SVGA3dUAViewId uaViewId; |
---|
| 1344 | + uint32 structureCount; |
---|
| 1345 | +} |
---|
| 1346 | +#include "vmware_pack_end.h" |
---|
| 1347 | +SVGA3dCmdDXSetStructureCount; |
---|
| 1348 | +/* SVGA_3D_CMD_DX_SET_STRUCTURE_COUNT */ |
---|
| 1349 | + |
---|
| 1350 | +typedef |
---|
| 1351 | +#include "vmware_pack_begin.h" |
---|
| 1352 | +struct SVGA3dCmdDXSetUAViews { |
---|
| 1353 | + uint32 uavSpliceIndex; |
---|
| 1354 | + /* Followed by a variable number of SVGA3dUAViewId's. */ |
---|
| 1355 | +} |
---|
| 1356 | +#include "vmware_pack_end.h" |
---|
| 1357 | +SVGA3dCmdDXSetUAViews; /* SVGA_3D_CMD_DX_SET_UA_VIEWS */ |
---|
| 1358 | + |
---|
| 1359 | +typedef |
---|
| 1360 | +#include "vmware_pack_begin.h" |
---|
| 1361 | +struct SVGA3dCmdDXSetCSUAViews { |
---|
| 1362 | + uint32 startIndex; |
---|
| 1363 | + /* Followed by a variable number of SVGA3dUAViewId's. */ |
---|
| 1364 | +} |
---|
| 1365 | +#include "vmware_pack_end.h" |
---|
| 1366 | +SVGA3dCmdDXSetCSUAViews; /* SVGA_3D_CMD_DX_SET_CS_UA_VIEWS */ |
---|
1083 | 1367 | |
---|
1084 | 1368 | typedef |
---|
1085 | 1369 | #include "vmware_pack_begin.h" |
---|
.. | .. |
---|
1099 | 1383 | struct { |
---|
1100 | 1384 | uint32 elid; |
---|
1101 | 1385 | uint32 numDescs; |
---|
1102 | | - SVGA3dInputElementDesc desc[32]; |
---|
| 1386 | + SVGA3dInputElementDesc descs[32]; |
---|
1103 | 1387 | uint32 pad[62]; |
---|
1104 | 1388 | } |
---|
1105 | 1389 | #include "vmware_pack_end.h" |
---|
.. | .. |
---|
1261 | 1545 | uint8 lineStippleEnable; |
---|
1262 | 1546 | uint8 lineStippleFactor; |
---|
1263 | 1547 | uint16 lineStipplePattern; |
---|
1264 | | - uint32 forcedSampleCount; |
---|
| 1548 | + uint8 forcedSampleCount; |
---|
| 1549 | + uint8 mustBeZero[3]; |
---|
1265 | 1550 | } |
---|
1266 | 1551 | #include "vmware_pack_end.h" |
---|
1267 | 1552 | SVGACOTableDXRasterizerStateEntry; |
---|
.. | .. |
---|
1352 | 1637 | #include "vmware_pack_end.h" |
---|
1353 | 1638 | SVGA3dCmdDXDestroySamplerState; /* SVGA_3D_CMD_DX_DESTROY_SAMPLER_STATE */ |
---|
1354 | 1639 | |
---|
| 1640 | + |
---|
| 1641 | +#define SVGADX_SIGNATURE_SEMANTIC_NAME_UNDEFINED 0 |
---|
| 1642 | +#define SVGADX_SIGNATURE_SEMANTIC_NAME_POSITION 1 |
---|
| 1643 | +#define SVGADX_SIGNATURE_SEMANTIC_NAME_CLIP_DISTANCE 2 |
---|
| 1644 | +#define SVGADX_SIGNATURE_SEMANTIC_NAME_CULL_DISTANCE 3 |
---|
| 1645 | +#define SVGADX_SIGNATURE_SEMANTIC_NAME_RENDER_TARGET_ARRAY_INDEX 4 |
---|
| 1646 | +#define SVGADX_SIGNATURE_SEMANTIC_NAME_VIEWPORT_ARRAY_INDEX 5 |
---|
| 1647 | +#define SVGADX_SIGNATURE_SEMANTIC_NAME_VERTEX_ID 6 |
---|
| 1648 | +#define SVGADX_SIGNATURE_SEMANTIC_NAME_PRIMITIVE_ID 7 |
---|
| 1649 | +#define SVGADX_SIGNATURE_SEMANTIC_NAME_INSTANCE_ID 8 |
---|
| 1650 | +#define SVGADX_SIGNATURE_SEMANTIC_NAME_IS_FRONT_FACE 9 |
---|
| 1651 | +#define SVGADX_SIGNATURE_SEMANTIC_NAME_SAMPLE_INDEX 10 |
---|
| 1652 | +#define SVGADX_SIGNATURE_SEMANTIC_NAME_FINAL_QUAD_U_EQ_0_EDGE_TESSFACTOR 11 |
---|
| 1653 | +#define SVGADX_SIGNATURE_SEMANTIC_NAME_FINAL_QUAD_V_EQ_0_EDGE_TESSFACTOR 12 |
---|
| 1654 | +#define SVGADX_SIGNATURE_SEMANTIC_NAME_FINAL_QUAD_U_EQ_1_EDGE_TESSFACTOR 13 |
---|
| 1655 | +#define SVGADX_SIGNATURE_SEMANTIC_NAME_FINAL_QUAD_V_EQ_1_EDGE_TESSFACTOR 14 |
---|
| 1656 | +#define SVGADX_SIGNATURE_SEMANTIC_NAME_FINAL_QUAD_U_INSIDE_TESSFACTOR 15 |
---|
| 1657 | +#define SVGADX_SIGNATURE_SEMANTIC_NAME_FINAL_QUAD_V_INSIDE_TESSFACTOR 16 |
---|
| 1658 | +#define SVGADX_SIGNATURE_SEMANTIC_NAME_FINAL_TRI_U_EQ_0_EDGE_TESSFACTOR 17 |
---|
| 1659 | +#define SVGADX_SIGNATURE_SEMANTIC_NAME_FINAL_TRI_V_EQ_0_EDGE_TESSFACTOR 18 |
---|
| 1660 | +#define SVGADX_SIGNATURE_SEMANTIC_NAME_FINAL_TRI_W_EQ_0_EDGE_TESSFACTOR 19 |
---|
| 1661 | +#define SVGADX_SIGNATURE_SEMANTIC_NAME_FINAL_TRI_INSIDE_TESSFACTOR 20 |
---|
| 1662 | +#define SVGADX_SIGNATURE_SEMANTIC_NAME_FINAL_LINE_DETAIL_TESSFACTOR 21 |
---|
| 1663 | +#define SVGADX_SIGNATURE_SEMANTIC_NAME_FINAL_LINE_DENSITY_TESSFACTOR 22 |
---|
| 1664 | +#define SVGADX_SIGNATURE_SEMANTIC_NAME_MAX 23 |
---|
| 1665 | +typedef uint32 SVGA3dDXSignatureSemanticName; |
---|
| 1666 | + |
---|
| 1667 | +#define SVGADX_SIGNATURE_REGISTER_COMPONENT_UNKNOWN 0 |
---|
| 1668 | +typedef uint32 SVGA3dDXSignatureRegisterComponentType; |
---|
| 1669 | + |
---|
| 1670 | +#define SVGADX_SIGNATURE_MIN_PRECISION_DEFAULT 0 |
---|
| 1671 | +typedef uint32 SVGA3dDXSignatureMinPrecision; |
---|
| 1672 | + |
---|
| 1673 | +typedef |
---|
| 1674 | +#include "vmware_pack_begin.h" |
---|
| 1675 | +struct SVGA3dDXSignatureEntry { |
---|
| 1676 | + uint32 registerIndex; |
---|
| 1677 | + SVGA3dDXSignatureSemanticName semanticName; |
---|
| 1678 | + uint32 mask; /* Lower 4 bits represent X, Y, Z, W channels */ |
---|
| 1679 | + SVGA3dDXSignatureRegisterComponentType componentType; |
---|
| 1680 | + SVGA3dDXSignatureMinPrecision minPrecision; |
---|
| 1681 | +} |
---|
| 1682 | +#include "vmware_pack_end.h" |
---|
| 1683 | +SVGA3dDXShaderSignatureEntry; |
---|
| 1684 | + |
---|
| 1685 | +#define SVGADX_SIGNATURE_HEADER_VERSION_0 0x08a92d12 |
---|
| 1686 | + |
---|
| 1687 | +/* |
---|
| 1688 | + * The SVGA3dDXSignatureHeader structure is added after the shader |
---|
| 1689 | + * body in the mob that is bound to the shader. It is followed by the |
---|
| 1690 | + * specified number of SVGA3dDXSignatureEntry structures for each of |
---|
| 1691 | + * the three types of signatures in the order (input, output, patch |
---|
| 1692 | + * constants). |
---|
| 1693 | + */ |
---|
| 1694 | +typedef |
---|
| 1695 | +#include "vmware_pack_begin.h" |
---|
| 1696 | +struct SVGA3dDXSignatureHeader { |
---|
| 1697 | + uint32 headerVersion; |
---|
| 1698 | + uint32 numInputSignatures; |
---|
| 1699 | + uint32 numOutputSignatures; |
---|
| 1700 | + uint32 numPatchConstantSignatures; |
---|
| 1701 | +} |
---|
| 1702 | +#include "vmware_pack_end.h" |
---|
| 1703 | +SVGA3dDXShaderSignatureHeader; |
---|
| 1704 | + |
---|
1355 | 1705 | typedef |
---|
1356 | 1706 | #include "vmware_pack_begin.h" |
---|
1357 | 1707 | struct SVGA3dCmdDXDefineShader { |
---|
.. | .. |
---|
1415 | 1765 | /* |
---|
1416 | 1766 | * The maximum number of streamout decl's in each streamout entry. |
---|
1417 | 1767 | */ |
---|
1418 | | -#define SVGA3D_MAX_STREAMOUT_DECLS 64 |
---|
| 1768 | +#define SVGA3D_MAX_DX10_STREAMOUT_DECLS 64 |
---|
| 1769 | +#define SVGA3D_MAX_STREAMOUT_DECLS 512 |
---|
1419 | 1770 | |
---|
1420 | 1771 | typedef |
---|
1421 | 1772 | #include "vmware_pack_begin.h" |
---|
.. | .. |
---|
1434 | 1785 | #include "vmware_pack_begin.h" |
---|
1435 | 1786 | struct SVGAOTableStreamOutputEntry { |
---|
1436 | 1787 | uint32 numOutputStreamEntries; |
---|
1437 | | - SVGA3dStreamOutputDeclarationEntry decl[SVGA3D_MAX_STREAMOUT_DECLS]; |
---|
| 1788 | + SVGA3dStreamOutputDeclarationEntry decl[SVGA3D_MAX_DX10_STREAMOUT_DECLS]; |
---|
1438 | 1789 | uint32 streamOutputStrideInBytes[SVGA3D_DX_MAX_SOTARGETS]; |
---|
1439 | 1790 | uint32 rasterizedStream; |
---|
1440 | | - uint32 pad[250]; |
---|
| 1791 | + uint32 numOutputStreamStrides; |
---|
| 1792 | + uint32 mobid; |
---|
| 1793 | + uint32 offsetInBytes; |
---|
| 1794 | + uint8 usesMob; |
---|
| 1795 | + uint8 pad0; |
---|
| 1796 | + uint16 pad1; |
---|
| 1797 | + uint32 pad2[246]; |
---|
1441 | 1798 | } |
---|
1442 | 1799 | #include "vmware_pack_end.h" |
---|
1443 | 1800 | SVGACOTableDXStreamOutputEntry; |
---|
.. | .. |
---|
1447 | 1804 | struct SVGA3dCmdDXDefineStreamOutput { |
---|
1448 | 1805 | SVGA3dStreamOutputId soid; |
---|
1449 | 1806 | uint32 numOutputStreamEntries; |
---|
1450 | | - SVGA3dStreamOutputDeclarationEntry decl[SVGA3D_MAX_STREAMOUT_DECLS]; |
---|
| 1807 | + SVGA3dStreamOutputDeclarationEntry decl[SVGA3D_MAX_DX10_STREAMOUT_DECLS]; |
---|
1451 | 1808 | uint32 streamOutputStrideInBytes[SVGA3D_DX_MAX_SOTARGETS]; |
---|
1452 | 1809 | uint32 rasterizedStream; |
---|
1453 | 1810 | } |
---|
1454 | 1811 | #include "vmware_pack_end.h" |
---|
1455 | 1812 | SVGA3dCmdDXDefineStreamOutput; /* SVGA_3D_CMD_DX_DEFINE_STREAMOUTPUT */ |
---|
| 1813 | + |
---|
| 1814 | +/* |
---|
| 1815 | + * Version 2 needed in order to start validating and using the |
---|
| 1816 | + * rasterizedStream field. Unfortunately the device wasn't validating |
---|
| 1817 | + * or using this field and the driver wasn't initializing it in shipped |
---|
| 1818 | + * code, so a new version of the command is needed to allow that code |
---|
| 1819 | + * to continue to work. Also added new numOutputStreamStrides field. |
---|
| 1820 | + */ |
---|
| 1821 | + |
---|
| 1822 | +#define SVGA3D_DX_SO_NO_RASTERIZED_STREAM 0xFFFFFFFF |
---|
| 1823 | + |
---|
| 1824 | +typedef |
---|
| 1825 | +#include "vmware_pack_begin.h" |
---|
| 1826 | +struct SVGA3dCmdDXDefineStreamOutputWithMob { |
---|
| 1827 | + SVGA3dStreamOutputId soid; |
---|
| 1828 | + uint32 numOutputStreamEntries; |
---|
| 1829 | + uint32 numOutputStreamStrides; |
---|
| 1830 | + uint32 streamOutputStrideInBytes[SVGA3D_DX_MAX_SOTARGETS]; |
---|
| 1831 | + uint32 rasterizedStream; |
---|
| 1832 | +} |
---|
| 1833 | +#include "vmware_pack_end.h" |
---|
| 1834 | +SVGA3dCmdDXDefineStreamOutputWithMob; |
---|
| 1835 | +/* SVGA_3D_CMD_DX_DEFINE_STREAMOUTPUT_WITH_MOB */ |
---|
| 1836 | + |
---|
| 1837 | +typedef |
---|
| 1838 | +#include "vmware_pack_begin.h" |
---|
| 1839 | +struct SVGA3dCmdDXBindStreamOutput { |
---|
| 1840 | + SVGA3dStreamOutputId soid; |
---|
| 1841 | + uint32 mobid; |
---|
| 1842 | + uint32 offsetInBytes; |
---|
| 1843 | + uint32 sizeInBytes; |
---|
| 1844 | +} |
---|
| 1845 | +#include "vmware_pack_end.h" |
---|
| 1846 | +SVGA3dCmdDXBindStreamOutput; /* SVGA_3D_CMD_DX_BIND_STREAMOUTPUT */ |
---|
1456 | 1847 | |
---|
1457 | 1848 | typedef |
---|
1458 | 1849 | #include "vmware_pack_begin.h" |
---|
.. | .. |
---|
1469 | 1860 | } |
---|
1470 | 1861 | #include "vmware_pack_end.h" |
---|
1471 | 1862 | SVGA3dCmdDXSetStreamOutput; /* SVGA_3D_CMD_DX_SET_STREAMOUTPUT */ |
---|
| 1863 | + |
---|
| 1864 | +typedef |
---|
| 1865 | +#include "vmware_pack_begin.h" |
---|
| 1866 | +struct SVGA3dCmdDXSetMinLOD { |
---|
| 1867 | + SVGA3dSurfaceId sid; |
---|
| 1868 | + float minLOD; |
---|
| 1869 | +} |
---|
| 1870 | +#include "vmware_pack_end.h" |
---|
| 1871 | +SVGA3dCmdDXSetMinLOD; /* SVGA_3D_CMD_DX_SET_MIN_LOD */ |
---|
1472 | 1872 | |
---|
1473 | 1873 | typedef |
---|
1474 | 1874 | #include "vmware_pack_begin.h" |
---|
.. | .. |
---|
1581 | 1981 | uint32 rasterizerStateId; |
---|
1582 | 1982 | uint32 depthStencilViewId; |
---|
1583 | 1983 | uint32 renderTargetViewIds[SVGA3D_MAX_SIMULTANEOUS_RENDER_TARGETS]; |
---|
1584 | | - uint32 unorderedAccessViewIds[SVGA3D_MAX_UAVIEWS]; |
---|
1585 | 1984 | } renderState; |
---|
| 1985 | + |
---|
| 1986 | + uint32 pad0[8]; |
---|
1586 | 1987 | |
---|
1587 | 1988 | struct { |
---|
1588 | 1989 | uint32 targets[SVGA3D_DX_MAX_SOTARGETS]; |
---|
1589 | 1990 | uint32 soid; |
---|
1590 | 1991 | } streamOut; |
---|
1591 | | - uint32 pad0[11]; |
---|
| 1992 | + |
---|
| 1993 | + uint32 pad1[10]; |
---|
| 1994 | + |
---|
| 1995 | + uint32 uavSpliceIndex; |
---|
1592 | 1996 | |
---|
1593 | 1997 | uint8 numViewports; |
---|
1594 | 1998 | uint8 numScissorRects; |
---|
1595 | | - uint16 pad1[1]; |
---|
| 1999 | + uint16 pad2[1]; |
---|
1596 | 2000 | |
---|
1597 | | - uint32 pad2[3]; |
---|
| 2001 | + uint32 pad3[3]; |
---|
1598 | 2002 | |
---|
1599 | 2003 | SVGA3dViewport viewports[SVGA3D_DX_MAX_VIEWPORTS]; |
---|
1600 | | - uint32 pad3[32]; |
---|
| 2004 | + uint32 pad4[32]; |
---|
1601 | 2005 | |
---|
1602 | 2006 | SVGASignedRect scissorRects[SVGA3D_DX_MAX_SCISSORRECTS]; |
---|
1603 | | - uint32 pad4[64]; |
---|
| 2007 | + uint32 pad5[64]; |
---|
1604 | 2008 | |
---|
1605 | 2009 | struct { |
---|
1606 | 2010 | uint32 queryID; |
---|
1607 | 2011 | uint32 value; |
---|
1608 | 2012 | } predication; |
---|
1609 | | - uint32 pad5[2]; |
---|
1610 | 2013 | |
---|
| 2014 | + SVGAMobId shaderIfaceMobid; |
---|
| 2015 | + uint32 shaderIfaceOffset; |
---|
1611 | 2016 | struct { |
---|
1612 | 2017 | uint32 shaderId; |
---|
1613 | 2018 | SVGA3dConstantBufferBinding constantBuffers[SVGA3D_DX_MAX_CONSTBUFFERS]; |
---|
.. | .. |
---|
1619 | 2024 | SVGA3dQueryId queryID[SVGA3D_MAX_QUERY]; |
---|
1620 | 2025 | |
---|
1621 | 2026 | SVGA3dCOTableData cotables[SVGA_COTABLE_MAX]; |
---|
1622 | | - uint32 pad7[380]; |
---|
| 2027 | + |
---|
| 2028 | + uint32 pad7[64]; |
---|
| 2029 | + |
---|
| 2030 | + uint32 uaViewIds[SVGA3D_DX11_1_MAX_UAVIEWS]; |
---|
| 2031 | + uint32 csuaViewIds[SVGA3D_DX11_1_MAX_UAVIEWS]; |
---|
| 2032 | + |
---|
| 2033 | + uint32 pad8[188]; |
---|
1623 | 2034 | } |
---|
1624 | 2035 | #include "vmware_pack_end.h" |
---|
1625 | 2036 | SVGADXContextMobFormat; |
---|
1626 | 2037 | |
---|
| 2038 | +/* |
---|
| 2039 | + * There is conflicting documentation on max class instances (253 vs 256). The |
---|
| 2040 | + * lower value is the one used throughout the device, but since mob format is |
---|
| 2041 | + * more involved to increase if needed, conservatively use the higher one here. |
---|
| 2042 | + */ |
---|
| 2043 | +#define SVGA3D_DX_MAX_CLASS_INSTANCES_PADDED 256 |
---|
| 2044 | + |
---|
| 2045 | +typedef |
---|
| 2046 | +#include "vmware_pack_begin.h" |
---|
| 2047 | +struct SVGADXShaderIfaceMobFormat { |
---|
| 2048 | + struct { |
---|
| 2049 | + uint32 numClassInstances; |
---|
| 2050 | + uint32 iface[SVGA3D_DX_MAX_CLASS_INSTANCES_PADDED]; |
---|
| 2051 | + SVGA3dIfaceData data[SVGA3D_DX_MAX_CLASS_INSTANCES_PADDED]; |
---|
| 2052 | + } shaderIfaceState[SVGA3D_NUM_SHADERTYPE]; |
---|
| 2053 | + |
---|
| 2054 | + uint32 pad0[1018]; |
---|
| 2055 | +} |
---|
| 2056 | +#include "vmware_pack_end.h" |
---|
| 2057 | +SVGADXShaderIfaceMobFormat; |
---|
| 2058 | + |
---|
1627 | 2059 | typedef |
---|
1628 | 2060 | #include "vmware_pack_begin.h" |
---|
1629 | 2061 | struct SVGA3dCmdDXTempSetContext { |
---|