1 module aurora.directx.d3d11.d3d11_3;
2 
3 version(Windows):
4 
5 public import aurora.directx.d3d11.d3d11_2;
6 
7 public:
8 
9 ///
10 /// Constants
11 ///
12 
13 ///
14 /// Functions
15 ///
16 
17 ///
18 /// Enumerations
19 ///
20 
21 enum D3D11_CONTEXT_TYPE : uint
22 {
23     TYPE_ALL = 0,
24     TYPE_3D = 1,
25     TYPE_COMPUTE = 2,
26     TYPE_COPY = 3,
27     TYPE_VIDEO = 4
28 }
29 
30 enum D3D11_TEXTURE_LAYOUT : uint
31 {
32     LAYOUT_UNDEFINED = 0,
33     LAYOUT_ROW_MAJOR = 1,
34     LAYOUT_64K_STANDARD_SWIZZLE = 2
35 }
36 
37 enum D3D11_CONSERVATIVE_RASTERIZATION_MODE : uint
38 {
39     OFF = 0,
40     ON = 1
41 }
42 
43 enum D3D11_FENCE_FLAG : uint
44 {
45     NONE	= 0x1,
46     SHARED	= 0x2,
47     SHARED_CROSS_ADAPTER	= 0x4
48 }
49 
50 ///
51 /// Structures
52 ///
53 
54 struct D3D11_TEXTURE2D_DESC1
55 {
56     uint Width;
57     uint Height;
58     uint MipLevels;
59     uint ArraySize;
60     DXGI_FORMAT Format;
61     DXGI_SAMPLE_DESC SampleDesc;
62     D3D11_USAGE Usage;
63     uint BindFlags;
64     uint CPUAccessFlags;
65     uint MiscFlags;
66     D3D11_TEXTURE_LAYOUT TextureLayout;
67 }
68 
69 struct D3D11_TEXTURE3D_DESC1
70 {
71     uint Width;
72     uint Height;
73     uint Depth;
74     uint MipLevels;
75     DXGI_FORMAT Format;
76     D3D11_USAGE Usage;
77     uint BindFlags;
78     uint CPUAccessFlags;
79     uint MiscFlags;
80     D3D11_TEXTURE_LAYOUT TextureLayout;
81 }
82 
83 struct D3D11_RASTERIZER_DESC2
84 {
85     D3D11_FILL_MODE FillMode;
86     D3D11_CULL_MODE CullMode;
87     bool FrontCounterClockwise;
88     int DepthBias;
89     float DepthBiasClamp;
90     float SlopeScaledDepthBias;
91     bool DepthClipEnable;
92     bool ScissorEnable;
93     bool MultisampleEnable;
94     bool AntialiasedLineEnable;
95     uint ForcedSampleCount;
96     D3D11_CONSERVATIVE_RASTERIZATION_MODE ConservativeRaster;
97 }
98 
99 struct D3D11_TEX2D_SRV1
100 {
101     uint MostDetailedMip;
102     uint MipLevels;
103     uint PlaneSlice;
104 }
105 
106 struct D3D11_TEX2D_ARRAY_SRV1
107 {
108     uint MostDetailedMip;
109     uint MipLevels;
110     uint FirstArraySlice;
111     uint ArraySize;
112     uint PlaneSlice;
113 }
114 
115 struct D3D11_SHADER_RESOURCE_VIEW_DESC1
116 {
117     DXGI_FORMAT Format;
118     D3D11_SRV_DIMENSION ViewDimension;
119     union 
120     {
121         D3D11_BUFFER_SRV Buffer;
122         D3D11_TEX1D_SRV Texture1D;
123         D3D11_TEX1D_ARRAY_SRV Texture1DArray;
124         D3D11_TEX2D_SRV1 Texture2D;
125         D3D11_TEX2D_ARRAY_SRV1 Texture2DArray;
126         D3D11_TEX2DMS_SRV Texture2DMS;
127         D3D11_TEX2DMS_ARRAY_SRV Texture2DMSArray;
128         D3D11_TEX3D_SRV Texture3D;
129         D3D11_TEXCUBE_SRV TextureCube;
130         D3D11_TEXCUBE_ARRAY_SRV TextureCubeArray;
131         D3D11_BUFFEREX_SRV BufferEx;
132     };
133 }
134 
135 struct D3D11_TEX2D_RTV1
136 {
137     uint MipSlice;
138     uint PlaneSlice;
139 }
140 
141 struct D3D11_TEX2D_ARRAY_RTV1
142 {
143     uint MipSlice;
144     uint FirstArraySlice;
145     uint ArraySize;
146     uint PlaneSlice;
147 }
148 
149 struct D3D11_RENDER_TARGET_VIEW_DESC1
150 {
151     DXGI_FORMAT Format;
152     D3D11_RTV_DIMENSION ViewDimension;
153     union 
154     {
155         D3D11_BUFFER_RTV Buffer;
156         D3D11_TEX1D_RTV Texture1D;
157         D3D11_TEX1D_ARRAY_RTV Texture1DArray;
158         D3D11_TEX2D_RTV1 Texture2D;
159         D3D11_TEX2D_ARRAY_RTV1 Texture2DArray;
160         D3D11_TEX2DMS_RTV Texture2DMS;
161         D3D11_TEX2DMS_ARRAY_RTV Texture2DMSArray;
162         D3D11_TEX3D_RTV Texture3D;
163     };
164 }
165 
166 struct D3D11_TEX2D_UAV1
167 {
168     uint MipSlice;
169     uint PlaneSlice;
170 }
171 
172 struct D3D11_TEX2D_ARRAY_UAV1
173 {
174     uint MipSlice;
175     uint FirstArraySlice;
176     uint ArraySize;
177     uint PlaneSlice;
178 }
179 
180 struct D3D11_UNORDERED_ACCESS_VIEW_DESC1
181 {
182     DXGI_FORMAT Format;
183     D3D11_UAV_DIMENSION ViewDimension;
184     union 
185     {
186         D3D11_BUFFER_UAV Buffer;
187         D3D11_TEX1D_UAV Texture1D;
188         D3D11_TEX1D_ARRAY_UAV Texture1DArray;
189         D3D11_TEX2D_UAV1 Texture2D;
190         D3D11_TEX2D_ARRAY_UAV1 Texture2DArray;
191         D3D11_TEX3D_UAV Texture3D;
192     };
193 }
194 
195 struct D3D11_QUERY_DESC1
196 {
197     D3D11_QUERY Query;
198     uint MiscFlags;
199     D3D11_CONTEXT_TYPE ContextType;
200 }
201 
202 ///
203 /// Interfaces
204 ///
205 
206 mixin(uuid!(ID3D11Texture2D1, "51218251-1E33-4617-9CCB-4D3A4367E7BB"));
207 public interface ID3D11Texture2D1 : ID3D11Texture2D
208 {
209 extern(Windows):
210 	void GetDesc1(D3D11_TEXTURE2D_DESC1 *pDesc);
211 }
212 
213 mixin(uuid!(ID3D11Texture3D1, "0C711683-2853-4846-9BB0-F3E60639E46A"));
214 public interface ID3D11Texture3D1 : ID3D11Texture3D
215 {
216 extern(Windows):
217 	void GetDesc1(D3D11_TEXTURE3D_DESC1 *pDesc);
218 }
219 
220 mixin(uuid!(ID3D11RasterizerState2, "6fbd02fb-209f-46c4-b059-2ed15586a6ac"));
221 public interface ID3D11RasterizerState2 : ID3D11RasterizerState1
222 {
223 extern(Windows):
224 	void GetDesc2(D3D11_RASTERIZER_DESC2 *pDesc);
225 }
226 
227 mixin(uuid!(ID3D11ShaderResourceView1, "91308b87-9040-411d-8c67-c39253ce3802"));
228 public interface ID3D11ShaderResourceView1 : ID3D11ShaderResourceView
229 {
230 extern(Windows):
231 	void GetDesc1(D3D11_SHADER_RESOURCE_VIEW_DESC1 *pDesc);
232 }
233 
234 mixin(uuid!(ID3D11RenderTargetView1, "ffbe2e23-f011-418a-ac56-5ceed7c5b94b"));
235 public interface ID3D11RenderTargetView1 : ID3D11RenderTargetView
236 {
237 extern(Windows):
238 	void GetDesc1(D3D11_RENDER_TARGET_VIEW_DESC1 *pDesc);
239 }
240 
241 mixin(uuid!(ID3D11UnorderedAccessView1, "7b3b6153-a886-4544-ab37-6537c8500403"));
242 public interface ID3D11UnorderedAccessView1 : ID3D11UnorderedAccessView
243 {
244 extern(Windows):
245 	void GetDesc1(D3D11_UNORDERED_ACCESS_VIEW_DESC1 *pDesc);
246 }
247 
248 mixin(uuid!(ID3D11Query1, "631b4766-36dc-461d-8db6-c47e13e60916"));
249 public interface ID3D11Query1 : ID3D11Query
250 {
251 extern(Windows):
252 	void GetDesc1(D3D11_QUERY_DESC1 *pDesc);
253 }
254 
255 mixin(uuid!(ID3D11DeviceContext3, "b4e3c01d-e79e-4637-91b2-510e9f4c9b8f"));
256 public interface ID3D11DeviceContext3 : ID3D11DeviceContext2
257 {
258 extern(Windows):
259 	void Flush1(D3D11_CONTEXT_TYPE ContextType, HANDLE hEvent);
260     void GetHardwareProtectionState(bool *pHwProtectionEnable);
261     void SetHardwareProtectionState(bool HwProtectionEnable);
262 }
263 
264 mixin(uuid!(ID3D11Fence, "affde9d1-1df7-4bb7-8a34-0f46251dab80"));
265 public interface ID3D11Fence : ID3D11DeviceChild
266 {
267 extern(Windows):
268 	HRESULT CreateSharedHandle(const SECURITY_ATTRIBUTES *pAttributes, uint Access, const wchar *Name, HANDLE *pHandle);
269     ulong GetCompletedValue();
270     HRESULT SetEventOnCompletion(ulong Value, HANDLE hEvent);
271 }
272 
273 mixin(uuid!(ID3D11DeviceContext4, "917600da-f58c-4c33-98d8-3e15b390fa24"));
274 public interface ID3D11DeviceContext4 : ID3D11DeviceContext3
275 {
276 extern(Windows):
277 	HRESULT Signal(ID3D11Fence pFence, ulong Value);
278     HRESULT Wait(ID3D11Fence pFence,ulong Value);
279 }
280 
281 mixin(uuid!(ID3D11Device3, "A05C8C37-D2C6-4732-B3A0-9CE0B0DC9AE6"));
282 public interface ID3D11Device3 : ID3D11Device2
283 {
284 extern(Windows):
285 	HRESULT CreateDeferredContext3(uint ContextFlags, ID3D11DeviceContext3 *ppDeferredContext);
286     HRESULT CreateQuery1(const D3D11_QUERY_DESC1 *pQueryDesc1, ID3D11Query1 *ppQuery1);
287     HRESULT CreateRasterizerState2(const D3D11_RASTERIZER_DESC2 *pRasterizerDesc, ID3D11RasterizerState2 *ppRasterizerState);
288     HRESULT CreateRenderTargetView1(ID3D11Resource pResource, const D3D11_RENDER_TARGET_VIEW_DESC1 *pDesc1, ID3D11RenderTargetView1 *ppRTView1);
289     HRESULT CreateShaderResourceView1(ID3D11Resource pResource, const D3D11_SHADER_RESOURCE_VIEW_DESC1 *pDesc1, ID3D11ShaderResourceView1 *ppSRView1);
290     HRESULT CreateTexture2D1(const D3D11_TEXTURE2D_DESC1 *pDesc1, const D3D11_SUBRESOURCE_DATA *pInitialData, ID3D11Texture2D1 *ppTexture2D);
291     HRESULT CreateTexture3D1(const D3D11_TEXTURE3D_DESC1 *pDesc1, const D3D11_SUBRESOURCE_DATA *pInitialData, ID3D11Texture3D1 *ppTexture3D);
292     HRESULT CreateUnorderedAccessView1(ID3D11Resource pResource, const D3D11_UNORDERED_ACCESS_VIEW_DESC1 *pDesc1, ID3D11UnorderedAccessView1 *ppUAView1);
293     void GetImmediateContext3(ID3D11DeviceContext3 *ppImmediateContext);
294     void ReadFromSubresource(void *pDstData, uint DstRowPitch, uint DstDepthPitch, ID3D11Resource *pSrcResource, uint SrcSubresource, const D3D11_BOX *pSrcBox);
295     void WriteToSubresource(ID3D11Resource *pDstResource, uint DstSubresource, const D3D11_BOX *pDstBox, const void *pSrcData, uint SrcRowPitch, uint SrcDepthPitch);
296 }