]> git.cworth.org Git - apitrace/blob - specs/d3d10_1.py
Minimal D3D11 support.
[apitrace] / specs / d3d10_1.py
1 ##########################################################################
2 #
3 # Copyright 2008-2012 VMware, Inc.
4 # All Rights Reserved.
5 #
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:
12 #
13 # The above copyright notice and this permission notice shall be included in
14 # all copies or substantial portions of the Software.
15 #
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
22 # THE SOFTWARE.
23 #
24 ##########################################################################/
25
26 """d3d10_1.h"""
27
28 from winapi import *
29 from d3d10sdklayers import *
30 from d3d10 import *
31
32 ID3D10Blob = Interface("ID3D10Blob", IUnknown)
33 LPD3D10BLOB = Pointer(ID3D10Blob)
34
35 ID3D10Blob.methods += [
36     Method(LPVOID, "GetBufferPointer", []),
37     Method(SIZE_T, "GetBufferSize", []),
38 ]
39
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",
46 ])
47
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",
54 ])
55
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"),
65 ])
66
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"),
71 ])
72
73 ID3D10BlendState1 = Interface("ID3D10BlendState1", ID3D10BlendState)
74 ID3D10BlendState1.methods += [
75     Method(Void, "GetDesc1", [Out(Pointer(D3D10_BLEND_DESC1), "pDesc")]),
76 ]
77
78 D3D10_TEXCUBE_ARRAY_SRV1 = Struct("D3D10_TEXCUBE_ARRAY_SRV1", [
79     (UINT, "MostDetailedMip"),
80     (UINT, "MipLevels"),
81     (UINT, "First2DArrayFace"),
82     (UINT, "NumCubes"),
83 ])
84
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"),
98 ])
99
100 ID3D10ShaderResourceView1 = Interface("ID3D10ShaderResourceView1", ID3D10ShaderResourceView)
101 ID3D10ShaderResourceView1.methods += [
102     Method(Void, "GetDesc1", [Out(Pointer(D3D10_SHADER_RESOURCE_VIEW_DESC1), "pDesc")]),
103 ]
104
105 ID3D10Device1 = Interface("ID3D10Device1", ID3D10Device)
106 ID3D10Device1.methods += [
107     Method(HRESULT, "CreateShaderResourceView1", [(Pointer(ID3D10Resource), "pResource"), Out(Pointer(Const(D3D10_SHADER_RESOURCE_VIEW_DESC1)), "pDesc"), Out(Pointer(Pointer(ID3D10ShaderResourceView1)), "ppSRView")]),
108     Method(HRESULT, "CreateBlendState1", [(Pointer(Const(D3D10_BLEND_DESC1)), "pBlendStateDesc"), Out(Pointer(Pointer(ID3D10BlendState1)), "ppBlendState")]),
109     Method(D3D10_FEATURE_LEVEL1, "GetFeatureLevel", []),
110 ]
111
112 d3d10_1 = API("d3d10_1")
113 d3d10_1.addFunctions([
114     StdFunction(HRESULT, "D3D10CreateDevice1", [(Pointer(IDXGIAdapter), "pAdapter"), (D3D10_DRIVER_TYPE, "DriverType"), (HMODULE, "Software"), (D3D10_CREATE_DEVICE_FLAG, "Flags"), (D3D10_FEATURE_LEVEL1, "HardwareLevel"), (UINT, "SDKVersion"), Out(Pointer(Pointer(ID3D10Device1)), "ppDevice")]),
115     StdFunction(HRESULT, "D3D10CreateDeviceAndSwapChain1", [(Pointer(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(Pointer(IDXGISwapChain)), "ppSwapChain"), Out(Pointer(Pointer(ID3D10Device1)), "ppDevice")]),
116     StdFunction(HRESULT, "D3D10CreateBlob", [(SIZE_T, "NumBytes"), Out(Pointer(LPD3D10BLOB), "ppBuffer")]),
117 ])
118
119 d3d10_1.addInterfaces([
120     IDXGIDevice,
121     ID3D10Debug,
122     ID3D10SwitchToRef,
123     ID3D10InfoQueue,
124     ID3D10DeviceChild,
125     ID3D10Resource,
126     ID3D10Buffer,
127     ID3D10Texture1D,
128     ID3D10Texture2D,
129     ID3D10Texture3D,
130     ID3D10View,
131     ID3D10DepthStencilView,
132     ID3D10RenderTargetView,
133     ID3D10ShaderResourceView1,
134     ID3D10BlendState1,
135     ID3D10DepthStencilState,
136     ID3D10GeometryShader,
137     ID3D10InputLayout,
138     ID3D10PixelShader,
139     ID3D10RasterizerState,
140     ID3D10SamplerState,
141     ID3D10VertexShader,
142     ID3D10Asynchronous,
143     ID3D10Counter,
144     ID3D10Query,
145     ID3D10Predicate,
146     ID3D10Device,
147     ID3D10Multithread,
148 ])