d3d11_3.idl 9.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385
  1. /*
  2. * Copyright 2017 Ihsan Akmal
  3. *
  4. * This library is free software; you can redistribute it and/or
  5. * modify it under the terms of the GNU Lesser General Public
  6. * License as published by the Free Software Foundation; either
  7. * version 2.1 of the License, or (at your option) any later version.
  8. *
  9. * This library is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  12. * Lesser General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU Lesser General Public
  15. * License along with this library; if not, write to the Free Software
  16. * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  17. */
  18. import "oaidl.idl";
  19. import "ocidl.idl";
  20. import "dxgi1_3.idl";
  21. import "d3dcommon.idl";
  22. import "d3d11_2.idl";
  23. typedef enum D3D11_CONTEXT_TYPE
  24. {
  25. D3D11_CONTEXT_TYPE_ALL = 0x0,
  26. D3D11_CONTEXT_TYPE_3D = 0x1,
  27. D3D11_CONTEXT_TYPE_COMPUTE = 0x2,
  28. D3D11_CONTEXT_TYPE_COPY = 0x3,
  29. D3D11_CONTEXT_TYPE_VIDEO = 0x4,
  30. } D3D11_CONTEXT_TYPE;
  31. typedef enum D3D11_TEXTURE_LAYOUT
  32. {
  33. D3D11_TEXTURE_LAYOUT_UNDEFINED = 0x0,
  34. D3D11_TEXTURE_LAYOUT_ROW_MAJOR = 0x1,
  35. D3D11_TEXTURE_LAYOUT_64K_STANDARD_SWIZZLE = 0x2,
  36. } D3D11_TEXTURE_LAYOUT;
  37. typedef enum D3D11_CONSERVATIVE_RASTERIZATION_MODE
  38. {
  39. D3D11_CONSERVATIVE_RASTERIZATION_MODE_OFF = 0x0,
  40. D3D11_CONSERVATIVE_RASTERIZATION_MODE_ON = 0x1,
  41. } D3D11_CONSERVATIVE_RASTERIZATION_MODE;
  42. typedef enum D3D11_FENCE_FLAG
  43. {
  44. D3D11_FENCE_FLAG_NONE = 0x1,
  45. D3D11_FENCE_FLAG_SHARED = 0x2,
  46. D3D11_FENCE_FLAG_SHARED_CROSS_ADAPTER = 0x4,
  47. D3D11_FENCE_FLAG_NON_MONITORED = 0x8,
  48. } D3D11_FENCE_FLAG;
  49. typedef struct D3D11_TEXTURE2D_DESC1
  50. {
  51. UINT Width;
  52. UINT Height;
  53. UINT MipLevels;
  54. UINT ArraySize;
  55. DXGI_FORMAT Format;
  56. DXGI_SAMPLE_DESC SampleDesc;
  57. D3D11_USAGE Usage;
  58. UINT BindFlags;
  59. UINT CPUAccessFlags;
  60. UINT MiscFlags;
  61. D3D11_TEXTURE_LAYOUT TextureLayout;
  62. } D3D11_TEXTURE2D_DESC1;
  63. typedef struct D3D11_TEXTURE3D_DESC1
  64. {
  65. UINT Width;
  66. UINT Height;
  67. UINT Depth;
  68. UINT MipLevels;
  69. DXGI_FORMAT Format;
  70. D3D11_USAGE Usage;
  71. UINT BindFlags;
  72. UINT CPUAccessFlags;
  73. UINT MiscFlags;
  74. D3D11_TEXTURE_LAYOUT TextureLayout;
  75. } D3D11_TEXTURE3D_DESC1;
  76. typedef struct D3D11_RASTERIZER_DESC2
  77. {
  78. D3D11_FILL_MODE FillMode;
  79. D3D11_CULL_MODE CullMode;
  80. BOOL FrontCounterClockwise;
  81. int DepthBias;
  82. float DepthBiasClamp;
  83. float SlopeScaledDepthBias;
  84. BOOL DepthClipEnable;
  85. BOOL ScissorEnable;
  86. BOOL MultisampleEnable;
  87. BOOL AntialiasedLineEnable;
  88. UINT ForcedSampleCount;
  89. D3D11_CONSERVATIVE_RASTERIZATION_MODE ConservativeRaster;
  90. } D3D11_RASTERIZER_DESC2;
  91. typedef struct D3D11_TEX2D_SRV1
  92. {
  93. UINT MostDetailedMip;
  94. UINT MipLevels;
  95. UINT PlaneSlice;
  96. } D3D11_TEX2D_SRV1;
  97. typedef struct D3D11_TEX2D_ARRAY_SRV1
  98. {
  99. UINT MostDetailedMip;
  100. UINT MipLevels;
  101. UINT FirstArraySlice;
  102. UINT ArraySize;
  103. UINT PlaneSlice;
  104. } D3D11_TEX2D_ARRAY_SRV1;
  105. typedef struct D3D11_SHADER_RESOURCE_VIEW_DESC1
  106. {
  107. DXGI_FORMAT Format;
  108. D3D11_SRV_DIMENSION ViewDimension;
  109. union
  110. {
  111. D3D11_BUFFER_SRV Buffer;
  112. D3D11_TEX1D_SRV Texture1D;
  113. D3D11_TEX1D_ARRAY_SRV Texture1DArray;
  114. D3D11_TEX2D_SRV1 Texture2D;
  115. D3D11_TEX2D_ARRAY_SRV1 Texture2DArray;
  116. D3D11_TEX2DMS_SRV Texture2DMS;
  117. D3D11_TEX2DMS_ARRAY_SRV Texture2DMSArray;
  118. D3D11_TEX3D_SRV Texture3D;
  119. D3D11_TEXCUBE_SRV TextureCube;
  120. D3D11_TEXCUBE_ARRAY_SRV TextureCubeArray;
  121. D3D11_BUFFEREX_SRV BufferEx;
  122. };
  123. } D3D11_SHADER_RESOURCE_VIEW_DESC1;
  124. typedef struct D3D11_TEX2D_RTV1
  125. {
  126. UINT MipSlice;
  127. UINT PlaneSlice;
  128. } D3D11_TEX2D_RTV1;
  129. typedef struct D3D11_TEX2D_ARRAY_RTV1
  130. {
  131. UINT MipSlice;
  132. UINT FirstArraySlice;
  133. UINT ArraySize;
  134. UINT PlaneSlice;
  135. } D3D11_TEX2D_ARRAY_RTV1;
  136. typedef struct D3D11_RENDER_TARGET_VIEW_DESC1
  137. {
  138. DXGI_FORMAT Format;
  139. D3D11_RTV_DIMENSION ViewDimension;
  140. union
  141. {
  142. D3D11_BUFFER_RTV Buffer;
  143. D3D11_TEX1D_RTV Texture1D;
  144. D3D11_TEX1D_ARRAY_RTV Texture1DArray;
  145. D3D11_TEX2D_RTV1 Texture2D;
  146. D3D11_TEX2D_ARRAY_RTV1 Texture2DArray;
  147. D3D11_TEX2DMS_RTV Texture2DMS;
  148. D3D11_TEX2DMS_ARRAY_RTV Texture2DMSArray;
  149. D3D11_TEX3D_RTV Texture3D;
  150. };
  151. } D3D11_RENDER_TARGET_VIEW_DESC1;
  152. typedef struct D3D11_TEX2D_UAV1
  153. {
  154. UINT MipSlice;
  155. UINT PlaneSlice;
  156. } D3D11_TEX2D_UAV1;
  157. typedef struct D3D11_TEX2D_ARRAY_UAV1
  158. {
  159. UINT MipSlice;
  160. UINT FirstArraySlice;
  161. UINT ArraySize;
  162. UINT PlaneSlice;
  163. } D3D11_TEX2D_ARRAY_UAV1;
  164. typedef struct D3D11_UNORDERED_ACCESS_VIEW_DESC1
  165. {
  166. DXGI_FORMAT Format;
  167. D3D11_UAV_DIMENSION ViewDimension;
  168. union
  169. {
  170. D3D11_BUFFER_UAV Buffer;
  171. D3D11_TEX1D_UAV Texture1D;
  172. D3D11_TEX1D_ARRAY_UAV Texture1DArray;
  173. D3D11_TEX2D_UAV1 Texture2D;
  174. D3D11_TEX2D_ARRAY_UAV1 Texture2DArray;
  175. D3D11_TEX3D_UAV Texture3D;
  176. };
  177. } D3D11_UNORDERED_ACCESS_VIEW_DESC1;
  178. typedef struct D3D11_QUERY_DESC1
  179. {
  180. D3D11_QUERY Query;
  181. UINT MiscFlags;
  182. D3D11_CONTEXT_TYPE ContextType;
  183. } D3D11_QUERY_DESC1;
  184. [
  185. uuid(51218251-1e33-4617-9ccb-4d3a4367e7bb),
  186. object,
  187. local,
  188. pointer_default(unique)
  189. ]
  190. interface ID3D11Texture2D1 : ID3D11Texture2D
  191. {
  192. void GetDesc1(D3D11_TEXTURE2D_DESC1 *desc);
  193. }
  194. [
  195. uuid(0c711683-2853-4846-9bb0-f3e60639e46a),
  196. object,
  197. local,
  198. pointer_default(unique)
  199. ]
  200. interface ID3D11Texture3D1 : ID3D11Texture3D
  201. {
  202. void GetDesc1(D3D11_TEXTURE3D_DESC1 *desc);
  203. }
  204. [
  205. uuid(6fbd02fb-209f-46c4-b059-2ed15586a6ac),
  206. object,
  207. local,
  208. pointer_default(unique)
  209. ]
  210. interface ID3D11RasterizerState2 : ID3D11RasterizerState1
  211. {
  212. void GetDesc2(D3D11_RASTERIZER_DESC2 *desc);
  213. }
  214. [
  215. uuid(91308b87-9040-411d-8c67-c39253ce3802),
  216. object,
  217. local,
  218. pointer_default(unique)
  219. ]
  220. interface ID3D11ShaderResourceView1 : ID3D11ShaderResourceView
  221. {
  222. void GetDesc1(D3D11_SHADER_RESOURCE_VIEW_DESC1 *desc);
  223. }
  224. [
  225. uuid(ffbe2e23-f011-418a-ac56-5ceed7c5b94b),
  226. object,
  227. local,
  228. pointer_default(unique)
  229. ]
  230. interface ID3D11RenderTargetView1 : ID3D11RenderTargetView
  231. {
  232. void GetDesc1(D3D11_RENDER_TARGET_VIEW_DESC1 *desc);
  233. }
  234. [
  235. uuid(7b3b6153-a886-4544-ab37-6537c8500403),
  236. object,
  237. local,
  238. pointer_default(unique)
  239. ]
  240. interface ID3D11UnorderedAccessView1 : ID3D11UnorderedAccessView
  241. {
  242. void GetDesc1(D3D11_UNORDERED_ACCESS_VIEW_DESC1 *desc);
  243. }
  244. [
  245. uuid(631b4766-36dc-461d-8db6-c47e13e60916),
  246. object,
  247. local,
  248. pointer_default(unique)
  249. ]
  250. interface ID3D11Query1 : ID3D11Query
  251. {
  252. void GetDesc1(D3D11_QUERY_DESC1 *desc);
  253. }
  254. [
  255. uuid(b4e3c01d-e79e-4637-91b2-510e9f4c9b8f),
  256. object,
  257. local,
  258. pointer_default(unique)
  259. ]
  260. interface ID3D11DeviceContext3 : ID3D11DeviceContext2
  261. {
  262. void Flush1(D3D11_CONTEXT_TYPE type, HANDLE event);
  263. void SetHardwareProtectionState(BOOL enable);
  264. void GetHardwareProtectionState(BOOL *enable);
  265. }
  266. [
  267. uuid(affde9d1-1df7-4bb7-8a34-0f46251dab80),
  268. object,
  269. local,
  270. pointer_default(unique)
  271. ]
  272. interface ID3D11Fence : ID3D11DeviceChild
  273. {
  274. HRESULT CreateSharedHandle(
  275. const SECURITY_ATTRIBUTES *attributes,
  276. DWORD access,
  277. const WCHAR *name,
  278. HANDLE *handle
  279. );
  280. UINT64 GetCompletedValue();
  281. HRESULT SetEventOnCompletion(
  282. UINT64 value,
  283. HANDLE event
  284. );
  285. }
  286. [
  287. uuid(917600da-f58c-4c33-98d8-3e15b390fa24),
  288. object,
  289. local,
  290. pointer_default(unique)
  291. ]
  292. interface ID3D11DeviceContext4 : ID3D11DeviceContext3
  293. {
  294. HRESULT Signal(ID3D11Fence *fence, UINT64 value);
  295. HRESULT Wait(ID3D11Fence *fence, UINT64 value);
  296. }
  297. [
  298. uuid(a05c8c37-d2c6-4732-b3a0-9ce0b0dc9ae6),
  299. object,
  300. local,
  301. pointer_default(unique)
  302. ]
  303. interface ID3D11Device3 : ID3D11Device2
  304. {
  305. HRESULT CreateTexture2D1(
  306. const D3D11_TEXTURE2D_DESC1 *desc,
  307. const D3D11_SUBRESOURCE_DATA *initial_data,
  308. ID3D11Texture2D1 **texture
  309. );
  310. HRESULT CreateTexture3D1(
  311. const D3D11_TEXTURE3D_DESC1 *desc,
  312. const D3D11_SUBRESOURCE_DATA *initial_data,
  313. ID3D11Texture3D1 **texture
  314. );
  315. HRESULT CreateRasterizerState2(
  316. const D3D11_RASTERIZER_DESC2 *desc,
  317. ID3D11RasterizerState2 **state
  318. );
  319. HRESULT CreateShaderResourceView1(
  320. ID3D11Resource *resource,
  321. const D3D11_SHADER_RESOURCE_VIEW_DESC1 *desc,
  322. ID3D11ShaderResourceView1 **view
  323. );
  324. HRESULT CreateUnorderedAccessView1(
  325. ID3D11Resource *resource,
  326. const D3D11_UNORDERED_ACCESS_VIEW_DESC1 *desc,
  327. ID3D11UnorderedAccessView1 **view
  328. );
  329. HRESULT CreateRenderTargetView1(
  330. ID3D11Resource *resource,
  331. const D3D11_RENDER_TARGET_VIEW_DESC1 *desc,
  332. ID3D11RenderTargetView1 **view
  333. );
  334. HRESULT CreateQuery1(const D3D11_QUERY_DESC1 *desc, ID3D11Query1 **query);
  335. void GetImmediateContext3(ID3D11DeviceContext3 **context);
  336. HRESULT CreateDeferredContext3(UINT flags, ID3D11DeviceContext3 **context);
  337. void WriteToSubresource(
  338. ID3D11Resource *dst_resource,
  339. UINT dst_subresource,
  340. const D3D11_BOX *dst_box,
  341. const void *src_data,
  342. UINT src_row_pitch,
  343. UINT src_depth_pitch
  344. );
  345. void ReadFromSubresource(
  346. void *dst_data,
  347. UINT dst_row_pitch,
  348. UINT dst_depth_pitch,
  349. ID3D11Resource *src_resource,
  350. UINT src_subresource,
  351. const D3D11_BOX *src_box
  352. );
  353. }