]> git.cworth.org Git - apitrace/blob - specs/d3d11_1.py
Use skiplist-based FastCallSet within trace::CallSet
[apitrace] / specs / d3d11_1.py
1 ##########################################################################
2 #
3 # Copyright 2012 Jose Fonseca
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 """d3d11_1.h"""
27
28
29 from winapi import *
30 from d3d11sdklayers import *
31 from d3d11 import *
32
33 import dxgi1_2
34
35 D3D_FEATURE_LEVEL.values += [
36     "D3D_FEATURE_LEVEL_11_1",
37 ]
38
39 D3D11_CREATE_DEVICE_FLAG.values += [
40     "D3D11_CREATE_DEVICE_DEBUGGABLE",
41     "D3D11_CREATE_DEVICE_PREVENT_ALTERING_LAYER_SETTINGS_FROM_REGISTRY",
42     "D3D11_CREATE_DEVICE_DISABLE_GPU_TIMEOUT",
43     "D3D11_CREATE_DEVICE_VIDEO_SUPPORT",
44 ]
45
46 D3D_MIN_PRECISION = Enum("D3D_MIN_PRECISION", [
47     "D3D_MIN_PRECISION_DEFAULT",
48     "D3D_MIN_PRECISION_FLOAT_16",
49     "D3D_MIN_PRECISION_FLOAT_2_8",
50     "D3D_MIN_PRECISION_RESERVED",
51     "D3D_MIN_PRECISION_SINT_16",
52     "D3D_MIN_PRECISION_UINT_16",
53     "D3D_MIN_PRECISION_ANY_16",
54     "D3D_MIN_PRECISION_ANY_10",
55 ])
56
57 ID3D11BlendState1 = Interface("ID3D11BlendState1", ID3D11BlendState)
58 ID3D11RasterizerState1 = Interface("ID3D11RasterizerState1", ID3D11RasterizerState)
59 ID3DDeviceContextState = Interface("ID3DDeviceContextState", ID3D11DeviceChild)
60 ID3D11DeviceContext1 = Interface("ID3D11DeviceContext1", ID3D11DeviceContext)
61 ID3D11Device1 = Interface("ID3D11Device1", ID3D11Device)
62 ID3DUserDefinedAnnotation = Interface("ID3DUserDefinedAnnotation", IUnknown)
63
64
65 D3D11_COPY_FLAGS = Flags(UINT, [
66     "D3D11_COPY_NO_OVERWRITE",
67     "D3D11_COPY_DISCARD",
68 ])
69
70 D3D11_LOGIC_OP = Enum("D3D11_LOGIC_OP", [
71     "D3D11_LOGIC_OP_CLEAR",
72     "D3D11_LOGIC_OP_SET",
73     "D3D11_LOGIC_OP_COPY",
74     "D3D11_LOGIC_OP_COPY_INVERTED",
75     "D3D11_LOGIC_OP_NOOP",
76     "D3D11_LOGIC_OP_INVERT",
77     "D3D11_LOGIC_OP_AND",
78     "D3D11_LOGIC_OP_NAND",
79     "D3D11_LOGIC_OP_OR",
80     "D3D11_LOGIC_OP_NOR",
81     "D3D11_LOGIC_OP_XOR",
82     "D3D11_LOGIC_OP_EQUIV",
83     "D3D11_LOGIC_OP_AND_REVERSE",
84     "D3D11_LOGIC_OP_AND_INVERTED",
85     "D3D11_LOGIC_OP_OR_REVERSE",
86     "D3D11_LOGIC_OP_OR_INVERTED",
87 ])
88
89 D3D11_RENDER_TARGET_BLEND_DESC1 = Struct("D3D11_RENDER_TARGET_BLEND_DESC1", [
90     (BOOL, "BlendEnable"),
91     (BOOL, "LogicOpEnable"),
92     (D3D11_BLEND, "SrcBlend"),
93     (D3D11_BLEND, "DestBlend"),
94     (D3D11_BLEND_OP, "BlendOp"),
95     (D3D11_BLEND, "SrcBlendAlpha"),
96     (D3D11_BLEND, "DestBlendAlpha"),
97     (D3D11_BLEND_OP, "BlendOpAlpha"),
98     (D3D11_LOGIC_OP, "LogicOp"),
99     (UINT8, "RenderTargetWriteMask"),
100 ])
101
102 D3D11_BLEND_DESC1 = Struct("D3D11_BLEND_DESC1", [
103     (BOOL, "AlphaToCoverageEnable"),
104     (BOOL, "IndependentBlendEnable"),
105     (Array(D3D11_RENDER_TARGET_BLEND_DESC1, "D3D11_SIMULTANEOUS_RENDER_TARGET_COUNT"), "RenderTarget"),
106 ])
107
108 ID3D11BlendState1.methods += [
109     StdMethod(Void, "GetDesc1", [Out(Pointer(D3D11_BLEND_DESC1), "pDesc")], sideeffects=False),
110 ]
111
112 D3D11_RASTERIZER_DESC1 = Struct("D3D11_RASTERIZER_DESC1", [
113     (D3D11_FILL_MODE, "FillMode"),
114     (D3D11_CULL_MODE, "CullMode"),
115     (BOOL, "FrontCounterClockwise"),
116     (INT, "DepthBias"),
117     (FLOAT, "DepthBiasClamp"),
118     (FLOAT, "SlopeScaledDepthBias"),
119     (BOOL, "DepthClipEnable"),
120     (BOOL, "ScissorEnable"),
121     (BOOL, "MultisampleEnable"),
122     (BOOL, "AntialiasedLineEnable"),
123     (UINT, "ForcedSampleCount"),
124 ])
125
126 ID3D11RasterizerState1.methods += [
127     StdMethod(Void, "GetDesc1", [Out(Pointer(D3D11_RASTERIZER_DESC1), "pDesc")], sideeffects=False),
128 ]
129
130 D3D11_1_CREATE_DEVICE_CONTEXT_STATE_FLAG = Flags(UINT, [
131     "D3D11_1_CREATE_DEVICE_CONTEXT_STATE_SINGLETHREADED",
132 ])
133
134 ID3D11DeviceContext1.methods += [
135     StdMethod(Void, "CopySubresourceRegion1", [(ObjPointer(ID3D11Resource), "pDstResource"), (UINT, "DstSubresource"), (UINT, "DstX"), (UINT, "DstY"), (UINT, "DstZ"), (ObjPointer(ID3D11Resource), "pSrcResource"), (UINT, "SrcSubresource"), (Pointer(Const(D3D11_BOX)), "pSrcBox"), (D3D11_COPY_FLAGS, "CopyFlags")]),
136     StdMethod(Void, "UpdateSubresource1", [(ObjPointer(ID3D11Resource), "pDstResource"), (UINT, "DstSubresource"), (Pointer(Const(D3D11_BOX)), "pDstBox"), (Blob(Const(Void), "_calcSubresourceSize(pDstResource, DstSubresource, pDstBox, SrcRowPitch, SrcDepthPitch)"), "pSrcData"), (UINT, "SrcRowPitch"), (UINT, "SrcDepthPitch"), (D3D11_COPY_FLAGS, "CopyFlags")]),
137     StdMethod(Void, "DiscardResource", [(ObjPointer(ID3D11Resource), "pResource")]),
138     StdMethod(Void, "DiscardView", [(ObjPointer(ID3D11View), "pResourceView")]),
139     StdMethod(Void, "DiscardView1", [(ObjPointer(ID3D11View), "pResourceView"), (Array(Const(D3D11_RECT), "NumRects"), "pRect"), (UINT, "NumRects")]),
140     StdMethod(Void, "VSSetConstantBuffers1", [(UINT, "StartSlot"), (UINT, "NumBuffers"), (Array(Const(ObjPointer(ID3D11Buffer)), "NumBuffers"), "ppConstantBuffers"), (Array(Const(UINT), "NumBuffers"), "pFirstConstant"), (Array(Const(UINT), "NumBuffers"), "pNumConstants")]),
141     StdMethod(Void, "HSSetConstantBuffers1", [(UINT, "StartSlot"), (UINT, "NumBuffers"), (Array(Const(ObjPointer(ID3D11Buffer)), "NumBuffers"), "ppConstantBuffers"), (Array(Const(UINT), "NumBuffers"), "pFirstConstant"), (Array(Const(UINT), "NumBuffers"), "pNumConstants")]),
142     StdMethod(Void, "DSSetConstantBuffers1", [(UINT, "StartSlot"), (UINT, "NumBuffers"), (Array(Const(ObjPointer(ID3D11Buffer)), "NumBuffers"), "ppConstantBuffers"), (Array(Const(UINT), "NumBuffers"), "pFirstConstant"), (Array(Const(UINT), "NumBuffers"), "pNumConstants")]),
143     StdMethod(Void, "GSSetConstantBuffers1", [(UINT, "StartSlot"), (UINT, "NumBuffers"), (Array(Const(ObjPointer(ID3D11Buffer)), "NumBuffers"), "ppConstantBuffers"), (Array(Const(UINT), "NumBuffers"), "pFirstConstant"), (Array(Const(UINT), "NumBuffers"), "pNumConstants")]),
144     StdMethod(Void, "PSSetConstantBuffers1", [(UINT, "StartSlot"), (UINT, "NumBuffers"), (Array(Const(ObjPointer(ID3D11Buffer)), "NumBuffers"), "ppConstantBuffers"), (Array(Const(UINT), "NumBuffers"), "pFirstConstant"), (Array(Const(UINT), "NumBuffers"), "pNumConstants")]),
145     StdMethod(Void, "CSSetConstantBuffers1", [(UINT, "StartSlot"), (UINT, "NumBuffers"), (Array(Const(ObjPointer(ID3D11Buffer)), "NumBuffers"), "ppConstantBuffers"), (Array(Const(UINT), "NumBuffers"), "pFirstConstant"), (Array(Const(UINT), "NumBuffers"), "pNumConstants")]),
146     StdMethod(Void, "VSGetConstantBuffers1", [(UINT, "StartSlot"), (UINT, "NumBuffers"), Out(Array(ObjPointer(ID3D11Buffer), "NumBuffers"), "ppConstantBuffers"), Out(Array(UINT, "NumBuffers"), "pFirstConstant"), Out(Array(UINT, "NumBuffers"), "pNumConstants")]),
147     StdMethod(Void, "HSGetConstantBuffers1", [(UINT, "StartSlot"), (UINT, "NumBuffers"), Out(Array(ObjPointer(ID3D11Buffer), "NumBuffers"), "ppConstantBuffers"), Out(Array(UINT, "NumBuffers"), "pFirstConstant"), Out(Array(UINT, "NumBuffers"), "pNumConstants")]),
148     StdMethod(Void, "DSGetConstantBuffers1", [(UINT, "StartSlot"), (UINT, "NumBuffers"), Out(Array(ObjPointer(ID3D11Buffer), "NumBuffers"), "ppConstantBuffers"), Out(Array(UINT, "NumBuffers"), "pFirstConstant"), Out(Array(UINT, "NumBuffers"), "pNumConstants")]),
149     StdMethod(Void, "GSGetConstantBuffers1", [(UINT, "StartSlot"), (UINT, "NumBuffers"), Out(Array(ObjPointer(ID3D11Buffer), "NumBuffers"), "ppConstantBuffers"), Out(Array(UINT, "NumBuffers"), "pFirstConstant"), Out(Array(UINT, "NumBuffers"), "pNumConstants")]),
150     StdMethod(Void, "PSGetConstantBuffers1", [(UINT, "StartSlot"), (UINT, "NumBuffers"), Out(Array(ObjPointer(ID3D11Buffer), "NumBuffers"), "ppConstantBuffers"), Out(Array(UINT, "NumBuffers"), "pFirstConstant"), Out(Array(UINT, "NumBuffers"), "pNumConstants")]),
151     StdMethod(Void, "CSGetConstantBuffers1", [(UINT, "StartSlot"), (UINT, "NumBuffers"), Out(Array(ObjPointer(ID3D11Buffer), "NumBuffers"), "ppConstantBuffers"), Out(Array(UINT, "NumBuffers"), "pFirstConstant"), Out(Array(UINT, "NumBuffers"), "pNumConstants")]),
152     StdMethod(Void, "SwapDeviceContextState", [(ObjPointer(ID3DDeviceContextState), "pState"), Out(Pointer(ObjPointer(ID3DDeviceContextState)), "ppPreviousState")]),
153     StdMethod(Void, "ClearView", [(ObjPointer(ID3D11View), "pView"), (Array(Const(FLOAT), 4), "Color"), (Pointer(Const(D3D11_RECT)), "pRect"), (UINT, "NumRects")]),
154 ]
155
156
157 ID3D11Device1.methods += [
158     StdMethod(Void, "GetImmediateContext1", [Out(Pointer(ObjPointer(ID3D11DeviceContext1)), "ppImmediateContext")]),
159     StdMethod(HRESULT, "CreateDeferredContext1", [(UINT, "ContextFlags"), Out(Pointer(ObjPointer(ID3D11DeviceContext1)), "ppDeferredContext")]),
160     StdMethod(HRESULT, "CreateBlendState1", [(Pointer(Const(D3D11_BLEND_DESC1)), "pBlendStateDesc"), Out(Pointer(ObjPointer(ID3D11BlendState1)), "ppBlendState")]),
161     StdMethod(HRESULT, "CreateRasterizerState1", [(Pointer(Const(D3D11_RASTERIZER_DESC1)), "pRasterizerDesc"), Out(Pointer(ObjPointer(ID3D11RasterizerState1)), "ppRasterizerState")]),
162     StdMethod(HRESULT, "CreateDeviceContextState", [(D3D11_1_CREATE_DEVICE_CONTEXT_STATE_FLAG, "Flags"), (Array(Const(D3D_FEATURE_LEVEL), "FeatureLevels"), "pFeatureLevels"), (UINT, "FeatureLevels"), (UINT, "SDKVersion"), (REFIID, "EmulatedInterface"), Out(Pointer(D3D_FEATURE_LEVEL), "pChosenFeatureLevel"), Out(Pointer(ObjPointer(ID3DDeviceContextState)), "ppContextState")]),
163     StdMethod(HRESULT, "OpenSharedResource1", [(HANDLE, "hResource"), (REFIID, "returnedInterface"), Out(Pointer(ObjPointer(Void)), "ppResource")]),
164     StdMethod(HRESULT, "OpenSharedResourceByName", [(LPCWSTR, "lpName"), (DXGI_SHARED_RESOURCE_FLAG, "dwDesiredAccess"), (REFIID, "returnedInterface"), Out(Pointer(ObjPointer(Void)), "ppResource")]),
165 ]
166
167 ID3DUserDefinedAnnotation.methods += [
168     StdMethod(INT, "BeginEvent", [(LPCWSTR, "Name")], sideeffects=False),
169     StdMethod(INT, "EndEvent", [], sideeffects=False),
170     StdMethod(Void, "SetMarker", [(LPCWSTR, "Name")], sideeffects=False),
171     StdMethod(BOOL, "GetStatus", [], sideeffects=False),
172 ]
173
174 d3d11.addInterfaces([
175     ID3D11Device1,
176     ID3DUserDefinedAnnotation,
177 ])