1 module directx.d3d11_1; 2 /*------------------------------------------------------------------------------------- 3 * 4 * Copyright (c) Microsoft Corporation 5 * 6 *-------------------------------------------------------------------------------------*/ 7 8 version(Windows): 9 10 public import directx.dxgi1_2; 11 public import directx.d3d11; 12 13 alias D3D11_COPY_FLAGS = int; 14 enum : D3D11_COPY_FLAGS 15 { 16 D3D11_COPY_NO_OVERWRITE = 0x1, 17 D3D11_COPY_DISCARD = 0x2 18 } 19 20 alias D3D11_LOGIC_OP = int; 21 enum : D3D11_LOGIC_OP 22 { 23 D3D11_LOGIC_OP_CLEAR = 0, 24 D3D11_LOGIC_OP_SET = ( D3D11_LOGIC_OP_CLEAR + 1 ) , 25 D3D11_LOGIC_OP_COPY = ( D3D11_LOGIC_OP_SET + 1 ) , 26 D3D11_LOGIC_OP_COPY_INVERTED = ( D3D11_LOGIC_OP_COPY + 1 ) , 27 D3D11_LOGIC_OP_NOOP = ( D3D11_LOGIC_OP_COPY_INVERTED + 1 ) , 28 D3D11_LOGIC_OP_INVERT = ( D3D11_LOGIC_OP_NOOP + 1 ) , 29 D3D11_LOGIC_OP_AND = ( D3D11_LOGIC_OP_INVERT + 1 ) , 30 D3D11_LOGIC_OP_NAND = ( D3D11_LOGIC_OP_AND + 1 ) , 31 D3D11_LOGIC_OP_OR = ( D3D11_LOGIC_OP_NAND + 1 ) , 32 D3D11_LOGIC_OP_NOR = ( D3D11_LOGIC_OP_OR + 1 ) , 33 D3D11_LOGIC_OP_XOR = ( D3D11_LOGIC_OP_NOR + 1 ) , 34 D3D11_LOGIC_OP_EQUIV = ( D3D11_LOGIC_OP_XOR + 1 ) , 35 D3D11_LOGIC_OP_AND_REVERSE = ( D3D11_LOGIC_OP_EQUIV + 1 ) , 36 D3D11_LOGIC_OP_AND_INVERTED = ( D3D11_LOGIC_OP_AND_REVERSE + 1 ) , 37 D3D11_LOGIC_OP_OR_REVERSE = ( D3D11_LOGIC_OP_AND_INVERTED + 1 ) , 38 D3D11_LOGIC_OP_OR_INVERTED = ( D3D11_LOGIC_OP_OR_REVERSE + 1 ) 39 } 40 41 struct D3D11_RENDER_TARGET_BLEND_DESC1 42 { 43 BOOL BlendEnable; 44 BOOL LogicOpEnable; 45 D3D11_BLEND SrcBlend; 46 D3D11_BLEND DestBlend; 47 D3D11_BLEND_OP BlendOp; 48 D3D11_BLEND SrcBlendAlpha; 49 D3D11_BLEND DestBlendAlpha; 50 D3D11_BLEND_OP BlendOpAlpha; 51 D3D11_LOGIC_OP LogicOp; 52 UINT8 RenderTargetWriteMask; 53 } 54 55 struct D3D11_BLEND_DESC1 56 { 57 BOOL AlphaToCoverageEnable = FALSE; 58 BOOL IndependentBlendEnable = FALSE; 59 D3D11_RENDER_TARGET_BLEND_DESC1[8] RenderTarget; 60 61 void Init() @property 62 { 63 const D3D11_RENDER_TARGET_BLEND_DESC1 defaultRenderTargetBlendDesc = 64 { 65 FALSE,FALSE, 66 D3D11_BLEND_ONE, D3D11_BLEND_ZERO, D3D11_BLEND_OP_ADD, 67 D3D11_BLEND_ONE, D3D11_BLEND_ZERO, D3D11_BLEND_OP_ADD, 68 D3D11_LOGIC_OP_NOOP, 69 D3D11_COLOR_WRITE_ENABLE_ALL, 70 }; 71 for (UINT i = 0; i < D3D11_SIMULTANEOUS_RENDER_TARGET_COUNT; ++i) 72 RenderTarget[ i ] = defaultRenderTargetBlendDesc; 73 } 74 } 75 76 mixin( uuid!(ID3D11BlendState1, "cc86fabe-da55-401d-85e7-e3c9de2877e9") ); 77 extern (C++) interface ID3D11BlendState1 : ID3D11BlendState 78 { 79 void GetDesc1( 80 /*out*/ D3D11_BLEND_DESC1* pDesc); 81 } 82 83 struct D3D11_RASTERIZER_DESC1 84 { 85 D3D11_FILL_MODE FillMode = D3D11_FILL_SOLID; 86 D3D11_CULL_MODE CullMode = D3D11_CULL_BACK; 87 BOOL FrontCounterClockwise = FALSE; 88 INT DepthBias = D3D11_DEFAULT_DEPTH_BIAS; 89 FLOAT DepthBiasClamp = D3D11_DEFAULT_DEPTH_BIAS_CLAMP; 90 FLOAT SlopeScaledDepthBias = D3D11_DEFAULT_SLOPE_SCALED_DEPTH_BIAS; 91 BOOL DepthClipEnable = TRUE; 92 BOOL ScissorEnable = FALSE; 93 BOOL MultisampleEnable = FALSE; 94 BOOL AntialiasedLineEnable = FALSE; 95 UINT ForcedSampleCount = 0; 96 } 97 98 mixin( uuid!(ID3D11RasterizerState1, "1217d7a6-5039-418c-b042-9cbe256afd6e") ); 99 extern (C++) interface ID3D11RasterizerState1 : ID3D11RasterizerState 100 { 101 void GetDesc1( 102 /*out*/ D3D11_RASTERIZER_DESC1* pDesc); 103 } 104 105 alias D3D11_1_CREATE_DEVICE_CONTEXT_STATE_FLAG = int; 106 enum : D3D11_1_CREATE_DEVICE_CONTEXT_STATE_FLAG 107 { 108 D3D11_1_CREATE_DEVICE_CONTEXT_STATE_SINGLETHREADED = 0x1 109 } 110 111 mixin( uuid!(ID3DDeviceContextState, "5c1e0d8a-7c23-48f9-8c59-a92958ceff11") ); 112 extern (C++) interface ID3DDeviceContextState : ID3D11DeviceChild 113 { 114 } 115 116 mixin( uuid!(ID3D11DeviceContext1, "bb2c6faa-b5fb-4082-8e6b-388b8cfa90e1") ); 117 extern (C++) interface ID3D11DeviceContext1 : ID3D11DeviceContext 118 { 119 void CopySubresourceRegion1( 120 ID3D11Resource pDstResource, 121 UINT DstSubresource, 122 UINT DstX, 123 UINT DstY, 124 UINT DstZ, 125 ID3D11Resource pSrcResource, 126 UINT SrcSubresource, 127 const(D3D11_BOX)* pSrcBox, 128 UINT CopyFlags); 129 130 void UpdateSubresource1( 131 ID3D11Resource pDstResource, 132 UINT DstSubresource, 133 const(D3D11_BOX)* pDstBox, 134 const(void*) pSrcData, 135 UINT SrcRowPitch, 136 UINT SrcDepthPitch, 137 UINT CopyFlags); 138 139 void DiscardResource( 140 ID3D11Resource pResource); 141 142 void DiscardView( 143 ID3D11View pResourceView); 144 145 void VSSetConstantBuffers1( 146 UINT StartSlot, 147 UINT NumBuffers, 148 const(ID3D11Buffer)* ppConstantBuffers, 149 const(UINT)* pFirstConstant, 150 const(UINT)* pNumConstants); 151 152 void HSSetConstantBuffers1( 153 UINT StartSlot, 154 UINT NumBuffers, 155 const(ID3D11Buffer)* ppConstantBuffers, 156 const(UINT)* pFirstConstant, 157 const(UINT)* pNumConstants); 158 159 void DSSetConstantBuffers1( 160 UINT StartSlot, 161 UINT NumBuffers, 162 const(ID3D11Buffer)* ppConstantBuffers, 163 const(UINT)* pFirstConstant, 164 const(UINT)* pNumConstants); 165 166 void GSSetConstantBuffers1( 167 UINT StartSlot, 168 UINT NumBuffers, 169 const(ID3D11Buffer)* ppConstantBuffers, 170 const(UINT)* pFirstConstant, 171 const(UINT)* pNumConstants); 172 173 void PSSetConstantBuffers1( 174 UINT StartSlot, 175 UINT NumBuffers, 176 const(ID3D11Buffer)* ppConstantBuffers, 177 const(UINT)* pFirstConstant, 178 const(UINT)* pNumConstants); 179 180 void CSSetConstantBuffers1( 181 UINT StartSlot, 182 UINT NumBuffers, 183 const(ID3D11Buffer)* ppConstantBuffers, 184 const(UINT)* pFirstConstant, 185 const(UINT)* pNumConstants); 186 187 void VSGetConstantBuffers1( 188 UINT StartSlot, 189 UINT NumBuffers, 190 /*out*/ ID3D11Buffer* ppConstantBuffers, 191 /*out*/ UINT* pFirstConstant, 192 /*out*/ UINT* pNumConstants); 193 194 void HSGetConstantBuffers1( 195 UINT StartSlot, 196 UINT NumBuffers, 197 /*out*/ ID3D11Buffer* ppConstantBuffers, 198 /*out*/ UINT* pFirstConstant, 199 /*out*/ UINT* pNumConstants); 200 201 void DSGetConstantBuffers1( 202 UINT StartSlot, 203 UINT NumBuffers, 204 /*out*/ ID3D11Buffer* ppConstantBuffers, 205 /*out*/ UINT* pFirstConstant, 206 /*out*/ UINT* pNumConstants); 207 208 void GSGetConstantBuffers1( 209 UINT StartSlot, 210 UINT NumBuffers, 211 /*out*/ ID3D11Buffer* ppConstantBuffers, 212 /*out*/ UINT* pFirstConstant, 213 /*out*/ UINT* pNumConstants); 214 215 void PSGetConstantBuffers1( 216 UINT StartSlot, 217 UINT NumBuffers, 218 /*out*/ ID3D11Buffer* ppConstantBuffers, 219 /*out*/ UINT* pFirstConstant, 220 /*out*/ UINT* pNumConstants); 221 222 void CSGetConstantBuffers1( 223 UINT StartSlot, 224 UINT NumBuffers, 225 /*out*/ ID3D11Buffer* ppConstantBuffers, 226 /*out*/ UINT* pFirstConstant, 227 /*out*/ UINT* pNumConstants); 228 229 void SwapDeviceContextState( 230 ID3DDeviceContextState pState, 231 ID3DDeviceContextState* ppPreviousState) ; 232 233 void ClearView( 234 ID3D11View pView, 235 const(FLOAT)[4] Color, 236 const(D3D11_RECT)* pRect, 237 UINT NumRects); 238 239 void DiscardView1( 240 ID3D11View pResourceView, 241 const(D3D11_RECT)* pRects, 242 UINT NumRects); 243 } 244 245 mixin( uuid!(ID3D11Device1, "a04bfb29-08ef-43d6-a49c-a9bdbdcbe686") ); 246 extern (C++) interface ID3D11Device1 : ID3D11Device 247 { 248 void GetImmediateContext1( 249 /*out*/ ID3D11DeviceContext1* ppImmediateContext); 250 251 HRESULT CreateDeferredContext1( 252 UINT ContextFlags, 253 /*out*/ ID3D11DeviceContext1* ppDeferredContext); 254 255 HRESULT CreateBlendState1( 256 const(D3D11_BLEND_DESC1)* pBlendStateDesc, 257 /*out*/ ID3D11BlendState1* ppBlendState); 258 259 HRESULT CreateRasterizerState1( 260 const(D3D11_RASTERIZER_DESC1)* pRasterizerDesc, 261 /*out*/ ID3D11RasterizerState1* ppRasterizerState); 262 263 HRESULT CreateDeviceContextState( 264 UINT Flags, 265 const(D3D_FEATURE_LEVEL)* pFeatureLevels, 266 UINT FeatureLevels, 267 UINT SDKVersion, 268 REFIID EmulatedInterface, 269 /*out*/ D3D_FEATURE_LEVEL* pChosenFeatureLevel, 270 /*out*/ ID3DDeviceContextState* ppContextState); 271 272 HRESULT OpenSharedResource1( 273 HANDLE hResource, 274 REFIID returnedInterface, 275 /*out*/ void** ppResource); 276 277 HRESULT OpenSharedResourceByName( 278 LPCWSTR lpName, 279 DWORD dwDesiredAccess, 280 REFIID returnedInterface, 281 /*out*/ void** ppResource); 282 } 283 284 mixin( uuid!(ID3DUserDefinedAnnotation, "b2daad8b-03d4-4dbf-95eb-32ab4b63d0ab") ); 285 extern (C++) interface ID3DUserDefinedAnnotation : IUnknown 286 { 287 INT BeginEvent( 288 LPCWSTR Name); 289 290 INT EndEvent(); 291 292 void SetMarker( 293 LPCWSTR Name); 294 295 BOOL GetStatus(); 296 }