VirtualBox

source: vbox/trunk/src/VBox/Devices/Graphics/vmsvga_include/vbsvga3d_dx.h@ 105575

Last change on this file since 105575 was 105575, checked in by vboxsync, 4 months ago

Devices/Graphics,WDDM: Implemented DEFINE_RASTERIZER_STATE_V2

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 29.7 KB
Line 
1/*
2 * Copyright (C) 2023 Oracle and/or its affiliates.
3 *
4 * This file is part of VirtualBox base platform packages, as
5 * available from https://www.virtualbox.org.
6 *
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation, in version 3 of the
10 * License.
11 *
12 * This program is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, see <https://www.gnu.org/licenses>.
19 *
20 * SPDX-License-Identifier: GPL-3.0-only
21 */
22
23#ifndef VBOX_INCLUDED_SRC_Graphics_vmsvga_include_vbsvga3d_dx_h
24#define VBOX_INCLUDED_SRC_Graphics_vmsvga_include_vbsvga3d_dx_h
25#ifndef RT_WITHOUT_PRAGMA_ONCE
26# pragma once
27#endif
28
29#include "svga3d_dx.h"
30
31/* Extended capabilities returned by SVGA3D_DEVCAP_3D if VBoxSVGA virtual device is enabled. */
32/* The original "3D support" capability. */
33#define VBSVGA3D_CAP_3D 0x00000001
34/* Video decoding/processing and ClearView commands. */
35#define VBSVGA3D_CAP_VIDEO 0x00000002
36/* The host supports SVGA_3D_CMD_DX_DEFINE_RASTERIZER_STATE_V2 command. */
37#define VBSVGA3D_CAP_RASTERIZER_STATE_V2 0x00000004
38
39/* Arbitrary limits. Allows to use constant size structures.
40 * NVIDIA supports 5 streams, AMD more, so 8 seems to be a good round number.
41 * Both support 1 rate conversion caps set.
42 * NVIDIA driver reports 6 custom rates.
43 */
44#define VBSVGA3D_MAX_VIDEO_STREAMS 8
45#define VBSVGA3D_MAX_VIDEO_RATE_CONVERSION_CAPS 1
46#define VBSVGA3D_MAX_VIDEO_CUSTOM_RATE_CAPS 8
47
48/* For 8-bit palettized formats. */
49#define VBSVGA3D_MAX_VIDEO_PALETTE_ENTRIES 256
50
51typedef uint32 VBSVGA3dVideoProcessorId;
52typedef uint32 VBSVGA3dVideoDecoderOutputViewId;
53typedef uint32 VBSVGA3dVideoDecoderId;
54typedef uint32 VBSVGA3dVideoProcessorInputViewId;
55typedef uint32 VBSVGA3dVideoProcessorOutputViewId;
56
57#define VBSVGA3D_VIDEO_FRAME_FORMAT_PROGRESSIVE 0
58#define VBSVGA3D_VIDEO_FRAME_FORMAT_INTERLACED_TOP_FIELD_FIRST 1
59#define VBSVGA3D_VIDEO_FRAME_FORMAT_INTERLACED_BOTTOM_FIELD_FIRST 2
60typedef uint32 VBSVGA3dVideoFrameFormat;
61
62#define VBSVGA3D_VIDEO_USAGE_PLAYBACK_NORMAL 0
63#define VBSVGA3D_VIDEO_USAGE_OPTIMAL_SPEED 1
64#define VBSVGA3D_VIDEO_USAGE_OPTIMAL_QUALITY 2
65typedef uint32 VBSVGA3dVideoUsage;
66
67#define VBSVGA3D_VP_OUTPUT_RATE_NORMAL 0
68#define VBSVGA3D_VP_OUTPUT_RATE_HALF 1
69#define VBSVGA3D_VP_OUTPUT_RATE_CUSTOM 2
70typedef uint32 VBSVGA3dVideoProcessorOutputRate;
71
72#define VBSVGA3D_VDOV_DIMENSION_UNKNOWN 0
73#define VBSVGA3D_VDOV_DIMENSION_TEXTURE2D 1
74typedef uint32 VBSVGA3dVDOVDimension;
75
76#define VBSVGA3D_VPIV_DIMENSION_UNKNOWN 0
77#define VBSVGA3D_VPIV_DIMENSION_TEXTURE2D 1
78typedef uint32 VBSVGA3dVPIVDimension;
79
80#define VBSVGA3D_VPOV_DIMENSION_UNKNOWN 0
81#define VBSVGA3D_VPOV_DIMENSION_TEXTURE2D 1
82#define VBSVGA3D_VPOV_DIMENSION_TEXTURE2DARRAY 2
83typedef uint32 VBSVGA3dVPOVDimension;
84
85#define VBSVGA3D_VD_BUFFER_PICTURE_PARAMETERS 0
86#define VBSVGA3D_VD_BUFFER_MACROBLOCK_CONTROL 1
87#define VBSVGA3D_VD_BUFFER_RESIDUAL_DIFFERENCE 2
88#define VBSVGA3D_VD_BUFFER_DEBLOCKING_CONTROL 3
89#define VBSVGA3D_VD_BUFFER_INVERSE_QUANTIZATION_MATRIX 4
90#define VBSVGA3D_VD_BUFFER_SLICE_CONTROL 5
91#define VBSVGA3D_VD_BUFFER_BITSTREAM 6
92#define VBSVGA3D_VD_BUFFER_MOTION_VECTOR 7
93#define VBSVGA3D_VD_BUFFER_FILM_GRAIN 8
94typedef uint32 VBSVGA3dVideoDecoderBufferType;
95
96#define VBSVGA3D_VP_ALPHA_FILL_MODE_OPAQUE 0
97#define VBSVGA3D_VP_ALPHA_FILL_MODE_BACKGROUND 1
98#define VBSVGA3D_VP_ALPHA_FILL_MODE_DESTINATION 2
99#define VBSVGA3D_VP_ALPHA_FILL_MODE_SOURCE_STREAM 3
100typedef uint32 VBSVGA3dVideoProcessorAlphaFillMode;
101
102#define VBSVGA3D_VP_STEREO_FORMAT_MONO 0
103#define VBSVGA3D_VP_STEREO_FORMAT_HORIZONTAL 1
104#define VBSVGA3D_VP_STEREO_FORMAT_VERTICAL 2
105#define VBSVGA3D_VP_STEREO_FORMAT_SEPARATE 3
106#define VBSVGA3D_VP_STEREO_FORMAT_MONO_OFFSET 4
107#define VBSVGA3D_VP_STEREO_FORMAT_ROW_INTERLEAVED 5
108#define VBSVGA3D_VP_STEREO_FORMAT_COLUMN_INTERLEAVED 6
109#define VBSVGA3D_VP_STEREO_FORMAT_CHECKERBOARD 7
110typedef uint32 VBSVGA3dVideoProcessorStereoFormat;
111
112#define VBSVGA3D_VP_STEREO_FLIP_NONE 0
113#define VBSVGA3D_VP_STEREO_FLIP_FRAME0 1
114#define VBSVGA3D_VP_STEREO_FLIP_FRAME1 2
115typedef uint32 VBSVGA3dVideoProcessorStereoFlipMode;
116
117#define VBSVGA3D_VP_FILTER_BRIGHTNESS 0
118#define VBSVGA3D_VP_FILTER_CONTRAST 1
119#define VBSVGA3D_VP_FILTER_HUE 2
120#define VBSVGA3D_VP_FILTER_SATURATION 3
121#define VBSVGA3D_VP_FILTER_NOISE_REDUCTION 4
122#define VBSVGA3D_VP_FILTER_EDGE_ENHANCEMENT 5
123#define VBSVGA3D_VP_FILTER_ANAMORPHIC_SCALING 6
124#define VBSVGA3D_VP_FILTER_STEREO_ADJUSTMENT 7
125#define VBSVGA3D_VP_MAX_FILTER_COUNT 8
126typedef uint32 VBSVGA3dVideoProcessorFilter;
127
128#define VBSVGA3D_VP_ROTATION_IDENTITY 0
129#define VBSVGA3D_VP_ROTATION_90 1
130#define VBSVGA3D_VP_ROTATION_180 2
131#define VBSVGA3D_VP_ROTATION_270 3
132typedef uint32 VBSVGA3dVideoProcessorRotation;
133
134#define VBSVGA3D_VP_FORMAT_SUPPORT_INPUT 0x1
135#define VBSVGA3D_VP_FORMAT_SUPPORT_OUTPUT 0x2
136typedef uint8 VBSVGA3dVideoProcessorFormatSupport;
137
138#define VBSVGA3D_VP_DEVICE_CAPS_LINEAR_SPACE 0x1
139#define VBSVGA3D_VP_DEVICE_CAPS_xvYCC 0x2
140#define VBSVGA3D_VP_DEVICE_CAPS_RGB_RANGE_CONVERSION 0x4
141#define VBSVGA3D_VP_DEVICE_CAPS_YCbCr_MATRIX_CONVERSION 0x8
142#define VBSVGA3D_VP_DEVICE_CAPS_NOMINAL_RANGE 0x10
143typedef uint32 VBSVGA3dVideoProcessorDeviceCaps;
144
145#define VBSVGA3D_VP_FEATURE_CAPS_ALPHA_FILL 0x1
146#define VBSVGA3D_VP_FEATURE_CAPS_CONSTRICTION 0x2
147#define VBSVGA3D_VP_FEATURE_CAPS_LUMA_KEY 0x4
148#define VBSVGA3D_VP_FEATURE_CAPS_ALPHA_PALETTE 0x8
149#define VBSVGA3D_VP_FEATURE_CAPS_LEGACY 0x10
150#define VBSVGA3D_VP_FEATURE_CAPS_STEREO 0x20
151#define VBSVGA3D_VP_FEATURE_CAPS_ROTATION 0x40
152#define VBSVGA3D_VP_FEATURE_CAPS_ALPHA_STREAM 0x80
153#define VBSVGA3D_VP_FEATURE_CAPS_PIXEL_ASPECT_RATIO 0x100
154#define VBSVGA3D_VP_FEATURE_CAPS_MIRROR 0x200
155#define VBSVGA3D_VP_FEATURE_CAPS_SHADER_USAGE 0x400
156#define VBSVGA3D_VP_FEATURE_CAPS_METADATA_HDR10 0x800
157typedef uint32 VBSVGA3dVideoProcessorFeatureCaps;
158
159#define VBSVGA3D_VP_FILTER_CAPS_BRIGHTNESS 0x1
160#define VBSVGA3D_VP_FILTER_CAPS_CONTRAST 0x2
161#define VBSVGA3D_VP_FILTER_CAPS_HUE 0x4
162#define VBSVGA3D_VP_FILTER_CAPS_SATURATION 0x8
163#define VBSVGA3D_VP_FILTER_CAPS_NOISE_REDUCTION 0x10
164#define VBSVGA3D_VP_FILTER_CAPS_EDGE_ENHANCEMENT 0x20
165#define VBSVGA3D_VP_FILTER_CAPS_ANAMORPHIC_SCALING 0x40
166#define VBSVGA3D_VP_FILTER_CAPS_STEREO_ADJUSTMENT 0x80
167typedef uint32 VBSVGA3dVideoProcessorFilterCaps;
168
169#define VBSVGA3D_VP_FORMAT_CAPS_RGB_INTERLACED 0x1
170#define VBSVGA3D_VP_FORMAT_CAPS_RGB_PROCAMP 0x2
171#define VBSVGA3D_VP_FORMAT_CAPS_RGB_LUMA_KEY 0x4
172#define VBSVGA3D_VP_FORMAT_CAPS_PALETTE_INTERLACED 0x8
173typedef uint32 VBSVGA3dVideoProcessorInputFormatCaps;
174
175#define VBSVGA3D_VP_AUTO_STREAM_CAPS_DENOISE 0x1
176#define VBSVGA3D_VP_AUTO_STREAM_CAPS_DERINGING 0x2
177#define VBSVGA3D_VP_AUTO_STREAM_CAPS_EDGE_ENHANCEMENT 0x4
178#define VBSVGA3D_VP_AUTO_STREAM_CAPS_COLOR_CORRECTION 0x8
179#define VBSVGA3D_VP_AUTO_STREAM_CAPS_FLESH_TONE_MAPPING 0x10
180#define VBSVGA3D_VP_AUTO_STREAM_CAPS_IMAGE_STABILIZATION 0x20
181#define VBSVGA3D_VP_AUTO_STREAM_CAPS_SUPER_RESOLUTION 0x40
182#define VBSVGA3D_VP_AUTO_STREAM_CAPS_ANAMORPHIC_SCALING 0x80
183typedef uint32 VBSVGA3dVideoProcessorAutoStreamCaps;
184
185#define VBSVGA3D_VP_STEREO_CAPS_MONO_OFFSET 0x1
186#define VBSVGA3D_VP_STEREO_CAPS_ROW_INTERLEAVED 0x2
187#define VBSVGA3D_VP_STEREO_CAPS_COLUMN_INTERLEAVED 0x4
188#define VBSVGA3D_VP_STEREO_CAPS_CHECKERBOARD 0x8
189#define VBSVGA3D_VP_STEREO_CAPS_FLIP_MODE 0x10
190typedef uint32 VBSVGA3dVideoProcessorStereoCaps;
191
192#define VBSVGA3D_VP_CAPS_DEINTERLACE_BLEND 0x1
193#define VBSVGA3D_VP_CAPS_DEINTERLACE_BOB 0x2
194#define VBSVGA3D_VP_CAPS_DEINTERLACE_ADAPTIVE 0x4
195#define VBSVGA3D_VP_CAPS_DEINTERLACE_MOTION_COMPENSATION 0x8
196#define VBSVGA3D_VP_CAPS_INVERSE_TELECINE 0x10
197#define VBSVGA3D_VP_CAPS_FRAME_RATE_CONVERSION 0x20
198typedef uint32 VBSVGA3dVideoRateConversionProcessorCaps;
199
200#define VBSVGA3D_VP_ITELECINE_CAPS_32 0x1
201#define VBSVGA3D_VP_ITELECINE_CAPS_22 0x2
202#define VBSVGA3D_VP_ITELECINE_CAPS_2224 0x4
203#define VBSVGA3D_VP_ITELECINE_CAPS_2332 0x8
204#define VBSVGA3D_VP_ITELECINE_CAPS_32322 0x10
205#define VBSVGA3D_VP_ITELECINE_CAPS_55 0x20
206#define VBSVGA3D_VP_ITELECINE_CAPS_64 0x40
207#define VBSVGA3D_VP_ITELECINE_CAPS_87 0x80
208#define VBSVGA3D_VP_ITELECINE_CAPS_222222222223 0x100
209#define VBSVGA3D_VP_ITELECINE_CAPS_OTHER 0x80000000
210typedef uint32 VBSVGA3dVideoRateConversionITelecineCaps;
211
212#define VBSVGA3D_VIDEO_CAPABILITY_DECODE_PROFILE 0
213#define VBSVGA3D_VIDEO_CAPABILITY_DECODE_CONFIG 1
214#define VBSVGA3D_VIDEO_CAPABILITY_PROCESSOR_ENUM 2
215typedef uint32 VBSVGA3dVideoCapability;
216
217typedef struct {
218 union {
219 float r;
220 float y;
221 };
222 union {
223 float g;
224 float cb;
225 };
226 union {
227 float b;
228 float cr;
229 };
230 float a;
231} VBSVGA3dVideoColor;
232
233typedef struct {
234 uint32 Usage : 1;
235 uint32 RGB_Range : 1;
236 uint32 YCbCr_Matrix : 1;
237 uint32 YCbCr_xvYCC : 1;
238 uint32 Nominal_Range : 2;
239 uint32 Reserved : 26;
240} VBSVGA3dVideoProcessorColorSpace;
241
242typedef struct {
243 VBSVGA3dVideoFrameFormat InputFrameFormat;
244 SVGA3dFraction64 InputFrameRate;
245 uint32 InputWidth;
246 uint32 InputHeight;
247 SVGA3dFraction64 OutputFrameRate;
248 uint32 OutputWidth;
249 uint32 OutputHeight;
250 VBSVGA3dVideoUsage Usage;
251} VBSVGA3dVideoProcessorDesc;
252
253#define VBSVGA3D_VP_SET_STREAM_FRAME_FORMAT 0x00000001
254#define VBSVGA3D_VP_SET_STREAM_COLOR_SPACE 0x00000002
255#define VBSVGA3D_VP_SET_STREAM_OUTPUT_RATE 0x00000004
256#define VBSVGA3D_VP_SET_STREAM_SOURCE_RECT 0x00000008
257#define VBSVGA3D_VP_SET_STREAM_DEST_RECT 0x00000010
258#define VBSVGA3D_VP_SET_STREAM_ALPHA 0x00000020
259#define VBSVGA3D_VP_SET_STREAM_PALETTE 0x00000040
260#define VBSVGA3D_VP_SET_STREAM_ASPECT_RATIO 0x00000080
261#define VBSVGA3D_VP_SET_STREAM_LUMA_KEY 0x00000100
262#define VBSVGA3D_VP_SET_STREAM_STEREO_FORMAT 0x00000200
263#define VBSVGA3D_VP_SET_STREAM_AUTO_PROCESSING_MODE 0x00000400
264#define VBSVGA3D_VP_SET_STREAM_FILTER 0x00000800
265#define VBSVGA3D_VP_SET_STREAM_ROTATION 0x00001000
266typedef uint32 VBSVGA3dVideoProcessorStreamSetMask;
267
268typedef struct
269{
270 VBSVGA3dVideoProcessorStreamSetMask SetMask;
271
272 union {
273 uint32 value;
274 struct {
275 uint32 SourceRectEnable : 1;
276 uint32 DestRectEnable : 1;
277 uint32 AlphaEnable : 1;
278 uint32 AspectRatioEnable : 1;
279 uint32 LumaKeyEnable : 1;
280 uint32 StereoFormatEnable : 1;
281 uint32 AutoProcessingModeEnable : 1;
282 uint32 RotationEnable : 1;
283 };
284 };
285
286 VBSVGA3dVideoFrameFormat FrameFormat;
287 VBSVGA3dVideoProcessorColorSpace ColorSpace;
288 VBSVGA3dVideoProcessorOutputRate OutputRate;
289 uint32 RepeatFrame;
290 SVGA3dFraction64 CustomRate;
291 SVGASignedRect SourceRect;
292 SVGASignedRect DestRect;
293 float Alpha;
294 uint32 PaletteCount;
295 uint32 aPalette[VBSVGA3D_MAX_VIDEO_PALETTE_ENTRIES];
296 SVGA3dFraction64 AspectSourceRatio;
297 SVGA3dFraction64 AspectDestRatio;
298 float LumaKeyLower;
299 float LumaKeyUpper;
300 VBSVGA3dVideoProcessorStereoFormat StereoFormat;
301 uint8 LeftViewFrame0;
302 uint8 BaseViewFrame0;
303 uint8 pad[2];
304 VBSVGA3dVideoProcessorStereoFlipMode FlipMode;
305 int32 MonoOffset;
306 uint32 FilterEnableMask;
307 struct {
308 int32 Level;
309 } aFilter[VBSVGA3D_VP_MAX_FILTER_COUNT];
310 VBSVGA3dVideoProcessorRotation Rotation;
311} VBSVGA3dVideoProcessorStreamState;
312
313#define VBSVGA3D_VP_SET_OUTPUT_TARGET_RECT 0x00000001
314#define VBSVGA3D_VP_SET_OUTPUT_BACKGROUND_COLOR 0x00000002
315#define VBSVGA3D_VP_SET_OUTPUT_COLOR_SPACE 0x00000004
316#define VBSVGA3D_VP_SET_OUTPUT_ALPHA_FILL_MODE 0x00000008
317#define VBSVGA3D_VP_SET_OUTPUT_CONSTRICTION 0x00000010
318#define VBSVGA3D_VP_SET_OUTPUT_STEREO_MODE 0x00000020
319typedef uint32 VBSVGA3dVideoProcessorOutputSetMask;
320
321typedef struct
322{
323 VBSVGA3dVideoProcessorOutputSetMask SetMask;
324
325 union {
326 uint32 value;
327 struct {
328 uint32 TargetRectEnable : 1;
329 uint32 BackgroundColorYCbCr : 1;
330 uint32 ConstrictionEnable : 1;
331 uint32 StereoModeEnable : 1;
332 };
333 };
334
335 SVGASignedRect TargetRect;
336 VBSVGA3dVideoColor BackgroundColor;
337 VBSVGA3dVideoProcessorColorSpace ColorSpace;
338 VBSVGA3dVideoProcessorAlphaFillMode AlphaFillMode;
339 uint32 AlphaFillStreamIndex;
340 uint32 ConstrictionWidth;
341 uint32 ConstrictionHeight;
342} VBSVGA3dVideoProcessorOutputState;
343
344typedef struct {
345 VBSVGA3dVideoProcessorDesc desc;
346
347 VBSVGA3dVideoProcessorOutputState output;
348
349 VBSVGA3dVideoProcessorStreamState aStreamState[VBSVGA3D_MAX_VIDEO_STREAMS];
350 uint32 pad[1719];
351} VBSVGACOTableDXVideoProcessorEntry;
352AssertCompile(sizeof(VBSVGACOTableDXVideoProcessorEntry) == 4096 * 4);
353
354typedef struct VBSVGA3dCmdDXDefineVideoProcessor {
355 VBSVGA3dVideoProcessorId videoProcessorId;
356
357 VBSVGA3dVideoProcessorDesc desc;
358} VBSVGA3dCmdDXDefineVideoProcessor;
359/* VBSVGA_3D_CMD_DX_DEFINE_VIDEO_PROCESSOR */
360
361typedef struct {
362 uint32 data1;
363 uint16 data2;
364 uint16 data3;
365 uint8 data4[8];
366} VBSVGA3dGuid;
367
368typedef struct {
369 VBSVGA3dGuid DecodeProfile;
370 VBSVGA3dVDOVDimension ViewDimension;
371 union {
372 struct {
373 uint32 ArraySlice;
374 } Texture2D;
375 uint32 pad[4];
376 };
377} VBSVGA3dVDOVDesc;
378
379typedef struct {
380 SVGA3dSurfaceId sid;
381 VBSVGA3dVDOVDesc desc;
382 uint32 pad[6];
383} VBSVGACOTableDXVideoDecoderOutputViewEntry;
384AssertCompile(sizeof(VBSVGACOTableDXVideoDecoderOutputViewEntry) == 16 * 4);
385
386typedef struct VBSVGA3dCmdDXDefineVideoDecoderOutputView {
387 VBSVGA3dVideoDecoderOutputViewId videoDecoderOutputViewId;
388
389 SVGA3dSurfaceId sid;
390
391 VBSVGA3dVDOVDesc desc;
392} VBSVGA3dCmdDXDefineVideoDecoderOutputView;
393/* VBSVGA_3D_CMD_DX_DEFINE_VIDEO_DECODER_OUTPUT_VIEW */
394
395typedef struct {
396 VBSVGA3dGuid DecodeProfile;
397 uint32 SampleWidth;
398 uint32 SampleHeight;
399 SVGA3dSurfaceFormat OutputFormat;
400} VBSVGA3dVideoDecoderDesc;
401
402typedef struct {
403 VBSVGA3dGuid guidConfigBitstreamEncryption;
404 VBSVGA3dGuid guidConfigMBcontrolEncryption;
405 VBSVGA3dGuid guidConfigResidDiffEncryption;
406 uint32 ConfigBitstreamRaw;
407 uint32 ConfigMBcontrolRasterOrder;
408 uint32 ConfigResidDiffHost;
409 uint32 ConfigSpatialResid8;
410 uint32 ConfigResid8Subtraction;
411 uint32 ConfigSpatialHost8or9Clipping;
412 uint32 ConfigSpatialResidInterleaved;
413 uint32 ConfigIntraResidUnsigned;
414 uint32 ConfigResidDiffAccelerator;
415 uint32 ConfigHostInverseScan;
416 uint32 ConfigSpecificIDCT;
417 uint32 Config4GroupedCoefs;
418 uint16 ConfigMinRenderTargetBuffCount;
419 uint16 ConfigDecoderSpecific;
420} VBSVGA3dVideoDecoderConfig;
421
422typedef struct {
423 VBSVGA3dVideoDecoderDesc desc;
424 VBSVGA3dVideoDecoderConfig config;
425 VBSVGA3dVideoDecoderOutputViewId vdovId;
426 uint32 pad[31];
427} VBSVGACOTableDXVideoDecoderEntry;
428AssertCompile(sizeof(VBSVGACOTableDXVideoDecoderEntry) == 64 * 4);
429
430typedef struct VBSVGA3dCmdDXDefineVideoDecoder {
431 VBSVGA3dVideoDecoderId videoDecoderId;
432
433 VBSVGA3dVideoDecoderDesc desc;
434 VBSVGA3dVideoDecoderConfig config;
435} VBSVGA3dCmdDXDefineVideoDecoder;
436/* VBSVGA_3D_CMD_DX_DEFINE_VIDEO_DECODER */
437
438typedef struct VBSVGA3dCmdDXVideoDecoderBeginFrame {
439 VBSVGA3dVideoDecoderId videoDecoderId;
440 VBSVGA3dVideoDecoderOutputViewId videoDecoderOutputViewId;
441} VBSVGA3dCmdDXVideoDecoderBeginFrame;
442/* VBSVGA_3D_CMD_DX_VIDEO_DECODER_BEGIN_FRAME */
443
444typedef struct {
445 SVGA3dSurfaceId sidBuffer;
446 VBSVGA3dVideoDecoderBufferType bufferType;
447 uint32 dataOffset;
448 uint32 dataSize;
449 uint32 firstMBaddress;
450 uint32 numMBsInBuffer;
451 /** @todo pIV, IVSize, PartialEncryption, EncryptedBlockInfo */
452} VBSVGA3dVideoDecoderBufferDesc;
453
454typedef struct VBSVGA3dCmdDXVideoDecoderSubmitBuffers {
455 VBSVGA3dVideoDecoderId videoDecoderId;
456 /* VBSVGA3dVideoDecoderBufferDesc[] */
457} VBSVGA3dCmdDXVideoDecoderSubmitBuffers;
458/* VBSVGA_3D_CMD_DX_VIDEO_DECODER_SUBMIT_BUFFERS */
459
460typedef struct VBSVGA3dCmdDXVideoDecoderEndFrame {
461 VBSVGA3dVideoDecoderId videoDecoderId;
462} VBSVGA3dCmdDXVideoDecoderEndFrame;
463/* VBSVGA_3D_CMD_DX_VIDEO_DECODER_END_FRAME */
464
465typedef struct {
466 uint32 FourCC;
467 VBSVGA3dVPIVDimension ViewDimension;
468 union {
469 struct {
470 uint32 MipSlice;
471 uint32 ArraySlice;
472 } Texture2D;
473 uint32 pad[4];
474 };
475} VBSVGA3dVPIVDesc;
476
477typedef struct {
478 SVGA3dSurfaceId sid;
479 VBSVGA3dVideoProcessorDesc contentDesc;
480 VBSVGA3dVPIVDesc desc;
481 uint32 pad[15];
482} VBSVGACOTableDXVideoProcessorInputViewEntry;
483AssertCompile(sizeof(VBSVGACOTableDXVideoProcessorInputViewEntry) == 32 * 4);
484
485typedef struct VBSVGA3dCmdDXDefineVideoProcessorInputView {
486 VBSVGA3dVideoProcessorInputViewId videoProcessorInputViewId;
487
488 SVGA3dSurfaceId sid;
489
490 VBSVGA3dVideoProcessorDesc contentDesc;
491 VBSVGA3dVPIVDesc desc;
492} VBSVGA3dCmdDXDefineVideoProcessorInputView;
493/* VBSVGA_3D_CMD_DX_DEFINE_VIDEO_PROCESSOR_INPUT_VIEW */
494
495typedef struct {
496 VBSVGA3dVPOVDimension ViewDimension;
497 union {
498 struct {
499 uint32 MipSlice;
500 } Texture2D;
501 struct {
502 uint32 MipSlice;
503 uint32 FirstArraySlice;
504 uint32 ArraySize;
505 } Texture2DArray;
506 uint32 pad[4];
507 };
508} VBSVGA3dVPOVDesc;
509
510typedef struct {
511 SVGA3dSurfaceId sid;
512 VBSVGA3dVideoProcessorDesc contentDesc;
513 VBSVGA3dVPOVDesc desc;
514 uint32 pad[15];
515} VBSVGACOTableDXVideoProcessorOutputViewEntry;
516AssertCompile(sizeof(VBSVGACOTableDXVideoProcessorInputViewEntry) == 32 * 4);
517
518typedef struct VBSVGA3dCmdDXDefineVideoProcessorOutputView {
519 VBSVGA3dVideoProcessorOutputViewId videoProcessorOutputViewId;
520
521 SVGA3dSurfaceId sid;
522
523 VBSVGA3dVideoProcessorDesc contentDesc;
524 VBSVGA3dVPOVDesc desc;
525} VBSVGA3dCmdDXDefineVideoProcessorOutputView;
526/* VBSVGA_3D_CMD_DX_DEFINE_VIDEO_PROCESSOR_OUTPUT_VIEW */
527
528typedef struct
529{
530 uint8 Enable;
531 uint8 StereoFormatSeparate;
532 uint16 pad;
533 uint32 OutputIndex;
534 uint32 InputFrameOrField;
535 uint32 PastFrames;
536 uint32 FutureFrames;
537 /* VBSVGA3dVideoProcessorInputViewId[PastFrames + 1 + FutureFrames]:
538 * [PastFrames]
539 * InputSurface
540 * [FutureFrames]
541 *
542 * If StereoFormatSeparate is 1 then more 'PastFrames + 1 + FutureFrames' ids follow:
543 * [PastFramesRight]
544 * InputSurfaceRight
545 * [FutureFramesRight]
546 */
547} VBSVGA3dVideoProcessorStream;
548
549typedef struct VBSVGA3dCmdDXVideoProcessorBlt {
550 VBSVGA3dVideoProcessorId videoProcessorId;
551 VBSVGA3dVideoProcessorOutputViewId videoProcessorOutputViewId;
552
553 uint32 outputFrame;
554 uint32 streamCount;
555 /* VBSVGA3dVideoProcessorStream data follow. */
556} VBSVGA3dCmdDXVideoProcessorBlt;
557/* VBSVGA_3D_CMD_DX_VIDEO_PROCESSOR_BLT */
558
559typedef struct VBSVGA3dCmdDXDestroyVideoDecoder {
560 VBSVGA3dVideoDecoderId videoDecoderId;
561} VBSVGA3dCmdDXDestroyVideoDecoder;
562/* VBSVGA_3D_CMD_DX_DESTROY_VIDEO_DECODER */
563
564typedef struct VBSVGA3dCmdDXDestroyVideoDecoderOutputView {
565 VBSVGA3dVideoDecoderOutputViewId videoDecoderOutputViewId;
566} VBSVGA3dCmdDXDestroyVideoDecoderOutputView;
567/* VBSVGA_3D_CMD_DX_DESTROY_VIDEO_DECODER_OUTPUT_VIEW */
568
569typedef struct VBSVGA3dCmdDXDestroyVideoProcessor {
570 VBSVGA3dVideoProcessorId videoProcessorId;
571} VBSVGA3dCmdDXDestroyVideoProcessor;
572/* VBSVGA_3D_CMD_DX_DESTROY_VIDEO_PROCESSOR */
573
574typedef struct VBSVGA3dCmdDXDestroyVideoProcessorInputView {
575 VBSVGA3dVideoProcessorInputViewId videoProcessorInputViewId;
576} VBSVGA3dCmdDXDestroyVideoProcessorInputView;
577/* VBSVGA_3D_CMD_DX_DESTROY_VIDEO_PROCESSOR_INPUT_VIEW */
578
579typedef struct VBSVGA3dCmdDXDestroyVideoProcessorOutputView {
580 VBSVGA3dVideoProcessorOutputViewId videoProcessorOutputViewId;
581} VBSVGA3dCmdDXDestroyVideoProcessorOutputView;
582/* VBSVGA_3D_CMD_DX_DESTROY_VIDEO_PROCESSOR_OUTPUT_VIEW */
583
584typedef struct VBSVGA3dCmdDXVideoProcessorSetOutputTargetRect {
585 VBSVGA3dVideoProcessorId videoProcessorId;
586 uint32 enable;
587 SVGASignedRect outputRect;
588} VBSVGA3dCmdDXVideoProcessorSetOutputTargetRect;
589/* VBSVGA_3D_CMD_DX_VIDEO_PROCESSOR_SET_OUTPUT_TARGET_RECT */
590
591typedef struct VBSVGA3dCmdDXVideoProcessorSetOutputBackgroundColor {
592 VBSVGA3dVideoProcessorId videoProcessorId;
593 uint32 ycbcr;
594 VBSVGA3dVideoColor color;
595} VBSVGA3dCmdDXVideoProcessorSetOutputBackgroundColor;
596/* VBSVGA_3D_CMD_DX_VIDEO_PROCESSOR_SET_OUTPUT_BACKGROUND_COLOR */
597
598typedef struct VBSVGA3dCmdDXVideoProcessorSetOutputColorSpace {
599 VBSVGA3dVideoProcessorId videoProcessorId;
600 VBSVGA3dVideoProcessorColorSpace colorSpace;
601} VBSVGA3dCmdDXVideoProcessorSetOutputColorSpace;
602/* VBSVGA_3D_CMD_DX_VIDEO_PROCESSOR_SET_OUTPUT_COLOR_SPACE */
603
604typedef struct VBSVGA3dCmdDXVideoProcessorSetOutputAlphaFillMode {
605 VBSVGA3dVideoProcessorId videoProcessorId;
606 VBSVGA3dVideoProcessorAlphaFillMode fillMode;
607 uint32 streamIndex;
608} VBSVGA3dCmdDXVideoProcessorSetOutputAlphaFillMode;
609/* VBSVGA_3D_CMD_DX_VIDEO_PROCESSOR_SET_OUTPUT_ALPHA_FILL_MODE */
610
611typedef struct VBSVGA3dCmdDXVideoProcessorSetOutputConstriction {
612 VBSVGA3dVideoProcessorId videoProcessorId;
613 uint32 enabled;
614 uint32 width;
615 uint32 height;
616} VBSVGA3dCmdDXVideoProcessorSetOutputConstriction;
617/* VBSVGA_3D_CMD_DX_VIDEO_PROCESSOR_SET_OUTPUT_CONSTRICTION */
618
619typedef struct VBSVGA3dCmdDXVideoProcessorSetOutputStereoMode {
620 VBSVGA3dVideoProcessorId videoProcessorId;
621 uint32 enable;
622} VBSVGA3dCmdDXVideoProcessorSetOutputStereoMode;
623/* VBSVGA_3D_CMD_DX_VIDEO_PROCESSOR_SET_OUTPUT_STEREO_MODE */
624
625typedef struct VBSVGA3dCmdDXVideoProcessorSetStreamFrameFormat {
626 VBSVGA3dVideoProcessorId videoProcessorId;
627 uint32 streamIndex;
628 VBSVGA3dVideoFrameFormat format;
629} VBSVGA3dCmdDXVideoProcessorSetStreamFrameFormat;
630/* VBSVGA_3D_CMD_DX_VIDEO_PROCESSOR_SET_STREAM_FRAME_FORMAT */
631
632typedef struct VBSVGA3dCmdDXVideoProcessorSetStreamColorSpace {
633 VBSVGA3dVideoProcessorId videoProcessorId;
634 uint32 streamIndex;
635 VBSVGA3dVideoProcessorColorSpace colorSpace;
636} VBSVGA3dCmdDXVideoProcessorSetStreamColorSpace;
637/* VBSVGA_3D_CMD_DX_VIDEO_PROCESSOR_SET_STREAM_COLOR_SPACE */
638
639typedef struct VBSVGA3dCmdDXVideoProcessorSetStreamOutputRate {
640 VBSVGA3dVideoProcessorId videoProcessorId;
641 uint32 streamIndex;
642 VBSVGA3dVideoProcessorOutputRate outputRate;
643 uint32 repeatFrame;
644 SVGA3dFraction64 customRate;
645} VBSVGA3dCmdDXVideoProcessorSetStreamOutputRate;
646/* VBSVGA_3D_CMD_DX_VIDEO_PROCESSOR_SET_STREAM_OUTPUT_RATE */
647
648typedef struct VBSVGA3dCmdDXVideoProcessorSetStreamSourceRect {
649 VBSVGA3dVideoProcessorId videoProcessorId;
650 uint32 streamIndex;
651 uint32 enable;
652 SVGASignedRect sourceRect;
653} VBSVGA3dCmdDXVideoProcessorSetStreamSourceRect;
654/* VBSVGA_3D_CMD_DX_VIDEO_PROCESSOR_SET_STREAM_SOURCE_RECT */
655
656typedef struct VBSVGA3dCmdDXVideoProcessorSetStreamDestRect {
657 VBSVGA3dVideoProcessorId videoProcessorId;
658 uint32 streamIndex;
659 uint32 enable;
660 SVGASignedRect destRect;
661} VBSVGA3dCmdDXVideoProcessorSetStreamDestRect;
662/* VBSVGA_3D_CMD_DX_VIDEO_PROCESSOR_SET_STREAM_DEST_RECT */
663
664typedef struct VBSVGA3dCmdDXVideoProcessorSetStreamAlpha {
665 VBSVGA3dVideoProcessorId videoProcessorId;
666 uint32 streamIndex;
667 uint32 enable;
668 float alpha;
669} VBSVGA3dCmdDXVideoProcessorSetStreamAlpha;
670/* VBSVGA_3D_CMD_DX_VIDEO_PROCESSOR_SET_STREAM_ALPHA */
671
672typedef struct VBSVGA3dCmdDXVideoProcessorSetStreamPalette {
673 VBSVGA3dVideoProcessorId videoProcessorId;
674 uint32 streamIndex;
675 /* uint32 entries: B8G8R8A8 or AYUV format. */
676} VBSVGA3dCmdDXVideoProcessorSetStreamPalette;
677/* VBSVGA_3D_CMD_DX_VIDEO_PROCESSOR_SET_STREAM_PALETTE */
678
679typedef struct VBSVGA3dCmdDXVideoProcessorSetStreamPixelAspectRatio {
680 VBSVGA3dVideoProcessorId videoProcessorId;
681 uint32 streamIndex;
682 uint32 enable;
683 SVGA3dFraction64 sourceRatio;
684 SVGA3dFraction64 destRatio;
685} VBSVGA3dCmdDXVideoProcessorSetStreamPixelAspectRatio;
686/* VBSVGA_3D_CMD_DX_VIDEO_PROCESSOR_SET_STREAM_PIXEL_ASPECT_RATIO */
687
688typedef struct VBSVGA3dCmdDXVideoProcessorSetStreamLumaKey {
689 VBSVGA3dVideoProcessorId videoProcessorId;
690 uint32 streamIndex;
691 uint32 enable;
692 float lower;
693 float upper;
694} VBSVGA3dCmdDXVideoProcessorSetStreamLumaKey;
695/* VBSVGA_3D_CMD_DX_VIDEO_PROCESSOR_SET_STREAM_LUMA_KEY */
696
697typedef struct VBSVGA3dCmdDXVideoProcessorSetStreamStereoFormat {
698 VBSVGA3dVideoProcessorId videoProcessorId;
699 uint32 streamIndex;
700 uint32 enable;
701 VBSVGA3dVideoProcessorStereoFormat stereoFormat;
702 uint8 leftViewFrame0;
703 uint8 baseViewFrame0;
704 uint8 pad[2];
705 VBSVGA3dVideoProcessorStereoFlipMode flipMode;
706 int32 monoOffset;
707} VBSVGA3dCmdDXVideoProcessorSetStreamStereoFormat;
708/* VBSVGA_3D_CMD_DX_VIDEO_PROCESSOR_SET_STREAM_STEREO_FORMAT */
709
710typedef struct VBSVGA3dCmdDXVideoProcessorSetStreamAutoProcessingMode {
711 VBSVGA3dVideoProcessorId videoProcessorId;
712 uint32 streamIndex;
713 uint32 enable;
714} VBSVGA3dCmdDXVideoProcessorSetStreamAutoProcessingMode;
715/* VBSVGA_3D_CMD_DX_VIDEO_PROCESSOR_SET_STREAM_AUTO_PROCESSING_MODE */
716
717typedef struct VBSVGA3dCmdDXVideoProcessorSetStreamFilter {
718 VBSVGA3dVideoProcessorId videoProcessorId;
719 uint32 streamIndex;
720 uint32 enable;
721 VBSVGA3dVideoProcessorFilter filter;
722 int32 level;
723} VBSVGA3dCmdDXVideoProcessorSetStreamFilter;
724/* VBSVGA_3D_CMD_DX_VIDEO_PROCESSOR_SET_STREAM_FILTER */
725
726typedef struct VBSVGA3dCmdDXVideoProcessorSetStreamRotation {
727 VBSVGA3dVideoProcessorId videoProcessorId;
728 uint32 streamIndex;
729 uint32 enable;
730 VBSVGA3dVideoProcessorRotation rotation;
731} VBSVGA3dCmdDXVideoProcessorSetStreamRotation;
732/* VBSVGA_3D_CMD_DX_VIDEO_PROCESSOR_SET_STREAM_ROTATION */
733
734typedef struct { /* VBSVGA3D_VIDEO_CAPABILITY_DECODE_PROFILE */
735 VBSVGA3dGuid DecodeProfile;
736 /* SVGA video formats. */
737 uint8 fAYUV;
738 uint8 fNV12;
739 uint8 fYUY2;
740} VBSVGA3dDecodeProfileInfo;
741
742typedef struct { /* VBSVGA3D_VIDEO_CAPABILITY_DECODE_CONFIG */
743 VBSVGA3dVideoDecoderDesc desc; /* In */
744 VBSVGA3dVideoDecoderConfig aConfig[1]; /* [(cbDataOut - sizeof(desc)) / sizeof(aConfig[0])] */
745} VBSVGA3dDecodeConfigInfo;
746
747typedef struct {
748 VBSVGA3dVideoProcessorDeviceCaps DeviceCaps;
749 VBSVGA3dVideoProcessorFeatureCaps FeatureCaps;
750 VBSVGA3dVideoProcessorFilterCaps FilterCaps;
751 VBSVGA3dVideoProcessorInputFormatCaps InputFormatCaps;
752 VBSVGA3dVideoProcessorAutoStreamCaps AutoStreamCaps;
753 VBSVGA3dVideoProcessorStereoCaps StereoCaps;
754 uint32 RateConversionCapsCount;
755 uint32 MaxInputStreams;
756 uint32 MaxStreamStates;
757} VBSVGA3dVideoProcessorCaps;
758
759typedef struct {
760 uint32 PastFrames;
761 uint32 FutureFrames;
762 VBSVGA3dVideoRateConversionProcessorCaps ProcessorCaps;
763 VBSVGA3dVideoRateConversionITelecineCaps ITelecineCaps;
764 uint32 CustomRateCount;
765} VBSVGA3dVideoProcessorRateCaps;
766
767typedef struct {
768 SVGA3dFraction64 CustomRate;
769 uint32 OutputFrames;
770 uint8 InputInterlaced;
771 uint8 pad[3];
772 uint32 InputFramesOrFields;
773} VBSVGA3dVideoProcessorCustomRateCaps;
774
775typedef struct {
776 int32 Minimum;
777 int32 Maximum;
778 int32 Default;
779 float Multiplier;
780} VBSVGA3dVideoProcessorFilterRange;
781
782typedef struct {
783 /* SVGA video processor formats. */
784 VBSVGA3dVideoProcessorFormatSupport fR8_UNORM;
785 VBSVGA3dVideoProcessorFormatSupport fR16_UNORM;
786 VBSVGA3dVideoProcessorFormatSupport fNV12;
787 VBSVGA3dVideoProcessorFormatSupport fYUY2;
788 VBSVGA3dVideoProcessorFormatSupport fR16G16B16A16_FLOAT;
789 VBSVGA3dVideoProcessorFormatSupport fB8G8R8X8_UNORM;
790 VBSVGA3dVideoProcessorFormatSupport fB8G8R8A8_UNORM;
791 VBSVGA3dVideoProcessorFormatSupport fR8G8B8A8_UNORM;
792 VBSVGA3dVideoProcessorFormatSupport fR10G10B10A2_UNORM;
793 VBSVGA3dVideoProcessorFormatSupport fR10G10B10_XR_BIAS_A2_UNORM;
794 VBSVGA3dVideoProcessorFormatSupport fR8G8B8A8_UNORM_SRGB;
795 VBSVGA3dVideoProcessorFormatSupport fB8G8R8A8_UNORM_SRGB;
796
797 VBSVGA3dVideoProcessorCaps Caps;
798 VBSVGA3dVideoProcessorRateCaps RateCaps;
799 VBSVGA3dVideoProcessorCustomRateCaps aCustomRateCaps[VBSVGA3D_MAX_VIDEO_CUSTOM_RATE_CAPS];
800 VBSVGA3dVideoProcessorFilterRange aFilterRange[VBSVGA3D_VP_MAX_FILTER_COUNT];
801} VBSVGA3dVideoProcessorEnumInfo;
802
803typedef struct { /* VBSVGA3D_VIDEO_CAPABILITY_PROCESSOR_ENUM */
804 VBSVGA3dVideoProcessorDesc desc; /* In */
805 VBSVGA3dVideoProcessorEnumInfo info;
806} VBSVGA3dProcessorEnumInfo;
807
808/* Layout of memory object for VBSVGA3dCmdDXGetVideoCapability command. */
809typedef struct {
810 uint64 fenceValue; /* Host sets this to VBSVGA3dCmdDXGetVideoCapability::fenceValue after updating the data. */
811 uint32 cbDataOut; /* Size in bytes of data written by host excluding u64Fence and cbDataOut fields. */
812 union
813 {
814 VBSVGA3dDecodeProfileInfo aDecodeProfile[1]; /* [cbDataOut / sizeof(aDecodeProfile[0])] */
815 VBSVGA3dDecodeConfigInfo config;
816 VBSVGA3dProcessorEnumInfo processorEnum;
817 } data;
818} VBSVGA3dVideoCapabilityMobLayout;
819
820typedef struct VBSVGA3dCmdDXGetVideoCapability {
821 VBSVGA3dVideoCapability capability;
822 uint32 mobid;
823 uint32 offsetInBytes;
824 uint32 sizeInBytes;
825 uint64 fenceValue;
826} VBSVGA3dCmdDXGetVideoCapability;
827/* VBSVGA_3D_CMD_DX_GET_VIDEO_CAPABILITY */
828
829typedef struct VBSVGA3dCmdDXClearView
830{
831 uint32 viewId;
832 SVGA3dRGBAFloat color;
833 /* followed by SVGASignedRect array */
834} VBSVGA3dCmdDXClearView;
835/* VBSVGA_3D_CMD_DX_CLEAR_RTV
836 * VBSVGA_3D_CMD_DX_CLEAR_UAV
837 * VBSVGA_3D_CMD_DX_CLEAR_VDOV
838 * VBSVGA_3D_CMD_DX_CLEAR_VPIV
839 * VBSVGA_3D_CMD_DX_CLEAR_VPOV
840 */
841
842#endif /* !VBOX_INCLUDED_SRC_Graphics_vmsvga_include_vbsvga3d_dx_h */
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette