1 module directx.d3d11_3; 2 /*------------------------------------------------------------------------------------- 3 * 4 * Copyright (c) Microsoft Corporation 5 * 6 *-------------------------------------------------------------------------------------*/ 7 8 version(Windows): 9 10 public import directx.dxgi1_3; 11 public import directx.d3d11_2; 12 13 alias DWORD D3D11_CONTEXT_TYPE; 14 enum : D3D11_CONTEXT_TYPE 15 { 16 D3D11_CONTEXT_TYPE_ALL = 0, 17 D3D11_CONTEXT_TYPE_3D = 1, 18 D3D11_CONTEXT_TYPE_COMPUTE = 2, 19 D3D11_CONTEXT_TYPE_COPY = 3, 20 D3D11_CONTEXT_TYPE_VIDEO = 4 21 } 22 23 alias DWORD D3D11_TEXTURE_LAYOUT; 24 enum : D3D11_TEXTURE_LAYOUT 25 { 26 D3D11_TEXTURE_LAYOUT_UNDEFINED = 0, 27 D3D11_TEXTURE_LAYOUT_ROW_MAJOR = 1, 28 D3D11_TEXTURE_LAYOUT_64K_STANDARD_SWIZZLE = 2 29 } 30 31 struct D3D11_TEXTURE2D_DESC1 32 { 33 UINT Width; 34 UINT Height; 35 UINT MipLevels; 36 UINT ArraySize; 37 DXGI_FORMAT Format; 38 DXGI_SAMPLE_DESC SampleDesc; 39 D3D11_USAGE Usage; 40 UINT BindFlags; 41 UINT CPUAccessFlags; 42 UINT MiscFlags; 43 D3D11_TEXTURE_LAYOUT TextureLayout; 44 } 45 46 mixin(uuid!(ID3D11Texture2D1, "51218251-1E33-4617-9CCB-4D3A4367E7BB")); 47 extern (C++) interface ID3D11Texture2D1 : ID3D11Texture2D { 48 void GetDesc1(D3D11_TEXTURE2D_DESC1* pDesc); 49 } 50 51 struct D3D11_TEXTURE3D_DESC1 52 { 53 UINT Width; 54 UINT Height; 55 UINT Depth; 56 UINT MipLevels; 57 DXGI_FORMAT Format; 58 D3D11_USAGE Usage; 59 UINT BindFlags; 60 UINT CPUAccessFlags; 61 UINT MiscFlags; 62 D3D11_TEXTURE_LAYOUT TextureLayout; 63 } 64 65 mixin(uuid!(ID3D11Texture3D1, "0C711683-2853-4846-9BB0-F3E60639E46A")); 66 extern (C++) interface ID3D11Texture3D1 : ID3D11Texture3D { 67 void GetDesc1(D3D11_TEXTURE3D_DESC1* pDesc); 68 69 } 70 71 alias DWORD D3D11_CONSERVATIVE_RASTERIZATION_MODE; 72 enum : D3D11_CONSERVATIVE_RASTERIZATION_MODE 73 { 74 D3D11_CONSERVATIVE_RASTERIZATION_MODE_OFF = 0, 75 D3D11_CONSERVATIVE_RASTERIZATION_MODE_ON = 1 76 } 77 78 struct D3D11_RASTERIZER_DESC2 79 { 80 D3D11_FILL_MODE FillMode; 81 D3D11_CULL_MODE CullMode; 82 BOOL FrontCounterClockwise; 83 INT DepthBias; 84 FLOAT DepthBiasClamp; 85 FLOAT SlopeScaledDepthBias; 86 BOOL DepthClipEnable; 87 BOOL ScissorEnable; 88 BOOL MultisampleEnable; 89 BOOL AntialiasedLineEnable; 90 UINT ForcedSampleCount; 91 D3D11_CONSERVATIVE_RASTERIZATION_MODE ConservativeRaster; 92 } 93 94 mixin(uuid!(ID3D11RasterizerState2, "6fbd02fb-209f-46c4-b059-2ed15586a6ac")); 95 extern (C++) interface ID3D11RasterizerState2 : ID3D11RasterizerState1 { 96 void GetDesc2(D3D11_RASTERIZER_DESC2* pDesc); 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 mixin(uuid!(ID3D11ShaderResourceView1, "91308b87-9040-411d-8c67-c39253ce3802")); 136 extern (C++) interface ID3D11ShaderResourceView1 : ID3D11ShaderResourceView { 137 void GetDesc1(D3D11_SHADER_RESOURCE_VIEW_DESC1* pDesc1); 138 } 139 140 struct D3D11_TEX2D_RTV1 141 { 142 UINT MipSlice; 143 UINT PlaneSlice; 144 } 145 146 struct D3D11_TEX2D_ARRAY_RTV1 147 { 148 UINT MipSlice; 149 UINT FirstArraySlice; 150 UINT ArraySize; 151 UINT PlaneSlice; 152 } 153 154 struct D3D11_RENDER_TARGET_VIEW_DESC1 155 { 156 DXGI_FORMAT Format; 157 D3D11_RTV_DIMENSION ViewDimension; 158 union 159 { 160 D3D11_BUFFER_RTV Buffer; 161 D3D11_TEX1D_RTV Texture1D; 162 D3D11_TEX1D_ARRAY_RTV Texture1DArray; 163 D3D11_TEX2D_RTV1 Texture2D; 164 D3D11_TEX2D_ARRAY_RTV1 Texture2DArray; 165 D3D11_TEX2DMS_RTV Texture2DMS; 166 D3D11_TEX2DMS_ARRAY_RTV Texture2DMSArray; 167 D3D11_TEX3D_RTV Texture3D; 168 } 169 } 170 171 mixin(uuid!(ID3D11RenderTargetView1, "ffbe2e23-f011-418a-ac56-5ceed7c5b94b")); 172 extern (C++) interface ID3D11RenderTargetView1 : ID3D11RenderTargetView { 173 void GetDesc1(D3D11_RENDER_TARGET_VIEW_DESC1* pDesc1); 174 } 175 176 struct D3D11_TEX2D_UAV1 177 { 178 UINT MipSlice; 179 UINT PlaneSlice; 180 } 181 182 struct D3D11_TEX2D_ARRAY_UAV1 183 { 184 UINT MipSlice; 185 UINT FirstArraySlice; 186 UINT ArraySize; 187 UINT PlaneSlice; 188 } 189 190 struct D3D11_UNORDERED_ACCESS_VIEW_DESC1 191 { 192 DXGI_FORMAT Format; 193 D3D11_UAV_DIMENSION ViewDimension; 194 union 195 { 196 D3D11_BUFFER_UAV Buffer; 197 D3D11_TEX1D_UAV Texture1D; 198 D3D11_TEX1D_ARRAY_UAV Texture1DArray; 199 D3D11_TEX2D_UAV1 Texture2D; 200 D3D11_TEX2D_ARRAY_UAV1 Texture2DArray; 201 D3D11_TEX3D_UAV Texture3D; 202 } 203 } 204 205 mixin(uuid!(ID3D11UnorderedAccessView1, "7b3b6153-a886-4544-ab37-6537c8500403")); 206 extern (C++) interface ID3D11UnorderedAccessView1 : ID3D11UnorderedAccessView { 207 void GetDesc1(D3D11_UNORDERED_ACCESS_VIEW_DESC1* pDesc1); 208 } 209 210 struct D3D11_QUERY_DESC1 211 { 212 D3D11_QUERY Query; 213 UINT MiscFlags; 214 D3D11_CONTEXT_TYPE ContextType; 215 } 216 217 mixin(uuid!(ID3D11Query1, "631b4766-36dc-461d-8db6-c47e13e60916")); 218 extern (C++) interface ID3D11Query1 : ID3D11Query { 219 void GetDesc1(D3D11_QUERY_DESC1* pDesc1); 220 221 } 222 223 mixin(uuid!(ID3D11DeviceContext3, "b4e3c01d-e79e-4637-91b2-510e9f4c9b8f")); 224 extern (C++) interface ID3D11DeviceContext3 : ID3D11DeviceContext2 { 225 void Flush1(D3D11_CONTEXT_TYPE ContextType, HANDLE hEvent); 226 void SetHardwareProtectionState(BOOL HwProtectionEnable); 227 void GetHardwareProtectionState(BOOL* pHwProtectionEnable); 228 } 229 230 mixin(uuid!(ID3D11Device3, "A05C8C37-D2C6-4732-B3A0-9CE0B0DC9AE6")); 231 extern (C++) interface ID3D11Device3 : ID3D11Device2 { 232 HRESULT CreateTexture2D1( 233 const(D3D11_TEXTURE2D_DESC1)* pDesc1, 234 const(D3D11_SUBRESOURCE_DATA)* pInitialData, 235 ID3D11Texture2D1* ppTexture2D); 236 237 HRESULT CreateTexture3D1( 238 const(D3D11_TEXTURE3D_DESC1)* pDesc1, 239 const(D3D11_SUBRESOURCE_DATA)* pInitialData, 240 ID3D11Texture3D1* ppTexture3D); 241 242 HRESULT CreateRasterizerState2( 243 const(D3D11_RASTERIZER_DESC2)* pRasterizerDesc, 244 ID3D11RasterizerState2* ppRasterizerState); 245 246 HRESULT CreateShaderResourceView1( 247 ID3D11Resource pResource, 248 const(D3D11_SHADER_RESOURCE_VIEW_DESC1)* pDesc1, 249 ID3D11ShaderResourceView1* ppSRView1); 250 251 HRESULT CreateUnorderedAccessView1( 252 ID3D11Resource pResource, 253 const(D3D11_UNORDERED_ACCESS_VIEW_DESC1)* pDesc1, 254 ID3D11UnorderedAccessView1* ppUAView1); 255 256 HRESULT CreateRenderTargetView1( 257 ID3D11Resource* pResource, 258 const(D3D11_RENDER_TARGET_VIEW_DESC1)* pDesc1, 259 ID3D11RenderTargetView1* ppRTView1); 260 261 HRESULT CreateQuery1( 262 const(D3D11_QUERY_DESC1)* pQueryDesc1, 263 ID3D11Query1* ppQuery1); 264 265 void GetImmediateContext3( 266 ID3D11DeviceContext3* ppImmediateContext); 267 268 HRESULT CreateDeferredContext3( 269 UINT ContextFlags, 270 ID3D11DeviceContext3* ppDeferredContext); 271 272 void WriteToSubresource( 273 ID3D11Resource pDstResource, 274 UINT DstSubresource, 275 const(D3D11_BOX)* pDstBox, 276 const(void)* pSrcData, 277 UINT SrcRowPitch, 278 UINT SrcDepthPitch); 279 280 void ReadFromSubresource( 281 void* pDstData, 282 UINT DstRowPitch, 283 UINT DstDepthPitch, 284 ID3D11Resource pSrcResource, 285 UINT SrcSubresource, 286 const(D3D11_BOX)* pSrcBox); 287 }