--- include/d3d12.idl | 3 + include/d3d12video.idl | 378 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 381 insertions(+) create mode 100644 include/d3d12video.idl
diff --git a/include/d3d12.idl b/include/d3d12.idl index 056e078ab9d..08ec5b9e2d3 100644 --- a/include/d3d12.idl +++ b/include/d3d12.idl @@ -1633,6 +1633,9 @@ typedef enum D3D12_COMMAND_LIST_TYPE D3D12_COMMAND_LIST_TYPE_BUNDLE = 1, D3D12_COMMAND_LIST_TYPE_COMPUTE = 2, D3D12_COMMAND_LIST_TYPE_COPY = 3, + D3D12_COMMAND_LIST_TYPE_VIDEO_DECODE = 4, + D3D12_COMMAND_LIST_TYPE_VIDEO_PROCESS = 5, + D3D12_COMMAND_LIST_TYPE_VIDEO_ENCODE = 6 } D3D12_COMMAND_LIST_TYPE;
typedef enum D3D12_COMMAND_QUEUE_PRIORITY diff --git a/include/d3d12video.idl b/include/d3d12video.idl new file mode 100644 index 00000000000..49aa8eea8d8 --- /dev/null +++ b/include/d3d12video.idl @@ -0,0 +1,378 @@ +import "d3d12.idl"; + +typedef enum D3D12_FEATURE_VIDEO +{ + D3D12_FEATURE_VIDEO_DECODE_SUPPORT = 0, + D3D12_FEATURE_VIDEO_DECODE_PROFILES = 1, + D3D12_FEATURE_VIDEO_DECODE_FORMATS = 2, + D3D12_FEATURE_VIDEO_DECODE_CONVERSION_SUPPORT = 3, + D3D12_FEATURE_VIDEO_PROCESS_SUPPORT = 5, + D3D12_FEATURE_VIDEO_PROCESS_MAX_INPUT_STREAMS = 6, + D3D12_FEATURE_VIDEO_PROCESS_REFERENCE_INFO = 7, + D3D12_FEATURE_VIDEO_DECODER_HEAP_SIZE = 8, + D3D12_FEATURE_VIDEO_PROCESSOR_SIZE = 9, + D3D12_FEATURE_VIDEO_DECODE_PROFILE_COUNT = 10, + D3D12_FEATURE_VIDEO_DECODE_FORMAT_COUNT = 11, + D3D12_FEATURE_VIDEO_ARCHITECTURE = 17, + D3D12_FEATURE_VIDEO_DECODE_HISTOGRAM = 18, + D3D12_FEATURE_VIDEO_FEATURE_AREA_SUPPORT = 19, + D3D12_FEATURE_VIDEO_MOTION_ESTIMATOR = 20, + D3D12_FEATURE_VIDEO_MOTION_ESTIMATOR_SIZE = 21, + D3D12_FEATURE_VIDEO_EXTENSION_COMMAND_COUNT = 22, + D3D12_FEATURE_VIDEO_EXTENSION_COMMANDS = 23, + D3D12_FEATURE_VIDEO_EXTENSION_COMMAND_PARAMETER_COUNT = 24, + D3D12_FEATURE_VIDEO_EXTENSION_COMMAND_PARAMETERS = 25, + D3D12_FEATURE_VIDEO_EXTENSION_COMMAND_SUPPORT = 26, + D3D12_FEATURE_VIDEO_EXTENSION_COMMAND_SIZE = 27, + D3D12_FEATURE_VIDEO_DECODE_PROTECTED_RESOURCES = 28, + D3D12_FEATURE_VIDEO_PROCESS_PROTECTED_RESOURCES = 29, + D3D12_FEATURE_VIDEO_MOTION_ESTIMATOR_PROTECTED_RESOURCES = 30, + D3D12_FEATURE_VIDEO_DECODER_HEAP_SIZE1 = 31, + D3D12_FEATURE_VIDEO_PROCESSOR_SIZE1 = 32 +} D3D12_FEATURE_VIDEO; + +typedef enum D3D12_BITSTREAM_ENCRYPTION_TYPE +{ + D3D12_BITSTREAM_ENCRYPTION_TYPE_NONE +} D3D12_BITSTREAM_ENCRYPTION_TYPE; + +typedef enum D3D12_VIDEO_FRAME_CODED_INTERLACE_TYPE +{ + D3D12_VIDEO_FRAME_CODED_INTERLACE_TYPE_NONE, + D3D12_VIDEO_FRAME_CODED_INTERLACE_TYPE_FIELD_BASED +} D3D12_VIDEO_FRAME_CODED_INTERLACE_TYPE; + +typedef enum D3D12_VIDEO_PROCESS_ALPHA_FILL_MODE +{ + D3D12_VIDEO_PROCESS_ALPHA_FILL_MODE_OPAQUE, + D3D12_VIDEO_PROCESS_ALPHA_FILL_MODE_BACKGROUND, + D3D12_VIDEO_PROCESS_ALPHA_FILL_MODE_DESTINATION, + D3D12_VIDEO_PROCESS_ALPHA_FILL_MODE_SOURCE_STREAM +} D3D12_VIDEO_PROCESS_ALPHA_FILL_MODE; + +typedef enum D3D12_VIDEO_PROCESS_FILTER_FLAGS +{ + D3D12_VIDEO_PROCESS_FILTER_FLAG_NONE, + D3D12_VIDEO_PROCESS_FILTER_FLAG_BRIGHTNESS, + D3D12_VIDEO_PROCESS_FILTER_FLAG_CONTRAST, + D3D12_VIDEO_PROCESS_FILTER_FLAG_HUE, + D3D12_VIDEO_PROCESS_FILTER_FLAG_SATURATION, + D3D12_VIDEO_PROCESS_FILTER_FLAG_NOISE_REDUCTION, + D3D12_VIDEO_PROCESS_FILTER_FLAG_EDGE_ENHANCEMENT, + D3D12_VIDEO_PROCESS_FILTER_FLAG_ANAMORPHIC_SCALING, + D3D12_VIDEO_PROCESS_FILTER_FLAG_STEREO_ADJUSTMENT +} D3D12_VIDEO_PROCESS_FILTER_FLAGS; + +typedef enum D3D12_VIDEO_FRAME_STEREO_FORMAT +{ + D3D12_VIDEO_FRAME_STEREO_FORMAT_NONE, + D3D12_VIDEO_FRAME_STEREO_FORMAT_MONO, + D3D12_VIDEO_FRAME_STEREO_FORMAT_HORIZONTAL, + D3D12_VIDEO_FRAME_STEREO_FORMAT_VERTICAL, + D3D12_VIDEO_FRAME_STEREO_FORMAT_SEPARATE +} D3D12_VIDEO_FRAME_STEREO_FORMAT; + +typedef enum D3D12_VIDEO_FIELD_TYPE +{ + D3D12_VIDEO_FIELD_TYPE_NONE, + D3D12_VIDEO_FIELD_TYPE_INTERLACED_TOP_FIELD_FIRST, + D3D12_VIDEO_FIELD_TYPE_INTERLACED_BOTTOM_FIELD_FIRST +} D3D12_VIDEO_FIELD_TYPE; + +typedef enum D3D12_VIDEO_PROCESS_DEINTERLACE_FLAGS +{ + D3D12_VIDEO_PROCESS_DEINTERLACE_FLAG_NONE, + D3D12_VIDEO_PROCESS_DEINTERLACE_FLAG_BOB, + D3D12_VIDEO_PROCESS_DEINTERLACE_FLAG_CUSTOM +} D3D12_VIDEO_PROCESS_DEINTERLACE_FLAGS; + +typedef enum D3D12_VIDEO_DECODE_ARGUMENT_TYPE +{ + D3D12_VIDEO_DECODE_ARGUMENT_TYPE_PICTURE_PARAMETERS, + D3D12_VIDEO_DECODE_ARGUMENT_TYPE_INVERSE_QUANTIZATION_MATRIX, + D3D12_VIDEO_DECODE_ARGUMENT_TYPE_SLICE_CONTROL, + D3D12_VIDEO_DECODE_ARGUMENT_TYPE_MAX_VALID +} D3D12_VIDEO_DECODE_ARGUMENT_TYPE; + +typedef enum D3D12_VIDEO_DECODE_SUPPORT_FLAGS +{ + D3D12_VIDEO_DECODE_SUPPORT_FLAG_NONE = 0x0, + D3D12_VIDEO_DECODE_SUPPORT_FLAG_SUPPORTED = 0x1, +} D3D12_VIDEO_DECODE_SUPPORT_FLAGS; + +typedef enum D3D12_VIDEO_DECODE_CONFIGURATION_FLAGS +{ + D3D12_VIDEO_DECODE_CONFIGURATION_FLAG_NONE = 0x0, + D3D12_VIDEO_DECODE_CONFIGURATION_FLAG_HEIGHT_ALIGNMENT_MULTIPLE_32_REQUIRED = 0x1, + D3D12_VIDEO_DECODE_CONFIGURATION_FLAG_POST_PROCESSING_SUPPORTED = 0x2, + D3D12_VIDEO_DECODE_CONFIGURATION_FLAG_REFERENCE_ONLY_ALLOCATIONS_REQUIRED = 0x4, + D3D12_VIDEO_DECODE_CONFIGURATION_FLAG_ALLOW_RESOLUTION_CHANGE_ON_NON_KEY_FRAME = 0x8, +} D3D12_VIDEO_DECODE_CONFIGURATION_FLAGS; + +typedef enum D3D12_VIDEO_DECODE_TIER +{ + D3D12_VIDEO_DECODE_TIER_NOT_SUPPORTED, + D3D12_VIDEO_DECODE_TIER_1, + D3D12_VIDEO_DECODE_TIER_2, + D3D12_VIDEO_DECODE_TIER_3, +} D3D12_VIDEO_DECODE_TIER; + + +interface ID3D12VideoDecoderHeap; + + +typedef struct D3D12_VIDEO_DECODE_CONFIGURATION +{ + GUID DecodeProfile; + D3D12_BITSTREAM_ENCRYPTION_TYPE BitstreamEncryption; + D3D12_VIDEO_FRAME_CODED_INTERLACE_TYPE InterlaceType; +} D3D12_VIDEO_DECODE_CONFIGURATION; + +typedef struct D3D12_VIDEO_DECODER_DESC +{ + UINT NodeMask; + D3D12_VIDEO_DECODE_CONFIGURATION Configuration; +} D3D12_VIDEO_DECODER_DESC; + +typedef struct D3D12_VIDEO_DECODER_HEAP_DESC +{ + UINT NodeMask; + D3D12_VIDEO_DECODE_CONFIGURATION Configuration; + UINT DecodeWidth; + UINT DecodeHeight; + DXGI_FORMAT Format; + DXGI_RATIONAL FrameRate; + UINT BitRate; + UINT MaxDecodePictureBufferCount; +} D3D12_VIDEO_DECODER_HEAP_DESC; + +typedef struct D3D12_VIDEO_PROCESS_OUTPUT_STREAM_DESC +{ + DXGI_FORMAT Format; + DXGI_COLOR_SPACE_TYPE ColorSpace; + D3D12_VIDEO_PROCESS_ALPHA_FILL_MODE AlphaFillMode; + UINT AlphaFillModeSourceStreamIndex; + FLOAT BackgroundColor[4]; + DXGI_RATIONAL FrameRate; + BOOL EnableStereo; +} D3D12_VIDEO_PROCESS_OUTPUT_STREAM_DESC; + +typedef struct D3D12_VIDEO_SIZE_RANGE +{ + UINT MaxWidth; + UINT MaxHeight; + UINT MinWidth; + UINT MinHeight; +} D3D12_VIDEO_SIZE_RANGE; + +typedef struct D3D12_VIDEO_PROCESS_LUMA_KEY +{ + BOOL Enable; + FLOAT Lower; + FLOAT Upper; +} D3D12_VIDEO_PROCESS_LUMA_KEY; + +typedef struct D3D12_VIDEO_PROCESS_INPUT_STREAM_DESC +{ + DXGI_FORMAT Format; + DXGI_COLOR_SPACE_TYPE ColorSpace; + DXGI_RATIONAL SourceAspectRatio; + DXGI_RATIONAL DestinationAspectRatio; + DXGI_RATIONAL FrameRate; + D3D12_VIDEO_SIZE_RANGE SourceSizeRange; + D3D12_VIDEO_SIZE_RANGE DestinationSizeRange; + BOOL EnableOrientation; + D3D12_VIDEO_PROCESS_FILTER_FLAGS FilterFlags; + D3D12_VIDEO_FRAME_STEREO_FORMAT StereoFormat; + D3D12_VIDEO_FIELD_TYPE FieldType; + D3D12_VIDEO_PROCESS_DEINTERLACE_FLAGS DeinterlaceMode; + BOOL EnableAlphaBlending; + D3D12_VIDEO_PROCESS_LUMA_KEY LumaKey; + UINT NumPastFrames; + UINT NumFutureFrames; + BOOL EnableAutoProcessing; +} D3D12_VIDEO_PROCESS_INPUT_STREAM_DESC; + +typedef struct D3D12_FEATURE_DATA_VIDEO_DECODE_PROFILE_COUNT +{ + UINT NodeIndex; + UINT ProfileCount; +} D3D12_FEATURE_DATA_VIDEO_DECODE_PROFILE_COUNT; + +typedef struct D3D12_FEATURE_DATA_VIDEO_DECODE_PROFILES +{ + UINT NodeIndex; + UINT ProfileCount; + GUID *pProfiles; +} D3D12_FEATURE_DATA_VIDEO_DECODE_PROFILES; + +typedef struct D3D12_FEATURE_DATA_VIDEO_DECODE_FORMAT_COUNT +{ + UINT NodeIndex; + D3D12_VIDEO_DECODE_CONFIGURATION Configuration; + UINT FormatCount; +} D3D12_FEATURE_DATA_VIDEO_DECODE_FORMAT_COUNT; + +typedef struct D3D12_FEATURE_DATA_VIDEO_DECODE_FORMATS +{ + UINT NodeIndex; + D3D12_VIDEO_DECODE_CONFIGURATION Configuration; + UINT FormatCount; + DXGI_FORMAT *pOutputFormats; +} D3D12_FEATURE_DATA_VIDEO_DECODE_FORMATS; + +typedef struct D3D12_FEATURE_DATA_VIDEO_DECODE_SUPPORT +{ + UINT NodeIndex; + D3D12_VIDEO_DECODE_CONFIGURATION Configuration; + UINT Width; + UINT Height; + DXGI_FORMAT DecodeFormat; + DXGI_RATIONAL FrameRate; + UINT BitRate; + D3D12_VIDEO_DECODE_SUPPORT_FLAGS SupportFlags; + D3D12_VIDEO_DECODE_CONFIGURATION_FLAGS ConfigurationFlags; + D3D12_VIDEO_DECODE_TIER DecodeTier; +} D3D12_FEATURE_DATA_VIDEO_DECODE_SUPPORT; + +typedef struct D3D12_VIDEO_DECODE_CONVERSION_ARGUMENTS +{ + BOOL Enable; + ID3D12Resource *pReferenceTexture2D; + UINT ReferenceSubresource; + DXGI_COLOR_SPACE_TYPE OutputColorSpace; + DXGI_COLOR_SPACE_TYPE DecodeColorSpace; +} D3D12_VIDEO_DECODE_CONVERSION_ARGUMENTS; + +typedef struct D3D12_VIDEO_DECODE_OUTPUT_STREAM_ARGUMENTS +{ + ID3D12Resource *pOutputTexture2D; + UINT OutputSubresource; + D3D12_VIDEO_DECODE_CONVERSION_ARGUMENTS ConversionArguments; +} D3D12_VIDEO_DECODE_OUTPUT_STREAM_ARGUMENTS; + +typedef struct D3D12_VIDEO_DECODE_FRAME_ARGUMENT +{ + D3D12_VIDEO_DECODE_ARGUMENT_TYPE Type; + UINT Size; + void *pData; +} D3D12_VIDEO_DECODE_FRAME_ARGUMENT; + +typedef struct D3D12_VIDEO_DECODE_REFERENCE_FRAMES +{ + UINT NumTexture2Ds; + ID3D12Resource **ppTexture2Ds; + UINT *pSubresources; + ID3D12VideoDecoderHeap **ppHeaps; +} D3D12_VIDEO_DECODE_REFERENCE_FRAMES; + +typedef struct D3D12_VIDEO_DECODE_COMPRESSED_BITSTREAM +{ + ID3D12Resource *pBuffer; + UINT64 Offset; + UINT64 Size; +} D3D12_VIDEO_DECODE_COMPRESSED_BITSTREAM; + +typedef struct D3D12_VIDEO_DECODE_INPUT_STREAM_ARGUMENTS +{ + UINT NumFrameArguments; + D3D12_VIDEO_DECODE_FRAME_ARGUMENT FrameArguments[10]; + D3D12_VIDEO_DECODE_REFERENCE_FRAMES ReferenceFrames; + D3D12_VIDEO_DECODE_COMPRESSED_BITSTREAM CompressedBitstream; + ID3D12VideoDecoderHeap *pHeap; +} D3D12_VIDEO_DECODE_INPUT_STREAM_ARGUMENTS; + + +[ + uuid(1F052807-0B46-4ACC-8A89-364F793718A4), + object, + local, + pointer_default(unique) +] +interface ID3D12VideoDevice : IUnknown +{ + HRESULT CheckFeatureSupport(D3D12_FEATURE_VIDEO FeatureVideo, + void *pFeatureSupportData, + UINT FeatureSupportDataSize); + + HRESULT CreateVideoDecoder(const D3D12_VIDEO_DECODER_DESC *pDesc, + REFIID riid, + void **ppVideoDecoder); + + HRESULT CreateVideoDecoderHeap(const D3D12_VIDEO_DECODER_HEAP_DESC *pVideoDecoderHeapDesc, + REFIID riid, + void **ppVideoDecoderHeap); + + HRESULT CreateVideoProcessor(UINT NodeMask, + const D3D12_VIDEO_PROCESS_OUTPUT_STREAM_DESC *pOutputStreamDesc, + UINT NumInputStreamDescs, + const D3D12_VIDEO_PROCESS_INPUT_STREAM_DESC *pInputStreamDescs, + REFIID riid, + void **ppVideoProcessor); +} + +[ + uuid(C59B6BDC-7720-4074-A136-17A156037470), + object, + local, + pointer_default(unique) +] +interface ID3D12VideoDecoder : ID3D12Pageable +{ + D3D12_VIDEO_DECODER_DESC GetDesc(); +} + +[ + uuid(0946B7C9-EBF6-4047-BB73-8683E27DBB1F), + object, + local, + pointer_default(unique) +] +interface ID3D12VideoDecoderHeap : ID3D12Pageable +{ + D3D12_VIDEO_DECODER_HEAP_DESC GetDesc(); +} + +[ + uuid(3B60536E-AD29-4E64-A269-F853837E5E53), + object, + local, + pointer_default(unique) +] +interface ID3D12VideoDecodeCommandList : ID3D12CommandList +{ + HRESULT Close(); + + HRESULT Reset(ID3D12CommandAllocator *pAllocator); + + void ClearState(); + + void ResourceBarrier(UINT NumBarriers, const D3D12_RESOURCE_BARRIER *pBarriers); + + void DiscardResource(ID3D12Resource *pResource, const D3D12_DISCARD_REGION *pRegion); + + void BeginQuery(ID3D12QueryHeap *pQueryHeap, D3D12_QUERY_TYPE Type, UINT Index); + + void EndQuery(ID3D12QueryHeap *pQueryHeap, D3D12_QUERY_TYPE Type, UINT Index); + + void ResolveQueryData(ID3D12QueryHeap *pQueryHeap, D3D12_QUERY_TYPE Type, UINT StartIndex, + UINT NumQueries, ID3D12Resource *pDestinationBuffer, + UINT64 AlignedDestinationBufferOffset); + + void SetPredication(ID3D12Resource *pBuffer, UINT64 AlignedBufferOffset, + D3D12_PREDICATION_OP Operation); + + void SetMarker(UINT Metadata, const void *pData, UINT Size); + + void BeginEvent(UINT Metadata, const void *pData, UINT Size); + + void EndEvent(); + + void DecodeFrame(ID3D12VideoDecoder *pDecoder, + const D3D12_VIDEO_DECODE_OUTPUT_STREAM_ARGUMENTS *pOutputArguments, + const D3D12_VIDEO_DECODE_INPUT_STREAM_ARGUMENTS *pInputArguments); + + void WriteBufferImmediate(UINT Count, + const D3D12_WRITEBUFFERIMMEDIATE_PARAMETER *pParams, + const D3D12_WRITEBUFFERIMMEDIATE_MODE *pModes); +}
d3dx12.h is a useful MIT licensed header from Microsoft to help do regular things with D3D12 (in C++). It's usable with mingw (and thus wine) with these additions.
Signed-off-by: Steve Lhomme robux4@ycbcr.xyz --- include/d3d12.idl | 77 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 77 insertions(+)
diff --git a/include/d3d12.idl b/include/d3d12.idl index 42f33a06e40..056e078ab9d 100644 --- a/include/d3d12.idl +++ b/include/d3d12.idl @@ -75,6 +75,9 @@ const UINT D3D12_UAV_COUNTER_PLACEMENT_ALIGNMENT = 4096; const UINT D3D12_VS_INPUT_REGISTER_COUNT = 32; const UINT D3D12_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE = 16;
+cpp_quote("#define D3D12_MIN_DEPTH ( 0.0f )") +cpp_quote("#define D3D12_MAX_DEPTH ( 1.0f )") + cpp_quote("#endif")
const UINT D3D12_SHADER_COMPONENT_MAPPING_MASK = 0x7; @@ -2005,6 +2008,80 @@ typedef enum D3D12_PREDICATION_OP D3D12_PREDICATION_OP_NOT_EQUAL_ZERO = 1, } D3D12_PREDICATION_OP;
+typedef enum D3D12_VIEW_INSTANCING_FLAGS +{ + D3D12_VIEW_INSTANCING_FLAG_NONE, + D3D12_VIEW_INSTANCING_FLAG_ENABLE_VIEW_INSTANCE_MASKING +} D3D12_VIEW_INSTANCING_FLAGS; + +typedef enum D3D12_PIPELINE_STATE_SUBOBJECT_TYPE +{ + D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_ROOT_SIGNATURE, + D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_VS, + D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_PS, + D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_DS, + D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_HS, + D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_GS, + D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_CS, + D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_STREAM_OUTPUT, + D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_BLEND, + D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_SAMPLE_MASK, + D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_RASTERIZER, + D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_DEPTH_STENCIL, + D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_INPUT_LAYOUT, + D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_IB_STRIP_CUT_VALUE, + D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_PRIMITIVE_TOPOLOGY, + D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_RENDER_TARGET_FORMATS, + D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_DEPTH_STENCIL_FORMAT, + D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_SAMPLE_DESC, + D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_NODE_MASK, + D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_CACHED_PSO, + D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_FLAGS, + D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_DEPTH_STENCIL1, + D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_VIEW_INSTANCING, + D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_AS, + D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_MS, + D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_MAX_VALID +} D3D12_PIPELINE_STATE_SUBOBJECT_TYPE; + +typedef struct D3D12_DEPTH_STENCIL_DESC1 +{ + BOOL DepthEnable; + D3D12_DEPTH_WRITE_MASK DepthWriteMask; + D3D12_COMPARISON_FUNC DepthFunc; + BOOL StencilEnable; + UINT8 StencilReadMask; + UINT8 StencilWriteMask; + D3D12_DEPTH_STENCILOP_DESC FrontFace; + D3D12_DEPTH_STENCILOP_DESC BackFace; + BOOL DepthBoundsTestEnable; +} D3D12_DEPTH_STENCIL_DESC1; + +typedef struct D3D12_VIEW_INSTANCE_LOCATION +{ + UINT ViewportArrayIndex; + UINT RenderTargetArrayIndex; +} D3D12_VIEW_INSTANCE_LOCATION; + +typedef struct D3D12_VIEW_INSTANCING_DESC +{ + UINT ViewInstanceCount; + const D3D12_VIEW_INSTANCE_LOCATION *pViewInstanceLocations; + D3D12_VIEW_INSTANCING_FLAGS Flags; +} D3D12_VIEW_INSTANCING_DESC; + +typedef struct D3D12_RT_FORMAT_ARRAY +{ + DXGI_FORMAT RTFormats[8]; + UINT NumRenderTargets; +} D3D12_RT_FORMAT_ARRAY; + +typedef struct D3D12_PIPELINE_STATE_STREAM_DESC +{ + SIZE_T SizeInBytes; + void *pPipelineStateSubobjectStream; +} D3D12_PIPELINE_STATE_STREAM_DESC; + [ uuid(8efb471d-616c-4f49-90f7-127bb763fa51), object,
Signed-off-by: Steve Lhomme robux4@ycbcr.xyz --- include/d3d12.idl | 3 + include/d3d12video.idl | 378 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 381 insertions(+) create mode 100644 include/d3d12video.idl
diff --git a/include/d3d12.idl b/include/d3d12.idl index 056e078ab9d..08ec5b9e2d3 100644 --- a/include/d3d12.idl +++ b/include/d3d12.idl @@ -1633,6 +1633,9 @@ typedef enum D3D12_COMMAND_LIST_TYPE D3D12_COMMAND_LIST_TYPE_BUNDLE = 1, D3D12_COMMAND_LIST_TYPE_COMPUTE = 2, D3D12_COMMAND_LIST_TYPE_COPY = 3, + D3D12_COMMAND_LIST_TYPE_VIDEO_DECODE = 4, + D3D12_COMMAND_LIST_TYPE_VIDEO_PROCESS = 5, + D3D12_COMMAND_LIST_TYPE_VIDEO_ENCODE = 6 } D3D12_COMMAND_LIST_TYPE;
typedef enum D3D12_COMMAND_QUEUE_PRIORITY diff --git a/include/d3d12video.idl b/include/d3d12video.idl new file mode 100644 index 00000000000..49aa8eea8d8 --- /dev/null +++ b/include/d3d12video.idl @@ -0,0 +1,378 @@ +import "d3d12.idl"; + +typedef enum D3D12_FEATURE_VIDEO +{ + D3D12_FEATURE_VIDEO_DECODE_SUPPORT = 0, + D3D12_FEATURE_VIDEO_DECODE_PROFILES = 1, + D3D12_FEATURE_VIDEO_DECODE_FORMATS = 2, + D3D12_FEATURE_VIDEO_DECODE_CONVERSION_SUPPORT = 3, + D3D12_FEATURE_VIDEO_PROCESS_SUPPORT = 5, + D3D12_FEATURE_VIDEO_PROCESS_MAX_INPUT_STREAMS = 6, + D3D12_FEATURE_VIDEO_PROCESS_REFERENCE_INFO = 7, + D3D12_FEATURE_VIDEO_DECODER_HEAP_SIZE = 8, + D3D12_FEATURE_VIDEO_PROCESSOR_SIZE = 9, + D3D12_FEATURE_VIDEO_DECODE_PROFILE_COUNT = 10, + D3D12_FEATURE_VIDEO_DECODE_FORMAT_COUNT = 11, + D3D12_FEATURE_VIDEO_ARCHITECTURE = 17, + D3D12_FEATURE_VIDEO_DECODE_HISTOGRAM = 18, + D3D12_FEATURE_VIDEO_FEATURE_AREA_SUPPORT = 19, + D3D12_FEATURE_VIDEO_MOTION_ESTIMATOR = 20, + D3D12_FEATURE_VIDEO_MOTION_ESTIMATOR_SIZE = 21, + D3D12_FEATURE_VIDEO_EXTENSION_COMMAND_COUNT = 22, + D3D12_FEATURE_VIDEO_EXTENSION_COMMANDS = 23, + D3D12_FEATURE_VIDEO_EXTENSION_COMMAND_PARAMETER_COUNT = 24, + D3D12_FEATURE_VIDEO_EXTENSION_COMMAND_PARAMETERS = 25, + D3D12_FEATURE_VIDEO_EXTENSION_COMMAND_SUPPORT = 26, + D3D12_FEATURE_VIDEO_EXTENSION_COMMAND_SIZE = 27, + D3D12_FEATURE_VIDEO_DECODE_PROTECTED_RESOURCES = 28, + D3D12_FEATURE_VIDEO_PROCESS_PROTECTED_RESOURCES = 29, + D3D12_FEATURE_VIDEO_MOTION_ESTIMATOR_PROTECTED_RESOURCES = 30, + D3D12_FEATURE_VIDEO_DECODER_HEAP_SIZE1 = 31, + D3D12_FEATURE_VIDEO_PROCESSOR_SIZE1 = 32 +} D3D12_FEATURE_VIDEO; + +typedef enum D3D12_BITSTREAM_ENCRYPTION_TYPE +{ + D3D12_BITSTREAM_ENCRYPTION_TYPE_NONE +} D3D12_BITSTREAM_ENCRYPTION_TYPE; + +typedef enum D3D12_VIDEO_FRAME_CODED_INTERLACE_TYPE +{ + D3D12_VIDEO_FRAME_CODED_INTERLACE_TYPE_NONE, + D3D12_VIDEO_FRAME_CODED_INTERLACE_TYPE_FIELD_BASED +} D3D12_VIDEO_FRAME_CODED_INTERLACE_TYPE; + +typedef enum D3D12_VIDEO_PROCESS_ALPHA_FILL_MODE +{ + D3D12_VIDEO_PROCESS_ALPHA_FILL_MODE_OPAQUE, + D3D12_VIDEO_PROCESS_ALPHA_FILL_MODE_BACKGROUND, + D3D12_VIDEO_PROCESS_ALPHA_FILL_MODE_DESTINATION, + D3D12_VIDEO_PROCESS_ALPHA_FILL_MODE_SOURCE_STREAM +} D3D12_VIDEO_PROCESS_ALPHA_FILL_MODE; + +typedef enum D3D12_VIDEO_PROCESS_FILTER_FLAGS +{ + D3D12_VIDEO_PROCESS_FILTER_FLAG_NONE, + D3D12_VIDEO_PROCESS_FILTER_FLAG_BRIGHTNESS, + D3D12_VIDEO_PROCESS_FILTER_FLAG_CONTRAST, + D3D12_VIDEO_PROCESS_FILTER_FLAG_HUE, + D3D12_VIDEO_PROCESS_FILTER_FLAG_SATURATION, + D3D12_VIDEO_PROCESS_FILTER_FLAG_NOISE_REDUCTION, + D3D12_VIDEO_PROCESS_FILTER_FLAG_EDGE_ENHANCEMENT, + D3D12_VIDEO_PROCESS_FILTER_FLAG_ANAMORPHIC_SCALING, + D3D12_VIDEO_PROCESS_FILTER_FLAG_STEREO_ADJUSTMENT +} D3D12_VIDEO_PROCESS_FILTER_FLAGS; + +typedef enum D3D12_VIDEO_FRAME_STEREO_FORMAT +{ + D3D12_VIDEO_FRAME_STEREO_FORMAT_NONE, + D3D12_VIDEO_FRAME_STEREO_FORMAT_MONO, + D3D12_VIDEO_FRAME_STEREO_FORMAT_HORIZONTAL, + D3D12_VIDEO_FRAME_STEREO_FORMAT_VERTICAL, + D3D12_VIDEO_FRAME_STEREO_FORMAT_SEPARATE +} D3D12_VIDEO_FRAME_STEREO_FORMAT; + +typedef enum D3D12_VIDEO_FIELD_TYPE +{ + D3D12_VIDEO_FIELD_TYPE_NONE, + D3D12_VIDEO_FIELD_TYPE_INTERLACED_TOP_FIELD_FIRST, + D3D12_VIDEO_FIELD_TYPE_INTERLACED_BOTTOM_FIELD_FIRST +} D3D12_VIDEO_FIELD_TYPE; + +typedef enum D3D12_VIDEO_PROCESS_DEINTERLACE_FLAGS +{ + D3D12_VIDEO_PROCESS_DEINTERLACE_FLAG_NONE, + D3D12_VIDEO_PROCESS_DEINTERLACE_FLAG_BOB, + D3D12_VIDEO_PROCESS_DEINTERLACE_FLAG_CUSTOM +} D3D12_VIDEO_PROCESS_DEINTERLACE_FLAGS; + +typedef enum D3D12_VIDEO_DECODE_ARGUMENT_TYPE +{ + D3D12_VIDEO_DECODE_ARGUMENT_TYPE_PICTURE_PARAMETERS, + D3D12_VIDEO_DECODE_ARGUMENT_TYPE_INVERSE_QUANTIZATION_MATRIX, + D3D12_VIDEO_DECODE_ARGUMENT_TYPE_SLICE_CONTROL, + D3D12_VIDEO_DECODE_ARGUMENT_TYPE_MAX_VALID +} D3D12_VIDEO_DECODE_ARGUMENT_TYPE; + +typedef enum D3D12_VIDEO_DECODE_SUPPORT_FLAGS +{ + D3D12_VIDEO_DECODE_SUPPORT_FLAG_NONE = 0x0, + D3D12_VIDEO_DECODE_SUPPORT_FLAG_SUPPORTED = 0x1, +} D3D12_VIDEO_DECODE_SUPPORT_FLAGS; + +typedef enum D3D12_VIDEO_DECODE_CONFIGURATION_FLAGS +{ + D3D12_VIDEO_DECODE_CONFIGURATION_FLAG_NONE = 0x0, + D3D12_VIDEO_DECODE_CONFIGURATION_FLAG_HEIGHT_ALIGNMENT_MULTIPLE_32_REQUIRED = 0x1, + D3D12_VIDEO_DECODE_CONFIGURATION_FLAG_POST_PROCESSING_SUPPORTED = 0x2, + D3D12_VIDEO_DECODE_CONFIGURATION_FLAG_REFERENCE_ONLY_ALLOCATIONS_REQUIRED = 0x4, + D3D12_VIDEO_DECODE_CONFIGURATION_FLAG_ALLOW_RESOLUTION_CHANGE_ON_NON_KEY_FRAME = 0x8, +} D3D12_VIDEO_DECODE_CONFIGURATION_FLAGS; + +typedef enum D3D12_VIDEO_DECODE_TIER +{ + D3D12_VIDEO_DECODE_TIER_NOT_SUPPORTED, + D3D12_VIDEO_DECODE_TIER_1, + D3D12_VIDEO_DECODE_TIER_2, + D3D12_VIDEO_DECODE_TIER_3, +} D3D12_VIDEO_DECODE_TIER; + + +interface ID3D12VideoDecoderHeap; + + +typedef struct D3D12_VIDEO_DECODE_CONFIGURATION +{ + GUID DecodeProfile; + D3D12_BITSTREAM_ENCRYPTION_TYPE BitstreamEncryption; + D3D12_VIDEO_FRAME_CODED_INTERLACE_TYPE InterlaceType; +} D3D12_VIDEO_DECODE_CONFIGURATION; + +typedef struct D3D12_VIDEO_DECODER_DESC +{ + UINT NodeMask; + D3D12_VIDEO_DECODE_CONFIGURATION Configuration; +} D3D12_VIDEO_DECODER_DESC; + +typedef struct D3D12_VIDEO_DECODER_HEAP_DESC +{ + UINT NodeMask; + D3D12_VIDEO_DECODE_CONFIGURATION Configuration; + UINT DecodeWidth; + UINT DecodeHeight; + DXGI_FORMAT Format; + DXGI_RATIONAL FrameRate; + UINT BitRate; + UINT MaxDecodePictureBufferCount; +} D3D12_VIDEO_DECODER_HEAP_DESC; + +typedef struct D3D12_VIDEO_PROCESS_OUTPUT_STREAM_DESC +{ + DXGI_FORMAT Format; + DXGI_COLOR_SPACE_TYPE ColorSpace; + D3D12_VIDEO_PROCESS_ALPHA_FILL_MODE AlphaFillMode; + UINT AlphaFillModeSourceStreamIndex; + FLOAT BackgroundColor[4]; + DXGI_RATIONAL FrameRate; + BOOL EnableStereo; +} D3D12_VIDEO_PROCESS_OUTPUT_STREAM_DESC; + +typedef struct D3D12_VIDEO_SIZE_RANGE +{ + UINT MaxWidth; + UINT MaxHeight; + UINT MinWidth; + UINT MinHeight; +} D3D12_VIDEO_SIZE_RANGE; + +typedef struct D3D12_VIDEO_PROCESS_LUMA_KEY +{ + BOOL Enable; + FLOAT Lower; + FLOAT Upper; +} D3D12_VIDEO_PROCESS_LUMA_KEY; + +typedef struct D3D12_VIDEO_PROCESS_INPUT_STREAM_DESC +{ + DXGI_FORMAT Format; + DXGI_COLOR_SPACE_TYPE ColorSpace; + DXGI_RATIONAL SourceAspectRatio; + DXGI_RATIONAL DestinationAspectRatio; + DXGI_RATIONAL FrameRate; + D3D12_VIDEO_SIZE_RANGE SourceSizeRange; + D3D12_VIDEO_SIZE_RANGE DestinationSizeRange; + BOOL EnableOrientation; + D3D12_VIDEO_PROCESS_FILTER_FLAGS FilterFlags; + D3D12_VIDEO_FRAME_STEREO_FORMAT StereoFormat; + D3D12_VIDEO_FIELD_TYPE FieldType; + D3D12_VIDEO_PROCESS_DEINTERLACE_FLAGS DeinterlaceMode; + BOOL EnableAlphaBlending; + D3D12_VIDEO_PROCESS_LUMA_KEY LumaKey; + UINT NumPastFrames; + UINT NumFutureFrames; + BOOL EnableAutoProcessing; +} D3D12_VIDEO_PROCESS_INPUT_STREAM_DESC; + +typedef struct D3D12_FEATURE_DATA_VIDEO_DECODE_PROFILE_COUNT +{ + UINT NodeIndex; + UINT ProfileCount; +} D3D12_FEATURE_DATA_VIDEO_DECODE_PROFILE_COUNT; + +typedef struct D3D12_FEATURE_DATA_VIDEO_DECODE_PROFILES +{ + UINT NodeIndex; + UINT ProfileCount; + GUID *pProfiles; +} D3D12_FEATURE_DATA_VIDEO_DECODE_PROFILES; + +typedef struct D3D12_FEATURE_DATA_VIDEO_DECODE_FORMAT_COUNT +{ + UINT NodeIndex; + D3D12_VIDEO_DECODE_CONFIGURATION Configuration; + UINT FormatCount; +} D3D12_FEATURE_DATA_VIDEO_DECODE_FORMAT_COUNT; + +typedef struct D3D12_FEATURE_DATA_VIDEO_DECODE_FORMATS +{ + UINT NodeIndex; + D3D12_VIDEO_DECODE_CONFIGURATION Configuration; + UINT FormatCount; + DXGI_FORMAT *pOutputFormats; +} D3D12_FEATURE_DATA_VIDEO_DECODE_FORMATS; + +typedef struct D3D12_FEATURE_DATA_VIDEO_DECODE_SUPPORT +{ + UINT NodeIndex; + D3D12_VIDEO_DECODE_CONFIGURATION Configuration; + UINT Width; + UINT Height; + DXGI_FORMAT DecodeFormat; + DXGI_RATIONAL FrameRate; + UINT BitRate; + D3D12_VIDEO_DECODE_SUPPORT_FLAGS SupportFlags; + D3D12_VIDEO_DECODE_CONFIGURATION_FLAGS ConfigurationFlags; + D3D12_VIDEO_DECODE_TIER DecodeTier; +} D3D12_FEATURE_DATA_VIDEO_DECODE_SUPPORT; + +typedef struct D3D12_VIDEO_DECODE_CONVERSION_ARGUMENTS +{ + BOOL Enable; + ID3D12Resource *pReferenceTexture2D; + UINT ReferenceSubresource; + DXGI_COLOR_SPACE_TYPE OutputColorSpace; + DXGI_COLOR_SPACE_TYPE DecodeColorSpace; +} D3D12_VIDEO_DECODE_CONVERSION_ARGUMENTS; + +typedef struct D3D12_VIDEO_DECODE_OUTPUT_STREAM_ARGUMENTS +{ + ID3D12Resource *pOutputTexture2D; + UINT OutputSubresource; + D3D12_VIDEO_DECODE_CONVERSION_ARGUMENTS ConversionArguments; +} D3D12_VIDEO_DECODE_OUTPUT_STREAM_ARGUMENTS; + +typedef struct D3D12_VIDEO_DECODE_FRAME_ARGUMENT +{ + D3D12_VIDEO_DECODE_ARGUMENT_TYPE Type; + UINT Size; + void *pData; +} D3D12_VIDEO_DECODE_FRAME_ARGUMENT; + +typedef struct D3D12_VIDEO_DECODE_REFERENCE_FRAMES +{ + UINT NumTexture2Ds; + ID3D12Resource **ppTexture2Ds; + UINT *pSubresources; + ID3D12VideoDecoderHeap **ppHeaps; +} D3D12_VIDEO_DECODE_REFERENCE_FRAMES; + +typedef struct D3D12_VIDEO_DECODE_COMPRESSED_BITSTREAM +{ + ID3D12Resource *pBuffer; + UINT64 Offset; + UINT64 Size; +} D3D12_VIDEO_DECODE_COMPRESSED_BITSTREAM; + +typedef struct D3D12_VIDEO_DECODE_INPUT_STREAM_ARGUMENTS +{ + UINT NumFrameArguments; + D3D12_VIDEO_DECODE_FRAME_ARGUMENT FrameArguments[10]; + D3D12_VIDEO_DECODE_REFERENCE_FRAMES ReferenceFrames; + D3D12_VIDEO_DECODE_COMPRESSED_BITSTREAM CompressedBitstream; + ID3D12VideoDecoderHeap *pHeap; +} D3D12_VIDEO_DECODE_INPUT_STREAM_ARGUMENTS; + + +[ + uuid(1F052807-0B46-4ACC-8A89-364F793718A4), + object, + local, + pointer_default(unique) +] +interface ID3D12VideoDevice : IUnknown +{ + HRESULT CheckFeatureSupport(D3D12_FEATURE_VIDEO FeatureVideo, + void *pFeatureSupportData, + UINT FeatureSupportDataSize); + + HRESULT CreateVideoDecoder(const D3D12_VIDEO_DECODER_DESC *pDesc, + REFIID riid, + void **ppVideoDecoder); + + HRESULT CreateVideoDecoderHeap(const D3D12_VIDEO_DECODER_HEAP_DESC *pVideoDecoderHeapDesc, + REFIID riid, + void **ppVideoDecoderHeap); + + HRESULT CreateVideoProcessor(UINT NodeMask, + const D3D12_VIDEO_PROCESS_OUTPUT_STREAM_DESC *pOutputStreamDesc, + UINT NumInputStreamDescs, + const D3D12_VIDEO_PROCESS_INPUT_STREAM_DESC *pInputStreamDescs, + REFIID riid, + void **ppVideoProcessor); +} + +[ + uuid(C59B6BDC-7720-4074-A136-17A156037470), + object, + local, + pointer_default(unique) +] +interface ID3D12VideoDecoder : ID3D12Pageable +{ + D3D12_VIDEO_DECODER_DESC GetDesc(); +} + +[ + uuid(0946B7C9-EBF6-4047-BB73-8683E27DBB1F), + object, + local, + pointer_default(unique) +] +interface ID3D12VideoDecoderHeap : ID3D12Pageable +{ + D3D12_VIDEO_DECODER_HEAP_DESC GetDesc(); +} + +[ + uuid(3B60536E-AD29-4E64-A269-F853837E5E53), + object, + local, + pointer_default(unique) +] +interface ID3D12VideoDecodeCommandList : ID3D12CommandList +{ + HRESULT Close(); + + HRESULT Reset(ID3D12CommandAllocator *pAllocator); + + void ClearState(); + + void ResourceBarrier(UINT NumBarriers, const D3D12_RESOURCE_BARRIER *pBarriers); + + void DiscardResource(ID3D12Resource *pResource, const D3D12_DISCARD_REGION *pRegion); + + void BeginQuery(ID3D12QueryHeap *pQueryHeap, D3D12_QUERY_TYPE Type, UINT Index); + + void EndQuery(ID3D12QueryHeap *pQueryHeap, D3D12_QUERY_TYPE Type, UINT Index); + + void ResolveQueryData(ID3D12QueryHeap *pQueryHeap, D3D12_QUERY_TYPE Type, UINT StartIndex, + UINT NumQueries, ID3D12Resource *pDestinationBuffer, + UINT64 AlignedDestinationBufferOffset); + + void SetPredication(ID3D12Resource *pBuffer, UINT64 AlignedBufferOffset, + D3D12_PREDICATION_OP Operation); + + void SetMarker(UINT Metadata, const void *pData, UINT Size); + + void BeginEvent(UINT Metadata, const void *pData, UINT Size); + + void EndEvent(); + + void DecodeFrame(ID3D12VideoDecoder *pDecoder, + const D3D12_VIDEO_DECODE_OUTPUT_STREAM_ARGUMENTS *pOutputArguments, + const D3D12_VIDEO_DECODE_INPUT_STREAM_ARGUMENTS *pInputArguments); + + void WriteBufferImmediate(UINT Count, + const D3D12_WRITEBUFFERIMMEDIATE_PARAMETER *pParams, + const D3D12_WRITEBUFFERIMMEDIATE_MODE *pModes); +}