1 /* SPDX-License-Identifier: GPL-2.0 OR MIT */
2 /**********************************************************
3 * Copyright 2012-2019 VMware, Inc.
5 * Permission is hereby granted, free of charge, to any person
6 * obtaining a copy of this software and associated documentation
7 * files (the "Software"), to deal in the Software without
8 * restriction, including without limitation the rights to use, copy,
9 * modify, merge, publish, distribute, sublicense, and/or sell copies
10 * of the Software, and to permit persons to whom the Software is
11 * furnished to do so, subject to the following conditions:
13 * The above copyright notice and this permission notice shall be
14 * included in all copies or substantial portions of the Software.
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
20 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
21 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
22 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
25 **********************************************************/
30 * SVGA 3d hardware definitions for DX10 support.
36 #define INCLUDE_ALLOW_MODULE
37 #define INCLUDE_ALLOW_USERLEVEL
38 #define INCLUDE_ALLOW_VMCORE
39 #include "includeCheck.h"
41 #include "svga3d_limits.h"
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
;
49 #define SVGA3D_RESOURCE_TYPE_MIN 1
50 #define SVGA3D_RESOURCE_BUFFER 1
51 #define SVGA3D_RESOURCE_TEXTURE1D 2
52 #define SVGA3D_RESOURCE_TEXTURE2D 3
53 #define SVGA3D_RESOURCE_TEXTURE3D 4
54 #define SVGA3D_RESOURCE_TEXTURECUBE 5
55 #define SVGA3D_RESOURCE_TYPE_DX10_MAX 6
56 #define SVGA3D_RESOURCE_BUFFEREX 6
57 #define SVGA3D_RESOURCE_TYPE_MAX 7
58 typedef uint32 SVGA3dResourceType
;
60 #define SVGA3D_COLOR_WRITE_ENABLE_RED (1 << 0)
61 #define SVGA3D_COLOR_WRITE_ENABLE_GREEN (1 << 1)
62 #define SVGA3D_COLOR_WRITE_ENABLE_BLUE (1 << 2)
63 #define SVGA3D_COLOR_WRITE_ENABLE_ALPHA (1 << 3)
64 #define SVGA3D_COLOR_WRITE_ENABLE_ALL (SVGA3D_COLOR_WRITE_ENABLE_RED | \
65 SVGA3D_COLOR_WRITE_ENABLE_GREEN | \
66 SVGA3D_COLOR_WRITE_ENABLE_BLUE | \
67 SVGA3D_COLOR_WRITE_ENABLE_ALPHA)
68 typedef uint8 SVGA3dColorWriteEnable
;
70 #define SVGA3D_DEPTH_WRITE_MASK_ZERO 0
71 #define SVGA3D_DEPTH_WRITE_MASK_ALL 1
72 typedef uint8 SVGA3dDepthWriteMask
;
74 #define SVGA3D_FILTER_MIP_LINEAR (1 << 0)
75 #define SVGA3D_FILTER_MAG_LINEAR (1 << 2)
76 #define SVGA3D_FILTER_MIN_LINEAR (1 << 4)
77 #define SVGA3D_FILTER_ANISOTROPIC (1 << 6)
78 #define SVGA3D_FILTER_COMPARE (1 << 7)
79 typedef uint32 SVGA3dFilter
;
81 #define SVGA3D_CULL_INVALID 0
82 #define SVGA3D_CULL_MIN 1
83 #define SVGA3D_CULL_NONE 1
84 #define SVGA3D_CULL_FRONT 2
85 #define SVGA3D_CULL_BACK 3
86 #define SVGA3D_CULL_MAX 4
87 typedef uint8 SVGA3dCullMode
;
89 #define SVGA3D_COMPARISON_INVALID 0
90 #define SVGA3D_COMPARISON_MIN 1
91 #define SVGA3D_COMPARISON_NEVER 1
92 #define SVGA3D_COMPARISON_LESS 2
93 #define SVGA3D_COMPARISON_EQUAL 3
94 #define SVGA3D_COMPARISON_LESS_EQUAL 4
95 #define SVGA3D_COMPARISON_GREATER 5
96 #define SVGA3D_COMPARISON_NOT_EQUAL 6
97 #define SVGA3D_COMPARISON_GREATER_EQUAL 7
98 #define SVGA3D_COMPARISON_ALWAYS 8
99 #define SVGA3D_COMPARISON_MAX 9
100 typedef uint8 SVGA3dComparisonFunc
;
103 * SVGA3D_MULTISAMPLE_RAST_DISABLE disables MSAA for all primitives.
104 * SVGA3D_MULTISAMPLE_RAST_DISABLE_LINE, which is supported in SM41,
105 * disables MSAA for lines only.
107 #define SVGA3D_MULTISAMPLE_RAST_DISABLE 0
108 #define SVGA3D_MULTISAMPLE_RAST_ENABLE 1
109 #define SVGA3D_MULTISAMPLE_RAST_DX_MAX 1
110 #define SVGA3D_MULTISAMPLE_RAST_DISABLE_LINE 2
111 #define SVGA3D_MULTISAMPLE_RAST_MAX 2
112 typedef uint8 SVGA3dMultisampleRastEnable
;
114 #define SVGA3D_DX_MAX_VERTEXBUFFERS 32
115 #define SVGA3D_DX_MAX_VERTEXINPUTREGISTERS 16
116 #define SVGA3D_DX_SM41_MAX_VERTEXINPUTREGISTERS 32
117 #define SVGA3D_DX_MAX_SOTARGETS 4
118 #define SVGA3D_DX_MAX_SRVIEWS 128
119 #define SVGA3D_DX_MAX_CONSTBUFFERS 16
120 #define SVGA3D_DX_MAX_SAMPLERS 16
121 #define SVGA3D_DX_MAX_CLASS_INSTANCES 253
123 #define SVGA3D_DX_MAX_CONSTBUF_BINDING_SIZE (4096 * 4 * (uint32)sizeof(uint32))
125 typedef uint32 SVGA3dShaderResourceViewId
;
126 typedef uint32 SVGA3dRenderTargetViewId
;
127 typedef uint32 SVGA3dDepthStencilViewId
;
128 typedef uint32 SVGA3dUAViewId
;
130 typedef uint32 SVGA3dShaderId
;
131 typedef uint32 SVGA3dElementLayoutId
;
132 typedef uint32 SVGA3dSamplerId
;
133 typedef uint32 SVGA3dBlendStateId
;
134 typedef uint32 SVGA3dDepthStencilStateId
;
135 typedef uint32 SVGA3dRasterizerStateId
;
136 typedef uint32 SVGA3dQueryId
;
137 typedef uint32 SVGA3dStreamOutputId
;
162 #include "vmware_pack_begin.h"
167 #include "vmware_pack_end.h"
168 SVGAOTableDXContextEntry
;
171 #include "vmware_pack_begin.h"
172 struct SVGA3dCmdDXDefineContext
{
175 #include "vmware_pack_end.h"
176 SVGA3dCmdDXDefineContext
; /* SVGA_3D_CMD_DX_DEFINE_CONTEXT */
179 #include "vmware_pack_begin.h"
180 struct SVGA3dCmdDXDestroyContext
{
183 #include "vmware_pack_end.h"
184 SVGA3dCmdDXDestroyContext
; /* SVGA_3D_CMD_DX_DESTROY_CONTEXT */
189 * validContents should be set to 0 for new contexts,
190 * and 1 if this is an old context which is getting paged
191 * back on to the device.
193 * For new contexts, it is recommended that the driver
194 * issue commands to initialize all interesting state
195 * prior to rendering.
198 #include "vmware_pack_begin.h"
199 struct SVGA3dCmdDXBindContext
{
202 uint32 validContents
;
204 #include "vmware_pack_end.h"
205 SVGA3dCmdDXBindContext
; /* SVGA_3D_CMD_DX_BIND_CONTEXT */
208 * Readback a DX context.
209 * (Request that the device flush the contents back into guest memory.)
212 #include "vmware_pack_begin.h"
213 struct SVGA3dCmdDXReadbackContext
{
216 #include "vmware_pack_end.h"
217 SVGA3dCmdDXReadbackContext
; /* SVGA_3D_CMD_DX_READBACK_CONTEXT */
220 * Invalidate a guest-backed context.
223 #include "vmware_pack_begin.h"
224 struct SVGA3dCmdDXInvalidateContext
{
227 #include "vmware_pack_end.h"
228 SVGA3dCmdDXInvalidateContext
; /* SVGA_3D_CMD_DX_INVALIDATE_CONTEXT */
231 #include "vmware_pack_begin.h"
232 struct SVGA3dCmdDXSetSingleConstantBuffer
{
234 SVGA3dShaderType type
;
236 uint32 offsetInBytes
;
239 #include "vmware_pack_end.h"
240 SVGA3dCmdDXSetSingleConstantBuffer
;
241 /* SVGA_3D_CMD_DX_SET_SINGLE_CONSTANT_BUFFER */
244 #include "vmware_pack_begin.h"
245 struct SVGA3dCmdDXSetShaderResources
{
247 SVGA3dShaderType type
;
250 * Followed by a variable number of SVGA3dShaderResourceViewId's.
253 #include "vmware_pack_end.h"
254 SVGA3dCmdDXSetShaderResources
; /* SVGA_3D_CMD_DX_SET_SHADER_RESOURCES */
257 #include "vmware_pack_begin.h"
258 struct SVGA3dCmdDXSetShader
{
259 SVGA3dShaderId shaderId
;
260 SVGA3dShaderType type
;
262 #include "vmware_pack_end.h"
263 SVGA3dCmdDXSetShader
; /* SVGA_3D_CMD_DX_SET_SHADER */
267 uint32 cbOffset
: 12;
277 #include "vmware_pack_begin.h"
278 struct SVGA3dCmdDXSetShaderIface
{
279 SVGA3dShaderType type
;
280 uint32 numClassInstances
;
283 SVGA3dIfaceData data
;
285 #include "vmware_pack_end.h"
286 SVGA3dCmdDXSetShaderIface
; /* SVGA_3D_CMD_DX_SET_SHADER_IFACE */
289 #include "vmware_pack_begin.h"
290 struct SVGA3dCmdDXBindShaderIface
{
293 uint32 offsetInBytes
;
295 #include "vmware_pack_end.h"
296 SVGA3dCmdDXBindShaderIface
; /* SVGA_3D_CMD_DX_BIND_SHADER_IFACE */
299 #include "vmware_pack_begin.h"
300 struct SVGA3dCmdDXSetSamplers
{
302 SVGA3dShaderType type
;
305 * Followed by a variable number of SVGA3dSamplerId's.
308 #include "vmware_pack_end.h"
309 SVGA3dCmdDXSetSamplers
; /* SVGA_3D_CMD_DX_SET_SAMPLERS */
312 #include "vmware_pack_begin.h"
313 struct SVGA3dCmdDXDraw
{
315 uint32 startVertexLocation
;
317 #include "vmware_pack_end.h"
318 SVGA3dCmdDXDraw
; /* SVGA_3D_CMD_DX_DRAW */
321 #include "vmware_pack_begin.h"
322 struct SVGA3dCmdDXDrawIndexed
{
324 uint32 startIndexLocation
;
325 int32 baseVertexLocation
;
327 #include "vmware_pack_end.h"
328 SVGA3dCmdDXDrawIndexed
; /* SVGA_3D_CMD_DX_DRAW_INDEXED */
331 #include "vmware_pack_begin.h"
332 struct SVGA3dCmdDXDrawInstanced
{
333 uint32 vertexCountPerInstance
;
334 uint32 instanceCount
;
335 uint32 startVertexLocation
;
336 uint32 startInstanceLocation
;
338 #include "vmware_pack_end.h"
339 SVGA3dCmdDXDrawInstanced
; /* SVGA_3D_CMD_DX_DRAW_INSTANCED */
342 #include "vmware_pack_begin.h"
343 struct SVGA3dCmdDXDrawIndexedInstanced
{
344 uint32 indexCountPerInstance
;
345 uint32 instanceCount
;
346 uint32 startIndexLocation
;
347 int32 baseVertexLocation
;
348 uint32 startInstanceLocation
;
350 #include "vmware_pack_end.h"
351 SVGA3dCmdDXDrawIndexedInstanced
; /* SVGA_3D_CMD_DX_DRAW_INDEXED_INSTANCED */
354 #include "vmware_pack_begin.h"
355 struct SVGA3dCmdDXDrawIndexedInstancedIndirect
{
356 SVGA3dSurfaceId argsBufferSid
;
357 uint32 byteOffsetForArgs
;
359 #include "vmware_pack_end.h"
360 SVGA3dCmdDXDrawIndexedInstancedIndirect
;
361 /* SVGA_3D_CMD_DX_DRAW_INDEXED_INSTANCED_INDIRECT */
364 #include "vmware_pack_begin.h"
365 struct SVGA3dCmdDXDrawInstancedIndirect
{
366 SVGA3dSurfaceId argsBufferSid
;
367 uint32 byteOffsetForArgs
;
369 #include "vmware_pack_end.h"
370 SVGA3dCmdDXDrawInstancedIndirect
;
371 /* SVGA_3D_CMD_DX_DRAW_INSTANCED_INDIRECT */
374 #include "vmware_pack_begin.h"
375 struct SVGA3dCmdDXDrawAuto
{
378 #include "vmware_pack_end.h"
379 SVGA3dCmdDXDrawAuto
; /* SVGA_3D_CMD_DX_DRAW_AUTO */
382 #include "vmware_pack_begin.h"
383 struct SVGA3dCmdDXDispatch
{
384 uint32 threadGroupCountX
;
385 uint32 threadGroupCountY
;
386 uint32 threadGroupCountZ
;
388 #include "vmware_pack_end.h"
390 /* SVGA_3D_CMD_DX_DISPATCH */
393 #include "vmware_pack_begin.h"
394 struct SVGA3dCmdDXDispatchIndirect
{
395 SVGA3dSurfaceId argsBufferSid
;
396 uint32 byteOffsetForArgs
;
398 #include "vmware_pack_end.h"
399 SVGA3dCmdDXDispatchIndirect
;
400 /* SVGA_3D_CMD_DX_DISPATCH_INDIRECT */
403 #include "vmware_pack_begin.h"
404 struct SVGA3dCmdDXSetInputLayout
{
405 SVGA3dElementLayoutId elementLayoutId
;
407 #include "vmware_pack_end.h"
408 SVGA3dCmdDXSetInputLayout
; /* SVGA_3D_CMD_DX_SET_INPUT_LAYOUT */
411 #include "vmware_pack_begin.h"
412 struct SVGA3dVertexBuffer
{
417 #include "vmware_pack_end.h"
421 #include "vmware_pack_begin.h"
422 struct SVGA3dCmdDXSetVertexBuffers
{
424 /* Followed by a variable number of SVGA3dVertexBuffer's. */
426 #include "vmware_pack_end.h"
427 SVGA3dCmdDXSetVertexBuffers
; /* SVGA_3D_CMD_DX_SET_VERTEX_BUFFERS */
430 #include "vmware_pack_begin.h"
431 struct SVGA3dCmdDXSetIndexBuffer
{
433 SVGA3dSurfaceFormat format
;
436 #include "vmware_pack_end.h"
437 SVGA3dCmdDXSetIndexBuffer
; /* SVGA_3D_CMD_DX_SET_INDEX_BUFFER */
440 #include "vmware_pack_begin.h"
441 struct SVGA3dCmdDXSetTopology
{
442 SVGA3dPrimitiveType topology
;
444 #include "vmware_pack_end.h"
445 SVGA3dCmdDXSetTopology
; /* SVGA_3D_CMD_DX_SET_TOPOLOGY */
448 #include "vmware_pack_begin.h"
449 struct SVGA3dCmdDXSetRenderTargets
{
450 SVGA3dDepthStencilViewId depthStencilViewId
;
451 /* Followed by a variable number of SVGA3dRenderTargetViewId's. */
453 #include "vmware_pack_end.h"
454 SVGA3dCmdDXSetRenderTargets
; /* SVGA_3D_CMD_DX_SET_RENDERTARGETS */
457 #include "vmware_pack_begin.h"
458 struct SVGA3dCmdDXSetBlendState
{
459 SVGA3dBlendStateId blendId
;
460 float blendFactor
[4];
463 #include "vmware_pack_end.h"
464 SVGA3dCmdDXSetBlendState
; /* SVGA_3D_CMD_DX_SET_BLEND_STATE */
467 #include "vmware_pack_begin.h"
468 struct SVGA3dCmdDXSetDepthStencilState
{
469 SVGA3dDepthStencilStateId depthStencilId
;
472 #include "vmware_pack_end.h"
473 SVGA3dCmdDXSetDepthStencilState
; /* SVGA_3D_CMD_DX_SET_DEPTHSTENCIL_STATE */
476 #include "vmware_pack_begin.h"
477 struct SVGA3dCmdDXSetRasterizerState
{
478 SVGA3dRasterizerStateId rasterizerId
;
480 #include "vmware_pack_end.h"
481 SVGA3dCmdDXSetRasterizerState
; /* SVGA_3D_CMD_DX_SET_RASTERIZER_STATE */
483 #define SVGA3D_DXQUERY_FLAG_PREDICATEHINT (1 << 0)
484 typedef uint32 SVGA3dDXQueryFlags
;
487 * The SVGADXQueryDeviceState and SVGADXQueryDeviceBits are used by the device
488 * to track query state transitions, but are not intended to be used by the
491 #define SVGADX_QDSTATE_INVALID ((uint8)-1) /* Query has no state */
492 #define SVGADX_QDSTATE_MIN 0
493 #define SVGADX_QDSTATE_IDLE 0 /* Query hasn't started yet */
494 #define SVGADX_QDSTATE_ACTIVE 1 /* Query is actively gathering data */
495 #define SVGADX_QDSTATE_PENDING 2 /* Query is waiting for results */
496 #define SVGADX_QDSTATE_FINISHED 3 /* Query has completed */
497 #define SVGADX_QDSTATE_MAX 4
498 typedef uint8 SVGADXQueryDeviceState
;
501 #include "vmware_pack_begin.h"
503 SVGA3dQueryTypeUint8 type
;
505 SVGADXQueryDeviceState state
;
506 SVGA3dDXQueryFlags flags
;
510 #include "vmware_pack_end.h"
511 SVGACOTableDXQueryEntry
;
514 #include "vmware_pack_begin.h"
515 struct SVGA3dCmdDXDefineQuery
{
516 SVGA3dQueryId queryId
;
517 SVGA3dQueryType type
;
518 SVGA3dDXQueryFlags flags
;
520 #include "vmware_pack_end.h"
521 SVGA3dCmdDXDefineQuery
; /* SVGA_3D_CMD_DX_DEFINE_QUERY */
524 #include "vmware_pack_begin.h"
525 struct SVGA3dCmdDXDestroyQuery
{
526 SVGA3dQueryId queryId
;
528 #include "vmware_pack_end.h"
529 SVGA3dCmdDXDestroyQuery
; /* SVGA_3D_CMD_DX_DESTROY_QUERY */
532 #include "vmware_pack_begin.h"
533 struct SVGA3dCmdDXBindQuery
{
534 SVGA3dQueryId queryId
;
537 #include "vmware_pack_end.h"
538 SVGA3dCmdDXBindQuery
; /* SVGA_3D_CMD_DX_BIND_QUERY */
541 #include "vmware_pack_begin.h"
542 struct SVGA3dCmdDXSetQueryOffset
{
543 SVGA3dQueryId queryId
;
546 #include "vmware_pack_end.h"
547 SVGA3dCmdDXSetQueryOffset
; /* SVGA_3D_CMD_DX_SET_QUERY_OFFSET */
550 #include "vmware_pack_begin.h"
551 struct SVGA3dCmdDXBeginQuery
{
552 SVGA3dQueryId queryId
;
554 #include "vmware_pack_end.h"
555 SVGA3dCmdDXBeginQuery
; /* SVGA_3D_CMD_DX_QUERY_BEGIN */
558 #include "vmware_pack_begin.h"
559 struct SVGA3dCmdDXEndQuery
{
560 SVGA3dQueryId queryId
;
562 #include "vmware_pack_end.h"
563 SVGA3dCmdDXEndQuery
; /* SVGA_3D_CMD_DX_QUERY_END */
566 #include "vmware_pack_begin.h"
567 struct SVGA3dCmdDXReadbackQuery
{
568 SVGA3dQueryId queryId
;
570 #include "vmware_pack_end.h"
571 SVGA3dCmdDXReadbackQuery
; /* SVGA_3D_CMD_DX_READBACK_QUERY */
574 #include "vmware_pack_begin.h"
575 struct SVGA3dCmdDXMoveQuery
{
576 SVGA3dQueryId queryId
;
580 #include "vmware_pack_end.h"
581 SVGA3dCmdDXMoveQuery
; /* SVGA_3D_CMD_DX_MOVE_QUERY */
584 #include "vmware_pack_begin.h"
585 struct SVGA3dCmdDXBindAllQuery
{
589 #include "vmware_pack_end.h"
590 SVGA3dCmdDXBindAllQuery
; /* SVGA_3D_CMD_DX_BIND_ALL_QUERY */
593 #include "vmware_pack_begin.h"
594 struct SVGA3dCmdDXReadbackAllQuery
{
597 #include "vmware_pack_end.h"
598 SVGA3dCmdDXReadbackAllQuery
; /* SVGA_3D_CMD_DX_READBACK_ALL_QUERY */
601 #include "vmware_pack_begin.h"
602 struct SVGA3dCmdDXSetPredication
{
603 SVGA3dQueryId queryId
;
604 uint32 predicateValue
;
606 #include "vmware_pack_end.h"
607 SVGA3dCmdDXSetPredication
; /* SVGA_3D_CMD_DX_SET_PREDICATION */
610 #include "vmware_pack_begin.h"
611 struct MKS3dDXSOState
{
612 uint32 offset
; /* Starting offset */
613 uint32 intOffset
; /* Internal offset */
614 uint32 vertexCount
; /* vertices written */
617 #include "vmware_pack_end.h"
620 /* Set the offset field to this value to append SO values to the buffer */
621 #define SVGA3D_DX_SO_OFFSET_APPEND ((uint32) ~0u)
624 #include "vmware_pack_begin.h"
625 struct SVGA3dSoTarget
{
630 #include "vmware_pack_end.h"
634 #include "vmware_pack_begin.h"
635 struct SVGA3dCmdDXSetSOTargets
{
637 /* Followed by a variable number of SVGA3dSOTarget's. */
639 #include "vmware_pack_end.h"
640 SVGA3dCmdDXSetSOTargets
; /* SVGA_3D_CMD_DX_SET_SOTARGETS */
643 #include "vmware_pack_begin.h"
644 struct SVGA3dViewport
653 #include "vmware_pack_end.h"
657 #include "vmware_pack_begin.h"
658 struct SVGA3dCmdDXSetViewports
{
660 /* Followed by a variable number of SVGA3dViewport's. */
662 #include "vmware_pack_end.h"
663 SVGA3dCmdDXSetViewports
; /* SVGA_3D_CMD_DX_SET_VIEWPORTS */
665 #define SVGA3D_DX_MAX_VIEWPORTS 16
668 #include "vmware_pack_begin.h"
669 struct SVGA3dCmdDXSetScissorRects
{
671 /* Followed by a variable number of SVGASignedRect's. */
673 #include "vmware_pack_end.h"
674 SVGA3dCmdDXSetScissorRects
; /* SVGA_3D_CMD_DX_SET_SCISSORRECTS */
676 #define SVGA3D_DX_MAX_SCISSORRECTS 16
679 #include "vmware_pack_begin.h"
680 struct SVGA3dCmdDXClearRenderTargetView
{
681 SVGA3dRenderTargetViewId renderTargetViewId
;
682 SVGA3dRGBAFloat rgba
;
684 #include "vmware_pack_end.h"
685 SVGA3dCmdDXClearRenderTargetView
; /* SVGA_3D_CMD_DX_CLEAR_RENDERTARGET_VIEW */
688 #include "vmware_pack_begin.h"
689 struct SVGA3dCmdDXClearDepthStencilView
{
692 SVGA3dDepthStencilViewId depthStencilViewId
;
695 #include "vmware_pack_end.h"
696 SVGA3dCmdDXClearDepthStencilView
; /* SVGA_3D_CMD_DX_CLEAR_DEPTHSTENCIL_VIEW */
699 #include "vmware_pack_begin.h"
700 struct SVGA3dCmdDXPredCopyRegion
{
701 SVGA3dSurfaceId dstSid
;
702 uint32 dstSubResource
;
703 SVGA3dSurfaceId srcSid
;
704 uint32 srcSubResource
;
707 #include "vmware_pack_end.h"
708 SVGA3dCmdDXPredCopyRegion
;
709 /* SVGA_3D_CMD_DX_PRED_COPY_REGION */
712 #include "vmware_pack_begin.h"
713 struct SVGA3dCmdDXPredCopy
{
714 SVGA3dSurfaceId dstSid
;
715 SVGA3dSurfaceId srcSid
;
717 #include "vmware_pack_end.h"
718 SVGA3dCmdDXPredCopy
; /* SVGA_3D_CMD_DX_PRED_COPY */
721 #include "vmware_pack_begin.h"
722 struct SVGA3dCmdDXPredConvertRegion
{
723 SVGA3dSurfaceId dstSid
;
724 uint32 dstSubResource
;
726 SVGA3dSurfaceId srcSid
;
727 uint32 srcSubResource
;
730 #include "vmware_pack_end.h"
731 SVGA3dCmdDXPredConvertRegion
; /* SVGA_3D_CMD_DX_PRED_CONVERT_REGION */
734 #include "vmware_pack_begin.h"
735 struct SVGA3dCmdDXPredConvert
{
736 SVGA3dSurfaceId dstSid
;
737 SVGA3dSurfaceId srcSid
;
739 #include "vmware_pack_end.h"
740 SVGA3dCmdDXPredConvert
; /* SVGA_3D_CMD_DX_PRED_CONVERT */
743 #include "vmware_pack_begin.h"
744 struct SVGA3dCmdDXBufferCopy
{
745 SVGA3dSurfaceId dest
;
751 #include "vmware_pack_end.h"
752 SVGA3dCmdDXBufferCopy
;
753 /* SVGA_3D_CMD_DX_BUFFER_COPY */
756 * Perform a surface copy between a multisample, and a non-multisampled
760 #include "vmware_pack_begin.h"
762 SVGA3dSurfaceId dstSid
;
763 uint32 dstSubResource
;
764 SVGA3dSurfaceId srcSid
;
765 uint32 srcSubResource
;
766 SVGA3dSurfaceFormat copyFormat
;
768 #include "vmware_pack_end.h"
769 SVGA3dCmdDXResolveCopy
; /* SVGA_3D_CMD_DX_RESOLVE_COPY */
772 * Perform a predicated surface copy between a multisample, and a
773 * non-multisampled surface.
776 #include "vmware_pack_begin.h"
778 SVGA3dSurfaceId dstSid
;
779 uint32 dstSubResource
;
780 SVGA3dSurfaceId srcSid
;
781 uint32 srcSubResource
;
782 SVGA3dSurfaceFormat copyFormat
;
784 #include "vmware_pack_end.h"
785 SVGA3dCmdDXPredResolveCopy
; /* SVGA_3D_CMD_DX_PRED_RESOLVE_COPY */
787 typedef uint32 SVGA3dDXPresentBltMode
;
788 #define SVGADX_PRESENTBLT_LINEAR (1 << 0)
789 #define SVGADX_PRESENTBLT_FORCE_SRC_SRGB (1 << 1)
790 #define SVGADX_PRESENTBLT_FORCE_SRC_XRBIAS (1 << 2)
791 #define SVGADX_PRESENTBLT_MODE_MAX (1 << 3)
794 #include "vmware_pack_begin.h"
795 struct SVGA3dCmdDXPresentBlt
{
796 SVGA3dSurfaceId srcSid
;
797 uint32 srcSubResource
;
798 SVGA3dSurfaceId dstSid
;
799 uint32 destSubResource
;
802 SVGA3dDXPresentBltMode mode
;
804 #include "vmware_pack_end.h"
805 SVGA3dCmdDXPresentBlt
; /* SVGA_3D_CMD_DX_PRESENTBLT*/
808 #include "vmware_pack_begin.h"
809 struct SVGA3dCmdDXGenMips
{
810 SVGA3dShaderResourceViewId shaderResourceViewId
;
812 #include "vmware_pack_end.h"
813 SVGA3dCmdDXGenMips
; /* SVGA_3D_CMD_DX_GENMIPS */
816 * Update a sub-resource in a guest-backed resource.
817 * (Inform the device that the guest-contents have been updated.)
820 #include "vmware_pack_begin.h"
821 struct SVGA3dCmdDXUpdateSubResource
{
826 #include "vmware_pack_end.h"
827 SVGA3dCmdDXUpdateSubResource
; /* SVGA_3D_CMD_DX_UPDATE_SUBRESOURCE */
830 * Readback a subresource in a guest-backed resource.
831 * (Request the device to flush the dirty contents into the guest.)
834 #include "vmware_pack_begin.h"
835 struct SVGA3dCmdDXReadbackSubResource
{
839 #include "vmware_pack_end.h"
840 SVGA3dCmdDXReadbackSubResource
; /* SVGA_3D_CMD_DX_READBACK_SUBRESOURCE */
843 * Invalidate an image in a guest-backed surface.
844 * (Notify the device that the contents can be lost.)
847 #include "vmware_pack_begin.h"
848 struct SVGA3dCmdDXInvalidateSubResource
{
852 #include "vmware_pack_end.h"
853 SVGA3dCmdDXInvalidateSubResource
; /* SVGA_3D_CMD_DX_INVALIDATE_SUBRESOURCE */
857 * Raw byte wise transfer from a buffer surface into another surface
858 * of the requested box. Supported if 3d is enabled and SVGA_CAP_DX
859 * is set. This command does not take a context.
862 #include "vmware_pack_begin.h"
863 struct SVGA3dCmdDXTransferFromBuffer
{
864 SVGA3dSurfaceId srcSid
;
867 uint32 srcSlicePitch
;
868 SVGA3dSurfaceId destSid
;
869 uint32 destSubResource
;
872 #include "vmware_pack_end.h"
873 SVGA3dCmdDXTransferFromBuffer
; /* SVGA_3D_CMD_DX_TRANSFER_FROM_BUFFER */
876 #define SVGA3D_TRANSFER_TO_BUFFER_READBACK (1 << 0)
877 #define SVGA3D_TRANSFER_TO_BUFFER_FLAGS_MASK (1 << 0)
878 typedef uint32 SVGA3dTransferToBufferFlags
;
881 * Raw byte wise transfer to a buffer surface from another surface
882 * of the requested box. Supported if SVGA_CAP_DX2 is set. This
883 * command does not take a context.
886 #include "vmware_pack_begin.h"
887 struct SVGA3dCmdDXTransferToBuffer
{
888 SVGA3dSurfaceId srcSid
;
889 uint32 srcSubResource
;
891 SVGA3dSurfaceId destSid
;
894 uint32 destSlicePitch
;
895 SVGA3dTransferToBufferFlags flags
;
897 #include "vmware_pack_end.h"
898 SVGA3dCmdDXTransferToBuffer
; /* SVGA_3D_CMD_DX_TRANSFER_TO_BUFFER */
902 * Raw byte wise transfer from a buffer surface into another surface
903 * of the requested box. Supported if SVGA3D_DEVCAP_DXCONTEXT is set.
904 * The context is implied from the command buffer header.
907 #include "vmware_pack_begin.h"
908 struct SVGA3dCmdDXPredTransferFromBuffer
{
909 SVGA3dSurfaceId srcSid
;
912 uint32 srcSlicePitch
;
913 SVGA3dSurfaceId destSid
;
914 uint32 destSubResource
;
917 #include "vmware_pack_end.h"
918 SVGA3dCmdDXPredTransferFromBuffer
;
919 /* SVGA_3D_CMD_DX_PRED_TRANSFER_FROM_BUFFER */
923 #include "vmware_pack_begin.h"
924 struct SVGA3dCmdDXSurfaceCopyAndReadback
{
925 SVGA3dSurfaceId srcSid
;
926 SVGA3dSurfaceId destSid
;
929 #include "vmware_pack_end.h"
930 SVGA3dCmdDXSurfaceCopyAndReadback
;
931 /* SVGA_3D_CMD_DX_SURFACE_COPY_AND_READBACK */
934 * SVGA_DX_HINT_NONE: Does nothing.
936 * SVGA_DX_HINT_PREFETCH_OBJECT:
937 * SVGA_DX_HINT_PREEVICT_OBJECT:
938 * Consumes a SVGAObjectRef, and hints that the host should consider
939 * fetching/evicting the specified object.
941 * An id of SVGA3D_INVALID_ID can be used if the guest isn't sure
942 * what object was affected. (For instance, if the guest knows that
943 * it is about to evict a DXShader, but doesn't know precisely which one,
944 * the device can still use this to help limit it's search, or track
945 * how many page-outs have happened.)
947 * SVGA_DX_HINT_PREFETCH_COBJECT:
948 * SVGA_DX_HINT_PREEVICT_COBJECT:
949 * Same as the above, except they consume an SVGACObjectRef.
951 typedef uint32 SVGADXHintId
;
952 #define SVGA_DX_HINT_NONE 0
953 #define SVGA_DX_HINT_PREFETCH_OBJECT 1
954 #define SVGA_DX_HINT_PREEVICT_OBJECT 2
955 #define SVGA_DX_HINT_PREFETCH_COBJECT 3
956 #define SVGA_DX_HINT_PREEVICT_COBJECT 4
957 #define SVGA_DX_HINT_MAX 5
960 #include "vmware_pack_begin.h"
961 struct SVGAObjectRef
{
965 #include "vmware_pack_end.h"
969 #include "vmware_pack_begin.h"
970 struct SVGACObjectRef
{
971 SVGACOTableType type
;
975 #include "vmware_pack_end.h"
979 #include "vmware_pack_begin.h"
980 struct SVGA3dCmdDXHint
{
984 * Followed by variable sized data depending on the hintId.
987 #include "vmware_pack_end.h"
989 /* SVGA_3D_CMD_DX_HINT */
992 #include "vmware_pack_begin.h"
993 struct SVGA3dCmdDXBufferUpdate
{
998 #include "vmware_pack_end.h"
999 SVGA3dCmdDXBufferUpdate
;
1000 /* SVGA_3D_CMD_DX_BUFFER_UPDATE */
1003 #include "vmware_pack_begin.h"
1004 struct SVGA3dCmdDXSetConstantBufferOffset
{
1006 uint32 offsetInBytes
;
1008 #include "vmware_pack_end.h"
1009 SVGA3dCmdDXSetConstantBufferOffset
;
1011 typedef SVGA3dCmdDXSetConstantBufferOffset SVGA3dCmdDXSetVSConstantBufferOffset
;
1012 /* SVGA_3D_CMD_DX_SET_VS_CONSTANT_BUFFER_OFFSET */
1014 typedef SVGA3dCmdDXSetConstantBufferOffset SVGA3dCmdDXSetPSConstantBufferOffset
;
1015 /* SVGA_3D_CMD_DX_SET_PS_CONSTANT_BUFFER_OFFSET */
1017 typedef SVGA3dCmdDXSetConstantBufferOffset SVGA3dCmdDXSetGSConstantBufferOffset
;
1018 /* SVGA_3D_CMD_DX_SET_GS_CONSTANT_BUFFER_OFFSET */
1020 typedef SVGA3dCmdDXSetConstantBufferOffset SVGA3dCmdDXSetHSConstantBufferOffset
;
1021 /* SVGA_3D_CMD_DX_SET_HS_CONSTANT_BUFFER_OFFSET */
1023 typedef SVGA3dCmdDXSetConstantBufferOffset SVGA3dCmdDXSetDSConstantBufferOffset
;
1024 /* SVGA_3D_CMD_DX_SET_DS_CONSTANT_BUFFER_OFFSET */
1026 typedef SVGA3dCmdDXSetConstantBufferOffset SVGA3dCmdDXSetCSConstantBufferOffset
;
1027 /* SVGA_3D_CMD_DX_SET_CS_CONSTANT_BUFFER_OFFSET */
1030 #define SVGA3D_BUFFEREX_SRV_RAW (1 << 0)
1031 #define SVGA3D_BUFFEREX_SRV_FLAGS_MAX (1 << 1)
1032 #define SVGA3D_BUFFEREX_SRV_FLAGS_MASK (SVGA3D_BUFFEREX_SRV_FLAGS_MAX - 1)
1033 typedef uint32 SVGA3dBufferExFlags
;
1036 #include "vmware_pack_begin.h"
1040 uint32 firstElement
;
1046 uint32 mostDetailedMip
;
1047 uint32 firstArraySlice
;
1050 } tex
; /* 1d, 2d, 3d, cube */
1052 uint32 firstElement
;
1054 SVGA3dBufferExFlags flags
;
1059 #include "vmware_pack_end.h"
1060 SVGA3dShaderResourceViewDesc
;
1063 #include "vmware_pack_begin.h"
1065 SVGA3dSurfaceId sid
;
1066 SVGA3dSurfaceFormat format
;
1067 SVGA3dResourceType resourceDimension
;
1068 SVGA3dShaderResourceViewDesc desc
;
1071 #include "vmware_pack_end.h"
1072 SVGACOTableDXSRViewEntry
;
1075 #include "vmware_pack_begin.h"
1076 struct SVGA3dCmdDXDefineShaderResourceView
{
1077 SVGA3dShaderResourceViewId shaderResourceViewId
;
1079 SVGA3dSurfaceId sid
;
1080 SVGA3dSurfaceFormat format
;
1081 SVGA3dResourceType resourceDimension
;
1083 SVGA3dShaderResourceViewDesc desc
;
1085 #include "vmware_pack_end.h"
1086 SVGA3dCmdDXDefineShaderResourceView
;
1087 /* SVGA_3D_CMD_DX_DEFINE_SHADERRESOURCE_VIEW */
1090 #include "vmware_pack_begin.h"
1091 struct SVGA3dCmdDXDestroyShaderResourceView
{
1092 SVGA3dShaderResourceViewId shaderResourceViewId
;
1094 #include "vmware_pack_end.h"
1095 SVGA3dCmdDXDestroyShaderResourceView
;
1096 /* SVGA_3D_CMD_DX_DESTROY_SHADERRESOURCE_VIEW */
1099 #include "vmware_pack_begin.h"
1100 struct SVGA3dRenderTargetViewDesc
{
1103 uint32 firstElement
;
1109 uint32 firstArraySlice
;
1111 } tex
; /* 1d, 2d, cube */
1119 #include "vmware_pack_end.h"
1120 SVGA3dRenderTargetViewDesc
;
1123 #include "vmware_pack_begin.h"
1125 SVGA3dSurfaceId sid
;
1126 SVGA3dSurfaceFormat format
;
1127 SVGA3dResourceType resourceDimension
;
1128 SVGA3dRenderTargetViewDesc desc
;
1131 #include "vmware_pack_end.h"
1132 SVGACOTableDXRTViewEntry
;
1135 #include "vmware_pack_begin.h"
1136 struct SVGA3dCmdDXDefineRenderTargetView
{
1137 SVGA3dRenderTargetViewId renderTargetViewId
;
1139 SVGA3dSurfaceId sid
;
1140 SVGA3dSurfaceFormat format
;
1141 SVGA3dResourceType resourceDimension
;
1143 SVGA3dRenderTargetViewDesc desc
;
1145 #include "vmware_pack_end.h"
1146 SVGA3dCmdDXDefineRenderTargetView
;
1147 /* SVGA_3D_CMD_DX_DEFINE_RENDERTARGET_VIEW */
1150 #include "vmware_pack_begin.h"
1151 struct SVGA3dCmdDXDestroyRenderTargetView
{
1152 SVGA3dRenderTargetViewId renderTargetViewId
;
1154 #include "vmware_pack_end.h"
1155 SVGA3dCmdDXDestroyRenderTargetView
;
1156 /* SVGA_3D_CMD_DX_DESTROY_RENDERTARGET_VIEW */
1160 #define SVGA3D_DXDSVIEW_CREATE_READ_ONLY_DEPTH 0x01
1161 #define SVGA3D_DXDSVIEW_CREATE_READ_ONLY_STENCIL 0x02
1162 #define SVGA3D_DXDSVIEW_CREATE_FLAG_MASK 0x03
1163 typedef uint8 SVGA3DCreateDSViewFlags
;
1166 #include "vmware_pack_begin.h"
1168 SVGA3dSurfaceId sid
;
1169 SVGA3dSurfaceFormat format
;
1170 SVGA3dResourceType resourceDimension
;
1172 uint32 firstArraySlice
;
1174 SVGA3DCreateDSViewFlags flags
;
1179 #include "vmware_pack_end.h"
1180 SVGACOTableDXDSViewEntry
;
1183 #include "vmware_pack_begin.h"
1184 struct SVGA3dCmdDXDefineDepthStencilView
{
1185 SVGA3dDepthStencilViewId depthStencilViewId
;
1187 SVGA3dSurfaceId sid
;
1188 SVGA3dSurfaceFormat format
;
1189 SVGA3dResourceType resourceDimension
;
1191 uint32 firstArraySlice
;
1193 SVGA3DCreateDSViewFlags flags
;
1197 #include "vmware_pack_end.h"
1198 SVGA3dCmdDXDefineDepthStencilView
;
1199 /* SVGA_3D_CMD_DX_DEFINE_DEPTHSTENCIL_VIEW */
1202 * Version 2 needed in order to start validating and using the flags
1203 * field. Unfortunately the device wasn't validating or using the
1204 * flags field and the driver wasn't initializing it in shipped code,
1205 * so a new version of the command is needed to allow that code to
1209 #include "vmware_pack_begin.h"
1210 struct SVGA3dCmdDXDefineDepthStencilView_v2
{
1211 SVGA3dDepthStencilViewId depthStencilViewId
;
1213 SVGA3dSurfaceId sid
;
1214 SVGA3dSurfaceFormat format
;
1215 SVGA3dResourceType resourceDimension
;
1217 uint32 firstArraySlice
;
1219 SVGA3DCreateDSViewFlags flags
;
1223 #include "vmware_pack_end.h"
1224 SVGA3dCmdDXDefineDepthStencilView_v2
;
1225 /* SVGA_3D_CMD_DX_DEFINE_DEPTHSTENCIL_VIEW_V2 */
1228 #include "vmware_pack_begin.h"
1229 struct SVGA3dCmdDXDestroyDepthStencilView
{
1230 SVGA3dDepthStencilViewId depthStencilViewId
;
1232 #include "vmware_pack_end.h"
1233 SVGA3dCmdDXDestroyDepthStencilView
;
1234 /* SVGA_3D_CMD_DX_DESTROY_DEPTHSTENCIL_VIEW */
1237 #define SVGA3D_UABUFFER_RAW (1 << 0)
1238 #define SVGA3D_UABUFFER_APPEND (1 << 1)
1239 #define SVGA3D_UABUFFER_COUNTER (1 << 2)
1240 typedef uint32 SVGA3dUABufferFlags
;
1243 #include "vmware_pack_begin.h"
1247 uint32 firstElement
;
1249 SVGA3dUABufferFlags flags
;
1255 uint32 firstArraySlice
;
1269 #include "vmware_pack_end.h"
1273 #include "vmware_pack_begin.h"
1275 SVGA3dSurfaceId sid
;
1276 SVGA3dSurfaceFormat format
;
1277 SVGA3dResourceType resourceDimension
;
1278 SVGA3dUAViewDesc desc
;
1279 uint32 structureCount
;
1282 #include "vmware_pack_end.h"
1283 SVGACOTableDXUAViewEntry
;
1286 #include "vmware_pack_begin.h"
1287 struct SVGA3dCmdDXDefineUAView
{
1288 SVGA3dUAViewId uaViewId
;
1290 SVGA3dSurfaceId sid
;
1291 SVGA3dSurfaceFormat format
;
1292 SVGA3dResourceType resourceDimension
;
1294 SVGA3dUAViewDesc desc
;
1296 #include "vmware_pack_end.h"
1297 SVGA3dCmdDXDefineUAView
;
1298 /* SVGA_3D_CMD_DX_DEFINE_UA_VIEW */
1301 #include "vmware_pack_begin.h"
1302 struct SVGA3dCmdDXDestroyUAView
{
1303 SVGA3dUAViewId uaViewId
;
1305 #include "vmware_pack_end.h"
1306 SVGA3dCmdDXDestroyUAView
;
1307 /* SVGA_3D_CMD_DX_DESTROY_UA_VIEW */
1310 #include "vmware_pack_begin.h"
1311 struct SVGA3dCmdDXClearUAViewUint
{
1312 SVGA3dUAViewId uaViewId
;
1313 SVGA3dRGBAUint32 value
;
1315 #include "vmware_pack_end.h"
1316 SVGA3dCmdDXClearUAViewUint
;
1317 /* SVGA_3D_CMD_DX_CLEAR_UA_VIEW_UINT */
1320 #include "vmware_pack_begin.h"
1321 struct SVGA3dCmdDXClearUAViewFloat
{
1322 SVGA3dUAViewId uaViewId
;
1323 SVGA3dRGBAFloat value
;
1325 #include "vmware_pack_end.h"
1326 SVGA3dCmdDXClearUAViewFloat
;
1327 /* SVGA_3D_CMD_DX_CLEAR_UA_VIEW_FLOAT */
1330 #include "vmware_pack_begin.h"
1331 struct SVGA3dCmdDXCopyStructureCount
{
1332 SVGA3dUAViewId srcUAViewId
;
1333 SVGA3dSurfaceId destSid
;
1334 uint32 destByteOffset
;
1336 #include "vmware_pack_end.h"
1337 SVGA3dCmdDXCopyStructureCount
;
1338 /* SVGA_3D_CMD_DX_COPY_STRUCTURE_COUNT */
1341 #include "vmware_pack_begin.h"
1342 struct SVGA3dCmdDXSetStructureCount
{
1343 SVGA3dUAViewId uaViewId
;
1344 uint32 structureCount
;
1346 #include "vmware_pack_end.h"
1347 SVGA3dCmdDXSetStructureCount
;
1348 /* SVGA_3D_CMD_DX_SET_STRUCTURE_COUNT */
1351 #include "vmware_pack_begin.h"
1352 struct SVGA3dCmdDXSetUAViews
{
1353 uint32 uavSpliceIndex
;
1354 /* Followed by a variable number of SVGA3dUAViewId's. */
1356 #include "vmware_pack_end.h"
1357 SVGA3dCmdDXSetUAViews
; /* SVGA_3D_CMD_DX_SET_UA_VIEWS */
1360 #include "vmware_pack_begin.h"
1361 struct SVGA3dCmdDXSetCSUAViews
{
1363 /* Followed by a variable number of SVGA3dUAViewId's. */
1365 #include "vmware_pack_end.h"
1366 SVGA3dCmdDXSetCSUAViews
; /* SVGA_3D_CMD_DX_SET_CS_UA_VIEWS */
1369 #include "vmware_pack_begin.h"
1370 struct SVGA3dInputElementDesc
{
1372 uint32 alignedByteOffset
;
1373 SVGA3dSurfaceFormat format
;
1374 SVGA3dInputClassification inputSlotClass
;
1375 uint32 instanceDataStepRate
;
1376 uint32 inputRegister
;
1378 #include "vmware_pack_end.h"
1379 SVGA3dInputElementDesc
;
1382 #include "vmware_pack_begin.h"
1386 SVGA3dInputElementDesc descs
[32];
1389 #include "vmware_pack_end.h"
1390 SVGACOTableDXElementLayoutEntry
;
1393 #include "vmware_pack_begin.h"
1394 struct SVGA3dCmdDXDefineElementLayout
{
1395 SVGA3dElementLayoutId elementLayoutId
;
1396 /* Followed by a variable number of SVGA3dInputElementDesc's. */
1398 #include "vmware_pack_end.h"
1399 SVGA3dCmdDXDefineElementLayout
;
1400 /* SVGA_3D_CMD_DX_DEFINE_ELEMENTLAYOUT */
1403 #include "vmware_pack_begin.h"
1404 struct SVGA3dCmdDXDestroyElementLayout
{
1405 SVGA3dElementLayoutId elementLayoutId
;
1407 #include "vmware_pack_end.h"
1408 SVGA3dCmdDXDestroyElementLayout
;
1409 /* SVGA_3D_CMD_DX_DESTROY_ELEMENTLAYOUT */
1412 #define SVGA3D_DX_MAX_RENDER_TARGETS 8
1415 #include "vmware_pack_begin.h"
1416 struct SVGA3dDXBlendStatePerRT
{
1421 uint8 srcBlendAlpha
;
1422 uint8 destBlendAlpha
;
1424 SVGA3dColorWriteEnable renderTargetWriteMask
;
1425 uint8 logicOpEnable
;
1429 #include "vmware_pack_end.h"
1430 SVGA3dDXBlendStatePerRT
;
1433 #include "vmware_pack_begin.h"
1435 uint8 alphaToCoverageEnable
;
1436 uint8 independentBlendEnable
;
1438 SVGA3dDXBlendStatePerRT perRT
[SVGA3D_MAX_RENDER_TARGETS
];
1441 #include "vmware_pack_end.h"
1442 SVGACOTableDXBlendStateEntry
;
1447 #include "vmware_pack_begin.h"
1448 struct SVGA3dCmdDXDefineBlendState
{
1449 SVGA3dBlendStateId blendId
;
1450 uint8 alphaToCoverageEnable
;
1451 uint8 independentBlendEnable
;
1453 SVGA3dDXBlendStatePerRT perRT
[SVGA3D_MAX_RENDER_TARGETS
];
1455 #include "vmware_pack_end.h"
1456 SVGA3dCmdDXDefineBlendState
; /* SVGA_3D_CMD_DX_DEFINE_BLEND_STATE */
1459 #include "vmware_pack_begin.h"
1460 struct SVGA3dCmdDXDestroyBlendState
{
1461 SVGA3dBlendStateId blendId
;
1463 #include "vmware_pack_end.h"
1464 SVGA3dCmdDXDestroyBlendState
; /* SVGA_3D_CMD_DX_DESTROY_BLEND_STATE */
1467 #include "vmware_pack_begin.h"
1470 SVGA3dDepthWriteMask depthWriteMask
;
1471 SVGA3dComparisonFunc depthFunc
;
1472 uint8 stencilEnable
;
1475 uint8 stencilReadMask
;
1476 uint8 stencilWriteMask
;
1478 uint8 frontStencilFailOp
;
1479 uint8 frontStencilDepthFailOp
;
1480 uint8 frontStencilPassOp
;
1481 SVGA3dComparisonFunc frontStencilFunc
;
1483 uint8 backStencilFailOp
;
1484 uint8 backStencilDepthFailOp
;
1485 uint8 backStencilPassOp
;
1486 SVGA3dComparisonFunc backStencilFunc
;
1488 #include "vmware_pack_end.h"
1489 SVGACOTableDXDepthStencilEntry
;
1494 #include "vmware_pack_begin.h"
1495 struct SVGA3dCmdDXDefineDepthStencilState
{
1496 SVGA3dDepthStencilStateId depthStencilId
;
1499 SVGA3dDepthWriteMask depthWriteMask
;
1500 SVGA3dComparisonFunc depthFunc
;
1501 uint8 stencilEnable
;
1504 uint8 stencilReadMask
;
1505 uint8 stencilWriteMask
;
1507 uint8 frontStencilFailOp
;
1508 uint8 frontStencilDepthFailOp
;
1509 uint8 frontStencilPassOp
;
1510 SVGA3dComparisonFunc frontStencilFunc
;
1512 uint8 backStencilFailOp
;
1513 uint8 backStencilDepthFailOp
;
1514 uint8 backStencilPassOp
;
1515 SVGA3dComparisonFunc backStencilFunc
;
1517 #include "vmware_pack_end.h"
1518 SVGA3dCmdDXDefineDepthStencilState
;
1519 /* SVGA_3D_CMD_DX_DEFINE_DEPTHSTENCIL_STATE */
1522 #include "vmware_pack_begin.h"
1523 struct SVGA3dCmdDXDestroyDepthStencilState
{
1524 SVGA3dDepthStencilStateId depthStencilId
;
1526 #include "vmware_pack_end.h"
1527 SVGA3dCmdDXDestroyDepthStencilState
;
1528 /* SVGA_3D_CMD_DX_DESTROY_DEPTHSTENCIL_STATE */
1531 #include "vmware_pack_begin.h"
1534 SVGA3dCullMode cullMode
;
1535 uint8 frontCounterClockwise
;
1536 uint8 provokingVertexLast
;
1538 float depthBiasClamp
;
1539 float slopeScaledDepthBias
;
1540 uint8 depthClipEnable
;
1541 uint8 scissorEnable
;
1542 SVGA3dMultisampleRastEnable multisampleEnable
;
1543 uint8 antialiasedLineEnable
;
1545 uint8 lineStippleEnable
;
1546 uint8 lineStippleFactor
;
1547 uint16 lineStipplePattern
;
1548 uint8 forcedSampleCount
;
1549 uint8 mustBeZero
[3];
1551 #include "vmware_pack_end.h"
1552 SVGACOTableDXRasterizerStateEntry
;
1557 #include "vmware_pack_begin.h"
1558 struct SVGA3dCmdDXDefineRasterizerState
{
1559 SVGA3dRasterizerStateId rasterizerId
;
1562 SVGA3dCullMode cullMode
;
1563 uint8 frontCounterClockwise
;
1564 uint8 provokingVertexLast
;
1566 float depthBiasClamp
;
1567 float slopeScaledDepthBias
;
1568 uint8 depthClipEnable
;
1569 uint8 scissorEnable
;
1570 SVGA3dMultisampleRastEnable multisampleEnable
;
1571 uint8 antialiasedLineEnable
;
1573 uint8 lineStippleEnable
;
1574 uint8 lineStippleFactor
;
1575 uint16 lineStipplePattern
;
1577 #include "vmware_pack_end.h"
1578 SVGA3dCmdDXDefineRasterizerState
;
1579 /* SVGA_3D_CMD_DX_DEFINE_RASTERIZER_STATE */
1582 #include "vmware_pack_begin.h"
1583 struct SVGA3dCmdDXDestroyRasterizerState
{
1584 SVGA3dRasterizerStateId rasterizerId
;
1586 #include "vmware_pack_end.h"
1587 SVGA3dCmdDXDestroyRasterizerState
;
1588 /* SVGA_3D_CMD_DX_DESTROY_RASTERIZER_STATE */
1591 #include "vmware_pack_begin.h"
1593 SVGA3dFilter filter
;
1599 uint8 maxAnisotropy
;
1600 SVGA3dComparisonFunc comparisonFunc
;
1602 SVGA3dRGBAFloat borderColor
;
1607 #include "vmware_pack_end.h"
1608 SVGACOTableDXSamplerEntry
;
1613 #include "vmware_pack_begin.h"
1614 struct SVGA3dCmdDXDefineSamplerState
{
1615 SVGA3dSamplerId samplerId
;
1616 SVGA3dFilter filter
;
1622 uint8 maxAnisotropy
;
1623 SVGA3dComparisonFunc comparisonFunc
;
1625 SVGA3dRGBAFloat borderColor
;
1629 #include "vmware_pack_end.h"
1630 SVGA3dCmdDXDefineSamplerState
; /* SVGA_3D_CMD_DX_DEFINE_SAMPLER_STATE */
1633 #include "vmware_pack_begin.h"
1634 struct SVGA3dCmdDXDestroySamplerState
{
1635 SVGA3dSamplerId samplerId
;
1637 #include "vmware_pack_end.h"
1638 SVGA3dCmdDXDestroySamplerState
; /* SVGA_3D_CMD_DX_DESTROY_SAMPLER_STATE */
1641 #define SVGADX_SIGNATURE_SEMANTIC_NAME_UNDEFINED 0
1642 #define SVGADX_SIGNATURE_SEMANTIC_NAME_POSITION 1
1643 #define SVGADX_SIGNATURE_SEMANTIC_NAME_CLIP_DISTANCE 2
1644 #define SVGADX_SIGNATURE_SEMANTIC_NAME_CULL_DISTANCE 3
1645 #define SVGADX_SIGNATURE_SEMANTIC_NAME_RENDER_TARGET_ARRAY_INDEX 4
1646 #define SVGADX_SIGNATURE_SEMANTIC_NAME_VIEWPORT_ARRAY_INDEX 5
1647 #define SVGADX_SIGNATURE_SEMANTIC_NAME_VERTEX_ID 6
1648 #define SVGADX_SIGNATURE_SEMANTIC_NAME_PRIMITIVE_ID 7
1649 #define SVGADX_SIGNATURE_SEMANTIC_NAME_INSTANCE_ID 8
1650 #define SVGADX_SIGNATURE_SEMANTIC_NAME_IS_FRONT_FACE 9
1651 #define SVGADX_SIGNATURE_SEMANTIC_NAME_SAMPLE_INDEX 10
1652 #define SVGADX_SIGNATURE_SEMANTIC_NAME_FINAL_QUAD_U_EQ_0_EDGE_TESSFACTOR 11
1653 #define SVGADX_SIGNATURE_SEMANTIC_NAME_FINAL_QUAD_V_EQ_0_EDGE_TESSFACTOR 12
1654 #define SVGADX_SIGNATURE_SEMANTIC_NAME_FINAL_QUAD_U_EQ_1_EDGE_TESSFACTOR 13
1655 #define SVGADX_SIGNATURE_SEMANTIC_NAME_FINAL_QUAD_V_EQ_1_EDGE_TESSFACTOR 14
1656 #define SVGADX_SIGNATURE_SEMANTIC_NAME_FINAL_QUAD_U_INSIDE_TESSFACTOR 15
1657 #define SVGADX_SIGNATURE_SEMANTIC_NAME_FINAL_QUAD_V_INSIDE_TESSFACTOR 16
1658 #define SVGADX_SIGNATURE_SEMANTIC_NAME_FINAL_TRI_U_EQ_0_EDGE_TESSFACTOR 17
1659 #define SVGADX_SIGNATURE_SEMANTIC_NAME_FINAL_TRI_V_EQ_0_EDGE_TESSFACTOR 18
1660 #define SVGADX_SIGNATURE_SEMANTIC_NAME_FINAL_TRI_W_EQ_0_EDGE_TESSFACTOR 19
1661 #define SVGADX_SIGNATURE_SEMANTIC_NAME_FINAL_TRI_INSIDE_TESSFACTOR 20
1662 #define SVGADX_SIGNATURE_SEMANTIC_NAME_FINAL_LINE_DETAIL_TESSFACTOR 21
1663 #define SVGADX_SIGNATURE_SEMANTIC_NAME_FINAL_LINE_DENSITY_TESSFACTOR 22
1664 #define SVGADX_SIGNATURE_SEMANTIC_NAME_MAX 23
1665 typedef uint32 SVGA3dDXSignatureSemanticName
;
1667 #define SVGADX_SIGNATURE_REGISTER_COMPONENT_UNKNOWN 0
1668 typedef uint32 SVGA3dDXSignatureRegisterComponentType
;
1670 #define SVGADX_SIGNATURE_MIN_PRECISION_DEFAULT 0
1671 typedef uint32 SVGA3dDXSignatureMinPrecision
;
1674 #include "vmware_pack_begin.h"
1675 struct SVGA3dDXSignatureEntry
{
1676 uint32 registerIndex
;
1677 SVGA3dDXSignatureSemanticName semanticName
;
1678 uint32 mask
; /* Lower 4 bits represent X, Y, Z, W channels */
1679 SVGA3dDXSignatureRegisterComponentType componentType
;
1680 SVGA3dDXSignatureMinPrecision minPrecision
;
1682 #include "vmware_pack_end.h"
1683 SVGA3dDXShaderSignatureEntry
;
1685 #define SVGADX_SIGNATURE_HEADER_VERSION_0 0x08a92d12
1688 * The SVGA3dDXSignatureHeader structure is added after the shader
1689 * body in the mob that is bound to the shader. It is followed by the
1690 * specified number of SVGA3dDXSignatureEntry structures for each of
1691 * the three types of signatures in the order (input, output, patch
1695 #include "vmware_pack_begin.h"
1696 struct SVGA3dDXSignatureHeader
{
1697 uint32 headerVersion
;
1698 uint32 numInputSignatures
;
1699 uint32 numOutputSignatures
;
1700 uint32 numPatchConstantSignatures
;
1702 #include "vmware_pack_end.h"
1703 SVGA3dDXShaderSignatureHeader
;
1706 #include "vmware_pack_begin.h"
1707 struct SVGA3dCmdDXDefineShader
{
1708 SVGA3dShaderId shaderId
;
1709 SVGA3dShaderType type
;
1710 uint32 sizeInBytes
; /* Number of bytes of shader text. */
1712 #include "vmware_pack_end.h"
1713 SVGA3dCmdDXDefineShader
; /* SVGA_3D_CMD_DX_DEFINE_SHADER */
1716 #include "vmware_pack_begin.h"
1717 struct SVGACOTableDXShaderEntry
{
1718 SVGA3dShaderType type
;
1720 uint32 offsetInBytes
;
1724 #include "vmware_pack_end.h"
1725 SVGACOTableDXShaderEntry
;
1728 #include "vmware_pack_begin.h"
1729 struct SVGA3dCmdDXDestroyShader
{
1730 SVGA3dShaderId shaderId
;
1732 #include "vmware_pack_end.h"
1733 SVGA3dCmdDXDestroyShader
; /* SVGA_3D_CMD_DX_DESTROY_SHADER */
1736 #include "vmware_pack_begin.h"
1737 struct SVGA3dCmdDXBindShader
{
1741 uint32 offsetInBytes
;
1743 #include "vmware_pack_end.h"
1744 SVGA3dCmdDXBindShader
; /* SVGA_3D_CMD_DX_BIND_SHADER */
1747 #include "vmware_pack_begin.h"
1748 struct SVGA3dCmdDXBindAllShader
{
1752 #include "vmware_pack_end.h"
1753 SVGA3dCmdDXBindAllShader
; /* SVGA_3D_CMD_DX_BIND_ALL_SHADER */
1756 #include "vmware_pack_begin.h"
1757 struct SVGA3dCmdDXCondBindAllShader
{
1759 SVGAMobId testMobid
;
1762 #include "vmware_pack_end.h"
1763 SVGA3dCmdDXCondBindAllShader
; /* SVGA_3D_CMD_DX_COND_BIND_ALL_SHADER */
1766 * The maximum number of streamout decl's in each streamout entry.
1768 #define SVGA3D_MAX_DX10_STREAMOUT_DECLS 64
1769 #define SVGA3D_MAX_STREAMOUT_DECLS 512
1772 #include "vmware_pack_begin.h"
1773 struct SVGA3dStreamOutputDeclarationEntry
{
1775 uint32 registerIndex
;
1781 #include "vmware_pack_end.h"
1782 SVGA3dStreamOutputDeclarationEntry
;
1785 #include "vmware_pack_begin.h"
1786 struct SVGAOTableStreamOutputEntry
{
1787 uint32 numOutputStreamEntries
;
1788 SVGA3dStreamOutputDeclarationEntry decl
[SVGA3D_MAX_DX10_STREAMOUT_DECLS
];
1789 uint32 streamOutputStrideInBytes
[SVGA3D_DX_MAX_SOTARGETS
];
1790 uint32 rasterizedStream
;
1791 uint32 numOutputStreamStrides
;
1793 uint32 offsetInBytes
;
1799 #include "vmware_pack_end.h"
1800 SVGACOTableDXStreamOutputEntry
;
1803 #include "vmware_pack_begin.h"
1804 struct SVGA3dCmdDXDefineStreamOutput
{
1805 SVGA3dStreamOutputId soid
;
1806 uint32 numOutputStreamEntries
;
1807 SVGA3dStreamOutputDeclarationEntry decl
[SVGA3D_MAX_DX10_STREAMOUT_DECLS
];
1808 uint32 streamOutputStrideInBytes
[SVGA3D_DX_MAX_SOTARGETS
];
1809 uint32 rasterizedStream
;
1811 #include "vmware_pack_end.h"
1812 SVGA3dCmdDXDefineStreamOutput
; /* SVGA_3D_CMD_DX_DEFINE_STREAMOUTPUT */
1815 * Version 2 needed in order to start validating and using the
1816 * rasterizedStream field. Unfortunately the device wasn't validating
1817 * or using this field and the driver wasn't initializing it in shipped
1818 * code, so a new version of the command is needed to allow that code
1819 * to continue to work. Also added new numOutputStreamStrides field.
1822 #define SVGA3D_DX_SO_NO_RASTERIZED_STREAM 0xFFFFFFFF
1825 #include "vmware_pack_begin.h"
1826 struct SVGA3dCmdDXDefineStreamOutputWithMob
{
1827 SVGA3dStreamOutputId soid
;
1828 uint32 numOutputStreamEntries
;
1829 uint32 numOutputStreamStrides
;
1830 uint32 streamOutputStrideInBytes
[SVGA3D_DX_MAX_SOTARGETS
];
1831 uint32 rasterizedStream
;
1833 #include "vmware_pack_end.h"
1834 SVGA3dCmdDXDefineStreamOutputWithMob
;
1835 /* SVGA_3D_CMD_DX_DEFINE_STREAMOUTPUT_WITH_MOB */
1838 #include "vmware_pack_begin.h"
1839 struct SVGA3dCmdDXBindStreamOutput
{
1840 SVGA3dStreamOutputId soid
;
1842 uint32 offsetInBytes
;
1845 #include "vmware_pack_end.h"
1846 SVGA3dCmdDXBindStreamOutput
; /* SVGA_3D_CMD_DX_BIND_STREAMOUTPUT */
1849 #include "vmware_pack_begin.h"
1850 struct SVGA3dCmdDXDestroyStreamOutput
{
1851 SVGA3dStreamOutputId soid
;
1853 #include "vmware_pack_end.h"
1854 SVGA3dCmdDXDestroyStreamOutput
; /* SVGA_3D_CMD_DX_DESTROY_STREAMOUTPUT */
1857 #include "vmware_pack_begin.h"
1858 struct SVGA3dCmdDXSetStreamOutput
{
1859 SVGA3dStreamOutputId soid
;
1861 #include "vmware_pack_end.h"
1862 SVGA3dCmdDXSetStreamOutput
; /* SVGA_3D_CMD_DX_SET_STREAMOUTPUT */
1865 #include "vmware_pack_begin.h"
1866 struct SVGA3dCmdDXSetMinLOD
{
1867 SVGA3dSurfaceId sid
;
1870 #include "vmware_pack_end.h"
1871 SVGA3dCmdDXSetMinLOD
; /* SVGA_3D_CMD_DX_SET_MIN_LOD */
1874 #include "vmware_pack_begin.h"
1880 #include "vmware_pack_end.h"
1881 SVGA3dCmdDXMobFence64
; /* SVGA_3D_CMD_DX_MOB_FENCE_64 */
1884 * SVGA3dCmdSetCOTable --
1886 * This command allows the guest to bind a mob to a context-object table.
1889 #include "vmware_pack_begin.h"
1890 struct SVGA3dCmdDXSetCOTable
{
1893 SVGACOTableType type
;
1894 uint32 validSizeInBytes
;
1896 #include "vmware_pack_end.h"
1897 SVGA3dCmdDXSetCOTable
; /* SVGA_3D_CMD_DX_SET_COTABLE */
1900 * Guests using SVGA_3D_CMD_DX_GROW_COTABLE are promising that
1901 * the new COTable contains the same contents as the old one, except possibly
1902 * for some new invalid entries at the end.
1904 * If there is an old cotable mob bound, it also has to still be valid.
1906 * (Otherwise, guests should use the DXSetCOTableBase command.)
1909 #include "vmware_pack_begin.h"
1910 struct SVGA3dCmdDXGrowCOTable
{
1913 SVGACOTableType type
;
1914 uint32 validSizeInBytes
;
1916 #include "vmware_pack_end.h"
1917 SVGA3dCmdDXGrowCOTable
; /* SVGA_3D_CMD_DX_GROW_COTABLE */
1920 #include "vmware_pack_begin.h"
1921 struct SVGA3dCmdDXReadbackCOTable
{
1923 SVGACOTableType type
;
1925 #include "vmware_pack_end.h"
1926 SVGA3dCmdDXReadbackCOTable
; /* SVGA_3D_CMD_DX_READBACK_COTABLE */
1929 #include "vmware_pack_begin.h"
1930 struct SVGA3dCOTableData
{
1933 #include "vmware_pack_end.h"
1937 #include "vmware_pack_begin.h"
1938 struct SVGA3dBufferBinding
{
1943 #include "vmware_pack_end.h"
1944 SVGA3dBufferBinding
;
1947 #include "vmware_pack_begin.h"
1948 struct SVGA3dConstantBufferBinding
{
1950 uint32 offsetInBytes
;
1953 #include "vmware_pack_end.h"
1954 SVGA3dConstantBufferBinding
;
1957 #include "vmware_pack_begin.h"
1958 struct SVGADXInputAssemblyMobFormat
{
1960 SVGA3dBufferBinding vertexBuffers
[SVGA3D_DX_MAX_VERTEXBUFFERS
];
1961 uint32 indexBufferSid
;
1963 uint32 indexBufferOffset
;
1964 uint32 indexBufferFormat
;
1967 #include "vmware_pack_end.h"
1968 SVGADXInputAssemblyMobFormat
;
1971 #include "vmware_pack_begin.h"
1972 struct SVGADXContextMobFormat
{
1973 SVGADXInputAssemblyMobFormat inputAssembly
;
1976 uint32 blendStateId
;
1977 uint32 blendFactor
[4];
1979 uint32 depthStencilStateId
;
1981 uint32 rasterizerStateId
;
1982 uint32 depthStencilViewId
;
1983 uint32 renderTargetViewIds
[SVGA3D_MAX_SIMULTANEOUS_RENDER_TARGETS
];
1989 uint32 targets
[SVGA3D_DX_MAX_SOTARGETS
];
1995 uint32 uavSpliceIndex
;
1998 uint8 numScissorRects
;
2003 SVGA3dViewport viewports
[SVGA3D_DX_MAX_VIEWPORTS
];
2006 SVGASignedRect scissorRects
[SVGA3D_DX_MAX_SCISSORRECTS
];
2014 SVGAMobId shaderIfaceMobid
;
2015 uint32 shaderIfaceOffset
;
2018 SVGA3dConstantBufferBinding constantBuffers
[SVGA3D_DX_MAX_CONSTBUFFERS
];
2019 uint32 shaderResources
[SVGA3D_DX_MAX_SRVIEWS
];
2020 uint32 samplers
[SVGA3D_DX_MAX_SAMPLERS
];
2021 } shaderState
[SVGA3D_NUM_SHADERTYPE
];
2024 SVGA3dQueryId queryID
[SVGA3D_MAX_QUERY
];
2026 SVGA3dCOTableData cotables
[SVGA_COTABLE_MAX
];
2030 uint32 uaViewIds
[SVGA3D_DX11_1_MAX_UAVIEWS
];
2031 uint32 csuaViewIds
[SVGA3D_DX11_1_MAX_UAVIEWS
];
2035 #include "vmware_pack_end.h"
2036 SVGADXContextMobFormat
;
2039 * There is conflicting documentation on max class instances (253 vs 256). The
2040 * lower value is the one used throughout the device, but since mob format is
2041 * more involved to increase if needed, conservatively use the higher one here.
2043 #define SVGA3D_DX_MAX_CLASS_INSTANCES_PADDED 256
2046 #include "vmware_pack_begin.h"
2047 struct SVGADXShaderIfaceMobFormat
{
2049 uint32 numClassInstances
;
2050 uint32 iface
[SVGA3D_DX_MAX_CLASS_INSTANCES_PADDED
];
2051 SVGA3dIfaceData data
[SVGA3D_DX_MAX_CLASS_INSTANCES_PADDED
];
2052 } shaderIfaceState
[SVGA3D_NUM_SHADERTYPE
];
2056 #include "vmware_pack_end.h"
2057 SVGADXShaderIfaceMobFormat
;
2060 #include "vmware_pack_begin.h"
2061 struct SVGA3dCmdDXTempSetContext
{
2064 #include "vmware_pack_end.h"
2065 SVGA3dCmdDXTempSetContext
; /* SVGA_3D_CMD_DX_TEMP_SET_CONTEXT */
2067 #endif /* _SVGA3D_DX_H_ */