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