treewide: remove redundant IS_ERR() before error code check
[linux/fpc-iii.git] / drivers / gpu / drm / vmwgfx / device_include / svga3d_dx.h
blob7a49c94df221c77c01ca0cdf0c086db7d69d39cc
1 /* SPDX-License-Identifier: GPL-2.0 OR MIT */
2 /**********************************************************
3 * Copyright 2012-2015 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
23 * SOFTWARE.
25 **********************************************************/
28 * svga3d_dx.h --
30 * SVGA 3d hardware definitions for DX10 support.
33 #ifndef _SVGA3D_DX_H_
34 #define _SVGA3D_DX_H_
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
122 #define SVGA3D_DX_MAX_CONSTBUF_BINDING_SIZE (4096 * 4 * (uint32)sizeof(uint32))
124 typedef uint32 SVGA3dShaderResourceViewId;
125 typedef uint32 SVGA3dRenderTargetViewId;
126 typedef uint32 SVGA3dDepthStencilViewId;
128 typedef uint32 SVGA3dShaderId;
129 typedef uint32 SVGA3dElementLayoutId;
130 typedef uint32 SVGA3dSamplerId;
131 typedef uint32 SVGA3dBlendStateId;
132 typedef uint32 SVGA3dDepthStencilStateId;
133 typedef uint32 SVGA3dRasterizerStateId;
134 typedef uint32 SVGA3dQueryId;
135 typedef uint32 SVGA3dStreamOutputId;
137 typedef union {
138 struct {
139 float r;
140 float g;
141 float b;
142 float a;
145 float value[4];
146 } SVGA3dRGBAFloat;
148 typedef
149 #include "vmware_pack_begin.h"
150 struct {
151 uint32 cid;
152 SVGAMobId mobid;
154 #include "vmware_pack_end.h"
155 SVGAOTableDXContextEntry;
157 typedef
158 #include "vmware_pack_begin.h"
159 struct SVGA3dCmdDXDefineContext {
160 uint32 cid;
162 #include "vmware_pack_end.h"
163 SVGA3dCmdDXDefineContext; /* SVGA_3D_CMD_DX_DEFINE_CONTEXT */
165 typedef
166 #include "vmware_pack_begin.h"
167 struct SVGA3dCmdDXDestroyContext {
168 uint32 cid;
170 #include "vmware_pack_end.h"
171 SVGA3dCmdDXDestroyContext; /* SVGA_3D_CMD_DX_DESTROY_CONTEXT */
174 * Bind a DX context.
176 * validContents should be set to 0 for new contexts,
177 * and 1 if this is an old context which is getting paged
178 * back on to the device.
180 * For new contexts, it is recommended that the driver
181 * issue commands to initialize all interesting state
182 * prior to rendering.
184 typedef
185 #include "vmware_pack_begin.h"
186 struct SVGA3dCmdDXBindContext {
187 uint32 cid;
188 SVGAMobId mobid;
189 uint32 validContents;
191 #include "vmware_pack_end.h"
192 SVGA3dCmdDXBindContext; /* SVGA_3D_CMD_DX_BIND_CONTEXT */
195 * Readback a DX context.
196 * (Request that the device flush the contents back into guest memory.)
198 typedef
199 #include "vmware_pack_begin.h"
200 struct SVGA3dCmdDXReadbackContext {
201 uint32 cid;
203 #include "vmware_pack_end.h"
204 SVGA3dCmdDXReadbackContext; /* SVGA_3D_CMD_DX_READBACK_CONTEXT */
207 * Invalidate a guest-backed context.
209 typedef
210 #include "vmware_pack_begin.h"
211 struct SVGA3dCmdDXInvalidateContext {
212 uint32 cid;
214 #include "vmware_pack_end.h"
215 SVGA3dCmdDXInvalidateContext; /* SVGA_3D_CMD_DX_INVALIDATE_CONTEXT */
217 typedef
218 #include "vmware_pack_begin.h"
219 struct SVGA3dCmdDXSetSingleConstantBuffer {
220 uint32 slot;
221 SVGA3dShaderType type;
222 SVGA3dSurfaceId sid;
223 uint32 offsetInBytes;
224 uint32 sizeInBytes;
226 #include "vmware_pack_end.h"
227 SVGA3dCmdDXSetSingleConstantBuffer;
228 /* SVGA_3D_CMD_DX_SET_SINGLE_CONSTANT_BUFFER */
230 typedef
231 #include "vmware_pack_begin.h"
232 struct SVGA3dCmdDXSetShaderResources {
233 uint32 startView;
234 SVGA3dShaderType type;
237 * Followed by a variable number of SVGA3dShaderResourceViewId's.
240 #include "vmware_pack_end.h"
241 SVGA3dCmdDXSetShaderResources; /* SVGA_3D_CMD_DX_SET_SHADER_RESOURCES */
243 typedef
244 #include "vmware_pack_begin.h"
245 struct SVGA3dCmdDXSetShader {
246 SVGA3dShaderId shaderId;
247 SVGA3dShaderType type;
249 #include "vmware_pack_end.h"
250 SVGA3dCmdDXSetShader; /* SVGA_3D_CMD_DX_SET_SHADER */
252 typedef
253 #include "vmware_pack_begin.h"
254 struct SVGA3dCmdDXSetSamplers {
255 uint32 startSampler;
256 SVGA3dShaderType type;
259 * Followed by a variable number of SVGA3dSamplerId's.
262 #include "vmware_pack_end.h"
263 SVGA3dCmdDXSetSamplers; /* SVGA_3D_CMD_DX_SET_SAMPLERS */
265 typedef
266 #include "vmware_pack_begin.h"
267 struct SVGA3dCmdDXDraw {
268 uint32 vertexCount;
269 uint32 startVertexLocation;
271 #include "vmware_pack_end.h"
272 SVGA3dCmdDXDraw; /* SVGA_3D_CMD_DX_DRAW */
274 typedef
275 #include "vmware_pack_begin.h"
276 struct SVGA3dCmdDXDrawIndexed {
277 uint32 indexCount;
278 uint32 startIndexLocation;
279 int32 baseVertexLocation;
281 #include "vmware_pack_end.h"
282 SVGA3dCmdDXDrawIndexed; /* SVGA_3D_CMD_DX_DRAW_INDEXED */
284 typedef
285 #include "vmware_pack_begin.h"
286 struct SVGA3dCmdDXDrawInstanced {
287 uint32 vertexCountPerInstance;
288 uint32 instanceCount;
289 uint32 startVertexLocation;
290 uint32 startInstanceLocation;
292 #include "vmware_pack_end.h"
293 SVGA3dCmdDXDrawInstanced; /* SVGA_3D_CMD_DX_DRAW_INSTANCED */
295 typedef
296 #include "vmware_pack_begin.h"
297 struct SVGA3dCmdDXDrawIndexedInstanced {
298 uint32 indexCountPerInstance;
299 uint32 instanceCount;
300 uint32 startIndexLocation;
301 int32 baseVertexLocation;
302 uint32 startInstanceLocation;
304 #include "vmware_pack_end.h"
305 SVGA3dCmdDXDrawIndexedInstanced; /* SVGA_3D_CMD_DX_DRAW_INDEXED_INSTANCED */
307 typedef
308 #include "vmware_pack_begin.h"
309 struct SVGA3dCmdDXDrawAuto {
310 uint32 pad0;
312 #include "vmware_pack_end.h"
313 SVGA3dCmdDXDrawAuto; /* SVGA_3D_CMD_DX_DRAW_AUTO */
315 typedef
316 #include "vmware_pack_begin.h"
317 struct SVGA3dCmdDXSetInputLayout {
318 SVGA3dElementLayoutId elementLayoutId;
320 #include "vmware_pack_end.h"
321 SVGA3dCmdDXSetInputLayout; /* SVGA_3D_CMD_DX_SET_INPUT_LAYOUT */
323 typedef
324 #include "vmware_pack_begin.h"
325 struct SVGA3dVertexBuffer {
326 SVGA3dSurfaceId sid;
327 uint32 stride;
328 uint32 offset;
330 #include "vmware_pack_end.h"
331 SVGA3dVertexBuffer;
333 typedef
334 #include "vmware_pack_begin.h"
335 struct SVGA3dCmdDXSetVertexBuffers {
336 uint32 startBuffer;
337 /* Followed by a variable number of SVGA3dVertexBuffer's. */
339 #include "vmware_pack_end.h"
340 SVGA3dCmdDXSetVertexBuffers; /* SVGA_3D_CMD_DX_SET_VERTEX_BUFFERS */
342 typedef
343 #include "vmware_pack_begin.h"
344 struct SVGA3dCmdDXSetIndexBuffer {
345 SVGA3dSurfaceId sid;
346 SVGA3dSurfaceFormat format;
347 uint32 offset;
349 #include "vmware_pack_end.h"
350 SVGA3dCmdDXSetIndexBuffer; /* SVGA_3D_CMD_DX_SET_INDEX_BUFFER */
352 typedef
353 #include "vmware_pack_begin.h"
354 struct SVGA3dCmdDXSetTopology {
355 SVGA3dPrimitiveType topology;
357 #include "vmware_pack_end.h"
358 SVGA3dCmdDXSetTopology; /* SVGA_3D_CMD_DX_SET_TOPOLOGY */
360 typedef
361 #include "vmware_pack_begin.h"
362 struct SVGA3dCmdDXSetRenderTargets {
363 SVGA3dDepthStencilViewId depthStencilViewId;
364 /* Followed by a variable number of SVGA3dRenderTargetViewId's. */
366 #include "vmware_pack_end.h"
367 SVGA3dCmdDXSetRenderTargets; /* SVGA_3D_CMD_DX_SET_RENDERTARGETS */
369 typedef
370 #include "vmware_pack_begin.h"
371 struct SVGA3dCmdDXSetBlendState {
372 SVGA3dBlendStateId blendId;
373 float blendFactor[4];
374 uint32 sampleMask;
376 #include "vmware_pack_end.h"
377 SVGA3dCmdDXSetBlendState; /* SVGA_3D_CMD_DX_SET_BLEND_STATE */
379 typedef
380 #include "vmware_pack_begin.h"
381 struct SVGA3dCmdDXSetDepthStencilState {
382 SVGA3dDepthStencilStateId depthStencilId;
383 uint32 stencilRef;
385 #include "vmware_pack_end.h"
386 SVGA3dCmdDXSetDepthStencilState; /* SVGA_3D_CMD_DX_SET_DEPTHSTENCIL_STATE */
388 typedef
389 #include "vmware_pack_begin.h"
390 struct SVGA3dCmdDXSetRasterizerState {
391 SVGA3dRasterizerStateId rasterizerId;
393 #include "vmware_pack_end.h"
394 SVGA3dCmdDXSetRasterizerState; /* SVGA_3D_CMD_DX_SET_RASTERIZER_STATE */
396 #define SVGA3D_DXQUERY_FLAG_PREDICATEHINT (1 << 0)
397 typedef uint32 SVGA3dDXQueryFlags;
400 * The SVGADXQueryDeviceState and SVGADXQueryDeviceBits are used by the device
401 * to track query state transitions, but are not intended to be used by the
402 * driver.
404 #define SVGADX_QDSTATE_INVALID ((uint8)-1) /* Query has no state */
405 #define SVGADX_QDSTATE_MIN 0
406 #define SVGADX_QDSTATE_IDLE 0 /* Query hasn't started yet */
407 #define SVGADX_QDSTATE_ACTIVE 1 /* Query is actively gathering data */
408 #define SVGADX_QDSTATE_PENDING 2 /* Query is waiting for results */
409 #define SVGADX_QDSTATE_FINISHED 3 /* Query has completed */
410 #define SVGADX_QDSTATE_MAX 4
411 typedef uint8 SVGADXQueryDeviceState;
413 typedef
414 #include "vmware_pack_begin.h"
415 struct {
416 SVGA3dQueryTypeUint8 type;
417 uint16 pad0;
418 SVGADXQueryDeviceState state;
419 SVGA3dDXQueryFlags flags;
420 SVGAMobId mobid;
421 uint32 offset;
423 #include "vmware_pack_end.h"
424 SVGACOTableDXQueryEntry;
426 typedef
427 #include "vmware_pack_begin.h"
428 struct SVGA3dCmdDXDefineQuery {
429 SVGA3dQueryId queryId;
430 SVGA3dQueryType type;
431 SVGA3dDXQueryFlags flags;
433 #include "vmware_pack_end.h"
434 SVGA3dCmdDXDefineQuery; /* SVGA_3D_CMD_DX_DEFINE_QUERY */
436 typedef
437 #include "vmware_pack_begin.h"
438 struct SVGA3dCmdDXDestroyQuery {
439 SVGA3dQueryId queryId;
441 #include "vmware_pack_end.h"
442 SVGA3dCmdDXDestroyQuery; /* SVGA_3D_CMD_DX_DESTROY_QUERY */
444 typedef
445 #include "vmware_pack_begin.h"
446 struct SVGA3dCmdDXBindQuery {
447 SVGA3dQueryId queryId;
448 SVGAMobId mobid;
450 #include "vmware_pack_end.h"
451 SVGA3dCmdDXBindQuery; /* SVGA_3D_CMD_DX_BIND_QUERY */
453 typedef
454 #include "vmware_pack_begin.h"
455 struct SVGA3dCmdDXSetQueryOffset {
456 SVGA3dQueryId queryId;
457 uint32 mobOffset;
459 #include "vmware_pack_end.h"
460 SVGA3dCmdDXSetQueryOffset; /* SVGA_3D_CMD_DX_SET_QUERY_OFFSET */
462 typedef
463 #include "vmware_pack_begin.h"
464 struct SVGA3dCmdDXBeginQuery {
465 SVGA3dQueryId queryId;
467 #include "vmware_pack_end.h"
468 SVGA3dCmdDXBeginQuery; /* SVGA_3D_CMD_DX_QUERY_BEGIN */
470 typedef
471 #include "vmware_pack_begin.h"
472 struct SVGA3dCmdDXEndQuery {
473 SVGA3dQueryId queryId;
475 #include "vmware_pack_end.h"
476 SVGA3dCmdDXEndQuery; /* SVGA_3D_CMD_DX_QUERY_END */
478 typedef
479 #include "vmware_pack_begin.h"
480 struct SVGA3dCmdDXReadbackQuery {
481 SVGA3dQueryId queryId;
483 #include "vmware_pack_end.h"
484 SVGA3dCmdDXReadbackQuery; /* SVGA_3D_CMD_DX_READBACK_QUERY */
486 typedef
487 #include "vmware_pack_begin.h"
488 struct SVGA3dCmdDXMoveQuery {
489 SVGA3dQueryId queryId;
490 SVGAMobId mobid;
491 uint32 mobOffset;
493 #include "vmware_pack_end.h"
494 SVGA3dCmdDXMoveQuery; /* SVGA_3D_CMD_DX_MOVE_QUERY */
496 typedef
497 #include "vmware_pack_begin.h"
498 struct SVGA3dCmdDXBindAllQuery {
499 uint32 cid;
500 SVGAMobId mobid;
502 #include "vmware_pack_end.h"
503 SVGA3dCmdDXBindAllQuery; /* SVGA_3D_CMD_DX_BIND_ALL_QUERY */
505 typedef
506 #include "vmware_pack_begin.h"
507 struct SVGA3dCmdDXReadbackAllQuery {
508 uint32 cid;
510 #include "vmware_pack_end.h"
511 SVGA3dCmdDXReadbackAllQuery; /* SVGA_3D_CMD_DX_READBACK_ALL_QUERY */
513 typedef
514 #include "vmware_pack_begin.h"
515 struct SVGA3dCmdDXSetPredication {
516 SVGA3dQueryId queryId;
517 uint32 predicateValue;
519 #include "vmware_pack_end.h"
520 SVGA3dCmdDXSetPredication; /* SVGA_3D_CMD_DX_SET_PREDICATION */
522 typedef
523 #include "vmware_pack_begin.h"
524 struct MKS3dDXSOState {
525 uint32 offset; /* Starting offset */
526 uint32 intOffset; /* Internal offset */
527 uint32 vertexCount; /* vertices written */
528 uint32 sizeInBytes; /* max bytes to write */
530 #include "vmware_pack_end.h"
531 SVGA3dDXSOState;
533 /* Set the offset field to this value to append SO values to the buffer */
534 #define SVGA3D_DX_SO_OFFSET_APPEND ((uint32) ~0u)
536 typedef
537 #include "vmware_pack_begin.h"
538 struct SVGA3dSoTarget {
539 SVGA3dSurfaceId sid;
540 uint32 offset;
541 uint32 sizeInBytes;
543 #include "vmware_pack_end.h"
544 SVGA3dSoTarget;
546 typedef
547 #include "vmware_pack_begin.h"
548 struct SVGA3dCmdDXSetSOTargets {
549 uint32 pad0;
550 /* Followed by a variable number of SVGA3dSOTarget's. */
552 #include "vmware_pack_end.h"
553 SVGA3dCmdDXSetSOTargets; /* SVGA_3D_CMD_DX_SET_SOTARGETS */
555 typedef
556 #include "vmware_pack_begin.h"
557 struct SVGA3dViewport
559 float x;
560 float y;
561 float width;
562 float height;
563 float minDepth;
564 float maxDepth;
566 #include "vmware_pack_end.h"
567 SVGA3dViewport;
569 typedef
570 #include "vmware_pack_begin.h"
571 struct SVGA3dCmdDXSetViewports {
572 uint32 pad0;
573 /* Followed by a variable number of SVGA3dViewport's. */
575 #include "vmware_pack_end.h"
576 SVGA3dCmdDXSetViewports; /* SVGA_3D_CMD_DX_SET_VIEWPORTS */
578 #define SVGA3D_DX_MAX_VIEWPORTS 16
580 typedef
581 #include "vmware_pack_begin.h"
582 struct SVGA3dCmdDXSetScissorRects {
583 uint32 pad0;
584 /* Followed by a variable number of SVGASignedRect's. */
586 #include "vmware_pack_end.h"
587 SVGA3dCmdDXSetScissorRects; /* SVGA_3D_CMD_DX_SET_SCISSORRECTS */
589 #define SVGA3D_DX_MAX_SCISSORRECTS 16
591 typedef
592 #include "vmware_pack_begin.h"
593 struct SVGA3dCmdDXClearRenderTargetView {
594 SVGA3dRenderTargetViewId renderTargetViewId;
595 SVGA3dRGBAFloat rgba;
597 #include "vmware_pack_end.h"
598 SVGA3dCmdDXClearRenderTargetView; /* SVGA_3D_CMD_DX_CLEAR_RENDERTARGET_VIEW */
600 typedef
601 #include "vmware_pack_begin.h"
602 struct SVGA3dCmdDXClearDepthStencilView {
603 uint16 flags;
604 uint16 stencil;
605 SVGA3dDepthStencilViewId depthStencilViewId;
606 float depth;
608 #include "vmware_pack_end.h"
609 SVGA3dCmdDXClearDepthStencilView; /* SVGA_3D_CMD_DX_CLEAR_DEPTHSTENCIL_VIEW */
611 typedef
612 #include "vmware_pack_begin.h"
613 struct SVGA3dCmdDXPredCopyRegion {
614 SVGA3dSurfaceId dstSid;
615 uint32 dstSubResource;
616 SVGA3dSurfaceId srcSid;
617 uint32 srcSubResource;
618 SVGA3dCopyBox box;
620 #include "vmware_pack_end.h"
621 SVGA3dCmdDXPredCopyRegion;
622 /* SVGA_3D_CMD_DX_PRED_COPY_REGION */
624 typedef
625 #include "vmware_pack_begin.h"
626 struct SVGA3dCmdDXPredCopy {
627 SVGA3dSurfaceId dstSid;
628 SVGA3dSurfaceId srcSid;
630 #include "vmware_pack_end.h"
631 SVGA3dCmdDXPredCopy; /* SVGA_3D_CMD_DX_PRED_COPY */
633 typedef
634 #include "vmware_pack_begin.h"
635 struct SVGA3dCmdDXPredConvertRegion {
636 SVGA3dSurfaceId dstSid;
637 uint32 dstSubResource;
638 SVGA3dBox destBox;
639 SVGA3dSurfaceId srcSid;
640 uint32 srcSubResource;
641 SVGA3dBox srcBox;
643 #include "vmware_pack_end.h"
644 SVGA3dCmdDXPredConvertRegion; /* SVGA_3D_CMD_DX_PRED_CONVERT_REGION */
646 typedef
647 #include "vmware_pack_begin.h"
648 struct SVGA3dCmdDXPredConvert {
649 SVGA3dSurfaceId dstSid;
650 SVGA3dSurfaceId srcSid;
652 #include "vmware_pack_end.h"
653 SVGA3dCmdDXPredConvert; /* SVGA_3D_CMD_DX_PRED_CONVERT */
655 typedef
656 #include "vmware_pack_begin.h"
657 struct SVGA3dCmdDXBufferCopy {
658 SVGA3dSurfaceId dest;
659 SVGA3dSurfaceId src;
660 uint32 destX;
661 uint32 srcX;
662 uint32 width;
664 #include "vmware_pack_end.h"
665 SVGA3dCmdDXBufferCopy;
666 /* SVGA_3D_CMD_DX_BUFFER_COPY */
669 * Perform a surface copy between a multisample, and a non-multisampled
670 * surface.
672 typedef
673 #include "vmware_pack_begin.h"
674 struct {
675 SVGA3dSurfaceId dstSid;
676 uint32 dstSubResource;
677 SVGA3dSurfaceId srcSid;
678 uint32 srcSubResource;
679 SVGA3dSurfaceFormat copyFormat;
681 #include "vmware_pack_end.h"
682 SVGA3dCmdDXResolveCopy; /* SVGA_3D_CMD_DX_RESOLVE_COPY */
685 * Perform a predicated surface copy between a multisample, and a
686 * non-multisampled surface.
688 typedef
689 #include "vmware_pack_begin.h"
690 struct {
691 SVGA3dSurfaceId dstSid;
692 uint32 dstSubResource;
693 SVGA3dSurfaceId srcSid;
694 uint32 srcSubResource;
695 SVGA3dSurfaceFormat copyFormat;
697 #include "vmware_pack_end.h"
698 SVGA3dCmdDXPredResolveCopy; /* SVGA_3D_CMD_DX_PRED_RESOLVE_COPY */
700 typedef uint32 SVGA3dDXPresentBltMode;
701 #define SVGADX_PRESENTBLT_LINEAR (1 << 0)
702 #define SVGADX_PRESENTBLT_FORCE_SRC_SRGB (1 << 1)
703 #define SVGADX_PRESENTBLT_FORCE_SRC_XRBIAS (1 << 2)
704 #define SVGADX_PRESENTBLT_MODE_MAX (1 << 3)
706 typedef
707 #include "vmware_pack_begin.h"
708 struct SVGA3dCmdDXPresentBlt {
709 SVGA3dSurfaceId srcSid;
710 uint32 srcSubResource;
711 SVGA3dSurfaceId dstSid;
712 uint32 destSubResource;
713 SVGA3dBox boxSrc;
714 SVGA3dBox boxDest;
715 SVGA3dDXPresentBltMode mode;
717 #include "vmware_pack_end.h"
718 SVGA3dCmdDXPresentBlt; /* SVGA_3D_CMD_DX_PRESENTBLT*/
720 typedef
721 #include "vmware_pack_begin.h"
722 struct SVGA3dCmdDXGenMips {
723 SVGA3dShaderResourceViewId shaderResourceViewId;
725 #include "vmware_pack_end.h"
726 SVGA3dCmdDXGenMips; /* SVGA_3D_CMD_DX_GENMIPS */
729 * Update a sub-resource in a guest-backed resource.
730 * (Inform the device that the guest-contents have been updated.)
732 typedef
733 #include "vmware_pack_begin.h"
734 struct SVGA3dCmdDXUpdateSubResource {
735 SVGA3dSurfaceId sid;
736 uint32 subResource;
737 SVGA3dBox box;
739 #include "vmware_pack_end.h"
740 SVGA3dCmdDXUpdateSubResource; /* SVGA_3D_CMD_DX_UPDATE_SUBRESOURCE */
743 * Readback a subresource in a guest-backed resource.
744 * (Request the device to flush the dirty contents into the guest.)
746 typedef
747 #include "vmware_pack_begin.h"
748 struct SVGA3dCmdDXReadbackSubResource {
749 SVGA3dSurfaceId sid;
750 uint32 subResource;
752 #include "vmware_pack_end.h"
753 SVGA3dCmdDXReadbackSubResource; /* SVGA_3D_CMD_DX_READBACK_SUBRESOURCE */
756 * Invalidate an image in a guest-backed surface.
757 * (Notify the device that the contents can be lost.)
759 typedef
760 #include "vmware_pack_begin.h"
761 struct SVGA3dCmdDXInvalidateSubResource {
762 SVGA3dSurfaceId sid;
763 uint32 subResource;
765 #include "vmware_pack_end.h"
766 SVGA3dCmdDXInvalidateSubResource; /* SVGA_3D_CMD_DX_INVALIDATE_SUBRESOURCE */
770 * Raw byte wise transfer from a buffer surface into another surface
771 * of the requested box. Supported if 3d is enabled and SVGA_CAP_DX
772 * is set. This command does not take a context.
774 typedef
775 #include "vmware_pack_begin.h"
776 struct SVGA3dCmdDXTransferFromBuffer {
777 SVGA3dSurfaceId srcSid;
778 uint32 srcOffset;
779 uint32 srcPitch;
780 uint32 srcSlicePitch;
781 SVGA3dSurfaceId destSid;
782 uint32 destSubResource;
783 SVGA3dBox destBox;
785 #include "vmware_pack_end.h"
786 SVGA3dCmdDXTransferFromBuffer; /* SVGA_3D_CMD_DX_TRANSFER_FROM_BUFFER */
790 * Raw byte wise transfer from a buffer surface into another surface
791 * of the requested box. Supported if SVGA3D_DEVCAP_DXCONTEXT is set.
792 * The context is implied from the command buffer header.
794 typedef
795 #include "vmware_pack_begin.h"
796 struct SVGA3dCmdDXPredTransferFromBuffer {
797 SVGA3dSurfaceId srcSid;
798 uint32 srcOffset;
799 uint32 srcPitch;
800 uint32 srcSlicePitch;
801 SVGA3dSurfaceId destSid;
802 uint32 destSubResource;
803 SVGA3dBox destBox;
805 #include "vmware_pack_end.h"
806 SVGA3dCmdDXPredTransferFromBuffer;
807 /* SVGA_3D_CMD_DX_PRED_TRANSFER_FROM_BUFFER */
810 typedef
811 #include "vmware_pack_begin.h"
812 struct SVGA3dCmdDXSurfaceCopyAndReadback {
813 SVGA3dSurfaceId srcSid;
814 SVGA3dSurfaceId destSid;
815 SVGA3dCopyBox box;
817 #include "vmware_pack_end.h"
818 SVGA3dCmdDXSurfaceCopyAndReadback;
819 /* SVGA_3D_CMD_DX_SURFACE_COPY_AND_READBACK */
822 * SVGA_DX_HINT_NONE: Does nothing.
824 * SVGA_DX_HINT_PREFETCH_OBJECT:
825 * SVGA_DX_HINT_PREEVICT_OBJECT:
826 * Consumes a SVGAObjectRef, and hints that the host should consider
827 * fetching/evicting the specified object.
829 * An id of SVGA3D_INVALID_ID can be used if the guest isn't sure
830 * what object was affected. (For instance, if the guest knows that
831 * it is about to evict a DXShader, but doesn't know precisely which one,
832 * the device can still use this to help limit it's search, or track
833 * how many page-outs have happened.)
835 * SVGA_DX_HINT_PREFETCH_COBJECT:
836 * SVGA_DX_HINT_PREEVICT_COBJECT:
837 * Same as the above, except they consume an SVGACObjectRef.
839 typedef uint32 SVGADXHintId;
840 #define SVGA_DX_HINT_NONE 0
841 #define SVGA_DX_HINT_PREFETCH_OBJECT 1
842 #define SVGA_DX_HINT_PREEVICT_OBJECT 2
843 #define SVGA_DX_HINT_PREFETCH_COBJECT 3
844 #define SVGA_DX_HINT_PREEVICT_COBJECT 4
845 #define SVGA_DX_HINT_MAX 5
847 typedef
848 #include "vmware_pack_begin.h"
849 struct SVGAObjectRef {
850 SVGAOTableType type;
851 uint32 id;
853 #include "vmware_pack_end.h"
854 SVGAObjectRef;
856 typedef
857 #include "vmware_pack_begin.h"
858 struct SVGACObjectRef {
859 SVGACOTableType type;
860 uint32 cid;
861 uint32 id;
863 #include "vmware_pack_end.h"
864 SVGACObjectRef;
866 typedef
867 #include "vmware_pack_begin.h"
868 struct SVGA3dCmdDXHint {
869 SVGADXHintId hintId;
872 * Followed by variable sized data depending on the hintId.
875 #include "vmware_pack_end.h"
876 SVGA3dCmdDXHint;
877 /* SVGA_3D_CMD_DX_HINT */
879 typedef
880 #include "vmware_pack_begin.h"
881 struct SVGA3dCmdDXBufferUpdate {
882 SVGA3dSurfaceId sid;
883 uint32 x;
884 uint32 width;
886 #include "vmware_pack_end.h"
887 SVGA3dCmdDXBufferUpdate;
888 /* SVGA_3D_CMD_DX_BUFFER_UPDATE */
890 typedef
891 #include "vmware_pack_begin.h"
892 struct SVGA3dCmdDXSetConstantBufferOffset {
893 uint32 slot;
894 uint32 offsetInBytes;
896 #include "vmware_pack_end.h"
897 SVGA3dCmdDXSetConstantBufferOffset;
899 typedef SVGA3dCmdDXSetConstantBufferOffset SVGA3dCmdDXSetVSConstantBufferOffset;
900 /* SVGA_3D_CMD_DX_SET_VS_CONSTANT_BUFFER_OFFSET */
902 typedef SVGA3dCmdDXSetConstantBufferOffset SVGA3dCmdDXSetPSConstantBufferOffset;
903 /* SVGA_3D_CMD_DX_SET_PS_CONSTANT_BUFFER_OFFSET */
905 typedef SVGA3dCmdDXSetConstantBufferOffset SVGA3dCmdDXSetGSConstantBufferOffset;
906 /* SVGA_3D_CMD_DX_SET_GS_CONSTANT_BUFFER_OFFSET */
909 typedef
910 #include "vmware_pack_begin.h"
911 struct {
912 union {
913 struct {
914 uint32 firstElement;
915 uint32 numElements;
916 uint32 pad0;
917 uint32 pad1;
918 } buffer;
919 struct {
920 uint32 mostDetailedMip;
921 uint32 firstArraySlice;
922 uint32 mipLevels;
923 uint32 arraySize;
924 } tex; /* 1d, 2d, 3d, cube */
925 struct {
926 uint32 firstElement;
927 uint32 numElements;
928 uint32 flags;
929 uint32 pad0;
930 } bufferex;
933 #include "vmware_pack_end.h"
934 SVGA3dShaderResourceViewDesc;
936 typedef
937 #include "vmware_pack_begin.h"
938 struct {
939 SVGA3dSurfaceId sid;
940 SVGA3dSurfaceFormat format;
941 SVGA3dResourceType resourceDimension;
942 SVGA3dShaderResourceViewDesc desc;
943 uint32 pad;
945 #include "vmware_pack_end.h"
946 SVGACOTableDXSRViewEntry;
948 typedef
949 #include "vmware_pack_begin.h"
950 struct SVGA3dCmdDXDefineShaderResourceView {
951 SVGA3dShaderResourceViewId shaderResourceViewId;
953 SVGA3dSurfaceId sid;
954 SVGA3dSurfaceFormat format;
955 SVGA3dResourceType resourceDimension;
957 SVGA3dShaderResourceViewDesc desc;
959 #include "vmware_pack_end.h"
960 SVGA3dCmdDXDefineShaderResourceView;
961 /* SVGA_3D_CMD_DX_DEFINE_SHADERRESOURCE_VIEW */
963 typedef
964 #include "vmware_pack_begin.h"
965 struct SVGA3dCmdDXDestroyShaderResourceView {
966 SVGA3dShaderResourceViewId shaderResourceViewId;
968 #include "vmware_pack_end.h"
969 SVGA3dCmdDXDestroyShaderResourceView;
970 /* SVGA_3D_CMD_DX_DESTROY_SHADERRESOURCE_VIEW */
972 typedef
973 #include "vmware_pack_begin.h"
974 struct SVGA3dRenderTargetViewDesc {
975 union {
976 struct {
977 uint32 firstElement;
978 uint32 numElements;
979 uint32 padding0;
980 } buffer;
981 struct {
982 uint32 mipSlice;
983 uint32 firstArraySlice;
984 uint32 arraySize;
985 } tex; /* 1d, 2d, cube */
986 struct {
987 uint32 mipSlice;
988 uint32 firstW;
989 uint32 wSize;
990 } tex3D;
993 #include "vmware_pack_end.h"
994 SVGA3dRenderTargetViewDesc;
996 typedef
997 #include "vmware_pack_begin.h"
998 struct {
999 SVGA3dSurfaceId sid;
1000 SVGA3dSurfaceFormat format;
1001 SVGA3dResourceType resourceDimension;
1002 SVGA3dRenderTargetViewDesc desc;
1003 uint32 pad[2];
1005 #include "vmware_pack_end.h"
1006 SVGACOTableDXRTViewEntry;
1008 typedef
1009 #include "vmware_pack_begin.h"
1010 struct SVGA3dCmdDXDefineRenderTargetView {
1011 SVGA3dRenderTargetViewId renderTargetViewId;
1013 SVGA3dSurfaceId sid;
1014 SVGA3dSurfaceFormat format;
1015 SVGA3dResourceType resourceDimension;
1017 SVGA3dRenderTargetViewDesc desc;
1019 #include "vmware_pack_end.h"
1020 SVGA3dCmdDXDefineRenderTargetView;
1021 /* SVGA_3D_CMD_DX_DEFINE_RENDERTARGET_VIEW */
1023 typedef
1024 #include "vmware_pack_begin.h"
1025 struct SVGA3dCmdDXDestroyRenderTargetView {
1026 SVGA3dRenderTargetViewId renderTargetViewId;
1028 #include "vmware_pack_end.h"
1029 SVGA3dCmdDXDestroyRenderTargetView;
1030 /* SVGA_3D_CMD_DX_DESTROY_RENDERTARGET_VIEW */
1034 #define SVGA3D_DXDSVIEW_CREATE_READ_ONLY_DEPTH 0x01
1035 #define SVGA3D_DXDSVIEW_CREATE_READ_ONLY_STENCIL 0x02
1036 #define SVGA3D_DXDSVIEW_CREATE_FLAG_MASK 0x03
1037 typedef uint8 SVGA3DCreateDSViewFlags;
1039 typedef
1040 #include "vmware_pack_begin.h"
1041 struct {
1042 SVGA3dSurfaceId sid;
1043 SVGA3dSurfaceFormat format;
1044 SVGA3dResourceType resourceDimension;
1045 uint32 mipSlice;
1046 uint32 firstArraySlice;
1047 uint32 arraySize;
1048 SVGA3DCreateDSViewFlags flags;
1049 uint8 pad0;
1050 uint16 pad1;
1051 uint32 pad2;
1053 #include "vmware_pack_end.h"
1054 SVGACOTableDXDSViewEntry;
1056 typedef
1057 #include "vmware_pack_begin.h"
1058 struct SVGA3dCmdDXDefineDepthStencilView {
1059 SVGA3dDepthStencilViewId depthStencilViewId;
1061 SVGA3dSurfaceId sid;
1062 SVGA3dSurfaceFormat format;
1063 SVGA3dResourceType resourceDimension;
1064 uint32 mipSlice;
1065 uint32 firstArraySlice;
1066 uint32 arraySize;
1067 SVGA3DCreateDSViewFlags flags;
1068 uint8 pad0;
1069 uint16 pad1;
1071 #include "vmware_pack_end.h"
1072 SVGA3dCmdDXDefineDepthStencilView;
1073 /* SVGA_3D_CMD_DX_DEFINE_DEPTHSTENCIL_VIEW */
1075 typedef
1076 #include "vmware_pack_begin.h"
1077 struct SVGA3dCmdDXDestroyDepthStencilView {
1078 SVGA3dDepthStencilViewId depthStencilViewId;
1080 #include "vmware_pack_end.h"
1081 SVGA3dCmdDXDestroyDepthStencilView;
1082 /* SVGA_3D_CMD_DX_DESTROY_DEPTHSTENCIL_VIEW */
1084 typedef
1085 #include "vmware_pack_begin.h"
1086 struct SVGA3dInputElementDesc {
1087 uint32 inputSlot;
1088 uint32 alignedByteOffset;
1089 SVGA3dSurfaceFormat format;
1090 SVGA3dInputClassification inputSlotClass;
1091 uint32 instanceDataStepRate;
1092 uint32 inputRegister;
1094 #include "vmware_pack_end.h"
1095 SVGA3dInputElementDesc;
1097 typedef
1098 #include "vmware_pack_begin.h"
1099 struct {
1100 uint32 elid;
1101 uint32 numDescs;
1102 SVGA3dInputElementDesc desc[32];
1103 uint32 pad[62];
1105 #include "vmware_pack_end.h"
1106 SVGACOTableDXElementLayoutEntry;
1108 typedef
1109 #include "vmware_pack_begin.h"
1110 struct SVGA3dCmdDXDefineElementLayout {
1111 SVGA3dElementLayoutId elementLayoutId;
1112 /* Followed by a variable number of SVGA3dInputElementDesc's. */
1114 #include "vmware_pack_end.h"
1115 SVGA3dCmdDXDefineElementLayout;
1116 /* SVGA_3D_CMD_DX_DEFINE_ELEMENTLAYOUT */
1118 typedef
1119 #include "vmware_pack_begin.h"
1120 struct SVGA3dCmdDXDestroyElementLayout {
1121 SVGA3dElementLayoutId elementLayoutId;
1123 #include "vmware_pack_end.h"
1124 SVGA3dCmdDXDestroyElementLayout;
1125 /* SVGA_3D_CMD_DX_DESTROY_ELEMENTLAYOUT */
1128 #define SVGA3D_DX_MAX_RENDER_TARGETS 8
1130 typedef
1131 #include "vmware_pack_begin.h"
1132 struct SVGA3dDXBlendStatePerRT {
1133 uint8 blendEnable;
1134 uint8 srcBlend;
1135 uint8 destBlend;
1136 uint8 blendOp;
1137 uint8 srcBlendAlpha;
1138 uint8 destBlendAlpha;
1139 uint8 blendOpAlpha;
1140 SVGA3dColorWriteEnable renderTargetWriteMask;
1141 uint8 logicOpEnable;
1142 uint8 logicOp;
1143 uint16 pad0;
1145 #include "vmware_pack_end.h"
1146 SVGA3dDXBlendStatePerRT;
1148 typedef
1149 #include "vmware_pack_begin.h"
1150 struct {
1151 uint8 alphaToCoverageEnable;
1152 uint8 independentBlendEnable;
1153 uint16 pad0;
1154 SVGA3dDXBlendStatePerRT perRT[SVGA3D_MAX_RENDER_TARGETS];
1155 uint32 pad1[7];
1157 #include "vmware_pack_end.h"
1158 SVGACOTableDXBlendStateEntry;
1162 typedef
1163 #include "vmware_pack_begin.h"
1164 struct SVGA3dCmdDXDefineBlendState {
1165 SVGA3dBlendStateId blendId;
1166 uint8 alphaToCoverageEnable;
1167 uint8 independentBlendEnable;
1168 uint16 pad0;
1169 SVGA3dDXBlendStatePerRT perRT[SVGA3D_MAX_RENDER_TARGETS];
1171 #include "vmware_pack_end.h"
1172 SVGA3dCmdDXDefineBlendState; /* SVGA_3D_CMD_DX_DEFINE_BLEND_STATE */
1174 typedef
1175 #include "vmware_pack_begin.h"
1176 struct SVGA3dCmdDXDestroyBlendState {
1177 SVGA3dBlendStateId blendId;
1179 #include "vmware_pack_end.h"
1180 SVGA3dCmdDXDestroyBlendState; /* SVGA_3D_CMD_DX_DESTROY_BLEND_STATE */
1182 typedef
1183 #include "vmware_pack_begin.h"
1184 struct {
1185 uint8 depthEnable;
1186 SVGA3dDepthWriteMask depthWriteMask;
1187 SVGA3dComparisonFunc depthFunc;
1188 uint8 stencilEnable;
1189 uint8 frontEnable;
1190 uint8 backEnable;
1191 uint8 stencilReadMask;
1192 uint8 stencilWriteMask;
1194 uint8 frontStencilFailOp;
1195 uint8 frontStencilDepthFailOp;
1196 uint8 frontStencilPassOp;
1197 SVGA3dComparisonFunc frontStencilFunc;
1199 uint8 backStencilFailOp;
1200 uint8 backStencilDepthFailOp;
1201 uint8 backStencilPassOp;
1202 SVGA3dComparisonFunc backStencilFunc;
1204 #include "vmware_pack_end.h"
1205 SVGACOTableDXDepthStencilEntry;
1209 typedef
1210 #include "vmware_pack_begin.h"
1211 struct SVGA3dCmdDXDefineDepthStencilState {
1212 SVGA3dDepthStencilStateId depthStencilId;
1214 uint8 depthEnable;
1215 SVGA3dDepthWriteMask depthWriteMask;
1216 SVGA3dComparisonFunc depthFunc;
1217 uint8 stencilEnable;
1218 uint8 frontEnable;
1219 uint8 backEnable;
1220 uint8 stencilReadMask;
1221 uint8 stencilWriteMask;
1223 uint8 frontStencilFailOp;
1224 uint8 frontStencilDepthFailOp;
1225 uint8 frontStencilPassOp;
1226 SVGA3dComparisonFunc frontStencilFunc;
1228 uint8 backStencilFailOp;
1229 uint8 backStencilDepthFailOp;
1230 uint8 backStencilPassOp;
1231 SVGA3dComparisonFunc backStencilFunc;
1233 #include "vmware_pack_end.h"
1234 SVGA3dCmdDXDefineDepthStencilState;
1235 /* SVGA_3D_CMD_DX_DEFINE_DEPTHSTENCIL_STATE */
1237 typedef
1238 #include "vmware_pack_begin.h"
1239 struct SVGA3dCmdDXDestroyDepthStencilState {
1240 SVGA3dDepthStencilStateId depthStencilId;
1242 #include "vmware_pack_end.h"
1243 SVGA3dCmdDXDestroyDepthStencilState;
1244 /* SVGA_3D_CMD_DX_DESTROY_DEPTHSTENCIL_STATE */
1246 typedef
1247 #include "vmware_pack_begin.h"
1248 struct {
1249 uint8 fillMode;
1250 SVGA3dCullMode cullMode;
1251 uint8 frontCounterClockwise;
1252 uint8 provokingVertexLast;
1253 int32 depthBias;
1254 float depthBiasClamp;
1255 float slopeScaledDepthBias;
1256 uint8 depthClipEnable;
1257 uint8 scissorEnable;
1258 SVGA3dMultisampleRastEnable multisampleEnable;
1259 uint8 antialiasedLineEnable;
1260 float lineWidth;
1261 uint8 lineStippleEnable;
1262 uint8 lineStippleFactor;
1263 uint16 lineStipplePattern;
1264 uint32 forcedSampleCount;
1266 #include "vmware_pack_end.h"
1267 SVGACOTableDXRasterizerStateEntry;
1271 typedef
1272 #include "vmware_pack_begin.h"
1273 struct SVGA3dCmdDXDefineRasterizerState {
1274 SVGA3dRasterizerStateId rasterizerId;
1276 uint8 fillMode;
1277 SVGA3dCullMode cullMode;
1278 uint8 frontCounterClockwise;
1279 uint8 provokingVertexLast;
1280 int32 depthBias;
1281 float depthBiasClamp;
1282 float slopeScaledDepthBias;
1283 uint8 depthClipEnable;
1284 uint8 scissorEnable;
1285 SVGA3dMultisampleRastEnable multisampleEnable;
1286 uint8 antialiasedLineEnable;
1287 float lineWidth;
1288 uint8 lineStippleEnable;
1289 uint8 lineStippleFactor;
1290 uint16 lineStipplePattern;
1292 #include "vmware_pack_end.h"
1293 SVGA3dCmdDXDefineRasterizerState;
1294 /* SVGA_3D_CMD_DX_DEFINE_RASTERIZER_STATE */
1296 typedef
1297 #include "vmware_pack_begin.h"
1298 struct SVGA3dCmdDXDestroyRasterizerState {
1299 SVGA3dRasterizerStateId rasterizerId;
1301 #include "vmware_pack_end.h"
1302 SVGA3dCmdDXDestroyRasterizerState;
1303 /* SVGA_3D_CMD_DX_DESTROY_RASTERIZER_STATE */
1305 typedef
1306 #include "vmware_pack_begin.h"
1307 struct {
1308 SVGA3dFilter filter;
1309 uint8 addressU;
1310 uint8 addressV;
1311 uint8 addressW;
1312 uint8 pad0;
1313 float mipLODBias;
1314 uint8 maxAnisotropy;
1315 SVGA3dComparisonFunc comparisonFunc;
1316 uint16 pad1;
1317 SVGA3dRGBAFloat borderColor;
1318 float minLOD;
1319 float maxLOD;
1320 uint32 pad2[6];
1322 #include "vmware_pack_end.h"
1323 SVGACOTableDXSamplerEntry;
1327 typedef
1328 #include "vmware_pack_begin.h"
1329 struct SVGA3dCmdDXDefineSamplerState {
1330 SVGA3dSamplerId samplerId;
1331 SVGA3dFilter filter;
1332 uint8 addressU;
1333 uint8 addressV;
1334 uint8 addressW;
1335 uint8 pad0;
1336 float mipLODBias;
1337 uint8 maxAnisotropy;
1338 SVGA3dComparisonFunc comparisonFunc;
1339 uint16 pad1;
1340 SVGA3dRGBAFloat borderColor;
1341 float minLOD;
1342 float maxLOD;
1344 #include "vmware_pack_end.h"
1345 SVGA3dCmdDXDefineSamplerState; /* SVGA_3D_CMD_DX_DEFINE_SAMPLER_STATE */
1347 typedef
1348 #include "vmware_pack_begin.h"
1349 struct SVGA3dCmdDXDestroySamplerState {
1350 SVGA3dSamplerId samplerId;
1352 #include "vmware_pack_end.h"
1353 SVGA3dCmdDXDestroySamplerState; /* SVGA_3D_CMD_DX_DESTROY_SAMPLER_STATE */
1355 typedef
1356 #include "vmware_pack_begin.h"
1357 struct SVGA3dCmdDXDefineShader {
1358 SVGA3dShaderId shaderId;
1359 SVGA3dShaderType type;
1360 uint32 sizeInBytes; /* Number of bytes of shader text. */
1362 #include "vmware_pack_end.h"
1363 SVGA3dCmdDXDefineShader; /* SVGA_3D_CMD_DX_DEFINE_SHADER */
1365 typedef
1366 #include "vmware_pack_begin.h"
1367 struct SVGACOTableDXShaderEntry {
1368 SVGA3dShaderType type;
1369 uint32 sizeInBytes;
1370 uint32 offsetInBytes;
1371 SVGAMobId mobid;
1372 uint32 pad[4];
1374 #include "vmware_pack_end.h"
1375 SVGACOTableDXShaderEntry;
1377 typedef
1378 #include "vmware_pack_begin.h"
1379 struct SVGA3dCmdDXDestroyShader {
1380 SVGA3dShaderId shaderId;
1382 #include "vmware_pack_end.h"
1383 SVGA3dCmdDXDestroyShader; /* SVGA_3D_CMD_DX_DESTROY_SHADER */
1385 typedef
1386 #include "vmware_pack_begin.h"
1387 struct SVGA3dCmdDXBindShader {
1388 uint32 cid;
1389 uint32 shid;
1390 SVGAMobId mobid;
1391 uint32 offsetInBytes;
1393 #include "vmware_pack_end.h"
1394 SVGA3dCmdDXBindShader; /* SVGA_3D_CMD_DX_BIND_SHADER */
1396 typedef
1397 #include "vmware_pack_begin.h"
1398 struct SVGA3dCmdDXBindAllShader {
1399 uint32 cid;
1400 SVGAMobId mobid;
1402 #include "vmware_pack_end.h"
1403 SVGA3dCmdDXBindAllShader; /* SVGA_3D_CMD_DX_BIND_ALL_SHADER */
1405 typedef
1406 #include "vmware_pack_begin.h"
1407 struct SVGA3dCmdDXCondBindAllShader {
1408 uint32 cid;
1409 SVGAMobId testMobid;
1410 SVGAMobId mobid;
1412 #include "vmware_pack_end.h"
1413 SVGA3dCmdDXCondBindAllShader; /* SVGA_3D_CMD_DX_COND_BIND_ALL_SHADER */
1416 * The maximum number of streamout decl's in each streamout entry.
1418 #define SVGA3D_MAX_STREAMOUT_DECLS 64
1420 typedef
1421 #include "vmware_pack_begin.h"
1422 struct SVGA3dStreamOutputDeclarationEntry {
1423 uint32 outputSlot;
1424 uint32 registerIndex;
1425 uint8 registerMask;
1426 uint8 pad0;
1427 uint16 pad1;
1428 uint32 stream;
1430 #include "vmware_pack_end.h"
1431 SVGA3dStreamOutputDeclarationEntry;
1433 typedef
1434 #include "vmware_pack_begin.h"
1435 struct SVGAOTableStreamOutputEntry {
1436 uint32 numOutputStreamEntries;
1437 SVGA3dStreamOutputDeclarationEntry decl[SVGA3D_MAX_STREAMOUT_DECLS];
1438 uint32 streamOutputStrideInBytes[SVGA3D_DX_MAX_SOTARGETS];
1439 uint32 rasterizedStream;
1440 uint32 pad[250];
1442 #include "vmware_pack_end.h"
1443 SVGACOTableDXStreamOutputEntry;
1445 typedef
1446 #include "vmware_pack_begin.h"
1447 struct SVGA3dCmdDXDefineStreamOutput {
1448 SVGA3dStreamOutputId soid;
1449 uint32 numOutputStreamEntries;
1450 SVGA3dStreamOutputDeclarationEntry decl[SVGA3D_MAX_STREAMOUT_DECLS];
1451 uint32 streamOutputStrideInBytes[SVGA3D_DX_MAX_SOTARGETS];
1452 uint32 rasterizedStream;
1454 #include "vmware_pack_end.h"
1455 SVGA3dCmdDXDefineStreamOutput; /* SVGA_3D_CMD_DX_DEFINE_STREAMOUTPUT */
1457 typedef
1458 #include "vmware_pack_begin.h"
1459 struct SVGA3dCmdDXDestroyStreamOutput {
1460 SVGA3dStreamOutputId soid;
1462 #include "vmware_pack_end.h"
1463 SVGA3dCmdDXDestroyStreamOutput; /* SVGA_3D_CMD_DX_DESTROY_STREAMOUTPUT */
1465 typedef
1466 #include "vmware_pack_begin.h"
1467 struct SVGA3dCmdDXSetStreamOutput {
1468 SVGA3dStreamOutputId soid;
1470 #include "vmware_pack_end.h"
1471 SVGA3dCmdDXSetStreamOutput; /* SVGA_3D_CMD_DX_SET_STREAMOUTPUT */
1473 typedef
1474 #include "vmware_pack_begin.h"
1475 struct {
1476 uint64 value;
1477 uint32 mobId;
1478 uint32 mobOffset;
1480 #include "vmware_pack_end.h"
1481 SVGA3dCmdDXMobFence64; /* SVGA_3D_CMD_DX_MOB_FENCE_64 */
1484 * SVGA3dCmdSetCOTable --
1486 * This command allows the guest to bind a mob to a context-object table.
1488 typedef
1489 #include "vmware_pack_begin.h"
1490 struct SVGA3dCmdDXSetCOTable {
1491 uint32 cid;
1492 uint32 mobid;
1493 SVGACOTableType type;
1494 uint32 validSizeInBytes;
1496 #include "vmware_pack_end.h"
1497 SVGA3dCmdDXSetCOTable; /* SVGA_3D_CMD_DX_SET_COTABLE */
1500 * Guests using SVGA_3D_CMD_DX_GROW_COTABLE are promising that
1501 * the new COTable contains the same contents as the old one, except possibly
1502 * for some new invalid entries at the end.
1504 * If there is an old cotable mob bound, it also has to still be valid.
1506 * (Otherwise, guests should use the DXSetCOTableBase command.)
1508 typedef
1509 #include "vmware_pack_begin.h"
1510 struct SVGA3dCmdDXGrowCOTable {
1511 uint32 cid;
1512 uint32 mobid;
1513 SVGACOTableType type;
1514 uint32 validSizeInBytes;
1516 #include "vmware_pack_end.h"
1517 SVGA3dCmdDXGrowCOTable; /* SVGA_3D_CMD_DX_GROW_COTABLE */
1519 typedef
1520 #include "vmware_pack_begin.h"
1521 struct SVGA3dCmdDXReadbackCOTable {
1522 uint32 cid;
1523 SVGACOTableType type;
1525 #include "vmware_pack_end.h"
1526 SVGA3dCmdDXReadbackCOTable; /* SVGA_3D_CMD_DX_READBACK_COTABLE */
1528 typedef
1529 #include "vmware_pack_begin.h"
1530 struct SVGA3dCOTableData {
1531 uint32 mobid;
1533 #include "vmware_pack_end.h"
1534 SVGA3dCOTableData;
1536 typedef
1537 #include "vmware_pack_begin.h"
1538 struct SVGA3dBufferBinding {
1539 uint32 bufferId;
1540 uint32 stride;
1541 uint32 offset;
1543 #include "vmware_pack_end.h"
1544 SVGA3dBufferBinding;
1546 typedef
1547 #include "vmware_pack_begin.h"
1548 struct SVGA3dConstantBufferBinding {
1549 uint32 sid;
1550 uint32 offsetInBytes;
1551 uint32 sizeInBytes;
1553 #include "vmware_pack_end.h"
1554 SVGA3dConstantBufferBinding;
1556 typedef
1557 #include "vmware_pack_begin.h"
1558 struct SVGADXInputAssemblyMobFormat {
1559 uint32 layoutId;
1560 SVGA3dBufferBinding vertexBuffers[SVGA3D_DX_MAX_VERTEXBUFFERS];
1561 uint32 indexBufferSid;
1562 uint32 pad;
1563 uint32 indexBufferOffset;
1564 uint32 indexBufferFormat;
1565 uint32 topology;
1567 #include "vmware_pack_end.h"
1568 SVGADXInputAssemblyMobFormat;
1570 typedef
1571 #include "vmware_pack_begin.h"
1572 struct SVGADXContextMobFormat {
1573 SVGADXInputAssemblyMobFormat inputAssembly;
1575 struct {
1576 uint32 blendStateId;
1577 uint32 blendFactor[4];
1578 uint32 sampleMask;
1579 uint32 depthStencilStateId;
1580 uint32 stencilRef;
1581 uint32 rasterizerStateId;
1582 uint32 depthStencilViewId;
1583 uint32 renderTargetViewIds[SVGA3D_MAX_SIMULTANEOUS_RENDER_TARGETS];
1584 uint32 unorderedAccessViewIds[SVGA3D_MAX_UAVIEWS];
1585 } renderState;
1587 struct {
1588 uint32 targets[SVGA3D_DX_MAX_SOTARGETS];
1589 uint32 soid;
1590 } streamOut;
1591 uint32 pad0[11];
1593 uint8 numViewports;
1594 uint8 numScissorRects;
1595 uint16 pad1[1];
1597 uint32 pad2[3];
1599 SVGA3dViewport viewports[SVGA3D_DX_MAX_VIEWPORTS];
1600 uint32 pad3[32];
1602 SVGASignedRect scissorRects[SVGA3D_DX_MAX_SCISSORRECTS];
1603 uint32 pad4[64];
1605 struct {
1606 uint32 queryID;
1607 uint32 value;
1608 } predication;
1609 uint32 pad5[2];
1611 struct {
1612 uint32 shaderId;
1613 SVGA3dConstantBufferBinding constantBuffers[SVGA3D_DX_MAX_CONSTBUFFERS];
1614 uint32 shaderResources[SVGA3D_DX_MAX_SRVIEWS];
1615 uint32 samplers[SVGA3D_DX_MAX_SAMPLERS];
1616 } shaderState[SVGA3D_NUM_SHADERTYPE];
1617 uint32 pad6[26];
1619 SVGA3dQueryId queryID[SVGA3D_MAX_QUERY];
1621 SVGA3dCOTableData cotables[SVGA_COTABLE_MAX];
1622 uint32 pad7[380];
1624 #include "vmware_pack_end.h"
1625 SVGADXContextMobFormat;
1627 typedef
1628 #include "vmware_pack_begin.h"
1629 struct SVGA3dCmdDXTempSetContext {
1630 uint32 dxcid;
1632 #include "vmware_pack_end.h"
1633 SVGA3dCmdDXTempSetContext; /* SVGA_3D_CMD_DX_TEMP_SET_CONTEXT */
1635 #endif /* _SVGA3D_DX_H_ */