1 module directx.d3d11_1;
2 /*-------------------------------------------------------------------------------------
3  *
4  * Copyright (c) Microsoft Corporation
5  *
6  *-------------------------------------------------------------------------------------*/
7 
8 public import directx.dxgi1_2;
9 public import directx.d3d11;
10 
11 alias D3D11_COPY_FLAGS = int;
12 enum : D3D11_COPY_FLAGS
13 {
14 	D3D11_COPY_NO_OVERWRITE	= 0x1,
15 	D3D11_COPY_DISCARD	= 0x2
16 }
17 
18 alias D3D11_LOGIC_OP = int;
19 enum : D3D11_LOGIC_OP
20 {
21 	D3D11_LOGIC_OP_CLEAR	= 0,
22 	D3D11_LOGIC_OP_SET	= ( D3D11_LOGIC_OP_CLEAR + 1 ) ,
23 	D3D11_LOGIC_OP_COPY	= ( D3D11_LOGIC_OP_SET + 1 ) ,
24 	D3D11_LOGIC_OP_COPY_INVERTED	= ( D3D11_LOGIC_OP_COPY + 1 ) ,
25 	D3D11_LOGIC_OP_NOOP	= ( D3D11_LOGIC_OP_COPY_INVERTED + 1 ) ,
26 	D3D11_LOGIC_OP_INVERT	= ( D3D11_LOGIC_OP_NOOP + 1 ) ,
27 	D3D11_LOGIC_OP_AND	= ( D3D11_LOGIC_OP_INVERT + 1 ) ,
28 	D3D11_LOGIC_OP_NAND	= ( D3D11_LOGIC_OP_AND + 1 ) ,
29 	D3D11_LOGIC_OP_OR	= ( D3D11_LOGIC_OP_NAND + 1 ) ,
30 	D3D11_LOGIC_OP_NOR	= ( D3D11_LOGIC_OP_OR + 1 ) ,
31 	D3D11_LOGIC_OP_XOR	= ( D3D11_LOGIC_OP_NOR + 1 ) ,
32 	D3D11_LOGIC_OP_EQUIV	= ( D3D11_LOGIC_OP_XOR + 1 ) ,
33 	D3D11_LOGIC_OP_AND_REVERSE	= ( D3D11_LOGIC_OP_EQUIV + 1 ) ,
34 	D3D11_LOGIC_OP_AND_INVERTED	= ( D3D11_LOGIC_OP_AND_REVERSE + 1 ) ,
35 	D3D11_LOGIC_OP_OR_REVERSE	= ( D3D11_LOGIC_OP_AND_INVERTED + 1 ) ,
36 	D3D11_LOGIC_OP_OR_INVERTED	= ( D3D11_LOGIC_OP_OR_REVERSE + 1 ) 
37 }
38 
39 struct D3D11_RENDER_TARGET_BLEND_DESC1
40 {
41 	BOOL BlendEnable;
42 	BOOL LogicOpEnable;
43 	D3D11_BLEND SrcBlend;
44 	D3D11_BLEND DestBlend;
45 	D3D11_BLEND_OP BlendOp;
46 	D3D11_BLEND SrcBlendAlpha;
47 	D3D11_BLEND DestBlendAlpha;
48 	D3D11_BLEND_OP BlendOpAlpha;
49 	D3D11_LOGIC_OP LogicOp;
50 	UINT8 RenderTargetWriteMask;
51 }
52 
53 struct D3D11_BLEND_DESC1
54 {
55 	BOOL AlphaToCoverageEnable = FALSE;
56 	BOOL IndependentBlendEnable = FALSE;
57 	D3D11_RENDER_TARGET_BLEND_DESC1[8] RenderTarget;
58 
59 	void Init() @property
60 	{
61 			const D3D11_RENDER_TARGET_BLEND_DESC1 defaultRenderTargetBlendDesc =
62 			{
63 				FALSE,FALSE,
64 					D3D11_BLEND_ONE, D3D11_BLEND_ZERO, D3D11_BLEND_OP_ADD,
65 					D3D11_BLEND_ONE, D3D11_BLEND_ZERO, D3D11_BLEND_OP_ADD,
66 					D3D11_LOGIC_OP_NOOP,
67 					D3D11_COLOR_WRITE_ENABLE_ALL,
68 			};
69 			for (UINT i = 0; i < D3D11_SIMULTANEOUS_RENDER_TARGET_COUNT; ++i)
70 				RenderTarget[ i ] = defaultRenderTargetBlendDesc;
71 	}
72 }
73 
74 mixin( uuid!(ID3D11BlendState1, "cc86fabe-da55-401d-85e7-e3c9de2877e9") );
75 extern (C++) interface ID3D11BlendState1 : ID3D11BlendState
76 {
77 	void GetDesc1( 
78         /*out*/ D3D11_BLEND_DESC1* pDesc);
79 }
80 
81 struct D3D11_RASTERIZER_DESC1
82 {
83 	D3D11_FILL_MODE FillMode = D3D11_FILL_SOLID;
84 	D3D11_CULL_MODE CullMode = D3D11_CULL_BACK;
85 	BOOL FrontCounterClockwise = FALSE;
86 	INT DepthBias = D3D11_DEFAULT_DEPTH_BIAS;
87 	FLOAT DepthBiasClamp = D3D11_DEFAULT_DEPTH_BIAS_CLAMP;
88 	FLOAT SlopeScaledDepthBias = D3D11_DEFAULT_SLOPE_SCALED_DEPTH_BIAS;
89 	BOOL DepthClipEnable = TRUE;
90 	BOOL ScissorEnable = FALSE;
91 	BOOL MultisampleEnable = FALSE;
92 	BOOL AntialiasedLineEnable = FALSE;
93 	UINT ForcedSampleCount = 0;
94 }
95 
96 mixin( uuid!(ID3D11RasterizerState1, "1217d7a6-5039-418c-b042-9cbe256afd6e") );
97 extern (C++) interface ID3D11RasterizerState1 : ID3D11RasterizerState
98 {
99     void GetDesc1( 
100             /*out*/ D3D11_RASTERIZER_DESC1* pDesc);
101 }
102 
103 alias D3D11_1_CREATE_DEVICE_CONTEXT_STATE_FLAG = int;
104 enum : D3D11_1_CREATE_DEVICE_CONTEXT_STATE_FLAG
105 {
106 	D3D11_1_CREATE_DEVICE_CONTEXT_STATE_SINGLETHREADED	= 0x1
107 }
108 
109 mixin( uuid!(ID3DDeviceContextState, "5c1e0d8a-7c23-48f9-8c59-a92958ceff11") );
110 extern (C++) interface ID3DDeviceContextState : ID3D11DeviceChild
111 {
112 }
113 
114 mixin( uuid!(ID3D11DeviceContext1, "bb2c6faa-b5fb-4082-8e6b-388b8cfa90e1") );
115 extern (C++) interface ID3D11DeviceContext1 : ID3D11DeviceContext
116 {
117 	void CopySubresourceRegion1( 
118             ID3D11Resource pDstResource,
119             UINT DstSubresource,
120             UINT DstX,
121             UINT DstY,
122             UINT DstZ,
123             ID3D11Resource pSrcResource,
124             UINT SrcSubresource,
125             const(D3D11_BOX)* pSrcBox,
126             UINT CopyFlags);
127         
128 	void UpdateSubresource1( 
129             ID3D11Resource pDstResource,
130             UINT DstSubresource,
131             const(D3D11_BOX)* pDstBox,
132             const(void*) pSrcData,
133             UINT SrcRowPitch,
134             UINT SrcDepthPitch,
135             UINT CopyFlags);
136         
137 	void DiscardResource( 
138             ID3D11Resource pResource);
139         
140 	void DiscardView( 
141 			ID3D11View pResourceView);
142         
143 	void VSSetConstantBuffers1( 
144             UINT StartSlot,
145             UINT NumBuffers,
146             const(ID3D11Buffer)* ppConstantBuffers,
147             const(UINT)* pFirstConstant,
148             const(UINT)* pNumConstants);
149         
150 	void HSSetConstantBuffers1( 
151 			UINT StartSlot,
152 			UINT NumBuffers,
153             const(ID3D11Buffer)* ppConstantBuffers,
154             const(UINT)* pFirstConstant,
155             const(UINT)* pNumConstants);
156         
157 	void DSSetConstantBuffers1( 
158 			UINT StartSlot,
159 			UINT NumBuffers,
160             const(ID3D11Buffer)* ppConstantBuffers,
161             const(UINT)* pFirstConstant,
162             const(UINT)* pNumConstants);
163         
164 	void GSSetConstantBuffers1( 
165 			UINT StartSlot,
166 			UINT NumBuffers,
167             const(ID3D11Buffer)* ppConstantBuffers,
168             const(UINT)* pFirstConstant,
169             const(UINT)* pNumConstants);
170         
171 	void PSSetConstantBuffers1( 
172 			UINT StartSlot,
173 			UINT NumBuffers,
174 			const(ID3D11Buffer)* ppConstantBuffers,
175 			const(UINT)* pFirstConstant,
176             const(UINT)* pNumConstants);
177         
178 	void CSSetConstantBuffers1( 
179 			UINT StartSlot,
180 			UINT NumBuffers,
181 			const(ID3D11Buffer)* ppConstantBuffers,
182 			const(UINT)* pFirstConstant,
183 			const(UINT)* pNumConstants);
184         
185 	void VSGetConstantBuffers1( 
186 			UINT StartSlot,
187 			UINT NumBuffers,
188             /*out*/ ID3D11Buffer* ppConstantBuffers,
189             /*out*/ UINT* pFirstConstant,
190             /*out*/ UINT* pNumConstants);
191         
192 	void HSGetConstantBuffers1( 
193 			UINT StartSlot,
194 			UINT NumBuffers,
195 			/*out*/ ID3D11Buffer* ppConstantBuffers,
196 			/*out*/ UINT* pFirstConstant,
197             /*out*/ UINT* pNumConstants);
198         
199 	void DSGetConstantBuffers1( 
200 			UINT StartSlot,
201 			UINT NumBuffers,
202 			/*out*/ ID3D11Buffer* ppConstantBuffers,
203             /*out*/ UINT* pFirstConstant,
204             /*out*/ UINT* pNumConstants);
205         
206 	void GSGetConstantBuffers1( 
207 			UINT StartSlot,
208 			UINT NumBuffers,
209             /*out*/ ID3D11Buffer* ppConstantBuffers,
210             /*out*/ UINT* pFirstConstant,
211             /*out*/ UINT* pNumConstants);
212         
213 	void PSGetConstantBuffers1( 
214 			UINT StartSlot,
215 			UINT NumBuffers,
216 			/*out*/ ID3D11Buffer* ppConstantBuffers,
217 			/*out*/ UINT* pFirstConstant,
218 			/*out*/ UINT* pNumConstants);
219         
220 	void CSGetConstantBuffers1( 
221 			UINT StartSlot,
222 			UINT NumBuffers,
223 			/*out*/ ID3D11Buffer* ppConstantBuffers,
224 			/*out*/ UINT* pFirstConstant,
225 			/*out*/ UINT* pNumConstants);
226         
227 	void SwapDeviceContextState( 
228 			ID3DDeviceContextState pState,
229 			ID3DDeviceContextState* ppPreviousState) ;
230         
231 	void ClearView( 
232             ID3D11View pView,
233             const(FLOAT)[4] Color,
234 			const(D3D11_RECT)* pRect,
235             UINT NumRects);
236         
237 	void DiscardView1( 
238             ID3D11View pResourceView,
239             const(D3D11_RECT)* pRects,
240             UINT NumRects);
241 }
242 
243 mixin( uuid!(ID3D11Device1, "a04bfb29-08ef-43d6-a49c-a9bdbdcbe686") );
244 extern (C++) interface ID3D11Device1 : ID3D11Device
245 {
246 	void GetImmediateContext1( 
247             /*out*/ ID3D11DeviceContext1* ppImmediateContext);
248         
249 	HRESULT CreateDeferredContext1( 
250             UINT ContextFlags,
251             /*out*/ ID3D11DeviceContext1* ppDeferredContext);
252         
253 	HRESULT CreateBlendState1( 
254             const(D3D11_BLEND_DESC1)* pBlendStateDesc,
255             /*out*/ ID3D11BlendState1* ppBlendState);
256         
257 	HRESULT CreateRasterizerState1( 
258             const(D3D11_RASTERIZER_DESC1)* pRasterizerDesc,
259             /*out*/ ID3D11RasterizerState1* ppRasterizerState);
260         
261 	HRESULT CreateDeviceContextState( 
262             UINT Flags,
263 			const(D3D_FEATURE_LEVEL)* pFeatureLevels,
264 			UINT FeatureLevels,
265             UINT SDKVersion,
266             REFIID EmulatedInterface,
267             /*out*/ D3D_FEATURE_LEVEL* pChosenFeatureLevel,
268             /*out*/ ID3DDeviceContextState* ppContextState);
269         
270 	HRESULT OpenSharedResource1( 
271             HANDLE hResource,
272             REFIID returnedInterface,
273             /*out*/ void** ppResource);
274         
275 	HRESULT OpenSharedResourceByName( 
276             LPCWSTR lpName,
277             DWORD dwDesiredAccess,
278             REFIID returnedInterface,
279             /*out*/ void** ppResource);
280 }
281 
282 mixin( uuid!(ID3DUserDefinedAnnotation, "b2daad8b-03d4-4dbf-95eb-32ab4b63d0ab") );
283 extern (C++) interface ID3DUserDefinedAnnotation : IUnknown
284 {
285 	INT BeginEvent( 
286             LPCWSTR Name);
287         
288 	INT EndEvent();
289         
290 	void SetMarker( 
291             LPCWSTR Name);
292         
293 	BOOL GetStatus();
294 }