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 ##########################################################################/
29 from d3d10sdklayers import *
32 ID3D10Blob = Interface("ID3D10Blob", IUnknown)
33 LPD3D10BLOB = ObjPointer(ID3D10Blob)
35 ID3D10Blob.methods += [
36 Method(LPVOID, "GetBufferPointer", []),
37 Method(SIZE_T, "GetBufferSize", []),
40 D3D10_DRIVER_TYPE = Enum("D3D10_DRIVER_TYPE", [
41 "D3D10_DRIVER_TYPE_HARDWARE",
42 "D3D10_DRIVER_TYPE_REFERENCE",
43 "D3D10_DRIVER_TYPE_NULL",
44 "D3D10_DRIVER_TYPE_SOFTWARE",
45 "D3D10_DRIVER_TYPE_WARP",
48 D3D10_FEATURE_LEVEL1 = Enum("D3D10_FEATURE_LEVEL1", [
49 "D3D10_FEATURE_LEVEL_10_0",
50 "D3D10_FEATURE_LEVEL_10_1",
51 "D3D10_FEATURE_LEVEL_9_1",
52 "D3D10_FEATURE_LEVEL_9_2",
53 "D3D10_FEATURE_LEVEL_9_3",
56 D3D10_RENDER_TARGET_BLEND_DESC1 = Struct("D3D10_RENDER_TARGET_BLEND_DESC1", [
57 (BOOL, "BlendEnable"),
58 (D3D10_BLEND, "SrcBlend"),
59 (D3D10_BLEND, "DestBlend"),
60 (D3D10_BLEND_OP, "BlendOp"),
61 (D3D10_BLEND, "SrcBlendAlpha"),
62 (D3D10_BLEND, "DestBlendAlpha"),
63 (D3D10_BLEND_OP, "BlendOpAlpha"),
64 (UINT8, "RenderTargetWriteMask"),
67 D3D10_BLEND_DESC1 = Struct("D3D10_BLEND_DESC1", [
68 (BOOL, "AlphaToCoverageEnable"),
69 (BOOL, "IndependentBlendEnable"),
70 (Array(D3D10_RENDER_TARGET_BLEND_DESC1, "D3D10_SIMULTANEOUS_RENDER_TARGET_COUNT"), "RenderTarget"),
73 ID3D10BlendState1 = Interface("ID3D10BlendState1", ID3D10BlendState)
74 ID3D10BlendState1.methods += [
75 Method(Void, "GetDesc1", [Out(Pointer(D3D10_BLEND_DESC1), "pDesc")]),
78 D3D10_TEXCUBE_ARRAY_SRV1 = Struct("D3D10_TEXCUBE_ARRAY_SRV1", [
79 (UINT, "MostDetailedMip"),
81 (UINT, "First2DArrayFace"),
85 D3D10_SHADER_RESOURCE_VIEW_DESC1 = Struct("D3D10_SHADER_RESOURCE_VIEW_DESC1", [
86 (DXGI_FORMAT, "Format"),
87 (D3D10_SRV_DIMENSION1, "ViewDimension"),
88 (D3D10_BUFFER_SRV, "Buffer"),
89 (D3D10_TEX1D_SRV, "Texture1D"),
90 (D3D10_TEX1D_ARRAY_SRV, "Texture1DArray"),
91 (D3D10_TEX2D_SRV, "Texture2D"),
92 (D3D10_TEX2D_ARRAY_SRV, "Texture2DArray"),
93 (D3D10_TEX2DMS_SRV, "Texture2DMS"),
94 (D3D10_TEX2DMS_ARRAY_SRV, "Texture2DMSArray"),
95 (D3D10_TEX3D_SRV, "Texture3D"),
96 (D3D10_TEXCUBE_SRV, "TextureCube"),
97 (D3D10_TEXCUBE_ARRAY_SRV1, "TextureCubeArray"),
100 ID3D10ShaderResourceView1 = Interface("ID3D10ShaderResourceView1", ID3D10ShaderResourceView)
101 ID3D10ShaderResourceView1.methods += [
102 Method(Void, "GetDesc1", [Out(Pointer(D3D10_SHADER_RESOURCE_VIEW_DESC1), "pDesc")]),
105 ID3D10Device1 = Interface("ID3D10Device1", ID3D10Device)
106 ID3D10Device1.methods += [
107 Method(HRESULT, "CreateShaderResourceView1", [(ObjPointer(ID3D10Resource), "pResource"), Out(Pointer(Const(D3D10_SHADER_RESOURCE_VIEW_DESC1)), "pDesc"), Out(Pointer(ObjPointer(ID3D10ShaderResourceView1)), "ppSRView")]),
108 Method(HRESULT, "CreateBlendState1", [(Pointer(Const(D3D10_BLEND_DESC1)), "pBlendStateDesc"), Out(Pointer(ObjPointer(ID3D10BlendState1)), "ppBlendState")]),
109 Method(D3D10_FEATURE_LEVEL1, "GetFeatureLevel", []),
112 d3d10_1 = API("d3d10_1")
113 d3d10_1.addFunctions([
114 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")]),
115 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")]),
116 StdFunction(HRESULT, "D3D10CreateBlob", [(SIZE_T, "NumBytes"), Out(Pointer(LPD3D10BLOB), "ppBuffer")]),
119 d3d10_1.addInterfaces([
131 ID3D10DepthStencilView,
132 ID3D10RenderTargetView,
133 ID3D10ShaderResourceView1,
135 ID3D10DepthStencilState,
136 ID3D10GeometryShader,
139 ID3D10RasterizerState,