1 ##########################################################################
3 # Copyright 2008-2012 VMware, Inc.
6 # Permission is hereby granted, free of charge, to any person obtaining a copy
7 # of this software and associated documentation files (the "Software"), to deal
8 # in the Software without restriction, including without limitation the rights
9 # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 # copies of the Software, and to permit persons to whom the Software is
11 # furnished to do so, subject to the following conditions:
13 # The above copyright notice and this permission notice shall be included in
14 # all copies or substantial portions of the Software.
16 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
24 ##########################################################################/
31 D3D10_DRIVER_TYPE = Enum("D3D10_DRIVER_TYPE", [
32 "D3D10_DRIVER_TYPE_HARDWARE",
33 "D3D10_DRIVER_TYPE_REFERENCE",
34 "D3D10_DRIVER_TYPE_NULL",
35 "D3D10_DRIVER_TYPE_SOFTWARE",
36 "D3D10_DRIVER_TYPE_WARP",
39 D3D10_FEATURE_LEVEL1 = Enum("D3D10_FEATURE_LEVEL1", [
40 "D3D10_FEATURE_LEVEL_10_0",
41 "D3D10_FEATURE_LEVEL_10_1",
42 "D3D10_FEATURE_LEVEL_9_1",
43 "D3D10_FEATURE_LEVEL_9_2",
44 "D3D10_FEATURE_LEVEL_9_3",
47 D3D10_RENDER_TARGET_BLEND_DESC1 = Struct("D3D10_RENDER_TARGET_BLEND_DESC1", [
48 (BOOL, "BlendEnable"),
49 (D3D10_BLEND, "SrcBlend"),
50 (D3D10_BLEND, "DestBlend"),
51 (D3D10_BLEND_OP, "BlendOp"),
52 (D3D10_BLEND, "SrcBlendAlpha"),
53 (D3D10_BLEND, "DestBlendAlpha"),
54 (D3D10_BLEND_OP, "BlendOpAlpha"),
55 (UINT8, "RenderTargetWriteMask"),
58 D3D10_BLEND_DESC1 = Struct("D3D10_BLEND_DESC1", [
59 (BOOL, "AlphaToCoverageEnable"),
60 (BOOL, "IndependentBlendEnable"),
61 (Array(D3D10_RENDER_TARGET_BLEND_DESC1, "D3D10_SIMULTANEOUS_RENDER_TARGET_COUNT"), "RenderTarget"),
64 ID3D10BlendState1 = Interface("ID3D10BlendState1", ID3D10BlendState)
65 ID3D10BlendState1.methods += [
66 Method(Void, "GetDesc1", [Out(Pointer(D3D10_BLEND_DESC1), "pDesc")]),
69 D3D10_TEXCUBE_ARRAY_SRV1 = Struct("D3D10_TEXCUBE_ARRAY_SRV1", [
70 (UINT, "MostDetailedMip"),
72 (UINT, "First2DArrayFace"),
76 D3D10_SHADER_RESOURCE_VIEW_DESC1 = Struct("D3D10_SHADER_RESOURCE_VIEW_DESC1", [
77 (DXGI_FORMAT, "Format"),
78 (D3D10_SRV_DIMENSION1, "ViewDimension"),
79 (D3D10_BUFFER_SRV, "Buffer"),
80 (D3D10_TEX1D_SRV, "Texture1D"),
81 (D3D10_TEX1D_ARRAY_SRV, "Texture1DArray"),
82 (D3D10_TEX2D_SRV, "Texture2D"),
83 (D3D10_TEX2D_ARRAY_SRV, "Texture2DArray"),
84 (D3D10_TEX2DMS_SRV, "Texture2DMS"),
85 (D3D10_TEX2DMS_ARRAY_SRV, "Texture2DMSArray"),
86 (D3D10_TEX3D_SRV, "Texture3D"),
87 (D3D10_TEXCUBE_SRV, "TextureCube"),
88 (D3D10_TEXCUBE_ARRAY_SRV1, "TextureCubeArray"),
91 ID3D10ShaderResourceView1 = Interface("ID3D10ShaderResourceView1", ID3D10ShaderResourceView)
92 ID3D10ShaderResourceView1.methods += [
93 Method(Void, "GetDesc1", [Out(Pointer(D3D10_SHADER_RESOURCE_VIEW_DESC1), "pDesc")]),
96 ID3D10Device1 = Interface("ID3D10Device1", ID3D10Device)
97 ID3D10Device1.methods += [
98 Method(HRESULT, "CreateShaderResourceView1", [(ObjPointer(ID3D10Resource), "pResource"), Out(Pointer(Const(D3D10_SHADER_RESOURCE_VIEW_DESC1)), "pDesc"), Out(Pointer(ObjPointer(ID3D10ShaderResourceView1)), "ppSRView")]),
99 Method(HRESULT, "CreateBlendState1", [(Pointer(Const(D3D10_BLEND_DESC1)), "pBlendStateDesc"), Out(Pointer(ObjPointer(ID3D10BlendState1)), "ppBlendState")]),
100 Method(D3D10_FEATURE_LEVEL1, "GetFeatureLevel", []),
103 d3d10_1 = API("d3d10_1")
104 d3d10_1.addFunctions([
105 StdFunction(HRESULT, "D3D10CreateDevice1", [(ObjPointer(IDXGIAdapter), "pAdapter"), (D3D10_DRIVER_TYPE, "DriverType"), (HMODULE, "Software"), (D3D10_CREATE_DEVICE_FLAG, "Flags"), (D3D10_FEATURE_LEVEL1, "HardwareLevel"), (UINT, "SDKVersion"), Out(Pointer(ObjPointer(ID3D10Device1)), "ppDevice")]),
106 StdFunction(HRESULT, "D3D10CreateDeviceAndSwapChain1", [(ObjPointer(IDXGIAdapter), "pAdapter"), (D3D10_DRIVER_TYPE, "DriverType"), (HMODULE, "Software"), (D3D10_CREATE_DEVICE_FLAG, "Flags"), (D3D10_FEATURE_LEVEL1, "HardwareLevel"), (UINT, "SDKVersion"), (Pointer(DXGI_SWAP_CHAIN_DESC), "pSwapChainDesc"), Out(Pointer(ObjPointer(IDXGISwapChain)), "ppSwapChain"), Out(Pointer(ObjPointer(ID3D10Device1)), "ppDevice")]),
107 StdFunction(HRESULT, "D3D10CreateBlob", [(SIZE_T, "NumBytes"), Out(Pointer(LPD3D10BLOB), "ppBuffer")]),
110 d3d10_1.addInterfaces([