0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033
0034
0035 #ifndef _SVGA3D_DX_H_
0036 #define _SVGA3D_DX_H_
0037
0038 #include "svga_reg.h"
0039 #include "svga3d_limits.h"
0040 #include "svga3d_types.h"
0041
0042 #define SVGA3D_INPUT_MIN 0
0043 #define SVGA3D_INPUT_PER_VERTEX_DATA 0
0044 #define SVGA3D_INPUT_PER_INSTANCE_DATA 1
0045 #define SVGA3D_INPUT_MAX 2
0046 typedef uint32 SVGA3dInputClassification;
0047
0048 #define SVGA3D_COLOR_WRITE_ENABLE_RED (1 << 0)
0049 #define SVGA3D_COLOR_WRITE_ENABLE_GREEN (1 << 1)
0050 #define SVGA3D_COLOR_WRITE_ENABLE_BLUE (1 << 2)
0051 #define SVGA3D_COLOR_WRITE_ENABLE_ALPHA (1 << 3)
0052 #define SVGA3D_COLOR_WRITE_ENABLE_ALL \
0053 (SVGA3D_COLOR_WRITE_ENABLE_RED | SVGA3D_COLOR_WRITE_ENABLE_GREEN | \
0054 SVGA3D_COLOR_WRITE_ENABLE_BLUE | SVGA3D_COLOR_WRITE_ENABLE_ALPHA)
0055 typedef uint8 SVGA3dColorWriteEnable;
0056
0057 #define SVGA3D_DEPTH_WRITE_MASK_ZERO 0
0058 #define SVGA3D_DEPTH_WRITE_MASK_ALL 1
0059 typedef uint8 SVGA3dDepthWriteMask;
0060
0061 #define SVGA3D_FILTER_MIP_LINEAR (1 << 0)
0062 #define SVGA3D_FILTER_MAG_LINEAR (1 << 2)
0063 #define SVGA3D_FILTER_MIN_LINEAR (1 << 4)
0064 #define SVGA3D_FILTER_ANISOTROPIC (1 << 6)
0065 #define SVGA3D_FILTER_COMPARE (1 << 7)
0066 typedef uint32 SVGA3dFilter;
0067
0068 #define SVGA3D_CULL_INVALID 0
0069 #define SVGA3D_CULL_MIN 1
0070 #define SVGA3D_CULL_NONE 1
0071 #define SVGA3D_CULL_FRONT 2
0072 #define SVGA3D_CULL_BACK 3
0073 #define SVGA3D_CULL_MAX 4
0074 typedef uint8 SVGA3dCullMode;
0075
0076 #define SVGA3D_COMPARISON_INVALID 0
0077 #define SVGA3D_COMPARISON_MIN 1
0078 #define SVGA3D_COMPARISON_NEVER 1
0079 #define SVGA3D_COMPARISON_LESS 2
0080 #define SVGA3D_COMPARISON_EQUAL 3
0081 #define SVGA3D_COMPARISON_LESS_EQUAL 4
0082 #define SVGA3D_COMPARISON_GREATER 5
0083 #define SVGA3D_COMPARISON_NOT_EQUAL 6
0084 #define SVGA3D_COMPARISON_GREATER_EQUAL 7
0085 #define SVGA3D_COMPARISON_ALWAYS 8
0086 #define SVGA3D_COMPARISON_MAX 9
0087 typedef uint8 SVGA3dComparisonFunc;
0088
0089 #define SVGA3D_MULTISAMPLE_RAST_DISABLE 0
0090 #define SVGA3D_MULTISAMPLE_RAST_ENABLE 1
0091 #define SVGA3D_MULTISAMPLE_RAST_DX_MAX 1
0092 #define SVGA3D_MULTISAMPLE_RAST_DISABLE_LINE 2
0093 #define SVGA3D_MULTISAMPLE_RAST_MAX 2
0094 typedef uint8 SVGA3dMultisampleRastEnable;
0095
0096 #define SVGA3D_DX_MAX_VERTEXBUFFERS 32
0097 #define SVGA3D_DX_MAX_VERTEXINPUTREGISTERS 16
0098 #define SVGA3D_DX_SM41_MAX_VERTEXINPUTREGISTERS 32
0099 #define SVGA3D_DX_MAX_SOTARGETS 4
0100 #define SVGA3D_DX_MAX_SRVIEWS 128
0101 #define SVGA3D_DX_MAX_CONSTBUFFERS 16
0102 #define SVGA3D_DX_MAX_SAMPLERS 16
0103 #define SVGA3D_DX_MAX_CLASS_INSTANCES 253
0104
0105 #define SVGA3D_DX_MAX_CONSTBUF_BINDING_SIZE (4096 * 4 * (uint32)sizeof(uint32))
0106
0107 typedef uint32 SVGA3dShaderResourceViewId;
0108 typedef uint32 SVGA3dRenderTargetViewId;
0109 typedef uint32 SVGA3dDepthStencilViewId;
0110 typedef uint32 SVGA3dUAViewId;
0111
0112 typedef uint32 SVGA3dShaderId;
0113 typedef uint32 SVGA3dElementLayoutId;
0114 typedef uint32 SVGA3dSamplerId;
0115 typedef uint32 SVGA3dBlendStateId;
0116 typedef uint32 SVGA3dDepthStencilStateId;
0117 typedef uint32 SVGA3dRasterizerStateId;
0118 typedef uint32 SVGA3dQueryId;
0119 typedef uint32 SVGA3dStreamOutputId;
0120
0121 typedef union {
0122 struct {
0123 uint32 r;
0124 uint32 g;
0125 uint32 b;
0126 uint32 a;
0127 };
0128
0129 uint32 value[4];
0130 } SVGA3dRGBAUint32;
0131
0132 #pragma pack(push, 1)
0133 typedef struct {
0134 uint32 cid;
0135 SVGAMobId mobid;
0136 } SVGAOTableDXContextEntry;
0137 #pragma pack(pop)
0138
0139 #pragma pack(push, 1)
0140 typedef struct SVGA3dCmdDXDefineContext {
0141 uint32 cid;
0142 } SVGA3dCmdDXDefineContext;
0143 #pragma pack(pop)
0144
0145 #pragma pack(push, 1)
0146 typedef struct SVGA3dCmdDXDestroyContext {
0147 uint32 cid;
0148 } SVGA3dCmdDXDestroyContext;
0149 #pragma pack(pop)
0150
0151 #pragma pack(push, 1)
0152 typedef struct SVGA3dCmdDXBindContext {
0153 uint32 cid;
0154 SVGAMobId mobid;
0155 uint32 validContents;
0156 } SVGA3dCmdDXBindContext;
0157 #pragma pack(pop)
0158
0159 #pragma pack(push, 1)
0160 typedef struct SVGA3dCmdDXReadbackContext {
0161 uint32 cid;
0162 } SVGA3dCmdDXReadbackContext;
0163 #pragma pack(pop)
0164
0165 #pragma pack(push, 1)
0166 typedef struct SVGA3dCmdDXInvalidateContext {
0167 uint32 cid;
0168 } SVGA3dCmdDXInvalidateContext;
0169 #pragma pack(pop)
0170
0171 #pragma pack(push, 1)
0172 typedef struct SVGA3dCmdDXSetSingleConstantBuffer {
0173 uint32 slot;
0174 SVGA3dShaderType type;
0175 SVGA3dSurfaceId sid;
0176 uint32 offsetInBytes;
0177 uint32 sizeInBytes;
0178 } SVGA3dCmdDXSetSingleConstantBuffer;
0179 #pragma pack(pop)
0180
0181 #pragma pack(push, 1)
0182 typedef struct SVGA3dCmdDXSetShaderResources {
0183 uint32 startView;
0184 SVGA3dShaderType type;
0185
0186 } SVGA3dCmdDXSetShaderResources;
0187 #pragma pack(pop)
0188
0189 #pragma pack(push, 1)
0190 typedef struct SVGA3dCmdDXSetShader {
0191 SVGA3dShaderId shaderId;
0192 SVGA3dShaderType type;
0193 } SVGA3dCmdDXSetShader;
0194 #pragma pack(pop)
0195
0196 typedef union {
0197 struct {
0198 uint32 cbOffset : 12;
0199 uint32 cbId : 4;
0200 uint32 baseSamp : 4;
0201 uint32 baseTex : 7;
0202 uint32 reserved : 5;
0203 };
0204 uint32 value;
0205 } SVGA3dIfaceData;
0206
0207 #pragma pack(push, 1)
0208 typedef struct SVGA3dCmdDXSetShaderIface {
0209 SVGA3dShaderType type;
0210 uint32 numClassInstances;
0211 uint32 index;
0212 uint32 iface;
0213 SVGA3dIfaceData data;
0214 } SVGA3dCmdDXSetShaderIface;
0215 #pragma pack(pop)
0216
0217 #pragma pack(push, 1)
0218 typedef struct SVGA3dCmdDXBindShaderIface {
0219 uint32 cid;
0220 SVGAMobId mobid;
0221 uint32 offsetInBytes;
0222 } SVGA3dCmdDXBindShaderIface;
0223 #pragma pack(pop)
0224
0225 #pragma pack(push, 1)
0226 typedef struct SVGA3dCmdDXSetSamplers {
0227 uint32 startSampler;
0228 SVGA3dShaderType type;
0229
0230 } SVGA3dCmdDXSetSamplers;
0231 #pragma pack(pop)
0232
0233 #pragma pack(push, 1)
0234 typedef struct SVGA3dCmdDXDraw {
0235 uint32 vertexCount;
0236 uint32 startVertexLocation;
0237 } SVGA3dCmdDXDraw;
0238 #pragma pack(pop)
0239
0240 #pragma pack(push, 1)
0241 typedef struct SVGA3dCmdDXDrawIndexed {
0242 uint32 indexCount;
0243 uint32 startIndexLocation;
0244 int32 baseVertexLocation;
0245 } SVGA3dCmdDXDrawIndexed;
0246 #pragma pack(pop)
0247
0248 #pragma pack(push, 1)
0249 typedef struct SVGA3dCmdDXDrawInstanced {
0250 uint32 vertexCountPerInstance;
0251 uint32 instanceCount;
0252 uint32 startVertexLocation;
0253 uint32 startInstanceLocation;
0254 } SVGA3dCmdDXDrawInstanced;
0255 #pragma pack(pop)
0256
0257 #pragma pack(push, 1)
0258 typedef struct SVGA3dCmdDXDrawIndexedInstanced {
0259 uint32 indexCountPerInstance;
0260 uint32 instanceCount;
0261 uint32 startIndexLocation;
0262 int32 baseVertexLocation;
0263 uint32 startInstanceLocation;
0264 } SVGA3dCmdDXDrawIndexedInstanced;
0265 #pragma pack(pop)
0266
0267 #pragma pack(push, 1)
0268 typedef struct SVGA3dCmdDXDrawIndexedInstancedIndirect {
0269 SVGA3dSurfaceId argsBufferSid;
0270 uint32 byteOffsetForArgs;
0271 } SVGA3dCmdDXDrawIndexedInstancedIndirect;
0272 #pragma pack(pop)
0273
0274 #pragma pack(push, 1)
0275 typedef struct SVGA3dCmdDXDrawInstancedIndirect {
0276 SVGA3dSurfaceId argsBufferSid;
0277 uint32 byteOffsetForArgs;
0278 } SVGA3dCmdDXDrawInstancedIndirect;
0279 #pragma pack(pop)
0280
0281 #pragma pack(push, 1)
0282 typedef struct SVGA3dCmdDXDrawAuto {
0283 uint32 pad0;
0284 } SVGA3dCmdDXDrawAuto;
0285 #pragma pack(pop)
0286
0287 #pragma pack(push, 1)
0288 typedef struct SVGA3dCmdDXDispatch {
0289 uint32 threadGroupCountX;
0290 uint32 threadGroupCountY;
0291 uint32 threadGroupCountZ;
0292 } SVGA3dCmdDXDispatch;
0293 #pragma pack(pop)
0294
0295 #pragma pack(push, 1)
0296 typedef struct SVGA3dCmdDXDispatchIndirect {
0297 SVGA3dSurfaceId argsBufferSid;
0298 uint32 byteOffsetForArgs;
0299 } SVGA3dCmdDXDispatchIndirect;
0300 #pragma pack(pop)
0301
0302 #pragma pack(push, 1)
0303 typedef struct SVGA3dCmdDXSetInputLayout {
0304 SVGA3dElementLayoutId elementLayoutId;
0305 } SVGA3dCmdDXSetInputLayout;
0306 #pragma pack(pop)
0307
0308 #pragma pack(push, 1)
0309 typedef struct SVGA3dVertexBuffer {
0310 SVGA3dSurfaceId sid;
0311 uint32 stride;
0312 uint32 offset;
0313 } SVGA3dVertexBuffer;
0314 #pragma pack(pop)
0315
0316 #pragma pack(push, 1)
0317 typedef struct SVGA3dCmdDXSetVertexBuffers {
0318 uint32 startBuffer;
0319
0320 } SVGA3dCmdDXSetVertexBuffers;
0321 #pragma pack(pop)
0322
0323 #pragma pack(push, 1)
0324 typedef struct SVGA3dVertexBuffer_v2 {
0325 SVGA3dSurfaceId sid;
0326 uint32 stride;
0327 uint32 offset;
0328 uint32 sizeInBytes;
0329 } SVGA3dVertexBuffer_v2;
0330 #pragma pack(pop)
0331
0332 #pragma pack(push, 1)
0333 typedef struct SVGA3dCmdDXSetVertexBuffers_v2 {
0334 uint32 startBuffer;
0335
0336 } SVGA3dCmdDXSetVertexBuffers_v2;
0337 #pragma pack(pop)
0338
0339 #pragma pack(push, 1)
0340 typedef struct SVGA3dVertexBufferOffsetAndSize {
0341 uint32 stride;
0342 uint32 offset;
0343 uint32 sizeInBytes;
0344 } SVGA3dVertexBufferOffsetAndSize;
0345 #pragma pack(pop)
0346
0347 #pragma pack(push, 1)
0348 typedef struct SVGA3dCmdDXSetVertexBuffersOffsetAndSize {
0349 uint32 startBuffer;
0350
0351 } SVGA3dCmdDXSetVertexBuffersOffsetAndSize;
0352 #pragma pack(pop)
0353
0354 #pragma pack(push, 1)
0355 typedef struct SVGA3dCmdDXSetIndexBuffer {
0356 SVGA3dSurfaceId sid;
0357 SVGA3dSurfaceFormat format;
0358 uint32 offset;
0359 } SVGA3dCmdDXSetIndexBuffer;
0360 #pragma pack(pop)
0361
0362 #pragma pack(push, 1)
0363 typedef struct SVGA3dCmdDXSetIndexBuffer_v2 {
0364 SVGA3dSurfaceId sid;
0365 SVGA3dSurfaceFormat format;
0366 uint32 offset;
0367 uint32 sizeInBytes;
0368 } SVGA3dCmdDXSetIndexBuffer_v2;
0369 #pragma pack(pop)
0370
0371 #pragma pack(push, 1)
0372 typedef struct SVGA3dCmdDXSetIndexBufferOffsetAndSize {
0373 SVGA3dSurfaceFormat format;
0374 uint32 offset;
0375 uint32 sizeInBytes;
0376 } SVGA3dCmdDXSetIndexBufferOffsetAndSize;
0377 #pragma pack(pop)
0378
0379 #pragma pack(push, 1)
0380 typedef struct SVGA3dCmdDXSetTopology {
0381 SVGA3dPrimitiveType topology;
0382 } SVGA3dCmdDXSetTopology;
0383 #pragma pack(pop)
0384
0385 #pragma pack(push, 1)
0386 typedef struct SVGA3dCmdDXSetRenderTargets {
0387 SVGA3dDepthStencilViewId depthStencilViewId;
0388
0389 } SVGA3dCmdDXSetRenderTargets;
0390 #pragma pack(pop)
0391
0392 #pragma pack(push, 1)
0393 typedef struct SVGA3dCmdDXSetBlendState {
0394 SVGA3dBlendStateId blendId;
0395 float blendFactor[4];
0396 uint32 sampleMask;
0397 } SVGA3dCmdDXSetBlendState;
0398 #pragma pack(pop)
0399
0400 #pragma pack(push, 1)
0401 typedef struct SVGA3dCmdDXSetDepthStencilState {
0402 SVGA3dDepthStencilStateId depthStencilId;
0403 uint32 stencilRef;
0404 } SVGA3dCmdDXSetDepthStencilState;
0405 #pragma pack(pop)
0406
0407 #pragma pack(push, 1)
0408 typedef struct SVGA3dCmdDXSetRasterizerState {
0409 SVGA3dRasterizerStateId rasterizerId;
0410 } SVGA3dCmdDXSetRasterizerState;
0411 #pragma pack(pop)
0412
0413 #define SVGA3D_DXQUERY_FLAG_PREDICATEHINT (1 << 0)
0414 typedef uint32 SVGA3dDXQueryFlags;
0415
0416 #define SVGADX_QDSTATE_INVALID ((uint8)-1)
0417 #define SVGADX_QDSTATE_MIN 0
0418 #define SVGADX_QDSTATE_IDLE 0
0419 #define SVGADX_QDSTATE_ACTIVE 1
0420 #define SVGADX_QDSTATE_PENDING 2
0421 #define SVGADX_QDSTATE_FINISHED 3
0422 #define SVGADX_QDSTATE_MAX 4
0423 typedef uint8 SVGADXQueryDeviceState;
0424
0425 #pragma pack(push, 1)
0426 typedef struct {
0427 SVGA3dQueryTypeUint8 type;
0428 uint16 pad0;
0429 SVGADXQueryDeviceState state;
0430 SVGA3dDXQueryFlags flags;
0431 SVGAMobId mobid;
0432 uint32 offset;
0433 } SVGACOTableDXQueryEntry;
0434 #pragma pack(pop)
0435
0436 #pragma pack(push, 1)
0437 typedef struct SVGA3dCmdDXDefineQuery {
0438 SVGA3dQueryId queryId;
0439 SVGA3dQueryType type;
0440 SVGA3dDXQueryFlags flags;
0441 } SVGA3dCmdDXDefineQuery;
0442 #pragma pack(pop)
0443
0444 #pragma pack(push, 1)
0445 typedef struct SVGA3dCmdDXDestroyQuery {
0446 SVGA3dQueryId queryId;
0447 } SVGA3dCmdDXDestroyQuery;
0448 #pragma pack(pop)
0449
0450 #pragma pack(push, 1)
0451 typedef struct SVGA3dCmdDXBindQuery {
0452 SVGA3dQueryId queryId;
0453 SVGAMobId mobid;
0454 } SVGA3dCmdDXBindQuery;
0455 #pragma pack(pop)
0456
0457 #pragma pack(push, 1)
0458 typedef struct SVGA3dCmdDXSetQueryOffset {
0459 SVGA3dQueryId queryId;
0460 uint32 mobOffset;
0461 } SVGA3dCmdDXSetQueryOffset;
0462 #pragma pack(pop)
0463
0464 #pragma pack(push, 1)
0465 typedef struct SVGA3dCmdDXBeginQuery {
0466 SVGA3dQueryId queryId;
0467 } SVGA3dCmdDXBeginQuery;
0468 #pragma pack(pop)
0469
0470 #pragma pack(push, 1)
0471 typedef struct SVGA3dCmdDXEndQuery {
0472 SVGA3dQueryId queryId;
0473 } SVGA3dCmdDXEndQuery;
0474 #pragma pack(pop)
0475
0476 #pragma pack(push, 1)
0477 typedef struct SVGA3dCmdDXReadbackQuery {
0478 SVGA3dQueryId queryId;
0479 } SVGA3dCmdDXReadbackQuery;
0480 #pragma pack(pop)
0481
0482 #pragma pack(push, 1)
0483 typedef struct SVGA3dCmdDXMoveQuery {
0484 SVGA3dQueryId queryId;
0485 SVGAMobId mobid;
0486 uint32 mobOffset;
0487 } SVGA3dCmdDXMoveQuery;
0488 #pragma pack(pop)
0489
0490 #pragma pack(push, 1)
0491 typedef struct SVGA3dCmdDXBindAllQuery {
0492 uint32 cid;
0493 SVGAMobId mobid;
0494 } SVGA3dCmdDXBindAllQuery;
0495 #pragma pack(pop)
0496
0497 #pragma pack(push, 1)
0498 typedef struct SVGA3dCmdDXReadbackAllQuery {
0499 uint32 cid;
0500 } SVGA3dCmdDXReadbackAllQuery;
0501 #pragma pack(pop)
0502
0503 #pragma pack(push, 1)
0504 typedef struct SVGA3dCmdDXSetPredication {
0505 SVGA3dQueryId queryId;
0506 uint32 predicateValue;
0507 } SVGA3dCmdDXSetPredication;
0508 #pragma pack(pop)
0509
0510 #pragma pack(push, 1)
0511 typedef struct SVGA3dDXSOState {
0512 uint32 offset;
0513 uint32 intOffset;
0514 uint32 dead1;
0515 uint32 dead2;
0516 } SVGA3dDXSOState;
0517 #pragma pack(pop)
0518
0519 #define SVGA3D_DX_SO_OFFSET_APPEND ((uint32)~0u)
0520
0521 #pragma pack(push, 1)
0522 typedef struct SVGA3dSoTarget {
0523 SVGA3dSurfaceId sid;
0524 uint32 offset;
0525 uint32 sizeInBytes;
0526 } SVGA3dSoTarget;
0527 #pragma pack(pop)
0528
0529 #pragma pack(push, 1)
0530 typedef struct SVGA3dCmdDXSetSOTargets {
0531 uint32 pad0;
0532
0533 } SVGA3dCmdDXSetSOTargets;
0534 #pragma pack(pop)
0535
0536 #pragma pack(push, 1)
0537 typedef struct SVGA3dViewport {
0538 float x;
0539 float y;
0540 float width;
0541 float height;
0542 float minDepth;
0543 float maxDepth;
0544 } SVGA3dViewport;
0545 #pragma pack(pop)
0546
0547 #pragma pack(push, 1)
0548 typedef struct SVGA3dCmdDXSetViewports {
0549 uint32 pad0;
0550
0551 } SVGA3dCmdDXSetViewports;
0552 #pragma pack(pop)
0553
0554 #define SVGA3D_DX_MAX_VIEWPORTS 16
0555
0556 #pragma pack(push, 1)
0557 typedef struct SVGA3dCmdDXSetScissorRects {
0558 uint32 pad0;
0559
0560 } SVGA3dCmdDXSetScissorRects;
0561 #pragma pack(pop)
0562
0563 #define SVGA3D_DX_MAX_SCISSORRECTS 16
0564
0565 #pragma pack(push, 1)
0566 typedef struct SVGA3dCmdDXClearRenderTargetView {
0567 SVGA3dRenderTargetViewId renderTargetViewId;
0568 SVGA3dRGBAFloat rgba;
0569 } SVGA3dCmdDXClearRenderTargetView;
0570 #pragma pack(pop)
0571
0572 #pragma pack(push, 1)
0573 typedef struct SVGA3dCmdDXClearDepthStencilView {
0574 uint16 flags;
0575 uint16 stencil;
0576 SVGA3dDepthStencilViewId depthStencilViewId;
0577 float depth;
0578 } SVGA3dCmdDXClearDepthStencilView;
0579 #pragma pack(pop)
0580
0581 #pragma pack(push, 1)
0582 typedef struct SVGA3dCmdDXPredCopyRegion {
0583 SVGA3dSurfaceId dstSid;
0584 uint32 dstSubResource;
0585 SVGA3dSurfaceId srcSid;
0586 uint32 srcSubResource;
0587 SVGA3dCopyBox box;
0588 } SVGA3dCmdDXPredCopyRegion;
0589 #pragma pack(pop)
0590
0591 #pragma pack(push, 1)
0592 typedef struct SVGA3dCmdDXPredStagingCopyRegion {
0593 SVGA3dSurfaceId dstSid;
0594 uint32 dstSubResource;
0595 SVGA3dSurfaceId srcSid;
0596 uint32 srcSubResource;
0597 SVGA3dCopyBox box;
0598 uint8 readback;
0599 uint8 unsynchronized;
0600 uint8 mustBeZero[2];
0601 } SVGA3dCmdDXPredStagingCopyRegion;
0602 #pragma pack(pop)
0603
0604 #pragma pack(push, 1)
0605 typedef struct SVGA3dCmdDXPredCopy {
0606 SVGA3dSurfaceId dstSid;
0607 SVGA3dSurfaceId srcSid;
0608 } SVGA3dCmdDXPredCopy;
0609 #pragma pack(pop)
0610
0611 #pragma pack(push, 1)
0612 typedef struct SVGA3dCmdDXPredConvertRegion {
0613 SVGA3dSurfaceId dstSid;
0614 uint32 dstSubResource;
0615 SVGA3dBox destBox;
0616 SVGA3dSurfaceId srcSid;
0617 uint32 srcSubResource;
0618 SVGA3dBox srcBox;
0619 } SVGA3dCmdDXPredConvertRegion;
0620 #pragma pack(pop)
0621
0622 #pragma pack(push, 1)
0623 typedef struct SVGA3dCmdDXPredStagingConvertRegion {
0624 SVGA3dSurfaceId dstSid;
0625 uint32 dstSubResource;
0626 SVGA3dBox destBox;
0627 SVGA3dSurfaceId srcSid;
0628 uint32 srcSubResource;
0629 SVGA3dBox srcBox;
0630 uint8 readback;
0631 uint8 unsynchronized;
0632 uint8 mustBeZero[2];
0633 } SVGA3dCmdDXPredStagingConvertRegion;
0634 #pragma pack(pop)
0635
0636 #pragma pack(push, 1)
0637 typedef struct SVGA3dCmdDXPredConvert {
0638 SVGA3dSurfaceId dstSid;
0639 SVGA3dSurfaceId srcSid;
0640 } SVGA3dCmdDXPredConvert;
0641 #pragma pack(pop)
0642
0643 #pragma pack(push, 1)
0644 typedef struct SVGA3dCmdDXPredStagingConvert {
0645 SVGA3dSurfaceId dstSid;
0646 SVGA3dSurfaceId srcSid;
0647 uint8 readback;
0648 uint8 unsynchronized;
0649 uint8 mustBeZero[2];
0650 } SVGA3dCmdDXPredStagingConvert;
0651 #pragma pack(pop)
0652
0653 #pragma pack(push, 1)
0654 typedef struct SVGA3dCmdDXBufferCopy {
0655 SVGA3dSurfaceId dest;
0656 SVGA3dSurfaceId src;
0657 uint32 destX;
0658 uint32 srcX;
0659 uint32 width;
0660 } SVGA3dCmdDXBufferCopy;
0661 #pragma pack(pop)
0662
0663 #pragma pack(push, 1)
0664 typedef struct SVGA3dCmdDXStagingBufferCopy {
0665 SVGA3dSurfaceId dest;
0666 SVGA3dSurfaceId src;
0667 uint32 destX;
0668 uint32 srcX;
0669 uint32 width;
0670 uint8 readback;
0671 uint8 unsynchronized;
0672 uint8 mustBeZero[2];
0673 } SVGA3dCmdDXStagingBufferCopy;
0674 #pragma pack(pop)
0675
0676 #pragma pack(push, 1)
0677 typedef struct {
0678 SVGA3dSurfaceId dstSid;
0679 uint32 dstSubResource;
0680 SVGA3dSurfaceId srcSid;
0681 uint32 srcSubResource;
0682 SVGA3dSurfaceFormat copyFormat;
0683 } SVGA3dCmdDXResolveCopy;
0684 #pragma pack(pop)
0685
0686 #pragma pack(push, 1)
0687 typedef struct {
0688 SVGA3dSurfaceId dstSid;
0689 uint32 dstSubResource;
0690 SVGA3dSurfaceId srcSid;
0691 uint32 srcSubResource;
0692 SVGA3dSurfaceFormat copyFormat;
0693 } SVGA3dCmdDXPredResolveCopy;
0694 #pragma pack(pop)
0695
0696 typedef uint32 SVGA3dDXPresentBltMode;
0697 #define SVGADX_PRESENTBLT_LINEAR (1 << 0)
0698 #define SVGADX_PRESENTBLT_FORCE_SRC_SRGB (1 << 1)
0699 #define SVGADX_PRESENTBLT_FORCE_SRC_XRBIAS (1 << 2)
0700 #define SVGADX_PRESENTBLT_MODE_MAX (1 << 3)
0701
0702 #pragma pack(push, 1)
0703 typedef struct SVGA3dCmdDXPresentBlt {
0704 SVGA3dSurfaceId srcSid;
0705 uint32 srcSubResource;
0706 SVGA3dSurfaceId dstSid;
0707 uint32 destSubResource;
0708 SVGA3dBox boxSrc;
0709 SVGA3dBox boxDest;
0710 SVGA3dDXPresentBltMode mode;
0711 } SVGA3dCmdDXPresentBlt;
0712 #pragma pack(pop)
0713
0714 #pragma pack(push, 1)
0715 typedef struct SVGA3dCmdDXGenMips {
0716 SVGA3dShaderResourceViewId shaderResourceViewId;
0717 } SVGA3dCmdDXGenMips;
0718 #pragma pack(pop)
0719
0720 #pragma pack(push, 1)
0721 typedef struct SVGA3dCmdDXUpdateSubResource {
0722 SVGA3dSurfaceId sid;
0723 uint32 subResource;
0724 SVGA3dBox box;
0725 } SVGA3dCmdDXUpdateSubResource;
0726 #pragma pack(pop)
0727
0728 #pragma pack(push, 1)
0729 typedef struct SVGA3dCmdDXReadbackSubResource {
0730 SVGA3dSurfaceId sid;
0731 uint32 subResource;
0732 } SVGA3dCmdDXReadbackSubResource;
0733 #pragma pack(pop)
0734
0735 #pragma pack(push, 1)
0736 typedef struct SVGA3dCmdDXInvalidateSubResource {
0737 SVGA3dSurfaceId sid;
0738 uint32 subResource;
0739 } SVGA3dCmdDXInvalidateSubResource;
0740 #pragma pack(pop)
0741
0742 #pragma pack(push, 1)
0743 typedef struct SVGA3dCmdDXTransferFromBuffer {
0744 SVGA3dSurfaceId srcSid;
0745 uint32 srcOffset;
0746 uint32 srcPitch;
0747 uint32 srcSlicePitch;
0748 SVGA3dSurfaceId destSid;
0749 uint32 destSubResource;
0750 SVGA3dBox destBox;
0751 } SVGA3dCmdDXTransferFromBuffer;
0752 #pragma pack(pop)
0753
0754 #define SVGA3D_TRANSFER_TO_BUFFER_READBACK (1 << 0)
0755 #define SVGA3D_TRANSFER_TO_BUFFER_FLAGS_MASK (1 << 0)
0756 typedef uint32 SVGA3dTransferToBufferFlags;
0757
0758 #pragma pack(push, 1)
0759 typedef struct SVGA3dCmdDXTransferToBuffer {
0760 SVGA3dSurfaceId srcSid;
0761 uint32 srcSubResource;
0762 SVGA3dBox srcBox;
0763 SVGA3dSurfaceId destSid;
0764 uint32 destOffset;
0765 uint32 destPitch;
0766 uint32 destSlicePitch;
0767 SVGA3dTransferToBufferFlags flags;
0768 } SVGA3dCmdDXTransferToBuffer;
0769 #pragma pack(pop)
0770
0771 #pragma pack(push, 1)
0772 typedef struct SVGA3dCmdDXPredTransferFromBuffer {
0773 SVGA3dSurfaceId srcSid;
0774 uint32 srcOffset;
0775 uint32 srcPitch;
0776 uint32 srcSlicePitch;
0777 SVGA3dSurfaceId destSid;
0778 uint32 destSubResource;
0779 SVGA3dBox destBox;
0780 } SVGA3dCmdDXPredTransferFromBuffer;
0781 #pragma pack(pop)
0782
0783 #pragma pack(push, 1)
0784 typedef struct SVGA3dCmdDXSurfaceCopyAndReadback {
0785 SVGA3dSurfaceId srcSid;
0786 SVGA3dSurfaceId destSid;
0787 SVGA3dCopyBox box;
0788 } SVGA3dCmdDXSurfaceCopyAndReadback;
0789 #pragma pack(pop)
0790
0791 typedef uint32 SVGADXHintId;
0792 #define SVGA_DX_HINT_NONE 0
0793 #define SVGA_DX_HINT_PREFETCH_OBJECT 1
0794 #define SVGA_DX_HINT_PREEVICT_OBJECT 2
0795 #define SVGA_DX_HINT_PREFETCH_COBJECT 3
0796 #define SVGA_DX_HINT_PREEVICT_COBJECT 4
0797 #define SVGA_DX_HINT_MAX 5
0798
0799 #pragma pack(push, 1)
0800 typedef struct SVGAObjectRef {
0801 SVGAOTableType type;
0802 uint32 id;
0803 } SVGAObjectRef;
0804 #pragma pack(pop)
0805
0806 #pragma pack(push, 1)
0807 typedef struct SVGACObjectRef {
0808 SVGACOTableType type;
0809 uint32 cid;
0810 uint32 id;
0811 } SVGACObjectRef;
0812 #pragma pack(pop)
0813
0814 #pragma pack(push, 1)
0815 typedef struct SVGA3dCmdDXHint {
0816 SVGADXHintId hintId;
0817
0818 } SVGA3dCmdDXHint;
0819 #pragma pack(pop)
0820
0821 #pragma pack(push, 1)
0822 typedef struct SVGA3dCmdDXBufferUpdate {
0823 SVGA3dSurfaceId sid;
0824 uint32 x;
0825 uint32 width;
0826 } SVGA3dCmdDXBufferUpdate;
0827 #pragma pack(pop)
0828
0829 #pragma pack(push, 1)
0830 typedef struct SVGA3dCmdDXSetConstantBufferOffset {
0831 uint32 slot;
0832 uint32 offsetInBytes;
0833 } SVGA3dCmdDXSetConstantBufferOffset;
0834 #pragma pack(pop)
0835
0836 typedef SVGA3dCmdDXSetConstantBufferOffset SVGA3dCmdDXSetVSConstantBufferOffset;
0837
0838 typedef SVGA3dCmdDXSetConstantBufferOffset SVGA3dCmdDXSetPSConstantBufferOffset;
0839
0840 typedef SVGA3dCmdDXSetConstantBufferOffset SVGA3dCmdDXSetGSConstantBufferOffset;
0841
0842 typedef SVGA3dCmdDXSetConstantBufferOffset SVGA3dCmdDXSetHSConstantBufferOffset;
0843
0844 typedef SVGA3dCmdDXSetConstantBufferOffset SVGA3dCmdDXSetDSConstantBufferOffset;
0845
0846 typedef SVGA3dCmdDXSetConstantBufferOffset SVGA3dCmdDXSetCSConstantBufferOffset;
0847
0848 #define SVGA3D_BUFFEREX_SRV_RAW (1 << 0)
0849 #define SVGA3D_BUFFEREX_SRV_FLAGS_MAX (1 << 1)
0850 #define SVGA3D_BUFFEREX_SRV_FLAGS_MASK (SVGA3D_BUFFEREX_SRV_FLAGS_MAX - 1)
0851 typedef uint32 SVGA3dBufferExFlags;
0852
0853 #pragma pack(push, 1)
0854 typedef struct {
0855 union {
0856 struct {
0857 uint32 firstElement;
0858 uint32 numElements;
0859 uint32 pad0;
0860 uint32 pad1;
0861 } buffer;
0862 struct {
0863 uint32 mostDetailedMip;
0864 uint32 firstArraySlice;
0865 uint32 mipLevels;
0866 uint32 arraySize;
0867 } tex;
0868 struct {
0869 uint32 firstElement;
0870 uint32 numElements;
0871 SVGA3dBufferExFlags flags;
0872 uint32 pad0;
0873 } bufferex;
0874 };
0875 } SVGA3dShaderResourceViewDesc;
0876 #pragma pack(pop)
0877
0878 #pragma pack(push, 1)
0879 typedef struct {
0880 SVGA3dSurfaceId sid;
0881 SVGA3dSurfaceFormat format;
0882 SVGA3dResourceType resourceDimension;
0883 SVGA3dShaderResourceViewDesc desc;
0884 uint32 pad;
0885 } SVGACOTableDXSRViewEntry;
0886 #pragma pack(pop)
0887
0888 #pragma pack(push, 1)
0889 typedef struct SVGA3dCmdDXDefineShaderResourceView {
0890 SVGA3dShaderResourceViewId shaderResourceViewId;
0891
0892 SVGA3dSurfaceId sid;
0893 SVGA3dSurfaceFormat format;
0894 SVGA3dResourceType resourceDimension;
0895
0896 SVGA3dShaderResourceViewDesc desc;
0897 } SVGA3dCmdDXDefineShaderResourceView;
0898 #pragma pack(pop)
0899
0900 #pragma pack(push, 1)
0901 typedef struct SVGA3dCmdDXDestroyShaderResourceView {
0902 SVGA3dShaderResourceViewId shaderResourceViewId;
0903 } SVGA3dCmdDXDestroyShaderResourceView;
0904 #pragma pack(pop)
0905
0906 #pragma pack(push, 1)
0907 typedef struct SVGA3dRenderTargetViewDesc {
0908 union {
0909 struct {
0910 uint32 firstElement;
0911 uint32 numElements;
0912 uint32 padding0;
0913 } buffer;
0914 struct {
0915 uint32 mipSlice;
0916 uint32 firstArraySlice;
0917 uint32 arraySize;
0918 } tex;
0919 struct {
0920 uint32 mipSlice;
0921 uint32 firstW;
0922 uint32 wSize;
0923 } tex3D;
0924 };
0925 } SVGA3dRenderTargetViewDesc;
0926 #pragma pack(pop)
0927
0928 #pragma pack(push, 1)
0929 typedef struct {
0930 SVGA3dSurfaceId sid;
0931 SVGA3dSurfaceFormat format;
0932 SVGA3dResourceType resourceDimension;
0933 SVGA3dRenderTargetViewDesc desc;
0934 uint32 pad[2];
0935 } SVGACOTableDXRTViewEntry;
0936 #pragma pack(pop)
0937
0938 #pragma pack(push, 1)
0939 typedef struct SVGA3dCmdDXDefineRenderTargetView {
0940 SVGA3dRenderTargetViewId renderTargetViewId;
0941
0942 SVGA3dSurfaceId sid;
0943 SVGA3dSurfaceFormat format;
0944 SVGA3dResourceType resourceDimension;
0945
0946 SVGA3dRenderTargetViewDesc desc;
0947 } SVGA3dCmdDXDefineRenderTargetView;
0948 #pragma pack(pop)
0949
0950 #pragma pack(push, 1)
0951 typedef struct SVGA3dCmdDXDestroyRenderTargetView {
0952 SVGA3dRenderTargetViewId renderTargetViewId;
0953 } SVGA3dCmdDXDestroyRenderTargetView;
0954 #pragma pack(pop)
0955
0956 #define SVGA3D_DXDSVIEW_CREATE_READ_ONLY_DEPTH 0x01
0957 #define SVGA3D_DXDSVIEW_CREATE_READ_ONLY_STENCIL 0x02
0958 #define SVGA3D_DXDSVIEW_CREATE_FLAG_MASK 0x03
0959 typedef uint8 SVGA3DCreateDSViewFlags;
0960
0961 #pragma pack(push, 1)
0962 typedef struct {
0963 SVGA3dSurfaceId sid;
0964 SVGA3dSurfaceFormat format;
0965 SVGA3dResourceType resourceDimension;
0966 uint32 mipSlice;
0967 uint32 firstArraySlice;
0968 uint32 arraySize;
0969 SVGA3DCreateDSViewFlags flags;
0970 uint8 pad0;
0971 uint16 pad1;
0972 uint32 pad2;
0973 } SVGACOTableDXDSViewEntry;
0974 #pragma pack(pop)
0975
0976 #pragma pack(push, 1)
0977 typedef struct SVGA3dCmdDXDefineDepthStencilView {
0978 SVGA3dDepthStencilViewId depthStencilViewId;
0979
0980 SVGA3dSurfaceId sid;
0981 SVGA3dSurfaceFormat format;
0982 SVGA3dResourceType resourceDimension;
0983 uint32 mipSlice;
0984 uint32 firstArraySlice;
0985 uint32 arraySize;
0986 SVGA3DCreateDSViewFlags flags;
0987 uint8 pad0;
0988 uint16 pad1;
0989 } SVGA3dCmdDXDefineDepthStencilView;
0990 #pragma pack(pop)
0991
0992 #pragma pack(push, 1)
0993 typedef struct SVGA3dCmdDXDefineDepthStencilView_v2 {
0994 SVGA3dDepthStencilViewId depthStencilViewId;
0995
0996 SVGA3dSurfaceId sid;
0997 SVGA3dSurfaceFormat format;
0998 SVGA3dResourceType resourceDimension;
0999 uint32 mipSlice;
1000 uint32 firstArraySlice;
1001 uint32 arraySize;
1002 SVGA3DCreateDSViewFlags flags;
1003 uint8 pad0;
1004 uint16 pad1;
1005 } SVGA3dCmdDXDefineDepthStencilView_v2;
1006 #pragma pack(pop)
1007
1008 #pragma pack(push, 1)
1009 typedef struct SVGA3dCmdDXDestroyDepthStencilView {
1010 SVGA3dDepthStencilViewId depthStencilViewId;
1011 } SVGA3dCmdDXDestroyDepthStencilView;
1012 #pragma pack(pop)
1013
1014 #define SVGA3D_UABUFFER_RAW (1 << 0)
1015 #define SVGA3D_UABUFFER_APPEND (1 << 1)
1016 #define SVGA3D_UABUFFER_COUNTER (1 << 2)
1017 typedef uint32 SVGA3dUABufferFlags;
1018
1019 #pragma pack(push, 1)
1020 typedef struct {
1021 union {
1022 struct {
1023 uint32 firstElement;
1024 uint32 numElements;
1025 SVGA3dUABufferFlags flags;
1026 uint32 padding0;
1027 uint32 padding1;
1028 } buffer;
1029 struct {
1030 uint32 mipSlice;
1031 uint32 firstArraySlice;
1032 uint32 arraySize;
1033 uint32 padding0;
1034 uint32 padding1;
1035 } tex;
1036 struct {
1037 uint32 mipSlice;
1038 uint32 firstW;
1039 uint32 wSize;
1040 uint32 padding0;
1041 uint32 padding1;
1042 } tex3D;
1043 };
1044 } SVGA3dUAViewDesc;
1045 #pragma pack(pop)
1046
1047 #pragma pack(push, 1)
1048 typedef struct {
1049 SVGA3dSurfaceId sid;
1050 SVGA3dSurfaceFormat format;
1051 SVGA3dResourceType resourceDimension;
1052 SVGA3dUAViewDesc desc;
1053 uint32 structureCount;
1054 uint32 pad[7];
1055 } SVGACOTableDXUAViewEntry;
1056 #pragma pack(pop)
1057
1058 #pragma pack(push, 1)
1059 typedef struct SVGA3dCmdDXDefineUAView {
1060 SVGA3dUAViewId uaViewId;
1061
1062 SVGA3dSurfaceId sid;
1063 SVGA3dSurfaceFormat format;
1064 SVGA3dResourceType resourceDimension;
1065
1066 SVGA3dUAViewDesc desc;
1067 } SVGA3dCmdDXDefineUAView;
1068 #pragma pack(pop)
1069
1070 #pragma pack(push, 1)
1071 typedef struct SVGA3dCmdDXDestroyUAView {
1072 SVGA3dUAViewId uaViewId;
1073 } SVGA3dCmdDXDestroyUAView;
1074 #pragma pack(pop)
1075
1076 #pragma pack(push, 1)
1077 typedef struct SVGA3dCmdDXClearUAViewUint {
1078 SVGA3dUAViewId uaViewId;
1079 SVGA3dRGBAUint32 value;
1080 } SVGA3dCmdDXClearUAViewUint;
1081 #pragma pack(pop)
1082
1083 #pragma pack(push, 1)
1084 typedef struct SVGA3dCmdDXClearUAViewFloat {
1085 SVGA3dUAViewId uaViewId;
1086 SVGA3dRGBAFloat value;
1087 } SVGA3dCmdDXClearUAViewFloat;
1088 #pragma pack(pop)
1089
1090 #pragma pack(push, 1)
1091 typedef struct SVGA3dCmdDXCopyStructureCount {
1092 SVGA3dUAViewId srcUAViewId;
1093 SVGA3dSurfaceId destSid;
1094 uint32 destByteOffset;
1095 } SVGA3dCmdDXCopyStructureCount;
1096 #pragma pack(pop)
1097
1098 #pragma pack(push, 1)
1099 typedef struct SVGA3dCmdDXSetStructureCount {
1100 SVGA3dUAViewId uaViewId;
1101 uint32 structureCount;
1102 } SVGA3dCmdDXSetStructureCount;
1103 #pragma pack(pop)
1104
1105 #pragma pack(push, 1)
1106 typedef struct SVGA3dCmdDXSetUAViews {
1107 uint32 uavSpliceIndex;
1108
1109 } SVGA3dCmdDXSetUAViews;
1110 #pragma pack(pop)
1111
1112 #pragma pack(push, 1)
1113 typedef struct SVGA3dCmdDXSetCSUAViews {
1114 uint32 startIndex;
1115
1116 } SVGA3dCmdDXSetCSUAViews;
1117 #pragma pack(pop)
1118
1119 #pragma pack(push, 1)
1120 typedef struct SVGA3dInputElementDesc {
1121 uint32 inputSlot;
1122 uint32 alignedByteOffset;
1123 SVGA3dSurfaceFormat format;
1124 SVGA3dInputClassification inputSlotClass;
1125 uint32 instanceDataStepRate;
1126 uint32 inputRegister;
1127 } SVGA3dInputElementDesc;
1128 #pragma pack(pop)
1129
1130 #pragma pack(push, 1)
1131 typedef struct {
1132 uint32 elid;
1133 uint32 numDescs;
1134 SVGA3dInputElementDesc descs[32];
1135 uint32 pad[62];
1136 } SVGACOTableDXElementLayoutEntry;
1137 #pragma pack(pop)
1138
1139 #pragma pack(push, 1)
1140 typedef struct SVGA3dCmdDXDefineElementLayout {
1141 SVGA3dElementLayoutId elementLayoutId;
1142
1143 } SVGA3dCmdDXDefineElementLayout;
1144 #pragma pack(pop)
1145
1146 #pragma pack(push, 1)
1147 typedef struct SVGA3dCmdDXDestroyElementLayout {
1148 SVGA3dElementLayoutId elementLayoutId;
1149 } SVGA3dCmdDXDestroyElementLayout;
1150 #pragma pack(pop)
1151
1152 #define SVGA3D_DX_MAX_RENDER_TARGETS 8
1153
1154 #pragma pack(push, 1)
1155 typedef struct SVGA3dDXBlendStatePerRT {
1156 uint8 blendEnable;
1157 uint8 srcBlend;
1158 uint8 destBlend;
1159 uint8 blendOp;
1160 uint8 srcBlendAlpha;
1161 uint8 destBlendAlpha;
1162 uint8 blendOpAlpha;
1163 SVGA3dColorWriteEnable renderTargetWriteMask;
1164 uint8 logicOpEnable;
1165 uint8 logicOp;
1166 uint16 pad0;
1167 } SVGA3dDXBlendStatePerRT;
1168 #pragma pack(pop)
1169
1170 #pragma pack(push, 1)
1171 typedef struct {
1172 uint8 alphaToCoverageEnable;
1173 uint8 independentBlendEnable;
1174 uint16 pad0;
1175 SVGA3dDXBlendStatePerRT perRT[SVGA3D_DX_MAX_RENDER_TARGETS];
1176 uint32 pad1[7];
1177 } SVGACOTableDXBlendStateEntry;
1178 #pragma pack(pop)
1179
1180 #pragma pack(push, 1)
1181 typedef struct SVGA3dCmdDXDefineBlendState {
1182 SVGA3dBlendStateId blendId;
1183 uint8 alphaToCoverageEnable;
1184 uint8 independentBlendEnable;
1185 uint16 pad0;
1186 SVGA3dDXBlendStatePerRT perRT[SVGA3D_DX_MAX_RENDER_TARGETS];
1187 } SVGA3dCmdDXDefineBlendState;
1188 #pragma pack(pop)
1189
1190 #pragma pack(push, 1)
1191 typedef struct SVGA3dCmdDXDestroyBlendState {
1192 SVGA3dBlendStateId blendId;
1193 } SVGA3dCmdDXDestroyBlendState;
1194 #pragma pack(pop)
1195
1196 #pragma pack(push, 1)
1197 typedef struct {
1198 uint8 depthEnable;
1199 SVGA3dDepthWriteMask depthWriteMask;
1200 SVGA3dComparisonFunc depthFunc;
1201 uint8 stencilEnable;
1202 uint8 frontEnable;
1203 uint8 backEnable;
1204 uint8 stencilReadMask;
1205 uint8 stencilWriteMask;
1206
1207 uint8 frontStencilFailOp;
1208 uint8 frontStencilDepthFailOp;
1209 uint8 frontStencilPassOp;
1210 SVGA3dComparisonFunc frontStencilFunc;
1211
1212 uint8 backStencilFailOp;
1213 uint8 backStencilDepthFailOp;
1214 uint8 backStencilPassOp;
1215 SVGA3dComparisonFunc backStencilFunc;
1216 } SVGACOTableDXDepthStencilEntry;
1217 #pragma pack(pop)
1218
1219 #pragma pack(push, 1)
1220 typedef struct SVGA3dCmdDXDefineDepthStencilState {
1221 SVGA3dDepthStencilStateId depthStencilId;
1222
1223 uint8 depthEnable;
1224 SVGA3dDepthWriteMask depthWriteMask;
1225 SVGA3dComparisonFunc depthFunc;
1226 uint8 stencilEnable;
1227 uint8 frontEnable;
1228 uint8 backEnable;
1229 uint8 stencilReadMask;
1230 uint8 stencilWriteMask;
1231
1232 uint8 frontStencilFailOp;
1233 uint8 frontStencilDepthFailOp;
1234 uint8 frontStencilPassOp;
1235 SVGA3dComparisonFunc frontStencilFunc;
1236
1237 uint8 backStencilFailOp;
1238 uint8 backStencilDepthFailOp;
1239 uint8 backStencilPassOp;
1240 SVGA3dComparisonFunc backStencilFunc;
1241 } SVGA3dCmdDXDefineDepthStencilState;
1242 #pragma pack(pop)
1243
1244 #pragma pack(push, 1)
1245 typedef struct SVGA3dCmdDXDestroyDepthStencilState {
1246 SVGA3dDepthStencilStateId depthStencilId;
1247 } SVGA3dCmdDXDestroyDepthStencilState;
1248 #pragma pack(pop)
1249
1250 #pragma pack(push, 1)
1251 typedef struct {
1252 uint8 fillMode;
1253 SVGA3dCullMode cullMode;
1254 uint8 frontCounterClockwise;
1255 uint8 provokingVertexLast;
1256 int32 depthBias;
1257 float depthBiasClamp;
1258 float slopeScaledDepthBias;
1259 uint8 depthClipEnable;
1260 uint8 scissorEnable;
1261 SVGA3dMultisampleRastEnable multisampleEnable;
1262 uint8 antialiasedLineEnable;
1263 float lineWidth;
1264 uint8 lineStippleEnable;
1265 uint8 lineStippleFactor;
1266 uint16 lineStipplePattern;
1267 uint8 forcedSampleCount;
1268 uint8 mustBeZero[3];
1269 } SVGACOTableDXRasterizerStateEntry;
1270 #pragma pack(pop)
1271
1272 #pragma pack(push, 1)
1273 typedef struct SVGA3dCmdDXDefineRasterizerState {
1274 SVGA3dRasterizerStateId rasterizerId;
1275
1276 uint8 fillMode;
1277 SVGA3dCullMode cullMode;
1278 uint8 frontCounterClockwise;
1279 uint8 provokingVertexLast;
1280 int32 depthBias;
1281 float depthBiasClamp;
1282 float slopeScaledDepthBias;
1283 uint8 depthClipEnable;
1284 uint8 scissorEnable;
1285 SVGA3dMultisampleRastEnable multisampleEnable;
1286 uint8 antialiasedLineEnable;
1287 float lineWidth;
1288 uint8 lineStippleEnable;
1289 uint8 lineStippleFactor;
1290 uint16 lineStipplePattern;
1291 } SVGA3dCmdDXDefineRasterizerState;
1292 #pragma pack(pop)
1293
1294 #pragma pack(push, 1)
1295 typedef struct SVGA3dCmdDXDefineRasterizerState_v2 {
1296 SVGA3dRasterizerStateId rasterizerId;
1297
1298 uint8 fillMode;
1299 SVGA3dCullMode cullMode;
1300 uint8 frontCounterClockwise;
1301 uint8 provokingVertexLast;
1302 int32 depthBias;
1303 float depthBiasClamp;
1304 float slopeScaledDepthBias;
1305 uint8 depthClipEnable;
1306 uint8 scissorEnable;
1307 SVGA3dMultisampleRastEnable multisampleEnable;
1308 uint8 antialiasedLineEnable;
1309 float lineWidth;
1310 uint8 lineStippleEnable;
1311 uint8 lineStippleFactor;
1312 uint16 lineStipplePattern;
1313 uint32 forcedSampleCount;
1314 } SVGA3dCmdDXDefineRasterizerState_v2;
1315 #pragma pack(pop)
1316
1317 #pragma pack(push, 1)
1318 typedef struct SVGA3dCmdDXDestroyRasterizerState {
1319 SVGA3dRasterizerStateId rasterizerId;
1320 } SVGA3dCmdDXDestroyRasterizerState;
1321 #pragma pack(pop)
1322
1323 #pragma pack(push, 1)
1324 typedef struct {
1325 SVGA3dFilter filter;
1326 uint8 addressU;
1327 uint8 addressV;
1328 uint8 addressW;
1329 uint8 pad0;
1330 float mipLODBias;
1331 uint8 maxAnisotropy;
1332 SVGA3dComparisonFunc comparisonFunc;
1333 uint16 pad1;
1334 SVGA3dRGBAFloat borderColor;
1335 float minLOD;
1336 float maxLOD;
1337 uint32 pad2[6];
1338 } SVGACOTableDXSamplerEntry;
1339 #pragma pack(pop)
1340
1341 #pragma pack(push, 1)
1342 typedef struct SVGA3dCmdDXDefineSamplerState {
1343 SVGA3dSamplerId samplerId;
1344 SVGA3dFilter filter;
1345 uint8 addressU;
1346 uint8 addressV;
1347 uint8 addressW;
1348 uint8 pad0;
1349 float mipLODBias;
1350 uint8 maxAnisotropy;
1351 SVGA3dComparisonFunc comparisonFunc;
1352 uint16 pad1;
1353 SVGA3dRGBAFloat borderColor;
1354 float minLOD;
1355 float maxLOD;
1356 } SVGA3dCmdDXDefineSamplerState;
1357 #pragma pack(pop)
1358
1359 #pragma pack(push, 1)
1360 typedef struct SVGA3dCmdDXDestroySamplerState {
1361 SVGA3dSamplerId samplerId;
1362 } SVGA3dCmdDXDestroySamplerState;
1363 #pragma pack(pop)
1364
1365 #define SVGADX_SIGNATURE_SEMANTIC_NAME_UNDEFINED 0
1366 #define SVGADX_SIGNATURE_SEMANTIC_NAME_POSITION 1
1367 #define SVGADX_SIGNATURE_SEMANTIC_NAME_CLIP_DISTANCE 2
1368 #define SVGADX_SIGNATURE_SEMANTIC_NAME_CULL_DISTANCE 3
1369 #define SVGADX_SIGNATURE_SEMANTIC_NAME_RENDER_TARGET_ARRAY_INDEX 4
1370 #define SVGADX_SIGNATURE_SEMANTIC_NAME_VIEWPORT_ARRAY_INDEX 5
1371 #define SVGADX_SIGNATURE_SEMANTIC_NAME_VERTEX_ID 6
1372 #define SVGADX_SIGNATURE_SEMANTIC_NAME_PRIMITIVE_ID 7
1373 #define SVGADX_SIGNATURE_SEMANTIC_NAME_INSTANCE_ID 8
1374 #define SVGADX_SIGNATURE_SEMANTIC_NAME_IS_FRONT_FACE 9
1375 #define SVGADX_SIGNATURE_SEMANTIC_NAME_SAMPLE_INDEX 10
1376 #define SVGADX_SIGNATURE_SEMANTIC_NAME_FINAL_QUAD_U_EQ_0_EDGE_TESSFACTOR 11
1377 #define SVGADX_SIGNATURE_SEMANTIC_NAME_FINAL_QUAD_V_EQ_0_EDGE_TESSFACTOR 12
1378 #define SVGADX_SIGNATURE_SEMANTIC_NAME_FINAL_QUAD_U_EQ_1_EDGE_TESSFACTOR 13
1379 #define SVGADX_SIGNATURE_SEMANTIC_NAME_FINAL_QUAD_V_EQ_1_EDGE_TESSFACTOR 14
1380 #define SVGADX_SIGNATURE_SEMANTIC_NAME_FINAL_QUAD_U_INSIDE_TESSFACTOR 15
1381 #define SVGADX_SIGNATURE_SEMANTIC_NAME_FINAL_QUAD_V_INSIDE_TESSFACTOR 16
1382 #define SVGADX_SIGNATURE_SEMANTIC_NAME_FINAL_TRI_U_EQ_0_EDGE_TESSFACTOR 17
1383 #define SVGADX_SIGNATURE_SEMANTIC_NAME_FINAL_TRI_V_EQ_0_EDGE_TESSFACTOR 18
1384 #define SVGADX_SIGNATURE_SEMANTIC_NAME_FINAL_TRI_W_EQ_0_EDGE_TESSFACTOR 19
1385 #define SVGADX_SIGNATURE_SEMANTIC_NAME_FINAL_TRI_INSIDE_TESSFACTOR 20
1386 #define SVGADX_SIGNATURE_SEMANTIC_NAME_FINAL_LINE_DETAIL_TESSFACTOR 21
1387 #define SVGADX_SIGNATURE_SEMANTIC_NAME_FINAL_LINE_DENSITY_TESSFACTOR 22
1388 #define SVGADX_SIGNATURE_SEMANTIC_NAME_MAX 23
1389 typedef uint32 SVGA3dDXSignatureSemanticName;
1390
1391 #define SVGADX_SIGNATURE_REGISTER_COMPONENT_UNKNOWN 0
1392 typedef uint32 SVGA3dDXSignatureRegisterComponentType;
1393
1394 #define SVGADX_SIGNATURE_MIN_PRECISION_DEFAULT 0
1395 typedef uint32 SVGA3dDXSignatureMinPrecision;
1396
1397 #pragma pack(push, 1)
1398 typedef struct SVGA3dDXSignatureEntry {
1399 uint32 registerIndex;
1400 SVGA3dDXSignatureSemanticName semanticName;
1401 uint32 mask;
1402 SVGA3dDXSignatureRegisterComponentType componentType;
1403 SVGA3dDXSignatureMinPrecision minPrecision;
1404 } SVGA3dDXShaderSignatureEntry;
1405 #pragma pack(pop)
1406
1407 #define SVGADX_SIGNATURE_HEADER_VERSION_0 0x08a92d12
1408
1409 #pragma pack(push, 1)
1410 typedef struct SVGA3dDXSignatureHeader {
1411 uint32 headerVersion;
1412 uint32 numInputSignatures;
1413 uint32 numOutputSignatures;
1414 uint32 numPatchConstantSignatures;
1415 } SVGA3dDXShaderSignatureHeader;
1416 #pragma pack(pop)
1417
1418 #pragma pack(push, 1)
1419 typedef struct SVGA3dCmdDXDefineShader {
1420 SVGA3dShaderId shaderId;
1421 SVGA3dShaderType type;
1422 uint32 sizeInBytes;
1423 } SVGA3dCmdDXDefineShader;
1424 #pragma pack(pop)
1425
1426 #pragma pack(push, 1)
1427 typedef struct SVGACOTableDXShaderEntry {
1428 SVGA3dShaderType type;
1429 uint32 sizeInBytes;
1430 uint32 offsetInBytes;
1431 SVGAMobId mobid;
1432 uint32 pad[4];
1433 } SVGACOTableDXShaderEntry;
1434 #pragma pack(pop)
1435
1436 #pragma pack(push, 1)
1437 typedef struct SVGA3dCmdDXDestroyShader {
1438 SVGA3dShaderId shaderId;
1439 } SVGA3dCmdDXDestroyShader;
1440 #pragma pack(pop)
1441
1442 #pragma pack(push, 1)
1443 typedef struct SVGA3dCmdDXBindShader {
1444 uint32 cid;
1445 uint32 shid;
1446 SVGAMobId mobid;
1447 uint32 offsetInBytes;
1448 } SVGA3dCmdDXBindShader;
1449 #pragma pack(pop)
1450
1451 #pragma pack(push, 1)
1452 typedef struct SVGA3dCmdDXBindAllShader {
1453 uint32 cid;
1454 SVGAMobId mobid;
1455 } SVGA3dCmdDXBindAllShader;
1456 #pragma pack(pop)
1457
1458 #pragma pack(push, 1)
1459 typedef struct SVGA3dCmdDXCondBindAllShader {
1460 uint32 cid;
1461 SVGAMobId testMobid;
1462 SVGAMobId mobid;
1463 } SVGA3dCmdDXCondBindAllShader;
1464 #pragma pack(pop)
1465
1466 #define SVGA3D_MAX_DX10_STREAMOUT_DECLS 64
1467 #define SVGA3D_MAX_STREAMOUT_DECLS 512
1468
1469 #pragma pack(push, 1)
1470 typedef struct SVGA3dStreamOutputDeclarationEntry {
1471 uint32 outputSlot;
1472 uint32 registerIndex;
1473 uint8 registerMask;
1474 uint8 pad0;
1475 uint16 pad1;
1476 uint32 stream;
1477 } SVGA3dStreamOutputDeclarationEntry;
1478 #pragma pack(pop)
1479
1480 #pragma pack(push, 1)
1481 typedef struct SVGAOTableStreamOutputEntry {
1482 uint32 numOutputStreamEntries;
1483 SVGA3dStreamOutputDeclarationEntry decl[SVGA3D_MAX_DX10_STREAMOUT_DECLS];
1484 uint32 streamOutputStrideInBytes[SVGA3D_DX_MAX_SOTARGETS];
1485 uint32 rasterizedStream;
1486 uint32 numOutputStreamStrides;
1487 uint32 mobid;
1488 uint32 offsetInBytes;
1489 uint8 usesMob;
1490 uint8 pad0;
1491 uint16 pad1;
1492 uint32 pad2[246];
1493 } SVGACOTableDXStreamOutputEntry;
1494 #pragma pack(pop)
1495
1496 #pragma pack(push, 1)
1497 typedef struct SVGA3dCmdDXDefineStreamOutput {
1498 SVGA3dStreamOutputId soid;
1499 uint32 numOutputStreamEntries;
1500 SVGA3dStreamOutputDeclarationEntry decl[SVGA3D_MAX_DX10_STREAMOUT_DECLS];
1501 uint32 streamOutputStrideInBytes[SVGA3D_DX_MAX_SOTARGETS];
1502 uint32 rasterizedStream;
1503 } SVGA3dCmdDXDefineStreamOutput;
1504 #pragma pack(pop)
1505
1506 #define SVGA3D_DX_SO_NO_RASTERIZED_STREAM 0xFFFFFFFF
1507
1508 #pragma pack(push, 1)
1509 typedef struct SVGA3dCmdDXDefineStreamOutputWithMob {
1510 SVGA3dStreamOutputId soid;
1511 uint32 numOutputStreamEntries;
1512 uint32 numOutputStreamStrides;
1513 uint32 streamOutputStrideInBytes[SVGA3D_DX_MAX_SOTARGETS];
1514 uint32 rasterizedStream;
1515 } SVGA3dCmdDXDefineStreamOutputWithMob;
1516 #pragma pack(pop)
1517
1518 #pragma pack(push, 1)
1519 typedef struct SVGA3dCmdDXBindStreamOutput {
1520 SVGA3dStreamOutputId soid;
1521 uint32 mobid;
1522 uint32 offsetInBytes;
1523 uint32 sizeInBytes;
1524 } SVGA3dCmdDXBindStreamOutput;
1525 #pragma pack(pop)
1526
1527 #pragma pack(push, 1)
1528 typedef struct SVGA3dCmdDXDestroyStreamOutput {
1529 SVGA3dStreamOutputId soid;
1530 } SVGA3dCmdDXDestroyStreamOutput;
1531 #pragma pack(pop)
1532
1533 #pragma pack(push, 1)
1534 typedef struct SVGA3dCmdDXSetStreamOutput {
1535 SVGA3dStreamOutputId soid;
1536 } SVGA3dCmdDXSetStreamOutput;
1537 #pragma pack(pop)
1538
1539 #pragma pack(push, 1)
1540 typedef struct SVGA3dCmdDXSetMinLOD {
1541 SVGA3dSurfaceId sid;
1542 float minLOD;
1543 } SVGA3dCmdDXSetMinLOD;
1544 #pragma pack(pop)
1545
1546 #pragma pack(push, 1)
1547 typedef struct {
1548 uint64 value;
1549 uint32 mobId;
1550 uint32 mobOffset;
1551 } SVGA3dCmdDXMobFence64;
1552 #pragma pack(pop)
1553
1554 #pragma pack(push, 1)
1555 typedef struct SVGA3dCmdDXSetCOTable {
1556 uint32 cid;
1557 uint32 mobid;
1558 SVGACOTableType type;
1559 uint32 validSizeInBytes;
1560 } SVGA3dCmdDXSetCOTable;
1561 #pragma pack(pop)
1562
1563 #pragma pack(push, 1)
1564 typedef struct SVGA3dCmdDXGrowCOTable {
1565 uint32 cid;
1566 uint32 mobid;
1567 SVGACOTableType type;
1568 uint32 validSizeInBytes;
1569 } SVGA3dCmdDXGrowCOTable;
1570 #pragma pack(pop)
1571
1572 #pragma pack(push, 1)
1573 typedef struct SVGA3dCmdDXReadbackCOTable {
1574 uint32 cid;
1575 SVGACOTableType type;
1576 } SVGA3dCmdDXReadbackCOTable;
1577 #pragma pack(pop)
1578
1579 #pragma pack(push, 1)
1580 typedef struct SVGA3dCmdDXCopyCOTableIntoMob {
1581 uint32 cid;
1582 SVGACOTableType type;
1583 uint32 mobid;
1584 } SVGA3dCmdDXCopyCOTableIntoMob;
1585 #pragma pack(pop)
1586
1587 #pragma pack(push, 1)
1588 typedef struct SVGA3dCmdDXPredStagingCopy {
1589 SVGA3dSurfaceId dstSid;
1590 SVGA3dSurfaceId srcSid;
1591 uint8 readback;
1592 uint8 unsynchronized;
1593 uint8 mustBeZero[2];
1594
1595 } SVGA3dCmdDXPredStagingCopy;
1596 #pragma pack(pop)
1597
1598 #pragma pack(push, 1)
1599 typedef struct SVGA3dCmdDXStagingCopy {
1600 SVGA3dSurfaceId dstSid;
1601 SVGA3dSurfaceId srcSid;
1602 uint8 readback;
1603 uint8 unsynchronized;
1604 uint8 mustBeZero[2];
1605
1606 } SVGA3dCmdDXStagingCopy;
1607 #pragma pack(pop)
1608
1609 #pragma pack(push, 1)
1610 typedef struct SVGA3dCOTableData {
1611 uint32 mobid;
1612 } SVGA3dCOTableData;
1613 #pragma pack(pop)
1614
1615 #pragma pack(push, 1)
1616 typedef struct SVGA3dBufferBinding {
1617 uint32 bufferId;
1618 uint32 stride;
1619 uint32 offset;
1620 } SVGA3dBufferBinding;
1621 #pragma pack(pop)
1622
1623 #pragma pack(push, 1)
1624 typedef struct SVGA3dConstantBufferBinding {
1625 uint32 sid;
1626 uint32 offsetInBytes;
1627 uint32 sizeInBytes;
1628 } SVGA3dConstantBufferBinding;
1629 #pragma pack(pop)
1630
1631 #pragma pack(push, 1)
1632 typedef struct SVGADXInputAssemblyMobFormat {
1633 uint32 layoutId;
1634 SVGA3dBufferBinding vertexBuffers[SVGA3D_DX_MAX_VERTEXBUFFERS];
1635 uint32 indexBufferSid;
1636 uint32 pad;
1637 uint32 indexBufferOffset;
1638 uint32 indexBufferFormat;
1639 uint32 topology;
1640 } SVGADXInputAssemblyMobFormat;
1641 #pragma pack(pop)
1642
1643 #pragma pack(push, 1)
1644 typedef struct SVGADXContextMobFormat {
1645 SVGADXInputAssemblyMobFormat inputAssembly;
1646
1647 struct {
1648 uint32 blendStateId;
1649 uint32 blendFactor[4];
1650 uint32 sampleMask;
1651 uint32 depthStencilStateId;
1652 uint32 stencilRef;
1653 uint32 rasterizerStateId;
1654 uint32 depthStencilViewId;
1655 uint32 renderTargetViewIds[SVGA3D_DX_MAX_RENDER_TARGETS];
1656 } renderState;
1657
1658 uint32 pad0[8];
1659
1660 struct {
1661 uint32 targets[SVGA3D_DX_MAX_SOTARGETS];
1662 uint32 soid;
1663 } streamOut;
1664
1665 uint32 pad1[10];
1666
1667 uint32 uavSpliceIndex;
1668
1669 uint8 numViewports;
1670 uint8 numScissorRects;
1671 uint16 pad2[1];
1672
1673 uint32 pad3[3];
1674
1675 SVGA3dViewport viewports[SVGA3D_DX_MAX_VIEWPORTS];
1676 uint32 pad4[32];
1677
1678 SVGASignedRect scissorRects[SVGA3D_DX_MAX_SCISSORRECTS];
1679 uint32 pad5[64];
1680
1681 struct {
1682 uint32 queryID;
1683 uint32 value;
1684 } predication;
1685
1686 SVGAMobId shaderIfaceMobid;
1687 uint32 shaderIfaceOffset;
1688 struct {
1689 uint32 shaderId;
1690 SVGA3dConstantBufferBinding
1691 constantBuffers[SVGA3D_DX_MAX_CONSTBUFFERS];
1692 uint32 shaderResources[SVGA3D_DX_MAX_SRVIEWS];
1693 uint32 samplers[SVGA3D_DX_MAX_SAMPLERS];
1694 } shaderState[SVGA3D_NUM_SHADERTYPE];
1695 uint32 pad6[26];
1696
1697 SVGA3dQueryId queryID[SVGA3D_MAX_QUERY];
1698
1699 SVGA3dCOTableData cotables[SVGA_COTABLE_MAX];
1700
1701 uint32 pad7[64];
1702
1703 uint32 uaViewIds[SVGA3D_DX11_1_MAX_UAVIEWS];
1704 uint32 csuaViewIds[SVGA3D_DX11_1_MAX_UAVIEWS];
1705
1706 uint32 pad8[188];
1707 } SVGADXContextMobFormat;
1708 #pragma pack(pop)
1709
1710 #define SVGA3D_DX_MAX_CLASS_INSTANCES_PADDED 256
1711
1712 #pragma pack(push, 1)
1713 typedef struct SVGADXShaderIfaceMobFormat {
1714 struct {
1715 uint32 numClassInstances;
1716 uint32 iface[SVGA3D_DX_MAX_CLASS_INSTANCES_PADDED];
1717 SVGA3dIfaceData data[SVGA3D_DX_MAX_CLASS_INSTANCES_PADDED];
1718 } shaderIfaceState[SVGA3D_NUM_SHADERTYPE];
1719
1720 uint32 pad0[1018];
1721 } SVGADXShaderIfaceMobFormat;
1722 #pragma pack(pop)
1723
1724 #endif