1 module aurora.directx.d3d11.d3d11_1;
2 
3 version(Windows):
4 
5 public import aurora.directx.d3d11.d3d11_0;
6 
7 public:
8 
9 ///
10 /// Constants
11 ///
12 
13 ///
14 /// Functions
15 ///
16 
17 ///
18 /// Enumerations
19 ///
20 
21 enum D3D11_COPY_FLAGS : uint
22 {
23     NO_OVERWRITE = 0x1,
24     DISCARD = 0x2
25 }
26 
27 enum D3D11_LOGIC_OP : uint
28 {
29     CLEAR	= 0,
30     SET	= ( CLEAR + 1 ) ,
31     COPY	= ( SET + 1 ) ,
32     COPY_INVERTED	= ( COPY + 1 ) ,
33     NOOP	= ( COPY_INVERTED + 1 ) ,
34     INVERT	= ( NOOP + 1 ) ,
35     AND	= ( INVERT + 1 ) ,
36     NAND	= ( AND + 1 ) ,
37     OR	= ( NAND + 1 ) ,
38     NOR	= ( OR + 1 ) ,
39     XOR	= ( NOR + 1 ) ,
40     EQUIV	= ( XOR + 1 ) ,
41     AND_REVERSE	= ( EQUIV + 1 ) ,
42     AND_INVERTED	= ( AND_REVERSE + 1 ) ,
43     OR_REVERSE	= ( AND_INVERTED + 1 ) ,
44     OR_INVERTED	= ( OR_REVERSE + 1 ) 
45 }
46 
47 enum D3D11_1_CREATE_DEVICE_CONTEXT_STATE_FLAG : uint
48 {
49     SINGLETHREADED	= 0x1
50 }
51 
52 enum D3D11_VIDEO_DECODER_CAPS : uint
53 {
54     DOWNSAMPLE	= 0x1,
55     NON_REAL_TIME	= 0x2,
56     DOWNSAMPLE_DYNAMIC	= 0x4,
57     DOWNSAMPLE_REQUIRED	= 0x8,
58     UNSUPPORTED	= 0x10
59 }
60 
61 enum D3D11_VIDEO_PROCESSOR_BEHAVIOR_HINTS : uint
62 {
63     MULTIPLANE_OVERLAY_ROTATION	= 0x1,
64     MULTIPLANE_OVERLAY_RESIZE	= 0x2,
65     MULTIPLANE_OVERLAY_COLOR_SPACE_CONVERSION	= 0x4,
66     TRIPLE_BUFFER_OUTPUT	= 0x8
67 }
68 
69 enum D3D11_CRYPTO_SESSION_STATUS : uint
70 {
71     OK	= 0,
72     KEY_LOST	= 1,
73     KEY_AND_CONTENT_LOST	= 2
74 }
75 
76 ///
77 /// Structures
78 ///
79 
80 struct D3D11_RENDER_TARGET_BLEND_DESC1
81 {
82 	bool           BlendEnable;
83 	bool           LogicOpEnable;
84 	D3D11_BLEND    SrcBlend;
85 	D3D11_BLEND    DestBlend;
86 	D3D11_BLEND_OP BlendOp;
87 	D3D11_BLEND    SrcBlendAlpha;
88 	D3D11_BLEND    DestBlendAlpha;
89 	D3D11_BLEND_OP BlendOpAlpha;
90 	D3D11_LOGIC_OP LogicOp;
91 	ubyte          RenderTargetWriteMask;
92 }
93 
94 struct D3D11_BLEND_DESC1
95 {
96     bool AlphaToCoverageEnable;
97     bool IndependentBlendEnable;
98     D3D11_RENDER_TARGET_BLEND_DESC1[8] RenderTarget;
99 }
100 
101 struct D3D11_RASTERIZER_DESC1 {
102 	D3D11_FILL_MODE FillMode;
103 	D3D11_CULL_MODE CullMode;
104 	bool            FrontCounterClockwise;
105 	int             DepthBias;
106 	float           DepthBiasClamp;
107 	float           SlopeScaledDepthBias;
108 	bool            DepthClipEnable;
109 	bool            ScissorEnable;
110 	bool            MultisampleEnable;
111 	bool            AntialiasedLineEnable;
112 	uint            ForcedSampleCount;
113 }
114 
115 struct D3D11_VIDEO_DECODER_SUB_SAMPLE_MAPPING_BLOCK
116 {
117     uint ClearSize;
118     uint EncryptedSize;
119 }
120 
121 struct D3D11_VIDEO_DECODER_BUFFER_DESC1
122 {
123     D3D11_VIDEO_DECODER_BUFFER_TYPE BufferType;
124     uint DataOffset;
125     uint DataSize;void *pIV;
126     uint IVSize;
127     D3D11_VIDEO_DECODER_SUB_SAMPLE_MAPPING_BLOCK *pSubSampleMappingBlock;
128     uint SubSampleMappingCount;
129 }
130 
131 struct D3D11_VIDEO_DECODER_BEGIN_FRAME_CRYPTO_SESSION
132 {
133     ID3D11CryptoSession pCryptoSession;
134     uint BlobSize;void *pBlob;
135     GUID *pKeyInfoId;
136     uint PrivateDataSize;
137     void *pPrivateData;
138 }
139 
140 struct D3D11_VIDEO_PROCESSOR_STREAM_BEHAVIOR_HINT
141 {
142     bool Enable;
143     uint Width;
144     uint Height;
145     DXGI_FORMAT Format;
146 }
147 
148 struct D3D11_KEY_EXCHANGE_HW_PROTECTION_INPUT_DATA
149 {
150     uint PrivateDataSize;
151     uint HWProtectionDataSize;
152     ubyte[4] pbInput;
153 }
154 
155 struct D3D11_KEY_EXCHANGE_HW_PROTECTION_OUTPUT_DATA
156     {
157     uint PrivateDataSize;
158     uint MaxHWProtectionDataSize;
159     uint HWProtectionDataSize;
160     ulong TransportTime;
161     ulong ExecutionTime;
162     ubyte[4] pbOutput;
163 }
164 
165 struct D3D11_KEY_EXCHANGE_HW_PROTECTION_DATA
166 {
167     uint HWProtectionFunctionID;
168     D3D11_KEY_EXCHANGE_HW_PROTECTION_INPUT_DATA *pInputData;
169     D3D11_KEY_EXCHANGE_HW_PROTECTION_OUTPUT_DATA *pOutputData;
170     HRESULT Status;
171 }
172 
173 struct D3D11_VIDEO_SAMPLE_DESC
174 {
175     uint Width;
176     uint Height;
177     DXGI_FORMAT Format;
178     DXGI_COLOR_SPACE_TYPE ColorSpace;
179 }
180 
181 ///
182 /// Interfaces
183 ///
184 
185 mixin(uuid!(ID3D11BlendState1, "cc86fabe-da55-401d-85e7-e3c9de2877e9"));
186 public interface ID3D11BlendState1 : ID3D11BlendState
187 {
188 extern(Windows):
189 	void GetDesc1(D3D11_BLEND_DESC1 *pDesc);
190 }
191 
192 mixin(uuid!(ID3D11RasterizerState1, "1217d7a6-5039-418c-b042-9cbe256afd6e"));
193 public interface ID3D11RasterizerState1 : ID3D11RasterizerState
194 {
195 extern(Windows):
196 	void GetDesc1(D3D11_RASTERIZER_DESC1 *pDesc);
197 }
198 
199 mixin(uuid!(ID3DDeviceContextState, "5c1e0d8a-7c23-48f9-8c59-a92958ceff11"));
200 public interface ID3DDeviceContextState : ID3D11DeviceChild
201 {
202 extern(Windows):
203 }
204 
205 mixin(uuid!(ID3D11DeviceContext1, "bb2c6faa-b5fb-4082-8e6b-388b8cfa90e1"));
206 public interface ID3D11DeviceContext1 : ID3D11DeviceContext
207 {
208 extern(Windows):
209 	void ClearView(ID3D11View pView, const(float[4]) Color, const(D3D11_RECT) *pRect, uint NumRects);
210 	void CopySubresourceRegion1(ID3D11Resource pDstResource, uint DstSubresource, uint DstX, uint DstY, uint DstZ, ID3D11Resource pSrcResource, uint SrcSubresource, const(D3D11_BOX) *pSrcBox, uint CopyFlags);
211 	void CSGetConstantBuffers1(uint StartSlot, uint NumBuffers, ID3D11Buffer *ppConstantBuffers, uint* pFirstConstant, uint* pNumConstants);
212 	void CSSetConstantBuffers1(uint StartSlot, uint NumBuffers, const(ID3D11Buffer) *ppConstantBuffers, const(uint)*pFirstConstant, const(uint)*pNumConstants);
213 	void DiscardResource(ID3D11Resource pResource);
214 	void DiscardView(ID3D11View pResourceView);
215 	void DiscardView1(ID3D11View pResourceView, const(D3D11_RECT) *pRects, uint NumRects);
216 	void DSGetConstantBuffers1(uint StartSlot, uint NumBuffers, ID3D11Buffer *ppConstantBuffers, uint* pFirstConstant, uint* pNumConstants);
217 	void DSSetConstantBuffers1(uint StartSlot, uint NumBuffers, const(ID3D11Buffer) *ppConstantBuffers, const(uint) *pFirstConstant, const(uint) *pNumConstants);
218 	void GSGetConstantBuffers1(uint StartSlot, uint NumBuffers, ID3D11Buffer *ppConstantBuffers, uint* pFirstConstant, uint* pNumConstants);
219 	void GSSetConstantBuffers1(uint StartSlot, uint NumBuffers, const(ID3D11Buffer) *ppConstantBuffers, const(uint) *pFirstConstant, const(uint) *pNumConstants);
220 	void HSGetConstantBuffers1(uint StartSlot, uint NumBuffers, ID3D11Buffer *ppConstantBuffers, uint* pFirstConstant, uint* pNumConstants);
221 	void HSSetConstantBuffers1(uint StartSlot, uint NumBuffers, const(ID3D11Buffer) *ppConstantBuffers, const(uint) *pFirstConstant, const(uint) *pNumConstants);
222 	void PSGetConstantBuffers1(uint StartSlot, uint NumBuffers, ID3D11Buffer *ppConstantBuffers, uint* pFirstConstant, uint* pNumConstants);
223 	void PSSetConstantBuffers1(uint StartSlot, uint NumBuffers, const(ID3D11Buffer) *ppConstantBuffers, const(uint) *pFirstConstant, const(uint) *pNumConstants);
224 	void SwapDeviceContextState(ID3DDeviceContextState pState, ID3DDeviceContextState *ppPreviousState);
225 	void UpdateSubresource1(ID3D11Resource pDstResource, uint DstSubresource, const(D3D11_BOX) *pDstBox, const(void) *pSrcData, uint SrcRowPitch, uint SrcDepthPitch, uint CopyFlags);
226 	void VSGetConstantBuffers1(uint StartSlot, uint NumBuffers, ID3D11Buffer *ppConstantBuffers, uint* pFirstConstant, uint* pNumConstants);
227 	void VSSetConstantBuffers1(uint StartSlot, uint NumBuffers, const(ID3D11Buffer) *ppConstantBuffers, const(uint) *pFirstConstant, const(uint) *pNumConstants);
228 }
229 
230 mixin(uuid!(ID3D11VideoContext1, "A7F026DA-A5F8-4487-A564-15E34357651E"));
231 public interface ID3D11VideoContext1 : ID3D11VideoContext
232 {
233 extern(Windows):
234     HRESULT CheckCryptoSessionStatus(ID3D11CryptoSession pCryptoSession, D3D11_CRYPTO_SESSION_STATUS *pStatus);
235     HRESULT DecoderEnableDownsampling(ID3D11VideoDecoder pDecoder, DXGI_COLOR_SPACE_TYPE InputColorSpace, const D3D11_VIDEO_SAMPLE_DESC *pOutputDesc, uint ReferenceFrameCount);
236     HRESULT DecoderUpdateDownsampling(ID3D11VideoDecoder pDecoder, const D3D11_VIDEO_SAMPLE_DESC *pOutputDesc);
237     HRESULT GetDataForNewHardwareKey(ID3D11CryptoSession pCryptoSession, uint PrivateInputSize, const void *pPrivatInputData, ulong *pPrivateOutputData);
238     HRESULT SubmitDecoderBuffers1(ID3D11VideoDecoder pDecoder, uint NumBuffers, const D3D11_VIDEO_DECODER_BUFFER_DESC1 *pBufferDesc);
239     HRESULT VideoProcessorGetBehaviorHints(ID3D11VideoProcessor pVideoProcessor, uint OutputWidth, uint OutputHeight, DXGI_FORMAT OutputFormat, uint StreamCount, const D3D11_VIDEO_PROCESSOR_STREAM_BEHAVIOR_HINT *pStreams, uint *pBehaviorHints);
240     void VideoProcessorGetOutputColorSpace1(ID3D11VideoProcessor pVideoProcessor, DXGI_COLOR_SPACE_TYPE *pColorSpace);
241     void VideoProcessorGetOutputShaderUsage(ID3D11VideoProcessor pVideoProcessor, bool *pShaderUsage);
242     void VideoProcessorGetStreamColorSpace1(ID3D11VideoProcessor pVideoProcessor, uint StreamIndex, DXGI_COLOR_SPACE_TYPE *pColorSpace);
243     void VideoProcessorGetStreamMirror(ID3D11VideoProcessor pVideoProcessor, uint StreamIndex, bool *pEnable, bool *pFlipHorizontal, bool *pFlipVertical);
244     void VideoProcessorSetOutputColorSpace1(ID3D11VideoProcessor pVideoProcessor, DXGI_COLOR_SPACE_TYPE ColorSpace);
245     void VideoProcessorSetOutputShaderUsage(ID3D11VideoProcessor pVideoProcessor, bool ShaderUsage);
246     void VideoProcessorSetStreamColorSpace1(ID3D11VideoProcessor pVideoProcessor, uint StreamIndex, DXGI_COLOR_SPACE_TYPE ColorSpace);
247     void VideoProcessorSetStreamMirror(ID3D11VideoProcessor pVideoProcessor, uint StreamIndex, bool Enable, bool FlipHorizontal, bool FlipVertical);
248 }
249 
250 mixin(uuid!(ID3D11VideoDevice1, "29DA1D51-1321-4454-804B-F5FC9F861F0F"));
251 public interface ID3D11VideoDevice1 : ID3D11VideoDevice
252 {
253 extern(Windows):
254     HRESULT CheckVideoDecoderDownsampling(const D3D11_VIDEO_DECODER_DESC *pInputDesc, DXGI_COLOR_SPACE_TYPE InputColorSpace, const D3D11_VIDEO_DECODER_CONFIG *pInputConfig, const DXGI_RATIONAL *pFrameRate, const D3D11_VIDEO_SAMPLE_DESC *pOutputDesc, bool *pSupported, bool *pRealTimeHint);
255     HRESULT GetCryptoSessionPrivateDataSize(const GUID *pCryptoType, const GUID *pDecoderProfile, const GUID *pKeyExchangeType, uint *pPrivateInputSize, uint *pPrivateOutputSize);
256     HRESULT GetVideoDecoderCaps(const GUID *pDecoderProfile, uint SampleWidth, uint SampleHeight, const DXGI_RATIONAL *pFrameRate, uint BitRate, const GUID *pCryptoType, uint *pDecoderCaps);
257     HRESULT RecommendVideoDecoderDownsampleParameters(const D3D11_VIDEO_DECODER_DESC *pInputDesc, DXGI_COLOR_SPACE_TYPE InputColorSpace, const D3D11_VIDEO_DECODER_CONFIG *pInputConfig, const DXGI_RATIONAL *pFrameRate, D3D11_VIDEO_SAMPLE_DESC *pRecommendedOutputDesc);
258 }
259 
260 mixin(uuid!(ID3D11VideoProcessorEnumerator1, "465217F2-5568-43CF-B5B9-F61D54531CA1"));
261 public interface ID3D11VideoProcessorEnumerator1 : ID3D11VideoProcessorEnumerator
262 {
263 extern(Windows):
264     HRESULT CheckVideoProcessorFormatConversion(DXGI_FORMAT InputFormat, DXGI_COLOR_SPACE_TYPE InputColorSpace, DXGI_FORMAT OutputFormat, DXGI_COLOR_SPACE_TYPE OutputColorSpace, bool *pSupported);
265 }
266 
267 mixin(uuid!(ID3D11Device1, "a04bfb29-08ef-43d6-a49c-a9bdbdcbe686"));
268 public interface ID3D11Device1 : ID3D11Device
269 {
270 extern(Windows):
271 	HRESULT CreateBlendState1(const D3D11_BLEND_DESC1 *pBlendStateDesc, ID3D11BlendState1 *ppBlendState);
272 	HRESULT CreateDeferredContext1(uint ContextFlags, ID3D11DeviceContext1 *ppDeferredContext);
273 	HRESULT CreateDeviceContextState(uint Flags, const D3D_FEATURE_LEVEL *pFeatureLevels, uint FeatureLevels, uint SDKVersion, IID* EmulatedInterface, D3D_FEATURE_LEVEL *pChosenFeatureLevel, ID3DDeviceContextState *ppContextState);
274 	HRESULT CreateRasterizerState1(const D3D11_RASTERIZER_DESC1 *pRasterizerDesc, ID3D11RasterizerState1 *ppRasterizerState);
275 	void GetImmediateContext1(ID3D11DeviceContext1 *ppImmediateContext);
276 	HRESULT OpenSharedResource1(HANDLE hResource, IID* returnedInterface, void **ppResource);
277 	HRESULT OpenSharedResourceByName(const(wchar)* lpName, uint dwDesiredAccess, IID* returnedInterface, void **ppResource);
278 }
279 
280 mixin(uuid!(ID3DUserDefinedAnnotation, "b2daad8b-03d4-4dbf-95eb-32ab4b63d0ab"));
281 public interface ID3DUserDefinedAnnotation : IUnknown
282 {
283 extern(Windows):
284     int BeginEvent(const wchar *Name);
285     int EndEvent();
286     bool GetStatus();
287     void SetMarker(const wchar *Name);
288 }