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 19import "oaidl.idl"; 20import "ocidl.idl"; 21import "dxgi1_3.idl"; 22import "d3dcommon.idl"; 23import "d3d11_2.idl"; 24 25typedef enum D3D11_CONTEXT_TYPE 26{ 27 D3D11_CONTEXT_TYPE_ALL = 0x0, 28 D3D11_CONTEXT_TYPE_3D = 0x1, 29 D3D11_CONTEXT_TYPE_COMPUTE = 0x2, 30 D3D11_CONTEXT_TYPE_COPY = 0x3, 31 D3D11_CONTEXT_TYPE_VIDEO = 0x4, 32} D3D11_CONTEXT_TYPE; 33 34typedef enum D3D11_TEXTURE_LAYOUT 35{ 36 D3D11_TEXTURE_LAYOUT_UNDEFINED = 0x0, 37 D3D11_TEXTURE_LAYOUT_ROW_MAJOR = 0x1, 38 D3D11_TEXTURE_LAYOUT_64K_STANDARD_SWIZZLE = 0x2, 39} D3D11_TEXTURE_LAYOUT; 40 41typedef enum D3D11_CONSERVATIVE_RASTERIZATION_MODE 42{ 43 D3D11_CONSERVATIVE_RASTERIZATION_MODE_OFF = 0x0, 44 D3D11_CONSERVATIVE_RASTERIZATION_MODE_ON = 0x1, 45} D3D11_CONSERVATIVE_RASTERIZATION_MODE; 46 47typedef enum D3D11_FENCE_FLAG 48{ 49 D3D11_FENCE_FLAG_NONE = 0x1, 50 D3D11_FENCE_FLAG_SHARED = 0x2, 51 D3D11_FENCE_FLAG_SHARED_CROSS_ADAPTER = 0x4, 52} D3D11_FENCE_FLAG; 53 54typedef 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} D3D11_TEXTURE2D_DESC1; 68 69typedef 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} D3D11_TEXTURE3D_DESC1; 82 83typedef 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} D3D11_RASTERIZER_DESC2; 98 99typedef struct D3D11_TEX2D_SRV1 100{ 101 UINT MostDetailedMip; 102 UINT MipLevels; 103 UINT PlaneSlice; 104} D3D11_TEX2D_SRV1; 105 106typedef struct D3D11_TEX2D_ARRAY_SRV1 107{ 108 UINT MostDetailedMip; 109 UINT MipLevels; 110 UINT FirstArraySlice; 111 UINT ArraySize; 112 UINT PlaneSlice; 113} D3D11_TEX2D_ARRAY_SRV1; 114 115typedef struct D3D11_SHADER_RESOURCE_VIEW_DESC1 116{ 117 DXGI_FORMAT Format; 118 D3D11_SRV_DIMENSION ViewDimension; 119 120 union 121 { 122 D3D11_BUFFER_SRV Buffer; 123 D3D11_TEX1D_SRV Texture1D; 124 D3D11_TEX1D_ARRAY_SRV Texture1DArray; 125 D3D11_TEX2D_SRV1 Texture2D; 126 D3D11_TEX2D_ARRAY_SRV1 Texture2DArray; 127 D3D11_TEX2DMS_SRV Texture2DMS; 128 D3D11_TEX2DMS_ARRAY_SRV Texture2DMSArray; 129 D3D11_TEX3D_SRV Texture3D; 130 D3D11_TEXCUBE_SRV TextureCube; 131 D3D11_TEXCUBE_ARRAY_SRV TextureCubeArray; 132 D3D11_BUFFEREX_SRV BufferEx; 133 }; 134} D3D11_SHADER_RESOURCE_VIEW_DESC1; 135 136typedef struct D3D11_TEX2D_RTV1 137{ 138 UINT MipSlice; 139 UINT PlaneSlice; 140} D3D11_TEX2D_RTV1; 141 142typedef struct D3D11_TEX2D_ARRAY_RTV1 143{ 144 UINT MipSlice; 145 UINT FirstArraySlice; 146 UINT ArraySize; 147 UINT PlaneSlice; 148} D3D11_TEX2D_ARRAY_RTV1; 149 150typedef struct D3D11_RENDER_TARGET_VIEW_DESC1 151{ 152 DXGI_FORMAT Format; 153 D3D11_RTV_DIMENSION ViewDimension; 154 155 union 156 { 157 D3D11_BUFFER_RTV Buffer; 158 D3D11_TEX1D_RTV Texture1D; 159 D3D11_TEX1D_ARRAY_RTV Texture1DArray; 160 D3D11_TEX2D_RTV1 Texture2D; 161 D3D11_TEX2D_ARRAY_RTV1 Texture2DArray; 162 D3D11_TEX2DMS_RTV Texture2DMS; 163 D3D11_TEX2DMS_ARRAY_RTV Texture2DMSArray; 164 D3D11_TEX3D_RTV Texture3D; 165 }; 166} D3D11_RENDER_TARGET_VIEW_DESC1; 167 168typedef struct D3D11_TEX2D_UAV1 169{ 170 UINT MipSlice; 171 UINT PlaneSlice; 172} D3D11_TEX2D_UAV1; 173 174typedef struct D3D11_TEX2D_ARRAY_UAV1 175{ 176 UINT MipSlice; 177 UINT FirstArraySlice; 178 UINT ArraySize; 179 UINT PlaneSlice; 180} D3D11_TEX2D_ARRAY_UAV1; 181 182typedef struct D3D11_UNORDERED_ACCESS_VIEW_DESC1 183{ 184 DXGI_FORMAT Format; 185 D3D11_UAV_DIMENSION ViewDimension; 186 187 union 188 { 189 D3D11_BUFFER_UAV Buffer; 190 D3D11_TEX1D_UAV Texture1D; 191 D3D11_TEX1D_ARRAY_UAV Texture1DArray; 192 D3D11_TEX2D_UAV1 Texture2D; 193 D3D11_TEX2D_ARRAY_UAV1 Texture2DArray; 194 D3D11_TEX3D_UAV Texture3D; 195 }; 196} D3D11_UNORDERED_ACCESS_VIEW_DESC1; 197 198typedef struct D3D11_QUERY_DESC1 199{ 200 D3D11_QUERY Query; 201 UINT MiscFlags; 202 D3D11_CONTEXT_TYPE ContextType; 203} D3D11_QUERY_DESC1; 204 205[ 206 uuid(51218251-1e33-4617-9ccb-4d3a4367e7bb), 207 object, 208 local, 209 pointer_default(unique) 210] 211interface ID3D11Texture2D1 : ID3D11Texture2D 212{ 213 void GetDesc1(D3D11_TEXTURE2D_DESC1 *desc); 214} 215 216[ 217 uuid(0c711683-2853-4846-9bb0-f3e60639e46a), 218 object, 219 local, 220 pointer_default(unique) 221] 222interface ID3D11Texture3D1 : ID3D11Texture3D 223{ 224 void GetDesc1(D3D11_TEXTURE3D_DESC1 *desc); 225} 226 227[ 228 uuid(6fbd02fb-209f-46c4-b059-2ed15586a6ac), 229 object, 230 local, 231 pointer_default(unique) 232] 233interface ID3D11RasterizerState2 : ID3D11RasterizerState1 234{ 235 void GetDesc2(D3D11_RASTERIZER_DESC2 *desc); 236} 237 238[ 239 uuid(91308b87-9040-411d-8c67-c39253ce3802), 240 object, 241 local, 242 pointer_default(unique) 243] 244interface ID3D11ShaderResourceView1 : ID3D11ShaderResourceView 245{ 246 void GetDesc1(D3D11_SHADER_RESOURCE_VIEW_DESC1 *desc); 247} 248 249[ 250 uuid(ffbe2e23-f011-418a-ac56-5ceed7c5b94b), 251 object, 252 local, 253 pointer_default(unique) 254] 255interface ID3D11RenderTargetView1 : ID3D11RenderTargetView 256{ 257 void GetDesc1(D3D11_RENDER_TARGET_VIEW_DESC1 *desc); 258} 259 260[ 261 uuid(7b3b6153-a886-4544-ab37-6537c8500403), 262 object, 263 local, 264 pointer_default(unique) 265] 266interface ID3D11UnorderedAccessView1 : ID3D11UnorderedAccessView 267{ 268 void GetDesc1(D3D11_UNORDERED_ACCESS_VIEW_DESC1 *desc); 269} 270 271[ 272 uuid(631b4766-36dc-461d-8db6-c47e13e60916), 273 object, 274 local, 275 pointer_default(unique) 276] 277interface ID3D11Query1 : ID3D11Query 278{ 279 void GetDesc1(D3D11_QUERY_DESC1 *desc); 280} 281 282[ 283 uuid(b4e3c01d-e79e-4637-91b2-510e9f4c9b8f), 284 object, 285 local, 286 pointer_default(unique) 287] 288interface ID3D11DeviceContext3 : ID3D11DeviceContext2 289{ 290 void Flush1(D3D11_CONTEXT_TYPE type, HANDLE event); 291 void SetHardwareProtectionState(BOOL enable); 292 void GetHardwareProtectionState(BOOL *enable); 293} 294 295[ 296 uuid(affde9d1-1df7-4bb7-8a34-0f46251dab80), 297 object, 298 local, 299 pointer_default(unique) 300] 301interface ID3D11Fence : ID3D11DeviceChild 302{ 303 HRESULT CreateSharedHandle( 304 const SECURITY_ATTRIBUTES *attributes, 305 DWORD access, 306 const WCHAR *name, 307 HANDLE *handle 308 ); 309 UINT64 GetCompletedValue(); 310 HRESULT SetEventOnCompletion( 311 UINT64 value, 312 HANDLE event 313 ); 314} 315 316[ 317 uuid(917600da-f58c-4c33-98d8-3e15b390fa24), 318 object, 319 local, 320 pointer_default(unique) 321] 322interface ID3D11DeviceContext4 : ID3D11DeviceContext3 323{ 324 HRESULT Signal(ID3D11Fence *fence, UINT64 value); 325 HRESULT Wait(ID3D11Fence *fence, UINT64 value); 326} 327 328[ 329 uuid(a05c8c37-d2c6-4732-b3a0-9ce0b0dc9ae6), 330 object, 331 local, 332 pointer_default(unique) 333] 334interface ID3D11Device3 : ID3D11Device2 335{ 336 HRESULT CreateTexture2D1( 337 const D3D11_TEXTURE2D_DESC1 *desc, 338 const D3D11_SUBRESOURCE_DATA *initial_data, 339 ID3D11Texture2D1 **texture 340 ); 341 HRESULT CreateTexture3D1( 342 const D3D11_TEXTURE3D_DESC1 *desc, 343 const D3D11_SUBRESOURCE_DATA *initial_data, 344 ID3D11Texture3D1 **texture 345 ); 346 HRESULT CreateRasterizerState2( 347 const D3D11_RASTERIZER_DESC2 *desc, 348 ID3D11RasterizerState2 **state 349 ); 350 HRESULT CreateShaderResourceView1( 351 ID3D11Resource *resource, 352 const D3D11_SHADER_RESOURCE_VIEW_DESC1 *desc, 353 ID3D11ShaderResourceView1 **view 354 ); 355 HRESULT CreateUnorderedAccessView1( 356 ID3D11Resource *resource, 357 const D3D11_UNORDERED_ACCESS_VIEW_DESC1 *desc, 358 ID3D11UnorderedAccessView1 **view 359 ); 360 HRESULT CreateRenderTargetView1( 361 ID3D11Resource *resource, 362 const D3D11_RENDER_TARGET_VIEW_DESC1 *desc, 363 ID3D11RenderTargetView1 **view 364 ); 365 HRESULT CreateQuery1(const D3D11_QUERY_DESC1 *desc, ID3D11Query1 **query); 366 void GetImmediateContext3(ID3D11DeviceContext3 **context); 367 HRESULT CreateDeferredContext3(UINT flags, ID3D11DeviceContext3 **context); 368 void WriteToSubresource( 369 ID3D11Resource *dst_resource, 370 UINT dst_subresource, 371 const D3D11_BOX *dst_box, 372 const void *src_data, 373 UINT src_row_pitch, 374 UINT src_depth_pitch 375 ); 376 void ReadFromSubresource( 377 void *dst_data, 378 UINT dst_row_pitch, 379 UINT dst_depth_pitch, 380 ID3D11Resource *src_resource, 381 UINT src_subresource, 382 const D3D11_BOX *src_box 383 ); 384} 385