d3d10: Add the ID3D10ShaderReflectionConstantBuffer interface.
[wine] / include / d3d10shader.h
1 /*
2  * Copyright 2009 Henri Verbeet for CodeWeavers
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Lesser General Public
6  * License as published by the Free Software Foundation; either
7  * version 2.1 of the License, or (at your option) any later version.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12  * Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with this library; if not, write to the Free Software
16  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
17  *
18  */
19
20 #ifndef __WINE_D3D10SHADER_H
21 #define __WINE_D3D10SHADER_H
22
23 #include "d3d10.h"
24
25 #define D3D10_SHADER_DEBUG                          0x0001
26 #define D3D10_SHADER_SKIP_VALIDATION                0x0002
27 #define D3D10_SHADER_SKIP_OPTIMIZATION              0x0004
28 #define D3D10_SHADER_PACK_MATRIX_ROW_MAJOR          0x0008
29 #define D3D10_SHADER_PACK_MATRIX_COLUMN_MAJOR       0x0010
30 #define D3D10_SHADER_PARTIAL_PRECISION              0x0020
31 #define D3D10_SHADER_FORCE_VS_SOFTWARE_NO_OPT       0x0040
32 #define D3D10_SHADER_FORCE_PS_SOFTWARE_NO_OPT       0x0080
33 #define D3D10_SHADER_NO_PRESHADER                   0x0100
34 #define D3D10_SHADER_AVOID_FLOW_CONTROL             0x0200
35 #define D3D10_SHADER_PREFER_FLOW_CONTROL            0x0300
36 #define D3D10_SHADER_ENABLE_STRICTNESS              0x0400
37 #define D3D10_SHADER_ENABLE_BACKWARDS_COMPATIBILITY 0x0800
38 #define D3D10_SHADER_IEEE_STRICTNESS                0x1000
39
40 typedef enum _D3D10_SHADER_VARIABLE_CLASS
41 {
42     D3D10_SVC_SCALAR,
43     D3D10_SVC_VECTOR,
44     D3D10_SVC_MATRIX_ROWS,
45     D3D10_SVC_MATRIX_COLUMNS,
46     D3D10_SVC_OBJECT,
47     D3D10_SVC_STRUCT,
48     D3D10_SVC_FORCE_DWORD = 0x7fffffff
49 } D3D10_SHADER_VARIABLE_CLASS, *LPD3D10_SHADER_VARIABLE_CLASS;
50
51 typedef enum _D3D10_SHADER_VARIABLE_TYPE
52 {
53     D3D10_SVT_VOID = 0,
54     D3D10_SVT_BOOL = 1,
55     D3D10_SVT_INT = 2,
56     D3D10_SVT_FLOAT = 3,
57     D3D10_SVT_STRING = 4,
58     D3D10_SVT_TEXTURE = 5,
59     D3D10_SVT_TEXTURE1D = 6,
60     D3D10_SVT_TEXTURE2D = 7,
61     D3D10_SVT_TEXTURE3D = 8,
62     D3D10_SVT_TEXTURECUBE = 9,
63     D3D10_SVT_SAMPLER = 10,
64     D3D10_SVT_PIXELSHADER = 15,
65     D3D10_SVT_VERTEXSHADER = 16,
66     D3D10_SVT_UINT = 19,
67     D3D10_SVT_UINT8 = 20,
68     D3D10_SVT_GEOMETRYSHADER = 21,
69     D3D10_SVT_RASTERIZER = 22,
70     D3D10_SVT_DEPTHSTENCIL = 23,
71     D3D10_SVT_BLEND = 24,
72     D3D10_SVT_BUFFER = 25,
73     D3D10_SVT_CBUFFER = 26,
74     D3D10_SVT_TBUFFER = 27,
75     D3D10_SVT_TEXTURE1DARRAY = 28,
76     D3D10_SVT_TEXTURE2DARRAY = 29,
77     D3D10_SVT_RENDERTARGETVIEW = 30,
78     D3D10_SVT_DEPTHSTENCILVIEW = 31,
79     D3D10_SVT_TEXTURE2DMS = 32,
80     D3D10_SVT_TEXTURE2DMSARRAY = 33,
81     D3D10_SVT_TEXTURECUBEARRAY = 34,
82     D3D10_SVT_FORCE_DWORD = 0x7fffffff
83 } D3D10_SHADER_VARIABLE_TYPE, *LPD3D10_SHADER_VARIABLE_TYPE;
84
85 typedef enum D3D10_CBUFFER_TYPE
86 {
87     D3D10_CT_CBUFFER = 0,
88     D3D10_CT_TBUFFER = 1
89 } D3D10_CBUFFER_TYPE, *LPD3D10_CBUFFER_TYPE;
90
91 typedef enum D3D10_NAME
92 {
93     D3D10_NAME_UNDEFINED = 0,
94     D3D10_NAME_POSITION = 1,
95     D3D10_NAME_CLIP_DISTANCE = 2,
96     D3D10_NAME_CULL_DISTANCE = 3,
97     D3D10_NAME_RENDER_TARGET_ARRAY_INDEX = 4,
98     D3D10_NAME_VIEWPORT_ARRAY_INDEX = 5,
99     D3D10_NAME_VERTEX_ID = 6,
100     D3D10_NAME_PRIMITIVE_ID = 7,
101     D3D10_NAME_INSTANCE_ID = 8,
102     D3D10_NAME_IS_FRONT_FACE = 9,
103     D3D10_NAME_SAMPLE_INDEX = 10,
104     D3D10_NAME_TARGET = 64,
105     D3D10_NAME_DEPTH = 65,
106 } D3D10_NAME;
107
108 typedef enum D3D10_REGISTER_COMPONENT_TYPE
109 {
110     D3D10_REGISTER_COMPONENT_UNKNOWN = 0,
111     D3D10_REGISTER_COMPONENT_UINT32 = 1,
112     D3D10_REGISTER_COMPONENT_SINT32 = 2,
113     D3D10_REGISTER_COMPONENT_FLOAT32 = 3,
114 } D3D10_REGISTER_COMPONENT_TYPE;
115
116 typedef struct _D3D10_SHADER_MACRO
117 {
118     LPCSTR Name;
119     LPCSTR Definition;
120 } D3D10_SHADER_MACRO, *LPD3D10_SHADER_MACRO;
121
122 typedef struct _D3D10_SIGNATURE_PARAMETER_DESC
123 {
124     LPCSTR SemanticName;
125     UINT SemanticIndex;
126     UINT Register;
127     D3D10_NAME SystemValueType;
128     D3D10_REGISTER_COMPONENT_TYPE ComponentType;
129     BYTE Mask;
130     BYTE ReadWriteMask;
131 } D3D10_SIGNATURE_PARAMETER_DESC;
132
133 typedef struct _D3D10_SHADER_BUFFER_DESC
134 {
135     LPCSTR Name;
136     D3D10_CBUFFER_TYPE Type;
137     UINT Variables;
138     UINT Size;
139     UINT uFlags;
140 } D3D10_SHADER_BUFFER_DESC;
141
142 typedef struct _D3D10_SHADER_VARIABLE_DESC
143 {
144     LPCSTR Name;
145     UINT StartOffset;
146     UINT Size;
147     UINT uFlags;
148     LPVOID DefaultValue;
149 } D3D10_SHADER_VARIABLE_DESC;
150
151 typedef struct _D3D10_SHADER_TYPE_DESC
152 {
153     D3D10_SHADER_VARIABLE_CLASS Class;
154     D3D10_SHADER_VARIABLE_TYPE Type;
155     UINT Rows;
156     UINT Columns;
157     UINT Elements;
158     UINT Members;
159     UINT Offset;
160 } D3D10_SHADER_TYPE_DESC;
161
162 DEFINE_GUID(IID_ID3D10ShaderReflectionType, 0xc530ad7d, 0x9b16, 0x4395, 0xa9, 0x79, 0xba, 0x2e, 0xcf, 0xf8, 0x3a, 0xdd);
163
164 #define INTERFACE ID3D10ShaderReflectionType
165 DECLARE_INTERFACE(ID3D10ShaderReflectionType)
166 {
167     STDMETHOD(GetDesc)(THIS_ D3D10_SHADER_TYPE_DESC *desc) PURE;
168     STDMETHOD_(struct ID3D10ShaderReflectionType *, GetMemberTypeByIndex)(THIS_ UINT index) PURE;
169     STDMETHOD_(struct ID3D10ShaderReflectionType *, GetMemberTypeByName)(THIS_ LPCSTR name) PURE;
170     STDMETHOD_(LPCSTR, GetMemberTypeName)(THIS_ UINT index) PURE;
171 };
172 #undef INTERFACE
173
174 DEFINE_GUID(IID_ID3D10ShaderReflectionVariable, 0x1bf63c95, 0x2650, 0x405d, 0x99, 0xc1, 0x36, 0x36, 0xbd, 0x1d, 0xa0, 0xa1);
175
176 #define INTERFACE ID3D10ShaderReflectionVariable
177 DECLARE_INTERFACE(ID3D10ShaderReflectionVariable)
178 {
179     STDMETHOD(GetDesc)(THIS_ D3D10_SHADER_VARIABLE_DESC *desc) PURE;
180     STDMETHOD_(struct ID3D10ShaderReflectionType *, GetType)(THIS) PURE;
181 };
182 #undef INTERFACE
183
184 DEFINE_GUID(IID_ID3D10ShaderReflectionConstantBuffer, 0x66c66a94, 0xdddd, 0x4b62, 0xa6, 0x6a, 0xf0, 0xda, 0x33, 0xc2, 0xb4, 0xd0);
185
186 #define INTERFACE ID3D10ShaderReflectionConstantBuffer
187 DECLARE_INTERFACE(ID3D10ShaderReflectionConstantBuffer)
188 {
189     STDMETHOD(GetDesc)(THIS_ D3D10_SHADER_BUFFER_DESC *desc) PURE;
190     STDMETHOD_(struct ID3D10ShaderReflectionVariable *, GetVariableByIndex)(THIS_ UINT index) PURE;
191     STDMETHOD_(struct ID3D10ShaderReflectionVariable *, GetVariableByName)(THIS_ LPCSTR name) PURE;
192 };
193 #undef INTERFACE
194
195 LPCSTR WINAPI D3D10GetVertexShaderProfile(ID3D10Device *device);
196 LPCSTR WINAPI D3D10GetGeometryShaderProfile(ID3D10Device *device);
197 LPCSTR WINAPI D3D10GetPixelShaderProfile(ID3D10Device *device);
198
199 #endif /* __WINE_D3D10SHADER_H */