1 module directx.d3d10_1;
2 /*-------------------------------------------------------------------------------------
3  *
4  * Copyright (c) Microsoft Corporation
5  *
6  *-------------------------------------------------------------------------------------*/
7 
8 public import directx.d3d10;
9 public import directx.d3d10misc;
10 public import directx.d3d10_1shader;
11 
12 enum D3D10_1_DEFAULT_SAMPLE_MASK    = ( 0xffffffff );
13 enum D3D10_1_FLOAT16_FUSED_TOLERANCE_IN_ULP = ( 0.6 );
14 enum D3D10_1_FLOAT32_TO_INTEGER_TOLERANCE_IN_ULP    = ( 0.6f );
15 enum D3D10_1_GS_INPUT_REGISTER_COUNT= ( 32 );
16 enum D3D10_1_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT    = ( 32 );
17 enum D3D10_1_IA_VERTEX_INPUT_STRUCTURE_ELEMENTS_COMPONENTS  = ( 128 );
18 enum D3D10_1_IA_VERTEX_INPUT_STRUCTURE_ELEMENT_COUNT= ( 32 );
19 enum D3D10_1_PS_OUTPUT_MASK_REGISTER_COMPONENTS     = ( 1 );
20 enum D3D10_1_PS_OUTPUT_MASK_REGISTER_COMPONENT_BIT_COUNT    = ( 32 );
21 enum D3D10_1_PS_OUTPUT_MASK_REGISTER_COUNT  = ( 1 );
22 enum D3D10_1_SHADER_MAJOR_VERSION   = ( 4 );
23 enum D3D10_1_SHADER_MINOR_VERSION   = ( 1 );
24 enum D3D10_1_SO_BUFFER_MAX_STRIDE_IN_BYTES  = ( 2048 );
25 enum D3D10_1_SO_BUFFER_MAX_WRITE_WINDOW_IN_BYTES    = ( 256 );
26 enum D3D10_1_SO_BUFFER_SLOT_COUNT   = ( 4 );
27 enum D3D10_1_SO_MULTIPLE_BUFFER_ELEMENTS_PER_BUFFER = ( 1 );
28 enum D3D10_1_SO_SINGLE_BUFFER_COMPONENT_LIMIT       = ( 64 );
29 enum D3D10_1_STANDARD_VERTEX_ELEMENT_COUNT  = ( 32 );
30 enum D3D10_1_SUBPIXEL_FRACTIONAL_BIT_COUNT  = ( 8 );
31 enum D3D10_1_VS_INPUT_REGISTER_COUNT= ( 32 );
32 enum D3D10_1_VS_OUTPUT_REGISTER_COUNT       = ( 32 );
33 
34 alias DWORD D3D10_FEATURE_LEVEL1;
35 enum : D3D10_FEATURE_LEVEL1
36 {
37     D3D10_FEATURE_LEVEL_10_0    = 0xa000,
38     D3D10_FEATURE_LEVEL_10_1    = 0xa100,
39     D3D10_FEATURE_LEVEL_9_1     = 0x9100,
40     D3D10_FEATURE_LEVEL_9_2     = 0x9200,
41     D3D10_FEATURE_LEVEL_9_3     = 0x9300
42 }
43 
44 struct D3D10_RENDER_TARGET_BLEND_DESC1
45 {
46     BOOL BlendEnable;
47     D3D10_BLEND SrcBlend;
48     D3D10_BLEND DestBlend;
49     D3D10_BLEND_OP BlendOp;
50     D3D10_BLEND SrcBlendAlpha;
51     D3D10_BLEND DestBlendAlpha;
52     D3D10_BLEND_OP BlendOpAlpha;
53     UINT8 RenderTargetWriteMask;
54 }
55 
56 struct D3D10_BLEND_DESC1
57 {
58     BOOL AlphaToCoverageEnable;
59     BOOL IndependentBlendEnable;
60     D3D10_RENDER_TARGET_BLEND_DESC1[8] RenderTarget;
61 }
62 
63 mixin(uuid!(ID3D10BlendState1, "EDAD8D99-8A35-4d6d-8566-2EA276CDE161"));
64 extern (C++) interface ID3D10BlendState1 : ID3D10BlendState {
65     void GetDesc1(D3D10_BLEND_DESC1* pDesc);
66 
67 }
68 
69 struct D3D10_TEXCUBE_ARRAY_SRV1
70 {
71     UINT MostDetailedMip;
72     UINT MipLevels;
73     UINT First2DArrayFace;
74     UINT NumCubes;
75 }
76 
77 alias D3D_SRV_DIMENSION D3D10_SRV_DIMENSION1;
78 
79 struct D3D10_SHADER_RESOURCE_VIEW_DESC1
80 {
81     DXGI_FORMAT Format;
82     D3D10_SRV_DIMENSION1 ViewDimension;
83     union
84     {
85         D3D10_BUFFER_SRV Buffer;
86         D3D10_TEX1D_SRV Texture1D;
87         D3D10_TEX1D_ARRAY_SRV Texture1DArray;
88         D3D10_TEX2D_SRV Texture2D;
89         D3D10_TEX2D_ARRAY_SRV Texture2DArray;
90         D3D10_TEX2DMS_SRV Texture2DMS;
91         D3D10_TEX2DMS_ARRAY_SRV Texture2DMSArray;
92         D3D10_TEX3D_SRV Texture3D;
93         D3D10_TEXCUBE_SRV TextureCube;
94         D3D10_TEXCUBE_ARRAY_SRV1 TextureCubeArray;
95     }
96 }
97 
98 mixin(uuid!(ID3D10ShaderResourceView1, "9B7E4C87-342C-4106-A19F-4F2704F689F0"));
99 extern (C++) interface ID3D10ShaderResourceView1 : ID3D10ShaderResourceView {
100     void GetDesc1(D3D10_SHADER_RESOURCE_VIEW_DESC1* pDesc);
101 }
102 
103 enum D3D10_STANDARD_MULTISAMPLE_QUALITY_LEVELS
104 {
105     D3D10_STANDARD_MULTISAMPLE_PATTERN  = 0xffffffff,
106     D3D10_CENTER_MULTISAMPLE_PATTERN    = 0xfffffffe
107 }
108 
109 mixin(uuid!(ID3D10Device1, "9B7E4C8F-342C-4106-A19F-4F2704F689F0"));
110 extern (C++) interface ID3D10Device1 : ID3D10Device {
111     HRESULT CreateShaderResourceView1(
112         ID3D10Resource pResource,
113         const(D3D10_SHADER_RESOURCE_VIEW_DESC1)* pDesc,
114         ID3D10ShaderResourceView1* ppSRView);
115 
116     HRESULT CreateBlendState1(
117         const(D3D10_BLEND_DESC1)* pBlendStateDesc,
118         ID3D10BlendState1* ppBlendState);
119 
120     D3D10_FEATURE_LEVEL1 GetFeatureLevel();
121 }
122 
123 enum D3D10_1_SDK_VERSION = 0x20;
124 
125 ///////////////////////////////////////////////////////////////////////////
126 // D3D10CreateDevice1
127 // ------------------
128 //
129 // pAdapter
130 //      If NULL, D3D10CreateDevice1 will choose the primary adapter and
131 //      create a new instance from a temporarily created IDXGIFactory.
132 //      If non-NULL, D3D10CreateDevice1 will register the appropriate
133 //      device, if necessary (via IDXGIAdapter::RegisterDrver), before
134 //      creating the device.
135 // DriverType
136 //      Specifies the driver type to be created: hardware, reference or
137 //      null.
138 // Software
139 //      HMODULE of a DLL implementing a software rasterizer. Must be NULL for
140 //      non-Software driver types.
141 // Flags
142 //      Any of those documented for D3D10CreateDeviceAndSwapChain1.
143 // HardwareLevel
144 //      Any of those documented for D3D10CreateDeviceAndSwapChain1.
145 // SDKVersion
146 //      SDK version. Use the D3D10_1_SDK_VERSION macro.
147 // ppDevice
148 //      Pointer to returned interface.
149 //
150 // Return Values
151 //  Any of those documented for
152 //          CreateDXGIFactory
153 //          IDXGIFactory::EnumAdapters
154 //          IDXGIAdapter::RegisterDriver
155 //          D3D10CreateDevice1
156 //
157 ///////////////////////////////////////////////////////////////////////////
158 
159 __gshared PFN_D3D10_CREATE_DEVICE1 D3D10CreateDevice1;
160 
161 extern (Windows) {
162     alias PFN_D3D10_CREATE_DEVICE1 = HRESULT function(
163         IDXGIAdapter         pAdapter,
164         D3D10_DRIVER_TYPE    DriverType,
165         HMODULE              Software,
166         UINT                 Flags,
167         D3D10_FEATURE_LEVEL1 HardwareLevel,
168         UINT                 SDKVersion,
169         ID3D10Device1        *ppDevice);
170 }
171 
172 ///////////////////////////////////////////////////////////////////////////
173 // D3D10CreateDeviceAndSwapChain1
174 // ------------------------------
175 //
176 // ppAdapter
177 //      If NULL, D3D10CreateDevice1 will choose the primary adapter and
178 //      create a new instance from a temporarily created IDXGIFactory.
179 //      If non-NULL, D3D10CreateDevice1 will register the appropriate
180 //      device, if necessary (via IDXGIAdapter::RegisterDrver), before
181 //      creating the device.
182 // DriverType
183 //      Specifies the driver type to be created: hardware, reference or
184 //      null.
185 // Software
186 //      HMODULE of a DLL implementing a software rasterizer. Must be NULL for
187 //      non-Software driver types.
188 // Flags
189 //      Any of those documented for D3D10CreateDevice1.
190 // HardwareLevel
191 //      Any of:
192 //          D3D10_CREATE_LEVEL_10_0
193 //          D3D10_CREATE_LEVEL_10_1
194 // SDKVersion
195 //      SDK version. Use the D3D10_1_SDK_VERSION macro.
196 // pSwapChainDesc
197 //      Swap chain description, may be NULL.
198 // ppSwapChain
199 //      Pointer to returned interface. May be NULL.
200 // ppDevice
201 //      Pointer to returned interface.
202 //
203 // Return Values
204 //  Any of those documented for
205 //          CreateDXGIFactory
206 //          IDXGIFactory::EnumAdapters
207 //          IDXGIAdapter::RegisterDriver
208 //          D3D10CreateDevice1
209 //          IDXGIFactory::CreateSwapChain
210 //
211 ///////////////////////////////////////////////////////////////////////////
212 
213 __gshared PFN_D3D10_CREATE_DEVICE_AND_SWAP_CHAIN1 D3D10CreateDeviceAndSwapChain1;
214 
215 extern (Windows) {
216     alias PFN_D3D10_CREATE_DEVICE_AND_SWAP_CHAIN1 = HRESULT function(
217             IDXGIAdapter pAdapter,
218             D3D10_DRIVER_TYPE DriverType,
219             HMODULE Software,
220             UINT Flags,
221             D3D10_FEATURE_LEVEL1 HardwareLevel,
222             UINT SDKVersion,
223             DXGI_SWAP_CHAIN_DESC* pSwapChainDesc,
224             IDXGISwapChain* ppSwapChain,
225             ID3D10Device1* ppDevice);
226 }