"Fossies" - the Fresh Open Source Software Archive

Member "mesa-20.1.8/src/gallium/drivers/svga/include/svga3d_dx.h" (16 Sep 2020, 42434 Bytes) of package /linux/misc/mesa-20.1.8.tar.xz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "svga3d_dx.h" see the Fossies "Dox" file reference documentation and the last Fossies "Diffs" side-by-side code changes report: 20.1.5_vs_20.2.0-rc1.

    1 /**********************************************************
    2  * Copyright 2007-2017 VMware, Inc.  All rights reserved.
    3  *
    4  * Permission is hereby granted, free of charge, to any person
    5  * obtaining a copy of this software and associated documentation
    6  * files (the "Software"), to deal in the Software without
    7  * restriction, including without limitation the rights to use, copy,
    8  * modify, merge, publish, distribute, sublicense, and/or sell copies
    9  * of the Software, and to permit persons to whom the Software is
   10  * furnished to do so, subject to the following conditions:
   11  *
   12  * The above copyright notice and this permission notice shall be
   13  * included in all copies or substantial portions of the Software.
   14  *
   15  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
   16  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
   17  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
   18  * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
   19  * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
   20  * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
   21  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
   22  * SOFTWARE.
   23  *
   24  **********************************************************/
   25 
   26 /*
   27  * svga3d_dx.h --
   28  *
   29  *       SVGA 3d hardware definitions for DX10 support.
   30  */
   31 
   32 #ifndef _SVGA3D_DX_H_
   33 #define _SVGA3D_DX_H_
   34 
   35 #define INCLUDE_ALLOW_MODULE
   36 #define INCLUDE_ALLOW_USERLEVEL
   37 #define INCLUDE_ALLOW_VMCORE
   38 #include "includeCheck.h"
   39 
   40 #include "svga3d_limits.h"
   41 
   42 /* Matches D3D10_DDI_INPUT_CLASSIFICATION and D3D10_INPUT_CLASSIFICATION */
   43 #define SVGA3D_INPUT_MIN               0
   44 #define SVGA3D_INPUT_PER_VERTEX_DATA   0
   45 #define SVGA3D_INPUT_PER_INSTANCE_DATA 1
   46 #define SVGA3D_INPUT_MAX               2
   47 typedef uint32 SVGA3dInputClassification;
   48 
   49 /* Matches D3D10DDIRESOURCE_TYPE */
   50 #define SVGA3D_RESOURCE_TYPE_MIN      1
   51 #define SVGA3D_RESOURCE_BUFFER        1
   52 #define SVGA3D_RESOURCE_TEXTURE1D     2
   53 #define SVGA3D_RESOURCE_TEXTURE2D     3
   54 #define SVGA3D_RESOURCE_TEXTURE3D     4
   55 #define SVGA3D_RESOURCE_TEXTURECUBE   5
   56 #define SVGA3D_RESOURCE_TYPE_DX10_MAX 6
   57 #define SVGA3D_RESOURCE_BUFFEREX      6
   58 #define SVGA3D_RESOURCE_TYPE_MAX      7
   59 typedef uint32 SVGA3dResourceType;
   60 
   61 /* Matches D3D10_DDI_COLOR_WRITE_ENABLE and D3D10_COLOR_WRITE_ENABLE */
   62 #define SVGA3D_COLOR_WRITE_ENABLE_RED     (1 << 0)
   63 #define SVGA3D_COLOR_WRITE_ENABLE_GREEN   (1 << 1)
   64 #define SVGA3D_COLOR_WRITE_ENABLE_BLUE    (1 << 2)
   65 #define SVGA3D_COLOR_WRITE_ENABLE_ALPHA   (1 << 3)
   66 #define SVGA3D_COLOR_WRITE_ENABLE_ALL     (SVGA3D_COLOR_WRITE_ENABLE_RED |   \
   67                                            SVGA3D_COLOR_WRITE_ENABLE_GREEN | \
   68                                            SVGA3D_COLOR_WRITE_ENABLE_BLUE |  \
   69                                            SVGA3D_COLOR_WRITE_ENABLE_ALPHA)
   70 typedef uint8 SVGA3dColorWriteEnable;
   71 
   72 /* Matches D3D10_DDI_DEPTH_WRITE_MASK and D3D10_DEPTH_WRITE_MASK */
   73 #define SVGA3D_DEPTH_WRITE_MASK_ZERO   0
   74 #define SVGA3D_DEPTH_WRITE_MASK_ALL    1
   75 typedef uint8 SVGA3dDepthWriteMask;
   76 
   77 /* Matches D3D10_DDI_FILTER and D3D10_FILTER */
   78 #define SVGA3D_FILTER_MIP_LINEAR  (1 << 0)
   79 #define SVGA3D_FILTER_MAG_LINEAR  (1 << 2)
   80 #define SVGA3D_FILTER_MIN_LINEAR  (1 << 4)
   81 #define SVGA3D_FILTER_ANISOTROPIC (1 << 6)
   82 #define SVGA3D_FILTER_COMPARE     (1 << 7)
   83 typedef uint32 SVGA3dFilter;
   84 
   85 /* Matches D3D10_DDI_CULL_MODE */
   86 #define SVGA3D_CULL_INVALID 0
   87 #define SVGA3D_CULL_MIN     1
   88 #define SVGA3D_CULL_NONE    1
   89 #define SVGA3D_CULL_FRONT   2
   90 #define SVGA3D_CULL_BACK    3
   91 #define SVGA3D_CULL_MAX     4
   92 typedef uint8 SVGA3dCullMode;
   93 
   94 /* Matches D3D10_DDI_COMPARISON_FUNC */
   95 #define SVGA3D_COMPARISON_INVALID         0
   96 #define SVGA3D_COMPARISON_MIN             1
   97 #define SVGA3D_COMPARISON_NEVER           1
   98 #define SVGA3D_COMPARISON_LESS            2
   99 #define SVGA3D_COMPARISON_EQUAL           3
  100 #define SVGA3D_COMPARISON_LESS_EQUAL      4
  101 #define SVGA3D_COMPARISON_GREATER         5
  102 #define SVGA3D_COMPARISON_NOT_EQUAL       6
  103 #define SVGA3D_COMPARISON_GREATER_EQUAL   7
  104 #define SVGA3D_COMPARISON_ALWAYS          8
  105 #define SVGA3D_COMPARISON_MAX             9
  106 typedef uint8 SVGA3dComparisonFunc;
  107 
  108 /*
  109  * SVGA3D_MULTISAMPLE_DISABLE disables MSAA for all primitives.
  110  * SVGA3D_MULTISAMPLE_DISABLE_LINE, which is supported in DX10.1,
  111  * disables MSAA for lines only.
  112  */
  113 #define SVGA3D_MULTISAMPLE_DISABLE        0
  114 #define SVGA3D_MULTISAMPLE_ENABLE         1
  115 #define SVGA3D_MULTISAMPLE_DX_MAX         1
  116 #define SVGA3D_MULTISAMPLE_DISABLE_LINE   2
  117 #define SVGA3D_MULTISAMPLE_MAX            2
  118 typedef uint8 SVGA3dMultisampleEnable;
  119 
  120 #define SVGA3D_DX_MAX_VERTEXBUFFERS 32
  121 #define SVGA3D_DX_MAX_VERTEXINPUTREGISTERS 16
  122 #define SVGA3D_DX_SM41_MAX_VERTEXINPUTREGISTERS 32
  123 #define SVGA3D_DX_MAX_SOTARGETS 4
  124 #define SVGA3D_DX_MAX_SRVIEWS 128
  125 #define SVGA3D_DX_MAX_CONSTBUFFERS 16
  126 #define SVGA3D_DX_MAX_SAMPLERS 16
  127 
  128 #define SVGA3D_DX_MAX_CONSTBUF_BINDING_SIZE (4096 * 4 * (uint32)sizeof(uint32))
  129 
  130 typedef uint32 SVGA3dShaderResourceViewId;
  131 typedef uint32 SVGA3dRenderTargetViewId;
  132 typedef uint32 SVGA3dDepthStencilViewId;
  133 
  134 typedef uint32 SVGA3dShaderId;
  135 typedef uint32 SVGA3dElementLayoutId;
  136 typedef uint32 SVGA3dSamplerId;
  137 typedef uint32 SVGA3dBlendStateId;
  138 typedef uint32 SVGA3dDepthStencilStateId;
  139 typedef uint32 SVGA3dRasterizerStateId;
  140 typedef uint32 SVGA3dQueryId;
  141 typedef uint32 SVGA3dStreamOutputId;
  142 
  143 typedef union {
  144    struct {
  145       float r;
  146       float g;
  147       float b;
  148       float a;
  149    };
  150 
  151    float value[4];
  152 } SVGA3dRGBAFloat;
  153 
  154 typedef
  155 #include "vmware_pack_begin.h"
  156 struct {
  157    uint32 cid;
  158    SVGAMobId mobid;
  159 }
  160 #include "vmware_pack_end.h"
  161 SVGAOTableDXContextEntry;
  162 
  163 typedef
  164 #include "vmware_pack_begin.h"
  165 struct SVGA3dCmdDXDefineContext {
  166    uint32 cid;
  167 }
  168 #include "vmware_pack_end.h"
  169 SVGA3dCmdDXDefineContext;   /* SVGA_3D_CMD_DX_DEFINE_CONTEXT */
  170 
  171 typedef
  172 #include "vmware_pack_begin.h"
  173 struct SVGA3dCmdDXDestroyContext {
  174    uint32 cid;
  175 }
  176 #include "vmware_pack_end.h"
  177 SVGA3dCmdDXDestroyContext;   /* SVGA_3D_CMD_DX_DESTROY_CONTEXT */
  178 
  179 /*
  180  * Bind a DX context.
  181  *
  182  * validContents should be set to 0 for new contexts,
  183  * and 1 if this is an old context which is getting paged
  184  * back on to the device.
  185  *
  186  * For new contexts, it is recommended that the driver
  187  * issue commands to initialize all interesting state
  188  * prior to rendering.
  189  */
  190 typedef
  191 #include "vmware_pack_begin.h"
  192 struct SVGA3dCmdDXBindContext {
  193    uint32 cid;
  194    SVGAMobId mobid;
  195    uint32 validContents;
  196 }
  197 #include "vmware_pack_end.h"
  198 SVGA3dCmdDXBindContext;   /* SVGA_3D_CMD_DX_BIND_CONTEXT */
  199 
  200 /*
  201  * Readback a DX context.
  202  * (Request that the device flush the contents back into guest memory.)
  203  */
  204 typedef
  205 #include "vmware_pack_begin.h"
  206 struct SVGA3dCmdDXReadbackContext {
  207    uint32 cid;
  208 }
  209 #include "vmware_pack_end.h"
  210 SVGA3dCmdDXReadbackContext;   /* SVGA_3D_CMD_DX_READBACK_CONTEXT */
  211 
  212 /*
  213  * Invalidate a guest-backed context.
  214  */
  215 typedef
  216 #include "vmware_pack_begin.h"
  217 struct SVGA3dCmdDXInvalidateContext {
  218    uint32 cid;
  219 }
  220 #include "vmware_pack_end.h"
  221 SVGA3dCmdDXInvalidateContext;   /* SVGA_3D_CMD_DX_INVALIDATE_CONTEXT */
  222 
  223 typedef
  224 #include "vmware_pack_begin.h"
  225 struct SVGA3dCmdDXSetSingleConstantBuffer {
  226    uint32 slot;
  227    SVGA3dShaderType type;
  228    SVGA3dSurfaceId sid;
  229    uint32 offsetInBytes;
  230    uint32 sizeInBytes;
  231 }
  232 #include "vmware_pack_end.h"
  233 SVGA3dCmdDXSetSingleConstantBuffer;
  234 /* SVGA_3D_CMD_DX_SET_SINGLE_CONSTANT_BUFFER */
  235 
  236 typedef
  237 #include "vmware_pack_begin.h"
  238 struct SVGA3dCmdDXSetShaderResources {
  239    uint32 startView;
  240    SVGA3dShaderType type;
  241 
  242    /*
  243     * Followed by a variable number of SVGA3dShaderResourceViewId's.
  244     */
  245 }
  246 #include "vmware_pack_end.h"
  247 SVGA3dCmdDXSetShaderResources; /* SVGA_3D_CMD_DX_SET_SHADER_RESOURCES */
  248 
  249 typedef
  250 #include "vmware_pack_begin.h"
  251 struct SVGA3dCmdDXSetShader {
  252    SVGA3dShaderId shaderId;
  253    SVGA3dShaderType type;
  254 }
  255 #include "vmware_pack_end.h"
  256 SVGA3dCmdDXSetShader; /* SVGA_3D_CMD_DX_SET_SHADER */
  257 
  258 typedef
  259 #include "vmware_pack_begin.h"
  260 struct SVGA3dCmdDXSetSamplers {
  261    uint32 startSampler;
  262    SVGA3dShaderType type;
  263 
  264    /*
  265     * Followed by a variable number of SVGA3dSamplerId's.
  266     */
  267 }
  268 #include "vmware_pack_end.h"
  269 SVGA3dCmdDXSetSamplers; /* SVGA_3D_CMD_DX_SET_SAMPLERS */
  270 
  271 typedef
  272 #include "vmware_pack_begin.h"
  273 struct SVGA3dCmdDXDraw {
  274    uint32 vertexCount;
  275    uint32 startVertexLocation;
  276 }
  277 #include "vmware_pack_end.h"
  278 SVGA3dCmdDXDraw; /* SVGA_3D_CMD_DX_DRAW */
  279 
  280 typedef
  281 #include "vmware_pack_begin.h"
  282 struct SVGA3dCmdDXDrawIndexed {
  283    uint32 indexCount;
  284    uint32 startIndexLocation;
  285    int32  baseVertexLocation;
  286 }
  287 #include "vmware_pack_end.h"
  288 SVGA3dCmdDXDrawIndexed; /* SVGA_3D_CMD_DX_DRAW_INDEXED */
  289 
  290 typedef
  291 #include "vmware_pack_begin.h"
  292 struct SVGA3dCmdDXDrawInstanced {
  293    uint32 vertexCountPerInstance;
  294    uint32 instanceCount;
  295    uint32 startVertexLocation;
  296    uint32 startInstanceLocation;
  297 }
  298 #include "vmware_pack_end.h"
  299 SVGA3dCmdDXDrawInstanced; /* SVGA_3D_CMD_DX_DRAW_INSTANCED */
  300 
  301 typedef
  302 #include "vmware_pack_begin.h"
  303 struct SVGA3dCmdDXDrawIndexedInstanced {
  304    uint32 indexCountPerInstance;
  305    uint32 instanceCount;
  306    uint32 startIndexLocation;
  307    int32  baseVertexLocation;
  308    uint32 startInstanceLocation;
  309 }
  310 #include "vmware_pack_end.h"
  311 SVGA3dCmdDXDrawIndexedInstanced; /* SVGA_3D_CMD_DX_DRAW_INDEXED_INSTANCED */
  312 
  313 typedef
  314 #include "vmware_pack_begin.h"
  315 struct SVGA3dCmdDXDrawAuto {
  316    uint32 pad0;
  317 }
  318 #include "vmware_pack_end.h"
  319 SVGA3dCmdDXDrawAuto; /* SVGA_3D_CMD_DX_DRAW_AUTO */
  320 
  321 typedef
  322 #include "vmware_pack_begin.h"
  323 struct SVGA3dCmdDXSetInputLayout {
  324    SVGA3dElementLayoutId elementLayoutId;
  325 }
  326 #include "vmware_pack_end.h"
  327 SVGA3dCmdDXSetInputLayout; /* SVGA_3D_CMD_DX_SET_INPUT_LAYOUT */
  328 
  329 typedef
  330 #include "vmware_pack_begin.h"
  331 struct SVGA3dVertexBuffer {
  332    SVGA3dSurfaceId sid;
  333    uint32 stride;
  334    uint32 offset;
  335 }
  336 #include "vmware_pack_end.h"
  337 SVGA3dVertexBuffer;
  338 
  339 typedef
  340 #include "vmware_pack_begin.h"
  341 struct SVGA3dCmdDXSetVertexBuffers {
  342    uint32 startBuffer;
  343    /* Followed by a variable number of SVGA3dVertexBuffer's. */
  344 }
  345 #include "vmware_pack_end.h"
  346 SVGA3dCmdDXSetVertexBuffers; /* SVGA_3D_CMD_DX_SET_VERTEX_BUFFERS */
  347 
  348 typedef
  349 #include "vmware_pack_begin.h"
  350 struct SVGA3dCmdDXSetIndexBuffer {
  351    SVGA3dSurfaceId sid;
  352    SVGA3dSurfaceFormat format;
  353    uint32 offset;
  354 }
  355 #include "vmware_pack_end.h"
  356 SVGA3dCmdDXSetIndexBuffer; /* SVGA_3D_CMD_DX_SET_INDEX_BUFFER */
  357 
  358 typedef
  359 #include "vmware_pack_begin.h"
  360 struct SVGA3dCmdDXSetTopology {
  361    SVGA3dPrimitiveType topology;
  362 }
  363 #include "vmware_pack_end.h"
  364 SVGA3dCmdDXSetTopology; /* SVGA_3D_CMD_DX_SET_TOPOLOGY */
  365 
  366 typedef
  367 #include "vmware_pack_begin.h"
  368 struct SVGA3dCmdDXSetRenderTargets {
  369    SVGA3dDepthStencilViewId depthStencilViewId;
  370    /* Followed by a variable number of SVGA3dRenderTargetViewId's. */
  371 }
  372 #include "vmware_pack_end.h"
  373 SVGA3dCmdDXSetRenderTargets; /* SVGA_3D_CMD_DX_SET_RENDERTARGETS */
  374 
  375 typedef
  376 #include "vmware_pack_begin.h"
  377 struct SVGA3dCmdDXSetBlendState {
  378    SVGA3dBlendStateId blendId;
  379    float blendFactor[4];
  380    uint32 sampleMask;
  381 }
  382 #include "vmware_pack_end.h"
  383 SVGA3dCmdDXSetBlendState; /* SVGA_3D_CMD_DX_SET_BLEND_STATE */
  384 
  385 typedef
  386 #include "vmware_pack_begin.h"
  387 struct SVGA3dCmdDXSetDepthStencilState {
  388    SVGA3dDepthStencilStateId depthStencilId;
  389    uint32 stencilRef;
  390 }
  391 #include "vmware_pack_end.h"
  392 SVGA3dCmdDXSetDepthStencilState; /* SVGA_3D_CMD_DX_SET_DEPTHSTENCIL_STATE */
  393 
  394 typedef
  395 #include "vmware_pack_begin.h"
  396 struct SVGA3dCmdDXSetRasterizerState {
  397    SVGA3dRasterizerStateId rasterizerId;
  398 }
  399 #include "vmware_pack_end.h"
  400 SVGA3dCmdDXSetRasterizerState; /* SVGA_3D_CMD_DX_SET_RASTERIZER_STATE */
  401 
  402 /* Matches D3D10DDI_QUERY_MISCFLAG and D3D10_QUERY_MISC_FLAG */
  403 #define SVGA3D_DXQUERY_FLAG_PREDICATEHINT (1 << 0)
  404 typedef uint32 SVGA3dDXQueryFlags;
  405 
  406 /*
  407  * The SVGADXQueryDeviceState and SVGADXQueryDeviceBits are used by the device
  408  * to track query state transitions, but are not intended to be used by the
  409  * driver.
  410  */
  411 #define SVGADX_QDSTATE_INVALID   ((uint8)-1) /* Query has no state */
  412 #define SVGADX_QDSTATE_MIN       0
  413 #define SVGADX_QDSTATE_IDLE      0   /* Query hasn't started yet */
  414 #define SVGADX_QDSTATE_ACTIVE    1   /* Query is actively gathering data */
  415 #define SVGADX_QDSTATE_PENDING   2   /* Query is waiting for results */
  416 #define SVGADX_QDSTATE_FINISHED  3   /* Query has completed */
  417 #define SVGADX_QDSTATE_MAX       4
  418 typedef uint8 SVGADXQueryDeviceState;
  419 
  420 typedef
  421 #include "vmware_pack_begin.h"
  422 struct {
  423    SVGA3dQueryTypeUint8 type;
  424    uint16 pad0;
  425    SVGADXQueryDeviceState state;
  426    SVGA3dDXQueryFlags flags;
  427    SVGAMobId mobid;
  428    uint32 offset;
  429 }
  430 #include "vmware_pack_end.h"
  431 SVGACOTableDXQueryEntry;
  432 
  433 typedef
  434 #include "vmware_pack_begin.h"
  435 struct SVGA3dCmdDXDefineQuery {
  436    SVGA3dQueryId queryId;
  437    SVGA3dQueryType type;
  438    SVGA3dDXQueryFlags flags;
  439 }
  440 #include "vmware_pack_end.h"
  441 SVGA3dCmdDXDefineQuery; /* SVGA_3D_CMD_DX_DEFINE_QUERY */
  442 
  443 typedef
  444 #include "vmware_pack_begin.h"
  445 struct SVGA3dCmdDXDestroyQuery {
  446    SVGA3dQueryId queryId;
  447 }
  448 #include "vmware_pack_end.h"
  449 SVGA3dCmdDXDestroyQuery; /* SVGA_3D_CMD_DX_DESTROY_QUERY */
  450 
  451 typedef
  452 #include "vmware_pack_begin.h"
  453 struct SVGA3dCmdDXBindQuery {
  454    SVGA3dQueryId queryId;
  455    SVGAMobId mobid;
  456 }
  457 #include "vmware_pack_end.h"
  458 SVGA3dCmdDXBindQuery; /* SVGA_3D_CMD_DX_BIND_QUERY */
  459 
  460 typedef
  461 #include "vmware_pack_begin.h"
  462 struct SVGA3dCmdDXSetQueryOffset {
  463    SVGA3dQueryId queryId;
  464    uint32 mobOffset;
  465 }
  466 #include "vmware_pack_end.h"
  467 SVGA3dCmdDXSetQueryOffset; /* SVGA_3D_CMD_DX_SET_QUERY_OFFSET */
  468 
  469 typedef
  470 #include "vmware_pack_begin.h"
  471 struct SVGA3dCmdDXBeginQuery {
  472    SVGA3dQueryId queryId;
  473 }
  474 #include "vmware_pack_end.h"
  475 SVGA3dCmdDXBeginQuery; /* SVGA_3D_CMD_DX_QUERY_BEGIN */
  476 
  477 typedef
  478 #include "vmware_pack_begin.h"
  479 struct SVGA3dCmdDXEndQuery {
  480    SVGA3dQueryId queryId;
  481 }
  482 #include "vmware_pack_end.h"
  483 SVGA3dCmdDXEndQuery; /* SVGA_3D_CMD_DX_QUERY_END */
  484 
  485 typedef
  486 #include "vmware_pack_begin.h"
  487 struct SVGA3dCmdDXReadbackQuery {
  488    SVGA3dQueryId queryId;
  489 }
  490 #include "vmware_pack_end.h"
  491 SVGA3dCmdDXReadbackQuery; /* SVGA_3D_CMD_DX_READBACK_QUERY */
  492 
  493 typedef
  494 #include "vmware_pack_begin.h"
  495 struct SVGA3dCmdDXMoveQuery {
  496    SVGA3dQueryId queryId;
  497    SVGAMobId mobid;
  498    uint32 mobOffset;
  499 }
  500 #include "vmware_pack_end.h"
  501 SVGA3dCmdDXMoveQuery; /* SVGA_3D_CMD_DX_MOVE_QUERY */
  502 
  503 typedef
  504 #include "vmware_pack_begin.h"
  505 struct SVGA3dCmdDXBindAllQuery {
  506    uint32 cid;
  507    SVGAMobId mobid;
  508 }
  509 #include "vmware_pack_end.h"
  510 SVGA3dCmdDXBindAllQuery; /* SVGA_3D_CMD_DX_BIND_ALL_QUERY */
  511 
  512 typedef
  513 #include "vmware_pack_begin.h"
  514 struct SVGA3dCmdDXReadbackAllQuery {
  515    uint32 cid;
  516 }
  517 #include "vmware_pack_end.h"
  518 SVGA3dCmdDXReadbackAllQuery; /* SVGA_3D_CMD_DX_READBACK_ALL_QUERY */
  519 
  520 typedef
  521 #include "vmware_pack_begin.h"
  522 struct SVGA3dCmdDXSetPredication {
  523    SVGA3dQueryId queryId;
  524    uint32 predicateValue;
  525 }
  526 #include "vmware_pack_end.h"
  527 SVGA3dCmdDXSetPredication; /* SVGA_3D_CMD_DX_SET_PREDICATION */
  528 
  529 typedef
  530 #include "vmware_pack_begin.h"
  531 struct MKS3dDXSOState {
  532    uint32 offset;       /* Starting offset */
  533    uint32 intOffset;    /* Internal offset */
  534    uint32 vertexCount;  /* vertices written */
  535    uint32 sizeInBytes;  /* max bytes to write */
  536 }
  537 #include "vmware_pack_end.h"
  538 SVGA3dDXSOState;
  539 
  540 /* Set the offset field to this value to append SO values to the buffer */
  541 #define SVGA3D_DX_SO_OFFSET_APPEND ((uint32) ~0u)
  542 
  543 typedef
  544 #include "vmware_pack_begin.h"
  545 struct SVGA3dSoTarget {
  546    SVGA3dSurfaceId sid;
  547    uint32 offset;
  548    uint32 sizeInBytes;
  549 }
  550 #include "vmware_pack_end.h"
  551 SVGA3dSoTarget;
  552 
  553 typedef
  554 #include "vmware_pack_begin.h"
  555 struct SVGA3dCmdDXSetSOTargets {
  556    uint32 pad0;
  557    /* Followed by a variable number of SVGA3dSOTarget's. */
  558 }
  559 #include "vmware_pack_end.h"
  560 SVGA3dCmdDXSetSOTargets; /* SVGA_3D_CMD_DX_SET_SOTARGETS */
  561 
  562 typedef
  563 #include "vmware_pack_begin.h"
  564 struct SVGA3dViewport
  565 {
  566    float x;
  567    float y;
  568    float width;
  569    float height;
  570    float minDepth;
  571    float maxDepth;
  572 }
  573 #include "vmware_pack_end.h"
  574 SVGA3dViewport;
  575 
  576 typedef
  577 #include "vmware_pack_begin.h"
  578 struct SVGA3dCmdDXSetViewports {
  579    uint32 pad0;
  580    /* Followed by a variable number of SVGA3dViewport's. */
  581 }
  582 #include "vmware_pack_end.h"
  583 SVGA3dCmdDXSetViewports; /* SVGA_3D_CMD_DX_SET_VIEWPORTS */
  584 
  585 #define SVGA3D_DX_MAX_VIEWPORTS  16
  586 
  587 typedef
  588 #include "vmware_pack_begin.h"
  589 struct SVGA3dCmdDXSetScissorRects {
  590    uint32 pad0;
  591    /* Followed by a variable number of SVGASignedRect's. */
  592 }
  593 #include "vmware_pack_end.h"
  594 SVGA3dCmdDXSetScissorRects; /* SVGA_3D_CMD_DX_SET_SCISSORRECTS */
  595 
  596 #define SVGA3D_DX_MAX_SCISSORRECTS  16
  597 
  598 typedef
  599 #include "vmware_pack_begin.h"
  600 struct SVGA3dCmdDXClearRenderTargetView {
  601    SVGA3dRenderTargetViewId renderTargetViewId;
  602    SVGA3dRGBAFloat rgba;
  603 }
  604 #include "vmware_pack_end.h"
  605 SVGA3dCmdDXClearRenderTargetView; /* SVGA_3D_CMD_DX_CLEAR_RENDERTARGET_VIEW */
  606 
  607 typedef
  608 #include "vmware_pack_begin.h"
  609 struct SVGA3dCmdDXClearDepthStencilView {
  610    uint16 flags;
  611    uint16 stencil;
  612    SVGA3dDepthStencilViewId depthStencilViewId;
  613    float depth;
  614 }
  615 #include "vmware_pack_end.h"
  616 SVGA3dCmdDXClearDepthStencilView; /* SVGA_3D_CMD_DX_CLEAR_DEPTHSTENCIL_VIEW */
  617 
  618 typedef
  619 #include "vmware_pack_begin.h"
  620 struct SVGA3dCmdDXPredCopyRegion {
  621    SVGA3dSurfaceId dstSid;
  622    uint32 dstSubResource;
  623    SVGA3dSurfaceId srcSid;
  624    uint32 srcSubResource;
  625    SVGA3dCopyBox box;
  626 }
  627 #include "vmware_pack_end.h"
  628 SVGA3dCmdDXPredCopyRegion;
  629 /* SVGA_3D_CMD_DX_PRED_COPY_REGION */
  630 
  631 typedef
  632 #include "vmware_pack_begin.h"
  633 struct SVGA3dCmdDXPredCopy {
  634    SVGA3dSurfaceId dstSid;
  635    SVGA3dSurfaceId srcSid;
  636 }
  637 #include "vmware_pack_end.h"
  638 SVGA3dCmdDXPredCopy; /* SVGA_3D_CMD_DX_PRED_COPY */
  639 
  640 typedef
  641 #include "vmware_pack_begin.h"
  642 struct SVGA3dCmdDXPredConvertRegion {
  643    SVGA3dSurfaceId dstSid;
  644    uint32 dstSubResource;
  645    SVGA3dSurfaceId srcSid;
  646    uint32 srcSubResource;
  647    SVGA3dCopyBox box;
  648 }
  649 #include "vmware_pack_end.h"
  650 SVGA3dCmdDXPredConvertRegion; /* SVGA_3D_CMD_DX_PRED_CONVERT_REGION */
  651 
  652 typedef
  653 #include "vmware_pack_begin.h"
  654 struct SVGA3dCmdDXPredConvert {
  655    SVGA3dSurfaceId dstSid;
  656    SVGA3dSurfaceId srcSid;
  657 }
  658 #include "vmware_pack_end.h"
  659 SVGA3dCmdDXPredConvert; /* SVGA_3D_CMD_DX_PRED_CONVERT */
  660 
  661 typedef
  662 #include "vmware_pack_begin.h"
  663 struct SVGA3dCmdDXBufferCopy {
  664    SVGA3dSurfaceId dest;
  665    SVGA3dSurfaceId src;
  666    uint32 destX;
  667    uint32 srcX;
  668    uint32 width;
  669 }
  670 #include "vmware_pack_end.h"
  671 SVGA3dCmdDXBufferCopy;
  672 /* SVGA_3D_CMD_DX_BUFFER_COPY */
  673 
  674 /*
  675  * Perform a surface copy between a multisample, and a non-multisampled
  676  * surface.
  677  */
  678 typedef
  679 #include "vmware_pack_begin.h"
  680 struct {
  681    SVGA3dSurfaceId dstSid;
  682    uint32 dstSubResource;
  683    SVGA3dSurfaceId srcSid;
  684    uint32 srcSubResource;
  685    SVGA3dSurfaceFormat copyFormat;
  686 }
  687 #include "vmware_pack_end.h"
  688 SVGA3dCmdDXResolveCopy;               /* SVGA_3D_CMD_DX_RESOLVE_COPY */
  689 
  690 /*
  691  * Perform a predicated surface copy between a multisample, and a
  692  * non-multisampled surface.
  693  */
  694 typedef
  695 #include "vmware_pack_begin.h"
  696 struct {
  697    SVGA3dSurfaceId dstSid;
  698    uint32 dstSubResource;
  699    SVGA3dSurfaceId srcSid;
  700    uint32 srcSubResource;
  701    SVGA3dSurfaceFormat copyFormat;
  702 }
  703 #include "vmware_pack_end.h"
  704 SVGA3dCmdDXPredResolveCopy;           /* SVGA_3D_CMD_DX_PRED_RESOLVE_COPY */
  705 
  706 typedef uint32 SVGA3dDXStretchBltMode;
  707 #define SVGADX_STRETCHBLT_LINEAR         (1 << 0)
  708 #define SVGADX_STRETCHBLT_FORCE_SRC_SRGB (1 << 1)
  709 #define SVGADX_STRETCHBLT_MODE_MAX       (1 << 2)
  710 
  711 typedef
  712 #include "vmware_pack_begin.h"
  713 struct SVGA3dCmdDXStretchBlt {
  714    SVGA3dSurfaceId srcSid;
  715    uint32 srcSubResource;
  716    SVGA3dSurfaceId dstSid;
  717    uint32 destSubResource;
  718    SVGA3dBox boxSrc;
  719    SVGA3dBox boxDest;
  720    SVGA3dDXStretchBltMode mode;
  721 }
  722 #include "vmware_pack_end.h"
  723 SVGA3dCmdDXStretchBlt; /* SVGA_3D_CMD_DX_STRETCHBLT */
  724 
  725 typedef
  726 #include "vmware_pack_begin.h"
  727 struct SVGA3dCmdDXGenMips {
  728    SVGA3dShaderResourceViewId shaderResourceViewId;
  729 }
  730 #include "vmware_pack_end.h"
  731 SVGA3dCmdDXGenMips; /* SVGA_3D_CMD_DX_GENMIPS */
  732 
  733 /*
  734  * Update a sub-resource in a guest-backed resource.
  735  * (Inform the device that the guest-contents have been updated.)
  736  */
  737 typedef
  738 #include "vmware_pack_begin.h"
  739 struct SVGA3dCmdDXUpdateSubResource {
  740    SVGA3dSurfaceId sid;
  741    uint32 subResource;
  742    SVGA3dBox box;
  743 }
  744 #include "vmware_pack_end.h"
  745 SVGA3dCmdDXUpdateSubResource;   /* SVGA_3D_CMD_DX_UPDATE_SUBRESOURCE */
  746 
  747 /*
  748  * Readback a subresource in a guest-backed resource.
  749  * (Request the device to flush the dirty contents into the guest.)
  750  */
  751 typedef
  752 #include "vmware_pack_begin.h"
  753 struct SVGA3dCmdDXReadbackSubResource {
  754    SVGA3dSurfaceId sid;
  755    uint32 subResource;
  756 }
  757 #include "vmware_pack_end.h"
  758 SVGA3dCmdDXReadbackSubResource;   /* SVGA_3D_CMD_DX_READBACK_SUBRESOURCE */
  759 
  760 /*
  761  * Invalidate an image in a guest-backed surface.
  762  * (Notify the device that the contents can be lost.)
  763  */
  764 typedef
  765 #include "vmware_pack_begin.h"
  766 struct SVGA3dCmdDXInvalidateSubResource {
  767    SVGA3dSurfaceId sid;
  768    uint32 subResource;
  769 }
  770 #include "vmware_pack_end.h"
  771 SVGA3dCmdDXInvalidateSubResource;   /* SVGA_3D_CMD_DX_INVALIDATE_SUBRESOURCE */
  772 
  773 
  774 /*
  775  * Raw byte wise transfer from a buffer surface into another surface
  776  * of the requested box.  Supported if 3d is enabled and SVGA_CAP_DX
  777  * is set.  This command does not take a context.
  778  */
  779 typedef
  780 #include "vmware_pack_begin.h"
  781 struct SVGA3dCmdDXTransferFromBuffer {
  782    SVGA3dSurfaceId srcSid;
  783    uint32 srcOffset;
  784    uint32 srcPitch;
  785    uint32 srcSlicePitch;
  786    SVGA3dSurfaceId destSid;
  787    uint32 destSubResource;
  788    SVGA3dBox destBox;
  789 }
  790 #include "vmware_pack_end.h"
  791 SVGA3dCmdDXTransferFromBuffer;   /* SVGA_3D_CMD_DX_TRANSFER_FROM_BUFFER */
  792 
  793 
  794 /*
  795  * Raw byte wise transfer from a buffer surface into another surface
  796  * of the requested box.  Supported if SVGA3D_DEVCAP_DXCONTEXT is set.
  797  * The context is implied from the command buffer header.
  798  */
  799 typedef
  800 #include "vmware_pack_begin.h"
  801 struct SVGA3dCmdDXPredTransferFromBuffer {
  802    SVGA3dSurfaceId srcSid;
  803    uint32 srcOffset;
  804    uint32 srcPitch;
  805    uint32 srcSlicePitch;
  806    SVGA3dSurfaceId destSid;
  807    uint32 destSubResource;
  808    SVGA3dBox destBox;
  809 }
  810 #include "vmware_pack_end.h"
  811 SVGA3dCmdDXPredTransferFromBuffer;
  812 /* SVGA_3D_CMD_DX_PRED_TRANSFER_FROM_BUFFER */
  813 
  814 
  815 typedef
  816 #include "vmware_pack_begin.h"
  817 struct SVGA3dCmdDXSurfaceCopyAndReadback {
  818    SVGA3dSurfaceId srcSid;
  819    SVGA3dSurfaceId destSid;
  820    SVGA3dCopyBox box;
  821 }
  822 #include "vmware_pack_end.h"
  823 SVGA3dCmdDXSurfaceCopyAndReadback;
  824 /* SVGA_3D_CMD_DX_SURFACE_COPY_AND_READBACK */
  825 
  826 /*
  827  * SVGA_DX_HINT_NONE: Does nothing.
  828  *
  829  * SVGA_DX_HINT_PREFETCH_OBJECT:
  830  * SVGA_DX_HINT_PREEVICT_OBJECT:
  831  *      Consumes a SVGAObjectRef, and hints that the host should consider
  832  *      fetching/evicting the specified object.
  833  *
  834  *      An id of SVGA3D_INVALID_ID can be used if the guest isn't sure
  835  *      what object was affected.  (For instance, if the guest knows that
  836  *      it is about to evict a DXShader, but doesn't know precisely which one,
  837  *      the device can still use this to help limit it's search, or track
  838  *      how many page-outs have happened.)
  839  *
  840  * SVGA_DX_HINT_PREFETCH_COBJECT:
  841  * SVGA_DX_HINT_PREEVICT_COBJECT:
  842  *      Same as the above, except they consume an SVGACObjectRef.
  843  */
  844 typedef uint32 SVGADXHintId;
  845 #define SVGA_DX_HINT_NONE              0
  846 #define SVGA_DX_HINT_PREFETCH_OBJECT   1
  847 #define SVGA_DX_HINT_PREEVICT_OBJECT   2
  848 #define SVGA_DX_HINT_PREFETCH_COBJECT  3
  849 #define SVGA_DX_HINT_PREEVICT_COBJECT  4
  850 #define SVGA_DX_HINT_MAX               5
  851 
  852 typedef
  853 #include "vmware_pack_begin.h"
  854 struct SVGAObjectRef {
  855    SVGAOTableType type;
  856    uint32 id;
  857 }
  858 #include "vmware_pack_end.h"
  859 SVGAObjectRef;
  860 
  861 typedef
  862 #include "vmware_pack_begin.h"
  863 struct SVGACObjectRef {
  864    SVGACOTableType type;
  865    uint32 cid;
  866    uint32 id;
  867 }
  868 #include "vmware_pack_end.h"
  869 SVGACObjectRef;
  870 
  871 typedef
  872 #include "vmware_pack_begin.h"
  873 struct SVGA3dCmdDXHint {
  874    SVGADXHintId hintId;
  875 
  876    /*
  877     * Followed by variable sized data depending on the hintId.
  878     */
  879 }
  880 #include "vmware_pack_end.h"
  881 SVGA3dCmdDXHint;
  882 /* SVGA_3D_CMD_DX_HINT */
  883 
  884 typedef
  885 #include "vmware_pack_begin.h"
  886 struct SVGA3dCmdDXBufferUpdate {
  887    SVGA3dSurfaceId sid;
  888    uint32 x;
  889    uint32 width;
  890 }
  891 #include "vmware_pack_end.h"
  892 SVGA3dCmdDXBufferUpdate;
  893 /* SVGA_3D_CMD_DX_BUFFER_UPDATE */
  894 
  895 typedef
  896 #include "vmware_pack_begin.h"
  897 struct SVGA3dCmdDXSetConstantBufferOffset {
  898    uint32 slot;
  899    uint32 offsetInBytes;
  900 }
  901 #include "vmware_pack_end.h"
  902 SVGA3dCmdDXSetConstantBufferOffset;
  903 
  904 typedef SVGA3dCmdDXSetConstantBufferOffset SVGA3dCmdDXSetVSConstantBufferOffset;
  905 /* SVGA_3D_CMD_DX_SET_VS_CONSTANT_BUFFER_OFFSET */
  906 
  907 typedef SVGA3dCmdDXSetConstantBufferOffset SVGA3dCmdDXSetPSConstantBufferOffset;
  908 /* SVGA_3D_CMD_DX_SET_PS_CONSTANT_BUFFER_OFFSET */
  909 
  910 typedef SVGA3dCmdDXSetConstantBufferOffset SVGA3dCmdDXSetGSConstantBufferOffset;
  911 /* SVGA_3D_CMD_DX_SET_GS_CONSTANT_BUFFER_OFFSET */
  912 
  913 
  914 typedef
  915 #include "vmware_pack_begin.h"
  916 struct {
  917    union {
  918       struct {
  919          uint32 firstElement;
  920          uint32 numElements;
  921          uint32 pad0;
  922          uint32 pad1;
  923       } buffer;
  924       struct {
  925          uint32 mostDetailedMip;
  926          uint32 firstArraySlice;
  927          uint32 mipLevels;
  928          uint32 arraySize;
  929       } tex;
  930       struct {
  931          uint32 firstElement;  // D3D11DDIARG_BUFFEREX_SHADERRESOURCEVIEW
  932          uint32 numElements;
  933          uint32 flags;
  934          uint32 pad0;
  935       } bufferex;
  936    };
  937 }
  938 #include "vmware_pack_end.h"
  939 SVGA3dShaderResourceViewDesc;
  940 
  941 typedef
  942 #include "vmware_pack_begin.h"
  943 struct {
  944    SVGA3dSurfaceId sid;
  945    SVGA3dSurfaceFormat format;
  946    SVGA3dResourceType resourceDimension;
  947    SVGA3dShaderResourceViewDesc desc;
  948    uint32 pad;
  949 }
  950 #include "vmware_pack_end.h"
  951 SVGACOTableDXSRViewEntry;
  952 
  953 typedef
  954 #include "vmware_pack_begin.h"
  955 struct SVGA3dCmdDXDefineShaderResourceView {
  956    SVGA3dShaderResourceViewId shaderResourceViewId;
  957 
  958    SVGA3dSurfaceId sid;
  959    SVGA3dSurfaceFormat format;
  960    SVGA3dResourceType resourceDimension;
  961 
  962    SVGA3dShaderResourceViewDesc desc;
  963 }
  964 #include "vmware_pack_end.h"
  965 SVGA3dCmdDXDefineShaderResourceView;
  966 /* SVGA_3D_CMD_DX_DEFINE_SHADERRESOURCE_VIEW */
  967 
  968 typedef
  969 #include "vmware_pack_begin.h"
  970 struct SVGA3dCmdDXDestroyShaderResourceView {
  971    SVGA3dShaderResourceViewId shaderResourceViewId;
  972 }
  973 #include "vmware_pack_end.h"
  974 SVGA3dCmdDXDestroyShaderResourceView;
  975 /* SVGA_3D_CMD_DX_DESTROY_SHADERRESOURCE_VIEW */
  976 
  977 typedef
  978 #include "vmware_pack_begin.h"
  979 struct SVGA3dRenderTargetViewDesc {
  980    union {
  981       struct {
  982          uint32 firstElement;
  983          uint32 numElements;
  984       } buffer;
  985       struct {
  986          uint32 mipSlice;
  987          uint32 firstArraySlice;
  988          uint32 arraySize;
  989       } tex;                    /* 1d, 2d, cube */
  990       struct {
  991          uint32 mipSlice;
  992          uint32 firstW;
  993          uint32 wSize;
  994       } tex3D;
  995    };
  996 }
  997 #include "vmware_pack_end.h"
  998 SVGA3dRenderTargetViewDesc;
  999 
 1000 typedef
 1001 #include "vmware_pack_begin.h"
 1002 struct {
 1003    SVGA3dSurfaceId sid;
 1004    SVGA3dSurfaceFormat format;
 1005    SVGA3dResourceType resourceDimension;
 1006    SVGA3dRenderTargetViewDesc desc;
 1007    uint32 pad[2];
 1008 }
 1009 #include "vmware_pack_end.h"
 1010 SVGACOTableDXRTViewEntry;
 1011 
 1012 typedef
 1013 #include "vmware_pack_begin.h"
 1014 struct SVGA3dCmdDXDefineRenderTargetView {
 1015    SVGA3dRenderTargetViewId renderTargetViewId;
 1016 
 1017    SVGA3dSurfaceId sid;
 1018    SVGA3dSurfaceFormat format;
 1019    SVGA3dResourceType resourceDimension;
 1020 
 1021    SVGA3dRenderTargetViewDesc desc;
 1022 }
 1023 #include "vmware_pack_end.h"
 1024 SVGA3dCmdDXDefineRenderTargetView;
 1025 /* SVGA_3D_CMD_DX_DEFINE_RENDERTARGET_VIEW */
 1026 
 1027 typedef
 1028 #include "vmware_pack_begin.h"
 1029 struct SVGA3dCmdDXDestroyRenderTargetView {
 1030    SVGA3dRenderTargetViewId renderTargetViewId;
 1031 }
 1032 #include "vmware_pack_end.h"
 1033 SVGA3dCmdDXDestroyRenderTargetView;
 1034 /* SVGA_3D_CMD_DX_DESTROY_RENDERTARGET_VIEW */
 1035 
 1036 /*
 1037  * Create Depth-stencil view flags
 1038  * http://msdn.microsoft.com/en-us/library/windows/hardware/ff542167(v=vs.85).aspx
 1039  */
 1040 #define SVGA3D_DXDSVIEW_CREATE_READ_ONLY_DEPTH   0x01
 1041 #define SVGA3D_DXDSVIEW_CREATE_READ_ONLY_STENCIL 0x02
 1042 #define SVGA3D_DXDSVIEW_CREATE_FLAG_MASK         0x03
 1043 typedef uint8 SVGA3DCreateDSViewFlags;
 1044 
 1045 typedef
 1046 #include "vmware_pack_begin.h"
 1047 struct {
 1048    SVGA3dSurfaceId sid;
 1049    SVGA3dSurfaceFormat format;
 1050    SVGA3dResourceType resourceDimension;
 1051    uint32 mipSlice;
 1052    uint32 firstArraySlice;
 1053    uint32 arraySize;
 1054    SVGA3DCreateDSViewFlags flags;
 1055    uint8 pad0;
 1056    uint16 pad1;
 1057    uint32 pad2;
 1058 }
 1059 #include "vmware_pack_end.h"
 1060 SVGACOTableDXDSViewEntry;
 1061 
 1062 typedef
 1063 #include "vmware_pack_begin.h"
 1064 struct SVGA3dCmdDXDefineDepthStencilView {
 1065    SVGA3dDepthStencilViewId depthStencilViewId;
 1066 
 1067    SVGA3dSurfaceId sid;
 1068    SVGA3dSurfaceFormat format;
 1069    SVGA3dResourceType resourceDimension;
 1070    uint32 mipSlice;
 1071    uint32 firstArraySlice;
 1072    uint32 arraySize;
 1073    SVGA3DCreateDSViewFlags flags;  /* D3D11DDIARG_CREATEDEPTHSTENCILVIEW */
 1074    uint8 pad0;
 1075    uint16 pad1;
 1076 }
 1077 #include "vmware_pack_end.h"
 1078 SVGA3dCmdDXDefineDepthStencilView;
 1079 /* SVGA_3D_CMD_DX_DEFINE_DEPTHSTENCIL_VIEW */
 1080 
 1081 typedef
 1082 #include "vmware_pack_begin.h"
 1083 struct SVGA3dCmdDXDestroyDepthStencilView {
 1084    SVGA3dDepthStencilViewId depthStencilViewId;
 1085 }
 1086 #include "vmware_pack_end.h"
 1087 SVGA3dCmdDXDestroyDepthStencilView;
 1088 /* SVGA_3D_CMD_DX_DESTROY_DEPTHSTENCIL_VIEW */
 1089 
 1090 typedef
 1091 #include "vmware_pack_begin.h"
 1092 struct SVGA3dInputElementDesc {
 1093    uint32 inputSlot;
 1094    uint32 alignedByteOffset;
 1095    SVGA3dSurfaceFormat format;
 1096    SVGA3dInputClassification inputSlotClass;
 1097    uint32 instanceDataStepRate;
 1098    uint32 inputRegister;
 1099 }
 1100 #include "vmware_pack_end.h"
 1101 SVGA3dInputElementDesc;
 1102 
 1103 typedef
 1104 #include "vmware_pack_begin.h"
 1105 struct {
 1106    uint32 elid;
 1107    uint32 numDescs;
 1108    SVGA3dInputElementDesc descs[32];
 1109    uint32 pad[62];
 1110 }
 1111 #include "vmware_pack_end.h"
 1112 SVGACOTableDXElementLayoutEntry;
 1113 
 1114 typedef
 1115 #include "vmware_pack_begin.h"
 1116 struct SVGA3dCmdDXDefineElementLayout {
 1117    SVGA3dElementLayoutId elementLayoutId;
 1118    /* Followed by a variable number of SVGA3dInputElementDesc's. */
 1119 }
 1120 #include "vmware_pack_end.h"
 1121 SVGA3dCmdDXDefineElementLayout;
 1122 /* SVGA_3D_CMD_DX_DEFINE_ELEMENTLAYOUT */
 1123 
 1124 typedef
 1125 #include "vmware_pack_begin.h"
 1126 struct SVGA3dCmdDXDestroyElementLayout {
 1127    SVGA3dElementLayoutId elementLayoutId;
 1128 }
 1129 #include "vmware_pack_end.h"
 1130 SVGA3dCmdDXDestroyElementLayout;
 1131 /* SVGA_3D_CMD_DX_DESTROY_ELEMENTLAYOUT */
 1132 
 1133 
 1134 #define SVGA3D_DX_MAX_RENDER_TARGETS 8
 1135 
 1136 typedef
 1137 #include "vmware_pack_begin.h"
 1138 struct SVGA3dDXBlendStatePerRT {
 1139       uint8 blendEnable;
 1140       uint8 srcBlend;
 1141       uint8 destBlend;
 1142       uint8 blendOp;
 1143       uint8 srcBlendAlpha;
 1144       uint8 destBlendAlpha;
 1145       uint8 blendOpAlpha;
 1146       SVGA3dColorWriteEnable renderTargetWriteMask;
 1147       uint8 logicOpEnable;
 1148       uint8 logicOp;
 1149       uint16 pad0;
 1150 }
 1151 #include "vmware_pack_end.h"
 1152 SVGA3dDXBlendStatePerRT;
 1153 
 1154 typedef
 1155 #include "vmware_pack_begin.h"
 1156 struct {
 1157    uint8 alphaToCoverageEnable;
 1158    uint8 independentBlendEnable;
 1159    uint16 pad0;
 1160    SVGA3dDXBlendStatePerRT perRT[SVGA3D_MAX_RENDER_TARGETS];
 1161    uint32 pad1[7];
 1162 }
 1163 #include "vmware_pack_end.h"
 1164 SVGACOTableDXBlendStateEntry;
 1165 
 1166 /*
 1167  * XXX - DX10 style (not 10.1 at this point)
 1168  * XXX - For more information see
 1169  *    http://msdn.microsoft.com/en-us/library/ff541919%28v=VS.85%29.aspx
 1170  */
 1171 typedef
 1172 #include "vmware_pack_begin.h"
 1173 struct SVGA3dCmdDXDefineBlendState {
 1174    SVGA3dBlendStateId blendId;
 1175    uint8 alphaToCoverageEnable;
 1176    uint8 independentBlendEnable;
 1177    uint16 pad0;
 1178    SVGA3dDXBlendStatePerRT perRT[SVGA3D_MAX_RENDER_TARGETS];
 1179 }
 1180 #include "vmware_pack_end.h"
 1181 SVGA3dCmdDXDefineBlendState; /* SVGA_3D_CMD_DX_DEFINE_BLEND_STATE */
 1182 
 1183 typedef
 1184 #include "vmware_pack_begin.h"
 1185 struct SVGA3dCmdDXDestroyBlendState {
 1186    SVGA3dBlendStateId blendId;
 1187 }
 1188 #include "vmware_pack_end.h"
 1189 SVGA3dCmdDXDestroyBlendState; /* SVGA_3D_CMD_DX_DESTROY_BLEND_STATE */
 1190 
 1191 typedef
 1192 #include "vmware_pack_begin.h"
 1193 struct {
 1194    uint8 depthEnable;
 1195    SVGA3dDepthWriteMask depthWriteMask;
 1196    SVGA3dComparisonFunc depthFunc;
 1197    uint8 stencilEnable;
 1198    uint8 frontEnable;
 1199    uint8 backEnable;
 1200    uint8 stencilReadMask;
 1201    uint8 stencilWriteMask;
 1202 
 1203    uint8 frontStencilFailOp;
 1204    uint8 frontStencilDepthFailOp;
 1205    uint8 frontStencilPassOp;
 1206    SVGA3dComparisonFunc frontStencilFunc;
 1207 
 1208    uint8 backStencilFailOp;
 1209    uint8 backStencilDepthFailOp;
 1210    uint8 backStencilPassOp;
 1211    SVGA3dComparisonFunc backStencilFunc;
 1212 }
 1213 #include "vmware_pack_end.h"
 1214 SVGACOTableDXDepthStencilEntry;
 1215 
 1216 /*
 1217  * XXX - For more information see
 1218  *    http://msdn.microsoft.com/en-us/library/ff541944%28v=VS.85%29.aspx
 1219  */
 1220 typedef
 1221 #include "vmware_pack_begin.h"
 1222 struct SVGA3dCmdDXDefineDepthStencilState {
 1223    SVGA3dDepthStencilStateId depthStencilId;
 1224 
 1225    uint8 depthEnable;
 1226    SVGA3dDepthWriteMask depthWriteMask;
 1227    SVGA3dComparisonFunc depthFunc;
 1228    uint8 stencilEnable;
 1229    uint8 frontEnable;
 1230    uint8 backEnable;
 1231    uint8 stencilReadMask;
 1232    uint8 stencilWriteMask;
 1233 
 1234    uint8 frontStencilFailOp;
 1235    uint8 frontStencilDepthFailOp;
 1236    uint8 frontStencilPassOp;
 1237    SVGA3dComparisonFunc frontStencilFunc;
 1238 
 1239    uint8 backStencilFailOp;
 1240    uint8 backStencilDepthFailOp;
 1241    uint8 backStencilPassOp;
 1242    SVGA3dComparisonFunc backStencilFunc;
 1243 }
 1244 #include "vmware_pack_end.h"
 1245 SVGA3dCmdDXDefineDepthStencilState;
 1246 /* SVGA_3D_CMD_DX_DEFINE_DEPTHSTENCIL_STATE */
 1247 
 1248 typedef
 1249 #include "vmware_pack_begin.h"
 1250 struct SVGA3dCmdDXDestroyDepthStencilState {
 1251    SVGA3dDepthStencilStateId depthStencilId;
 1252 }
 1253 #include "vmware_pack_end.h"
 1254 SVGA3dCmdDXDestroyDepthStencilState;
 1255 /* SVGA_3D_CMD_DX_DESTROY_DEPTHSTENCIL_STATE */
 1256 
 1257 typedef
 1258 #include "vmware_pack_begin.h"
 1259 struct {
 1260    uint8 fillMode;
 1261    SVGA3dCullMode cullMode;
 1262    uint8 frontCounterClockwise;
 1263    uint8 provokingVertexLast;
 1264    int32 depthBias;
 1265    float depthBiasClamp;
 1266    float slopeScaledDepthBias;
 1267    uint8 depthClipEnable;
 1268    uint8 scissorEnable;
 1269    SVGA3dMultisampleEnable multisampleEnable;
 1270    uint8 antialiasedLineEnable;
 1271    float lineWidth;
 1272    uint8 lineStippleEnable;
 1273    uint8 lineStippleFactor;
 1274    uint16 lineStipplePattern;
 1275    uint32 forcedSampleCount;
 1276 }
 1277 #include "vmware_pack_end.h"
 1278 SVGACOTableDXRasterizerStateEntry;
 1279 
 1280 /*
 1281  * XXX - For more information see
 1282  *    http://msdn.microsoft.com/en-us/library/ff541988%28v=VS.85%29.aspx
 1283  */
 1284 typedef
 1285 #include "vmware_pack_begin.h"
 1286 struct SVGA3dCmdDXDefineRasterizerState {
 1287    SVGA3dRasterizerStateId rasterizerId;
 1288 
 1289    uint8 fillMode;
 1290    SVGA3dCullMode cullMode;
 1291    uint8 frontCounterClockwise;
 1292    uint8 provokingVertexLast;
 1293    int32 depthBias;
 1294    float depthBiasClamp;
 1295    float slopeScaledDepthBias;
 1296    uint8 depthClipEnable;
 1297    uint8 scissorEnable;
 1298    SVGA3dMultisampleEnable multisampleEnable;
 1299    uint8 antialiasedLineEnable;
 1300    float lineWidth;
 1301    uint8 lineStippleEnable;
 1302    uint8 lineStippleFactor;
 1303    uint16 lineStipplePattern;
 1304 }
 1305 #include "vmware_pack_end.h"
 1306 SVGA3dCmdDXDefineRasterizerState;
 1307 /* SVGA_3D_CMD_DX_DEFINE_RASTERIZER_STATE */
 1308 
 1309 typedef
 1310 #include "vmware_pack_begin.h"
 1311 struct SVGA3dCmdDXDestroyRasterizerState {
 1312    SVGA3dRasterizerStateId rasterizerId;
 1313 }
 1314 #include "vmware_pack_end.h"
 1315 SVGA3dCmdDXDestroyRasterizerState;
 1316 /* SVGA_3D_CMD_DX_DESTROY_RASTERIZER_STATE */
 1317 
 1318 typedef
 1319 #include "vmware_pack_begin.h"
 1320 struct {
 1321    SVGA3dFilter filter;
 1322    uint8 addressU;
 1323    uint8 addressV;
 1324    uint8 addressW;
 1325    uint8 pad0;
 1326    float mipLODBias;
 1327    uint8 maxAnisotropy;
 1328    SVGA3dComparisonFunc comparisonFunc;
 1329    uint16 pad1;
 1330    SVGA3dRGBAFloat borderColor;
 1331    float minLOD;
 1332    float maxLOD;
 1333    uint32 pad2[6];
 1334 }
 1335 #include "vmware_pack_end.h"
 1336 SVGACOTableDXSamplerEntry;
 1337 
 1338 /*
 1339  * XXX - For more information see
 1340  *    http://msdn.microsoft.com/en-us/library/ff542011%28v=VS.85%29.aspx
 1341  */
 1342 typedef
 1343 #include "vmware_pack_begin.h"
 1344 struct SVGA3dCmdDXDefineSamplerState {
 1345    SVGA3dSamplerId samplerId;
 1346    SVGA3dFilter filter;
 1347    uint8 addressU;
 1348    uint8 addressV;
 1349    uint8 addressW;
 1350    uint8 pad0;
 1351    float mipLODBias;
 1352    uint8 maxAnisotropy;
 1353    SVGA3dComparisonFunc comparisonFunc;
 1354    uint16 pad1;
 1355    SVGA3dRGBAFloat borderColor;
 1356    float minLOD;
 1357    float maxLOD;
 1358 }
 1359 #include "vmware_pack_end.h"
 1360 SVGA3dCmdDXDefineSamplerState; /* SVGA_3D_CMD_DX_DEFINE_SAMPLER_STATE */
 1361 
 1362 typedef
 1363 #include "vmware_pack_begin.h"
 1364 struct SVGA3dCmdDXDestroySamplerState {
 1365    SVGA3dSamplerId samplerId;
 1366 }
 1367 #include "vmware_pack_end.h"
 1368 SVGA3dCmdDXDestroySamplerState; /* SVGA_3D_CMD_DX_DESTROY_SAMPLER_STATE */
 1369 
 1370 typedef
 1371 #include "vmware_pack_begin.h"
 1372 struct SVGA3dCmdDXDefineShader {
 1373    SVGA3dShaderId shaderId;
 1374    SVGA3dShaderType type;
 1375    uint32 sizeInBytes; /* Number of bytes of shader text. */
 1376 }
 1377 #include "vmware_pack_end.h"
 1378 SVGA3dCmdDXDefineShader; /* SVGA_3D_CMD_DX_DEFINE_SHADER */
 1379 
 1380 typedef
 1381 #include "vmware_pack_begin.h"
 1382 struct SVGACOTableDXShaderEntry {
 1383    SVGA3dShaderType type;
 1384    uint32 sizeInBytes;
 1385    uint32 offsetInBytes;
 1386    SVGAMobId mobid;
 1387    uint32 pad[4];
 1388 }
 1389 #include "vmware_pack_end.h"
 1390 SVGACOTableDXShaderEntry;
 1391 
 1392 typedef
 1393 #include "vmware_pack_begin.h"
 1394 struct SVGA3dCmdDXDestroyShader {
 1395    SVGA3dShaderId shaderId;
 1396 }
 1397 #include "vmware_pack_end.h"
 1398 SVGA3dCmdDXDestroyShader; /* SVGA_3D_CMD_DX_DESTROY_SHADER */
 1399 
 1400 typedef
 1401 #include "vmware_pack_begin.h"
 1402 struct SVGA3dCmdDXBindShader {
 1403    uint32 cid;
 1404    uint32 shid;
 1405    SVGAMobId mobid;
 1406    uint32 offsetInBytes;
 1407 }
 1408 #include "vmware_pack_end.h"
 1409 SVGA3dCmdDXBindShader;   /* SVGA_3D_CMD_DX_BIND_SHADER */
 1410 
 1411 typedef
 1412 #include "vmware_pack_begin.h"
 1413 struct SVGA3dCmdDXBindAllShader {
 1414    uint32 cid;
 1415    SVGAMobId mobid;
 1416 }
 1417 #include "vmware_pack_end.h"
 1418 SVGA3dCmdDXBindAllShader;   /* SVGA_3D_CMD_DX_BIND_ALL_SHADER */
 1419 
 1420 typedef
 1421 #include "vmware_pack_begin.h"
 1422 struct SVGA3dCmdDXCondBindAllShader {
 1423    uint32 cid;
 1424    SVGAMobId testMobid;
 1425    SVGAMobId mobid;
 1426 }
 1427 #include "vmware_pack_end.h"
 1428 SVGA3dCmdDXCondBindAllShader;   /* SVGA_3D_CMD_DX_COND_BIND_ALL_SHADER */
 1429 
 1430 /*
 1431  * The maximum number of streamout decl's in each streamout entry.
 1432  */
 1433 #define SVGA3D_MAX_STREAMOUT_DECLS 64
 1434 
 1435 typedef
 1436 #include "vmware_pack_begin.h"
 1437 struct SVGA3dStreamOutputDeclarationEntry {
 1438    uint32 outputSlot;
 1439    uint32 registerIndex;
 1440    uint8  registerMask;
 1441    uint8  pad0;
 1442    uint16 pad1;
 1443    uint32 stream;
 1444 }
 1445 #include "vmware_pack_end.h"
 1446 SVGA3dStreamOutputDeclarationEntry;
 1447 
 1448 typedef
 1449 #include "vmware_pack_begin.h"
 1450 struct SVGAOTableStreamOutputEntry {
 1451    uint32 numOutputStreamEntries;
 1452    SVGA3dStreamOutputDeclarationEntry decl[SVGA3D_MAX_STREAMOUT_DECLS];
 1453    uint32 streamOutputStrideInBytes[SVGA3D_DX_MAX_SOTARGETS];
 1454    uint32 rasterizedStream;
 1455    uint32 pad[250];
 1456 }
 1457 #include "vmware_pack_end.h"
 1458 SVGACOTableDXStreamOutputEntry;
 1459 
 1460 typedef
 1461 #include "vmware_pack_begin.h"
 1462 struct SVGA3dCmdDXDefineStreamOutput {
 1463    SVGA3dStreamOutputId soid;
 1464    uint32 numOutputStreamEntries;
 1465    SVGA3dStreamOutputDeclarationEntry decl[SVGA3D_MAX_STREAMOUT_DECLS];
 1466    uint32 streamOutputStrideInBytes[SVGA3D_DX_MAX_SOTARGETS];
 1467    uint32 rasterizedStream;
 1468 }
 1469 #include "vmware_pack_end.h"
 1470 SVGA3dCmdDXDefineStreamOutput; /* SVGA_3D_CMD_DX_DEFINE_STREAMOUTPUT */
 1471 
 1472 typedef
 1473 #include "vmware_pack_begin.h"
 1474 struct SVGA3dCmdDXDestroyStreamOutput {
 1475    SVGA3dStreamOutputId soid;
 1476 }
 1477 #include "vmware_pack_end.h"
 1478 SVGA3dCmdDXDestroyStreamOutput; /* SVGA_3D_CMD_DX_DESTROY_STREAMOUTPUT */
 1479 
 1480 typedef
 1481 #include "vmware_pack_begin.h"
 1482 struct SVGA3dCmdDXSetStreamOutput {
 1483    SVGA3dStreamOutputId soid;
 1484 }
 1485 #include "vmware_pack_end.h"
 1486 SVGA3dCmdDXSetStreamOutput; /* SVGA_3D_CMD_DX_SET_STREAMOUTPUT */
 1487 
 1488 typedef
 1489 #include "vmware_pack_begin.h"
 1490 struct {
 1491    uint64 value;
 1492    uint32 mobId;
 1493    uint32 mobOffset;
 1494 }
 1495 #include "vmware_pack_end.h"
 1496 SVGA3dCmdDXMobFence64;  /* SVGA_3D_CMD_DX_MOB_FENCE_64 */
 1497 
 1498 /*
 1499  * SVGA3dCmdSetCOTable --
 1500  *
 1501  * This command allows the guest to bind a mob to a context-object table.
 1502  */
 1503 typedef
 1504 #include "vmware_pack_begin.h"
 1505 struct SVGA3dCmdDXSetCOTable {
 1506    uint32 cid;
 1507    uint32 mobid;
 1508    SVGACOTableType type;
 1509    uint32 validSizeInBytes;
 1510 }
 1511 #include "vmware_pack_end.h"
 1512 SVGA3dCmdDXSetCOTable; /* SVGA_3D_CMD_DX_SET_COTABLE */
 1513 
 1514 /*
 1515  * Guests using SVGA_3D_CMD_DX_GROW_COTABLE are promising that
 1516  * the new COTable contains the same contents as the old one, except possibly
 1517  * for some new invalid entries at the end.
 1518  *
 1519  * If there is an old cotable mob bound, it also has to still be valid.
 1520  *
 1521  * (Otherwise, guests should use the DXSetCOTableBase command.)
 1522  */
 1523 typedef
 1524 #include "vmware_pack_begin.h"
 1525 struct SVGA3dCmdDXGrowCOTable {
 1526    uint32 cid;
 1527    uint32 mobid;
 1528    SVGACOTableType type;
 1529    uint32 validSizeInBytes;
 1530 }
 1531 #include "vmware_pack_end.h"
 1532 SVGA3dCmdDXGrowCOTable; /* SVGA_3D_CMD_DX_GROW_COTABLE */
 1533 
 1534 typedef
 1535 #include "vmware_pack_begin.h"
 1536 struct SVGA3dCmdDXReadbackCOTable {
 1537    uint32 cid;
 1538    SVGACOTableType type;
 1539 }
 1540 #include "vmware_pack_end.h"
 1541 SVGA3dCmdDXReadbackCOTable; /* SVGA_3D_CMD_DX_READBACK_COTABLE */
 1542 
 1543 typedef
 1544 #include "vmware_pack_begin.h"
 1545 struct SVGA3dCOTableData {
 1546    uint32 mobid;
 1547 }
 1548 #include "vmware_pack_end.h"
 1549 SVGA3dCOTableData;
 1550 
 1551 typedef
 1552 #include "vmware_pack_begin.h"
 1553 struct SVGA3dBufferBinding {
 1554    uint32 bufferId;
 1555    uint32 stride;
 1556    uint32 offset;
 1557 }
 1558 #include "vmware_pack_end.h"
 1559 SVGA3dBufferBinding;
 1560 
 1561 typedef
 1562 #include "vmware_pack_begin.h"
 1563 struct SVGA3dConstantBufferBinding {
 1564    uint32 sid;
 1565    uint32 offsetInBytes;
 1566    uint32 sizeInBytes;
 1567 }
 1568 #include "vmware_pack_end.h"
 1569 SVGA3dConstantBufferBinding;
 1570 
 1571 typedef
 1572 #include "vmware_pack_begin.h"
 1573 struct SVGADXInputAssemblyMobFormat {
 1574    uint32 layoutId;
 1575    SVGA3dBufferBinding vertexBuffers[SVGA3D_DX_MAX_VERTEXBUFFERS];
 1576    uint32 indexBufferSid;
 1577    uint32 pad;
 1578    uint32 indexBufferOffset;
 1579    uint32 indexBufferFormat;
 1580    uint32 topology;
 1581 }
 1582 #include "vmware_pack_end.h"
 1583 SVGADXInputAssemblyMobFormat;
 1584 
 1585 typedef
 1586 #include "vmware_pack_begin.h"
 1587 struct SVGADXContextMobFormat {
 1588    SVGADXInputAssemblyMobFormat inputAssembly;
 1589 
 1590    struct {
 1591       uint32 blendStateId;
 1592       uint32 blendFactor[4];
 1593       uint32 sampleMask;
 1594       uint32 depthStencilStateId;
 1595       uint32 stencilRef;
 1596       uint32 rasterizerStateId;
 1597       uint32 depthStencilViewId;
 1598       uint32 renderTargetViewIds[SVGA3D_MAX_SIMULTANEOUS_RENDER_TARGETS];
 1599       uint32 unorderedAccessViewIds[SVGA3D_MAX_UAVIEWS];
 1600    } renderState;
 1601 
 1602    struct {
 1603       uint32 targets[SVGA3D_DX_MAX_SOTARGETS];
 1604       uint32 soid;
 1605    } streamOut;
 1606    uint32 pad0[11];
 1607 
 1608    uint8 numViewports;
 1609    uint8 numScissorRects;
 1610    uint16 pad1[1];
 1611 
 1612    uint32 pad2[3];
 1613 
 1614    SVGA3dViewport viewports[SVGA3D_DX_MAX_VIEWPORTS];
 1615    uint32 pad3[32];
 1616 
 1617    SVGASignedRect scissorRects[SVGA3D_DX_MAX_SCISSORRECTS];
 1618    uint32 pad4[64];
 1619 
 1620    struct {
 1621       uint32 queryID;
 1622       uint32 value;
 1623    } predication;
 1624    uint32 pad5[2];
 1625 
 1626    struct {
 1627       uint32 shaderId;
 1628       SVGA3dConstantBufferBinding constantBuffers[SVGA3D_DX_MAX_CONSTBUFFERS];
 1629       uint32 shaderResources[SVGA3D_DX_MAX_SRVIEWS];
 1630       uint32 samplers[SVGA3D_DX_MAX_SAMPLERS];
 1631    } shaderState[SVGA3D_NUM_SHADERTYPE];
 1632    uint32 pad6[26];
 1633 
 1634    SVGA3dQueryId queryID[SVGA3D_MAX_QUERY];
 1635 
 1636    SVGA3dCOTableData cotables[SVGA_COTABLE_MAX];
 1637    uint32 pad7[380];
 1638 }
 1639 #include "vmware_pack_end.h"
 1640 SVGADXContextMobFormat;
 1641 
 1642 #endif // _SVGA3D_DX_H_