2 * Copyright 2009 Henri Verbeet for CodeWeavers
3 * Copyright 2009 Rico Schüller
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2.1 of the License, or (at your option) any later version.
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
22 #include "wine/port.h"
24 #include "d3d10_private.h"
28 WINE_DEFAULT_DEBUG_CHANNEL(d3d10);
30 #define D3D10_FX10_TYPE_COLUMN_SHIFT 11
31 #define D3D10_FX10_TYPE_COLUMN_MASK (0x7 << D3D10_FX10_TYPE_COLUMN_SHIFT)
33 #define D3D10_FX10_TYPE_ROW_SHIFT 8
34 #define D3D10_FX10_TYPE_ROW_MASK (0x7 << D3D10_FX10_TYPE_ROW_SHIFT)
36 #define D3D10_FX10_TYPE_BASETYPE_SHIFT 3
37 #define D3D10_FX10_TYPE_BASETYPE_MASK (0x1f << D3D10_FX10_TYPE_BASETYPE_SHIFT)
39 #define D3D10_FX10_TYPE_CLASS_SHIFT 0
40 #define D3D10_FX10_TYPE_CLASS_MASK (0x7 << D3D10_FX10_TYPE_CLASS_SHIFT)
42 #define D3D10_FX10_TYPE_MATRIX_COLUMN_MAJOR_MASK 0x4000
44 static const struct ID3D10EffectTechniqueVtbl d3d10_effect_technique_vtbl;
45 static const struct ID3D10EffectPassVtbl d3d10_effect_pass_vtbl;
46 static const struct ID3D10EffectVariableVtbl d3d10_effect_variable_vtbl;
47 static const struct ID3D10EffectConstantBufferVtbl d3d10_effect_constant_buffer_vtbl;
48 static const struct ID3D10EffectScalarVariableVtbl d3d10_effect_scalar_variable_vtbl;
49 static const struct ID3D10EffectVectorVariableVtbl d3d10_effect_vector_variable_vtbl;
50 static const struct ID3D10EffectMatrixVariableVtbl d3d10_effect_matrix_variable_vtbl;
51 static const struct ID3D10EffectStringVariableVtbl d3d10_effect_string_variable_vtbl;
52 static const struct ID3D10EffectShaderResourceVariableVtbl d3d10_effect_shader_resource_variable_vtbl;
53 static const struct ID3D10EffectRenderTargetViewVariableVtbl d3d10_effect_render_target_view_variable_vtbl;
54 static const struct ID3D10EffectDepthStencilViewVariableVtbl d3d10_effect_depth_stencil_view_variable_vtbl;
55 static const struct ID3D10EffectShaderVariableVtbl d3d10_effect_shader_variable_vtbl;
56 static const struct ID3D10EffectBlendVariableVtbl d3d10_effect_blend_variable_vtbl;
57 static const struct ID3D10EffectDepthStencilVariableVtbl d3d10_effect_depth_stencil_variable_vtbl;
58 static const struct ID3D10EffectRasterizerVariableVtbl d3d10_effect_rasterizer_variable_vtbl;
59 static const struct ID3D10EffectSamplerVariableVtbl d3d10_effect_sampler_variable_vtbl;
60 static const struct ID3D10EffectTypeVtbl d3d10_effect_type_vtbl;
62 /* null objects - needed for invalid calls */
63 static struct d3d10_effect_technique null_technique = {{&d3d10_effect_technique_vtbl}};
64 static struct d3d10_effect_pass null_pass = {{&d3d10_effect_pass_vtbl}};
65 static struct d3d10_effect_type null_type = {{&d3d10_effect_type_vtbl}};
66 static struct d3d10_effect_variable null_local_buffer = {{(const ID3D10EffectVariableVtbl *)&d3d10_effect_constant_buffer_vtbl},
67 &null_local_buffer, &null_type};
68 static struct d3d10_effect_variable null_variable = {{&d3d10_effect_variable_vtbl},
69 &null_local_buffer, &null_type};
70 static struct d3d10_effect_variable null_scalar_variable = {{(const ID3D10EffectVariableVtbl *)&d3d10_effect_scalar_variable_vtbl},
71 &null_local_buffer, &null_type};
72 static struct d3d10_effect_variable null_vector_variable = {{(const ID3D10EffectVariableVtbl *)&d3d10_effect_vector_variable_vtbl},
73 &null_local_buffer, &null_type};
74 static struct d3d10_effect_variable null_matrix_variable = {{(const ID3D10EffectVariableVtbl *)&d3d10_effect_matrix_variable_vtbl},
75 &null_local_buffer, &null_type};
76 static struct d3d10_effect_variable null_string_variable = {{(const ID3D10EffectVariableVtbl *)&d3d10_effect_string_variable_vtbl},
77 &null_local_buffer, &null_type};
78 static struct d3d10_effect_variable null_shader_resource_variable = {{(const ID3D10EffectVariableVtbl *)&d3d10_effect_shader_resource_variable_vtbl},
79 &null_local_buffer, &null_type};
80 static struct d3d10_effect_variable null_render_target_view_variable = {{(const ID3D10EffectVariableVtbl *)&d3d10_effect_render_target_view_variable_vtbl},
81 &null_local_buffer, &null_type};
82 static struct d3d10_effect_variable null_depth_stencil_view_variable = {{(const ID3D10EffectVariableVtbl *)&d3d10_effect_depth_stencil_view_variable_vtbl},
83 &null_local_buffer, &null_type};
84 static struct d3d10_effect_variable null_shader_variable = {{(const ID3D10EffectVariableVtbl *)&d3d10_effect_shader_variable_vtbl},
85 &null_local_buffer, &null_type};
86 static struct d3d10_effect_variable null_blend_variable = {{(const ID3D10EffectVariableVtbl *)&d3d10_effect_blend_variable_vtbl},
87 &null_local_buffer, &null_type};
88 static struct d3d10_effect_variable null_depth_stencil_variable = {{(const ID3D10EffectVariableVtbl *)&d3d10_effect_depth_stencil_variable_vtbl},
89 &null_local_buffer, &null_type};
90 static struct d3d10_effect_variable null_rasterizer_variable = {{(const ID3D10EffectVariableVtbl *)&d3d10_effect_rasterizer_variable_vtbl},
91 &null_local_buffer, &null_type};
92 static struct d3d10_effect_variable null_sampler_variable = {{(const ID3D10EffectVariableVtbl *)&d3d10_effect_sampler_variable_vtbl},
93 &null_local_buffer, &null_type};
95 /* anonymous_shader_type and anonymous_shader */
96 static char anonymous_name[] = "$Anonymous";
97 static char anonymous_vertexshader_name[] = "vertexshader";
98 static char anonymous_pixelshader_name[] = "pixelshader";
99 static char anonymous_geometryshader_name[] = "geometryshader";
100 static struct d3d10_effect_type anonymous_vs_type = {{&d3d10_effect_type_vtbl},
101 anonymous_vertexshader_name, D3D10_SVT_VERTEXSHADER, D3D10_SVC_OBJECT};
102 static struct d3d10_effect_type anonymous_ps_type = {{&d3d10_effect_type_vtbl},
103 anonymous_pixelshader_name, D3D10_SVT_PIXELSHADER, D3D10_SVC_OBJECT};
104 static struct d3d10_effect_type anonymous_gs_type = {{&d3d10_effect_type_vtbl},
105 anonymous_geometryshader_name, D3D10_SVT_GEOMETRYSHADER, D3D10_SVC_OBJECT};
106 static struct d3d10_effect_variable anonymous_vs = {{(const ID3D10EffectVariableVtbl *)&d3d10_effect_shader_variable_vtbl},
107 &null_local_buffer, &anonymous_vs_type, &null_shader_variable, anonymous_name};
108 static struct d3d10_effect_variable anonymous_ps = {{(const ID3D10EffectVariableVtbl *)&d3d10_effect_shader_variable_vtbl},
109 &null_local_buffer, &anonymous_ps_type, &null_shader_variable, anonymous_name};
110 static struct d3d10_effect_variable anonymous_gs = {{(const ID3D10EffectVariableVtbl *)&d3d10_effect_shader_variable_vtbl},
111 &null_local_buffer, &anonymous_gs_type, &null_shader_variable, anonymous_name};
113 static struct d3d10_effect_type *get_fx10_type(struct d3d10_effect *effect, const char *data, DWORD offset);
115 static inline struct d3d10_effect_variable *impl_from_ID3D10EffectVariable(ID3D10EffectVariable *iface)
117 return CONTAINING_RECORD(iface, struct d3d10_effect_variable, ID3D10EffectVariable_iface);
120 struct d3d10_effect_state_property_info
124 D3D_SHADER_VARIABLE_TYPE type;
127 D3D_SHADER_VARIABLE_TYPE container_type;
131 static const struct d3d10_effect_state_property_info property_info[] =
133 {0x0c, "RasterizerState.FillMode", D3D10_SVT_INT, 1, 1, D3D10_SVT_RASTERIZER, FIELD_OFFSET(D3D10_RASTERIZER_DESC, FillMode) },
134 {0x0d, "RasterizerState.CullMode", D3D10_SVT_INT, 1, 1, D3D10_SVT_RASTERIZER, FIELD_OFFSET(D3D10_RASTERIZER_DESC, CullMode) },
135 {0x0e, "RasterizerState.FrontCounterClockwise", D3D10_SVT_BOOL, 1, 1, D3D10_SVT_RASTERIZER, FIELD_OFFSET(D3D10_RASTERIZER_DESC, FrontCounterClockwise) },
136 {0x0f, "RasterizerState.DepthBias", D3D10_SVT_INT, 1, 1, D3D10_SVT_RASTERIZER, FIELD_OFFSET(D3D10_RASTERIZER_DESC, DepthBias) },
137 {0x10, "RasterizerState.DepthBiasClamp", D3D10_SVT_FLOAT, 1, 1, D3D10_SVT_RASTERIZER, FIELD_OFFSET(D3D10_RASTERIZER_DESC, DepthBiasClamp) },
138 {0x11, "RasterizerState.SlopeScaledDepthBias", D3D10_SVT_FLOAT, 1, 1, D3D10_SVT_RASTERIZER, FIELD_OFFSET(D3D10_RASTERIZER_DESC, SlopeScaledDepthBias) },
139 {0x12, "RasterizerState.DepthClipEnable", D3D10_SVT_BOOL, 1, 1, D3D10_SVT_RASTERIZER, FIELD_OFFSET(D3D10_RASTERIZER_DESC, DepthClipEnable) },
140 {0x13, "RasterizerState.ScissorEnable", D3D10_SVT_BOOL, 1, 1, D3D10_SVT_RASTERIZER, FIELD_OFFSET(D3D10_RASTERIZER_DESC, ScissorEnable) },
141 {0x14, "RasterizerState.MultisampleEnable", D3D10_SVT_BOOL, 1, 1, D3D10_SVT_RASTERIZER, FIELD_OFFSET(D3D10_RASTERIZER_DESC, MultisampleEnable) },
142 {0x15, "RasterizerState.AntialiasedLineEnable", D3D10_SVT_BOOL, 1, 1, D3D10_SVT_RASTERIZER, FIELD_OFFSET(D3D10_RASTERIZER_DESC, AntialiasedLineEnable) },
143 {0x16, "DepthStencilState.DepthEnable", D3D10_SVT_BOOL, 1, 1, D3D10_SVT_DEPTHSTENCIL, FIELD_OFFSET(D3D10_DEPTH_STENCIL_DESC, DepthEnable) },
144 {0x17, "DepthStencilState.DepthWriteMask", D3D10_SVT_INT, 1, 1, D3D10_SVT_DEPTHSTENCIL, FIELD_OFFSET(D3D10_DEPTH_STENCIL_DESC, DepthWriteMask) },
145 {0x18, "DepthStencilState.DepthFunc", D3D10_SVT_INT, 1, 1, D3D10_SVT_DEPTHSTENCIL, FIELD_OFFSET(D3D10_DEPTH_STENCIL_DESC, DepthFunc) },
146 {0x19, "DepthStencilState.StencilEnable", D3D10_SVT_BOOL, 1, 1, D3D10_SVT_DEPTHSTENCIL, FIELD_OFFSET(D3D10_DEPTH_STENCIL_DESC, StencilEnable) },
147 {0x1a, "DepthStencilState.StencilReadMask", D3D10_SVT_UINT8, 1, 1, D3D10_SVT_DEPTHSTENCIL, FIELD_OFFSET(D3D10_DEPTH_STENCIL_DESC, StencilReadMask) },
148 {0x1b, "DepthStencilState.StencilWriteMask", D3D10_SVT_UINT8, 1, 1, D3D10_SVT_DEPTHSTENCIL, FIELD_OFFSET(D3D10_DEPTH_STENCIL_DESC, StencilWriteMask) },
149 {0x1c, "DepthStencilState.FrontFaceStencilFail", D3D10_SVT_INT, 1, 1, D3D10_SVT_DEPTHSTENCIL, FIELD_OFFSET(D3D10_DEPTH_STENCIL_DESC, FrontFace.StencilFailOp) },
150 {0x1d, "DepthStencilState.FrontFaceStencilDepthFail", D3D10_SVT_INT, 1, 1, D3D10_SVT_DEPTHSTENCIL, FIELD_OFFSET(D3D10_DEPTH_STENCIL_DESC, FrontFace.StencilDepthFailOp)},
151 {0x1e, "DepthStencilState.FrontFaceStencilPass", D3D10_SVT_INT, 1, 1, D3D10_SVT_DEPTHSTENCIL, FIELD_OFFSET(D3D10_DEPTH_STENCIL_DESC, FrontFace.StencilPassOp) },
152 {0x1f, "DepthStencilState.FrontFaceStencilFunc", D3D10_SVT_INT, 1, 1, D3D10_SVT_DEPTHSTENCIL, FIELD_OFFSET(D3D10_DEPTH_STENCIL_DESC, FrontFace.StencilFunc) },
153 {0x20, "DepthStencilState.BackFaceStencilFail", D3D10_SVT_INT, 1, 1, D3D10_SVT_DEPTHSTENCIL, FIELD_OFFSET(D3D10_DEPTH_STENCIL_DESC, BackFace.StencilFailOp) },
154 {0x21, "DepthStencilState.BackFaceStencilDepthFail", D3D10_SVT_INT, 1, 1, D3D10_SVT_DEPTHSTENCIL, FIELD_OFFSET(D3D10_DEPTH_STENCIL_DESC, BackFace.StencilDepthFailOp) },
155 {0x22, "DepthStencilState.BackFaceStencilPass", D3D10_SVT_INT, 1, 1, D3D10_SVT_DEPTHSTENCIL, FIELD_OFFSET(D3D10_DEPTH_STENCIL_DESC, BackFace.StencilPassOp) },
156 {0x23, "DepthStencilState.BackFaceStencilFunc", D3D10_SVT_INT, 1, 1, D3D10_SVT_DEPTHSTENCIL, FIELD_OFFSET(D3D10_DEPTH_STENCIL_DESC, BackFace.StencilFunc) },
157 {0x24, "BlendState.AlphaToCoverageEnable", D3D10_SVT_BOOL, 1, 1, D3D10_SVT_BLEND, FIELD_OFFSET(D3D10_BLEND_DESC, AlphaToCoverageEnable) },
158 {0x25, "BlendState.BlendEnable", D3D10_SVT_BOOL, 1, 8, D3D10_SVT_BLEND, FIELD_OFFSET(D3D10_BLEND_DESC, BlendEnable) },
159 {0x26, "BlendState.SrcBlend", D3D10_SVT_INT, 1, 1, D3D10_SVT_BLEND, FIELD_OFFSET(D3D10_BLEND_DESC, SrcBlend) },
160 {0x27, "BlendState.DestBlend", D3D10_SVT_INT, 1, 1, D3D10_SVT_BLEND, FIELD_OFFSET(D3D10_BLEND_DESC, DestBlend) },
161 {0x28, "BlendState.BlendOp", D3D10_SVT_INT, 1, 1, D3D10_SVT_BLEND, FIELD_OFFSET(D3D10_BLEND_DESC, BlendOp) },
162 {0x29, "BlendState.SrcBlendAlpha", D3D10_SVT_INT, 1, 1, D3D10_SVT_BLEND, FIELD_OFFSET(D3D10_BLEND_DESC, SrcBlendAlpha) },
163 {0x2a, "BlendState.DestBlendAlpha", D3D10_SVT_INT, 1, 1, D3D10_SVT_BLEND, FIELD_OFFSET(D3D10_BLEND_DESC, DestBlendAlpha) },
164 {0x2b, "BlendState.BlendOpAlpha", D3D10_SVT_INT, 1, 1, D3D10_SVT_BLEND, FIELD_OFFSET(D3D10_BLEND_DESC, BlendOpAlpha) },
165 {0x2c, "BlendState.RenderTargetWriteMask", D3D10_SVT_UINT8, 1, 8, D3D10_SVT_BLEND, FIELD_OFFSET(D3D10_BLEND_DESC, RenderTargetWriteMask) },
166 {0x2d, "SamplerState.Filter", D3D10_SVT_INT, 1, 1, D3D10_SVT_SAMPLER, FIELD_OFFSET(D3D10_SAMPLER_DESC, Filter) },
167 {0x2e, "SamplerState.AddressU", D3D10_SVT_INT, 1, 1, D3D10_SVT_SAMPLER, FIELD_OFFSET(D3D10_SAMPLER_DESC, AddressU) },
168 {0x2f, "SamplerState.AddressV", D3D10_SVT_INT, 1, 1, D3D10_SVT_SAMPLER, FIELD_OFFSET(D3D10_SAMPLER_DESC, AddressV) },
169 {0x30, "SamplerState.AddressW", D3D10_SVT_INT, 1, 1, D3D10_SVT_SAMPLER, FIELD_OFFSET(D3D10_SAMPLER_DESC, AddressW) },
170 {0x31, "SamplerState.MipMapLODBias", D3D10_SVT_FLOAT, 1, 1, D3D10_SVT_SAMPLER, FIELD_OFFSET(D3D10_SAMPLER_DESC, MipLODBias) },
171 {0x32, "SamplerState.MaxAnisotropy", D3D10_SVT_UINT, 1, 1, D3D10_SVT_SAMPLER, FIELD_OFFSET(D3D10_SAMPLER_DESC, MaxAnisotropy) },
172 {0x33, "SamplerState.ComparisonFunc", D3D10_SVT_INT, 1, 1, D3D10_SVT_SAMPLER, FIELD_OFFSET(D3D10_SAMPLER_DESC, ComparisonFunc) },
173 {0x34, "SamplerState.BorderColor", D3D10_SVT_FLOAT, 4, 1, D3D10_SVT_SAMPLER, FIELD_OFFSET(D3D10_SAMPLER_DESC, BorderColor) },
174 {0x35, "SamplerState.MinLOD", D3D10_SVT_FLOAT, 1, 1, D3D10_SVT_SAMPLER, FIELD_OFFSET(D3D10_SAMPLER_DESC, MinLOD) },
175 {0x36, "SamplerState.MaxLOD", D3D10_SVT_FLOAT, 1, 1, D3D10_SVT_SAMPLER, FIELD_OFFSET(D3D10_SAMPLER_DESC, MaxLOD) },
178 static const D3D10_RASTERIZER_DESC default_rasterizer_desc =
192 static const D3D10_DEPTH_STENCIL_DESC default_depth_stencil_desc =
195 D3D10_DEPTH_WRITE_MASK_ALL,
196 D3D10_COMPARISON_LESS,
198 D3D10_DEFAULT_STENCIL_READ_MASK,
199 D3D10_DEFAULT_STENCIL_WRITE_MASK,
200 {D3D10_STENCIL_OP_KEEP, D3D10_STENCIL_OP_KEEP, D3D10_STENCIL_OP_KEEP, D3D10_COMPARISON_ALWAYS},
201 {D3D10_STENCIL_OP_KEEP, D3D10_STENCIL_OP_KEEP, D3D10_STENCIL_OP_KEEP, D3D10_COMPARISON_ALWAYS},
204 static const D3D10_BLEND_DESC default_blend_desc =
207 {FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE},
208 D3D10_BLEND_SRC_ALPHA,
209 D3D10_BLEND_INV_SRC_ALPHA,
211 D3D10_BLEND_SRC_ALPHA,
212 D3D10_BLEND_INV_SRC_ALPHA,
214 {0xf, 0xf, 0xf, 0xf, 0xf, 0xf, 0xf, 0xf},
217 static const D3D10_SAMPLER_DESC default_sampler_desc =
219 D3D10_FILTER_MIN_MAG_MIP_POINT,
220 D3D10_TEXTURE_ADDRESS_WRAP,
221 D3D10_TEXTURE_ADDRESS_WRAP,
222 D3D10_TEXTURE_ADDRESS_WRAP,
225 D3D10_COMPARISON_NEVER,
226 {0.0f, 0.0f, 0.0f, 0.0f},
231 struct d3d10_effect_state_storage_info
233 D3D_SHADER_VARIABLE_TYPE id;
235 const void *default_state;
238 static const struct d3d10_effect_state_storage_info d3d10_effect_state_storage_info[] =
240 {D3D10_SVT_RASTERIZER, sizeof(default_rasterizer_desc), &default_rasterizer_desc },
241 {D3D10_SVT_DEPTHSTENCIL, sizeof(default_depth_stencil_desc), &default_depth_stencil_desc},
242 {D3D10_SVT_BLEND, sizeof(default_blend_desc), &default_blend_desc },
243 {D3D10_SVT_SAMPLER, sizeof(default_sampler_desc), &default_sampler_desc },
246 static BOOL copy_name(const char *ptr, char **name)
250 if (!ptr) return TRUE;
252 name_len = strlen(ptr) + 1;
258 *name = HeapAlloc(GetProcessHeap(), 0, name_len);
261 ERR("Failed to allocate name memory.\n");
265 memcpy(*name, ptr, name_len);
270 static HRESULT shader_parse_signature(const char *data, DWORD data_size, struct d3d10_effect_shader_signature *s)
272 D3D10_SIGNATURE_PARAMETER_DESC *e;
273 const char *ptr = data;
277 read_dword(&ptr, &count);
278 TRACE("%u elements\n", count);
280 skip_dword_unknown("shader signature", &ptr, 1);
282 e = HeapAlloc(GetProcessHeap(), 0, count * sizeof(*e));
285 ERR("Failed to allocate signature memory.\n");
286 return E_OUTOFMEMORY;
289 for (i = 0; i < count; ++i)
294 read_dword(&ptr, &name_offset);
295 e[i].SemanticName = data + name_offset;
296 read_dword(&ptr, &e[i].SemanticIndex);
297 read_dword(&ptr, &e[i].SystemValueType);
298 read_dword(&ptr, &e[i].ComponentType);
299 read_dword(&ptr, &e[i].Register);
300 read_dword(&ptr, &mask);
302 e[i].ReadWriteMask = mask >> 8;
303 e[i].Mask = mask & 0xff;
305 TRACE("semantic: %s, semantic idx: %u, sysval_semantic %#x, "
306 "type %u, register idx: %u, use_mask %#x, input_mask %#x\n",
307 debugstr_a(e[i].SemanticName), e[i].SemanticIndex, e[i].SystemValueType,
308 e[i].ComponentType, e[i].Register, e[i].Mask, e[i].ReadWriteMask);
312 s->element_count = count;
317 static void shader_free_signature(struct d3d10_effect_shader_signature *s)
319 HeapFree(GetProcessHeap(), 0, s->signature);
320 HeapFree(GetProcessHeap(), 0, s->elements);
323 static HRESULT shader_chunk_handler(const char *data, DWORD data_size, DWORD tag, void *ctx)
325 struct d3d10_effect_shader_variable *s = ctx;
328 TRACE("tag: %s.\n", debugstr_an((const char *)&tag, 4));
330 TRACE("chunk size: %#x\n", data_size);
337 /* 32 (DXBC header) + 1 * 4 (chunk index) + 2 * 4 (chunk header) + data_size (chunk data) */
338 UINT size = 44 + data_size;
339 struct d3d10_effect_shader_signature *sig;
342 if (tag == TAG_ISGN) sig = &s->input_signature;
343 else sig = &s->output_signature;
345 sig->signature = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, size);
348 ERR("Failed to allocate input signature data\n");
349 return E_OUTOFMEMORY;
351 sig->signature_size = size;
353 ptr = sig->signature;
355 write_dword(&ptr, TAG_DXBC);
358 write_dword_unknown(&ptr, 0);
359 write_dword_unknown(&ptr, 0);
360 write_dword_unknown(&ptr, 0);
361 write_dword_unknown(&ptr, 0);
363 /* seems to be always 1 */
364 write_dword_unknown(&ptr, 1);
367 write_dword(&ptr, size);
370 write_dword(&ptr, 1);
373 write_dword(&ptr, (ptr - sig->signature) + 4);
376 write_dword(&ptr, tag);
377 write_dword(&ptr, data_size);
378 memcpy(ptr, data, data_size);
380 hr = shader_parse_signature(ptr, data_size, sig);
383 ERR("Failed to parse shader, hr %#x\n", hr);
384 shader_free_signature(sig);
391 FIXME("Unhandled chunk %s.\n", debugstr_an((const char *)&tag, 4));
398 static HRESULT parse_shader(ID3D10EffectVariable *variable, const char *data)
400 struct d3d10_effect_variable *v = impl_from_ID3D10EffectVariable(variable);
401 ID3D10Device *device = v->effect->device;
402 struct d3d10_effect_shader_variable *s;
403 const char *ptr = data;
407 s = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*s));
410 ERR("Failed to allocate shader variable memory\n");
411 return E_OUTOFMEMORY;
416 if (v->effect->used_shader_current >= v->effect->used_shader_count)
418 WARN("Invalid shader? Used shader current(%u) >= used shader count(%u)\n", v->effect->used_shader_current, v->effect->used_shader_count);
422 v->effect->used_shaders[v->effect->used_shader_current] = v;
423 ++v->effect->used_shader_current;
425 if (!ptr) return S_OK;
427 read_dword(&ptr, &dxbc_size);
428 TRACE("dxbc size: %#x\n", dxbc_size);
430 /* We got a shader VertexShader vs = NULL, so it is fine to skip this. */
431 if (!dxbc_size) return S_OK;
433 switch (v->type->basetype)
435 case D3D10_SVT_VERTEXSHADER:
436 hr = ID3D10Device_CreateVertexShader(device, ptr, dxbc_size, &s->shader.vs);
437 if (FAILED(hr)) return hr;
440 case D3D10_SVT_PIXELSHADER:
441 hr = ID3D10Device_CreatePixelShader(device, ptr, dxbc_size, &s->shader.ps);
442 if (FAILED(hr)) return hr;
445 case D3D10_SVT_GEOMETRYSHADER:
446 hr = ID3D10Device_CreateGeometryShader(device, ptr, dxbc_size, &s->shader.gs);
447 if (FAILED(hr)) return hr;
451 ERR("This should not happen!\n");
455 return parse_dxbc(ptr, dxbc_size, shader_chunk_handler, s);
458 static D3D10_SHADER_VARIABLE_CLASS d3d10_variable_class(DWORD c, BOOL is_column_major)
462 case 1: return D3D10_SVC_SCALAR;
463 case 2: return D3D10_SVC_VECTOR;
464 case 3: if (is_column_major) return D3D10_SVC_MATRIX_COLUMNS;
465 else return D3D10_SVC_MATRIX_ROWS;
467 FIXME("Unknown variable class %#x.\n", c);
472 static D3D10_SHADER_VARIABLE_TYPE d3d10_variable_type(DWORD t, BOOL is_object)
478 case 1: return D3D10_SVT_STRING;
479 case 2: return D3D10_SVT_BLEND;
480 case 3: return D3D10_SVT_DEPTHSTENCIL;
481 case 4: return D3D10_SVT_RASTERIZER;
482 case 5: return D3D10_SVT_PIXELSHADER;
483 case 6: return D3D10_SVT_VERTEXSHADER;
484 case 7: return D3D10_SVT_GEOMETRYSHADER;
486 case 10: return D3D10_SVT_TEXTURE1D;
487 case 11: return D3D10_SVT_TEXTURE1DARRAY;
488 case 12: return D3D10_SVT_TEXTURE2D;
489 case 13: return D3D10_SVT_TEXTURE2DARRAY;
490 case 14: return D3D10_SVT_TEXTURE2DMS;
491 case 15: return D3D10_SVT_TEXTURE2DMSARRAY;
492 case 16: return D3D10_SVT_TEXTURE3D;
493 case 17: return D3D10_SVT_TEXTURECUBE;
495 case 19: return D3D10_SVT_RENDERTARGETVIEW;
496 case 20: return D3D10_SVT_DEPTHSTENCILVIEW;
497 case 21: return D3D10_SVT_SAMPLER;
498 case 22: return D3D10_SVT_BUFFER;
500 FIXME("Unknown variable type %#x.\n", t);
501 return D3D10_SVT_VOID;
508 case 1: return D3D10_SVT_FLOAT;
509 case 2: return D3D10_SVT_INT;
510 case 3: return D3D10_SVT_UINT;
511 case 4: return D3D10_SVT_BOOL;
513 FIXME("Unknown variable type %#x.\n", t);
514 return D3D10_SVT_VOID;
519 static HRESULT parse_fx10_type(struct d3d10_effect_type *t, const char *ptr, const char *data)
526 read_dword(&ptr, &offset);
527 TRACE("Type name at offset %#x.\n", offset);
529 if (!copy_name(data + offset, &t->name))
531 ERR("Failed to copy name.\n");
532 return E_OUTOFMEMORY;
534 TRACE("Type name: %s.\n", debugstr_a(t->name));
536 read_dword(&ptr, &unknown0);
537 TRACE("Unknown 0: %u.\n", unknown0);
539 read_dword(&ptr, &t->element_count);
540 TRACE("Element count: %u.\n", t->element_count);
542 read_dword(&ptr, &t->size_unpacked);
543 TRACE("Unpacked size: %#x.\n", t->size_unpacked);
545 read_dword(&ptr, &t->stride);
546 TRACE("Stride: %#x.\n", t->stride);
548 read_dword(&ptr, &t->size_packed);
549 TRACE("Packed size %#x.\n", t->size_packed);
556 read_dword(&ptr, &typeinfo);
557 t->column_count = (typeinfo & D3D10_FX10_TYPE_COLUMN_MASK) >> D3D10_FX10_TYPE_COLUMN_SHIFT;
558 t->row_count = (typeinfo & D3D10_FX10_TYPE_ROW_MASK) >> D3D10_FX10_TYPE_ROW_SHIFT;
559 t->basetype = d3d10_variable_type((typeinfo & D3D10_FX10_TYPE_BASETYPE_MASK) >> D3D10_FX10_TYPE_BASETYPE_SHIFT, FALSE);
560 t->type_class = d3d10_variable_class((typeinfo & D3D10_FX10_TYPE_CLASS_MASK) >> D3D10_FX10_TYPE_CLASS_SHIFT, typeinfo & D3D10_FX10_TYPE_MATRIX_COLUMN_MAJOR_MASK);
562 TRACE("Type description: %#x.\n", typeinfo);
563 TRACE("\tcolumns: %u.\n", t->column_count);
564 TRACE("\trows: %u.\n", t->row_count);
565 TRACE("\tbasetype: %s.\n", debug_d3d10_shader_variable_type(t->basetype));
566 TRACE("\tclass: %s.\n", debug_d3d10_shader_variable_class(t->type_class));
567 TRACE("\tunknown bits: %#x.\n", typeinfo & ~(D3D10_FX10_TYPE_COLUMN_MASK | D3D10_FX10_TYPE_ROW_MASK
568 | D3D10_FX10_TYPE_BASETYPE_MASK | D3D10_FX10_TYPE_CLASS_MASK | D3D10_FX10_TYPE_MATRIX_COLUMN_MAJOR_MASK));
572 TRACE("Type is an object.\n");
577 t->type_class = D3D10_SVC_OBJECT;
579 read_dword(&ptr, &typeinfo);
580 t->basetype = d3d10_variable_type(typeinfo, TRUE);
582 TRACE("Type description: %#x.\n", typeinfo);
583 TRACE("\tbasetype: %s.\n", debug_d3d10_shader_variable_type(t->basetype));
584 TRACE("\tclass: %s.\n", debug_d3d10_shader_variable_class(t->type_class));
588 TRACE("Type is a structure.\n");
590 read_dword(&ptr, &t->member_count);
591 TRACE("Member count: %u.\n", t->member_count);
596 t->type_class = D3D10_SVC_STRUCT;
598 t->members = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, t->member_count * sizeof(*t->members));
601 ERR("Failed to allocate members memory.\n");
602 return E_OUTOFMEMORY;
605 for (i = 0; i < t->member_count; ++i)
607 struct d3d10_effect_type_member *typem = &t->members[i];
609 read_dword(&ptr, &offset);
610 TRACE("Member name at offset %#x.\n", offset);
612 if (!copy_name(data + offset, &typem->name))
614 ERR("Failed to copy name.\n");
615 return E_OUTOFMEMORY;
617 TRACE("Member name: %s.\n", debugstr_a(typem->name));
619 read_dword(&ptr, &offset);
620 TRACE("Member semantic at offset %#x.\n", offset);
622 if (!copy_name(data + offset, &typem->semantic))
624 ERR("Failed to copy semantic.\n");
625 return E_OUTOFMEMORY;
627 TRACE("Member semantic: %s.\n", debugstr_a(typem->semantic));
629 read_dword(&ptr, &typem->buffer_offset);
630 TRACE("Member offset in struct: %#x.\n", typem->buffer_offset);
632 read_dword(&ptr, &offset);
633 TRACE("Member type info at offset %#x.\n", offset);
635 typem->type = get_fx10_type(t->effect, data, offset);
638 ERR("Failed to get variable type.\n");
645 FIXME("Unhandled case %#x.\n", unknown0);
649 if (t->element_count)
651 TRACE("Elementtype for type at offset: %#x\n", t->id);
653 /* allocate elementtype - we need only one, because all elements have the same type */
654 t->elementtype = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*t->elementtype));
657 ERR("Failed to allocate members memory.\n");
658 return E_OUTOFMEMORY;
661 /* create a copy of the original type with some minor changes */
662 t->elementtype->ID3D10EffectType_iface.lpVtbl = &d3d10_effect_type_vtbl;
663 t->elementtype->effect = t->effect;
665 if (!copy_name(t->name, &t->elementtype->name))
667 ERR("Failed to copy name.\n");
668 return E_OUTOFMEMORY;
670 TRACE("\tType name: %s.\n", debugstr_a(t->elementtype->name));
672 t->elementtype->element_count = 0;
673 TRACE("\tElement count: %u.\n", t->elementtype->element_count);
676 * Not sure if this calculation is 100% correct, but a test
677 * shows that these values work.
679 t->elementtype->size_unpacked = t->size_packed / t->element_count;
680 TRACE("\tUnpacked size: %#x.\n", t->elementtype->size_unpacked);
682 t->elementtype->stride = t->stride;
683 TRACE("\tStride: %#x.\n", t->elementtype->stride);
685 t->elementtype->size_packed = t->size_packed / t->element_count;
686 TRACE("\tPacked size: %#x.\n", t->elementtype->size_packed);
688 t->elementtype->member_count = t->member_count;
689 TRACE("\tMember count: %u.\n", t->elementtype->member_count);
691 t->elementtype->column_count = t->column_count;
692 TRACE("\tColumns: %u.\n", t->elementtype->column_count);
694 t->elementtype->row_count = t->row_count;
695 TRACE("\tRows: %u.\n", t->elementtype->row_count);
697 t->elementtype->basetype = t->basetype;
698 TRACE("\tBasetype: %s.\n", debug_d3d10_shader_variable_type(t->elementtype->basetype));
700 t->elementtype->type_class = t->type_class;
701 TRACE("\tClass: %s.\n", debug_d3d10_shader_variable_class(t->elementtype->type_class));
703 t->elementtype->members = t->members;
709 static struct d3d10_effect_type *get_fx10_type(struct d3d10_effect *effect, const char *data, DWORD offset)
711 struct d3d10_effect_type *type;
712 struct wine_rb_entry *entry;
715 entry = wine_rb_get(&effect->types, &offset);
718 TRACE("Returning existing type.\n");
719 return WINE_RB_ENTRY_VALUE(entry, struct d3d10_effect_type, entry);
722 type = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*type));
725 ERR("Failed to allocate type memory.\n");
729 type->ID3D10EffectType_iface.lpVtbl = &d3d10_effect_type_vtbl;
731 type->effect = effect;
732 hr = parse_fx10_type(type, data + offset, data);
735 ERR("Failed to parse type info, hr %#x.\n", hr);
736 HeapFree(GetProcessHeap(), 0, type);
740 if (wine_rb_put(&effect->types, &offset, &type->entry) == -1)
742 ERR("Failed to insert type entry.\n");
743 HeapFree(GetProcessHeap(), 0, type);
750 static void set_variable_vtbl(struct d3d10_effect_variable *v)
752 const ID3D10EffectVariableVtbl **vtbl = &v->ID3D10EffectVariable_iface.lpVtbl;
754 switch (v->type->type_class)
756 case D3D10_SVC_SCALAR:
757 *vtbl = (const ID3D10EffectVariableVtbl *)&d3d10_effect_scalar_variable_vtbl;
760 case D3D10_SVC_VECTOR:
761 *vtbl = (const ID3D10EffectVariableVtbl *)&d3d10_effect_vector_variable_vtbl;
764 case D3D10_SVC_MATRIX_ROWS:
765 case D3D10_SVC_MATRIX_COLUMNS:
766 *vtbl = (const ID3D10EffectVariableVtbl *)&d3d10_effect_matrix_variable_vtbl;
769 case D3D10_SVC_STRUCT:
770 *vtbl = &d3d10_effect_variable_vtbl;
773 case D3D10_SVC_OBJECT:
774 switch(v->type->basetype)
776 case D3D10_SVT_STRING:
777 *vtbl = (const ID3D10EffectVariableVtbl *)&d3d10_effect_string_variable_vtbl;
780 case D3D10_SVT_TEXTURE1D:
781 case D3D10_SVT_TEXTURE1DARRAY:
782 case D3D10_SVT_TEXTURE2D:
783 case D3D10_SVT_TEXTURE2DARRAY:
784 case D3D10_SVT_TEXTURE2DMS:
785 case D3D10_SVT_TEXTURE2DMSARRAY:
786 case D3D10_SVT_TEXTURE3D:
787 case D3D10_SVT_TEXTURECUBE:
788 case D3D10_SVT_BUFFER: /* Either resource or constant buffer. */
789 *vtbl = (const ID3D10EffectVariableVtbl *)&d3d10_effect_shader_resource_variable_vtbl;
792 case D3D10_SVT_RENDERTARGETVIEW:
793 *vtbl = (const ID3D10EffectVariableVtbl *)&d3d10_effect_render_target_view_variable_vtbl;
796 case D3D10_SVT_DEPTHSTENCILVIEW:
797 *vtbl = (const ID3D10EffectVariableVtbl *)&d3d10_effect_depth_stencil_view_variable_vtbl;
800 case D3D10_SVT_DEPTHSTENCIL:
801 *vtbl = (const ID3D10EffectVariableVtbl *)&d3d10_effect_depth_stencil_variable_vtbl;
804 case D3D10_SVT_VERTEXSHADER:
805 case D3D10_SVT_GEOMETRYSHADER:
806 case D3D10_SVT_PIXELSHADER:
807 *vtbl = (const ID3D10EffectVariableVtbl *)&d3d10_effect_shader_variable_vtbl;
810 case D3D10_SVT_BLEND:
811 *vtbl = (const ID3D10EffectVariableVtbl *)&d3d10_effect_blend_variable_vtbl;
814 case D3D10_SVT_RASTERIZER:
815 *vtbl = (const ID3D10EffectVariableVtbl *)&d3d10_effect_rasterizer_variable_vtbl;
818 case D3D10_SVT_SAMPLER:
819 *vtbl = (const ID3D10EffectVariableVtbl *)&d3d10_effect_sampler_variable_vtbl;
823 FIXME("Unhandled basetype %s.\n", debug_d3d10_shader_variable_type(v->type->basetype));
824 *vtbl = &d3d10_effect_variable_vtbl;
830 FIXME("Unhandled type class %s.\n", debug_d3d10_shader_variable_class(v->type->type_class));
831 *vtbl = &d3d10_effect_variable_vtbl;
836 static HRESULT copy_variableinfo_from_type(struct d3d10_effect_variable *v)
841 if (v->type->member_count)
843 v->members = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, v->type->member_count * sizeof(*v->members));
846 ERR("Failed to allocate members memory.\n");
847 return E_OUTOFMEMORY;
850 for (i = 0; i < v->type->member_count; ++i)
852 struct d3d10_effect_variable *var = &v->members[i];
853 struct d3d10_effect_type_member *typem = &v->type->members[i];
855 var->buffer = v->buffer;
856 var->effect = v->effect;
857 var->type = typem->type;
858 set_variable_vtbl(var);
860 if (!copy_name(typem->name, &var->name))
862 ERR("Failed to copy name.\n");
863 return E_OUTOFMEMORY;
865 TRACE("Variable name: %s.\n", debugstr_a(var->name));
867 if (!copy_name(typem->semantic, &var->semantic))
869 ERR("Failed to copy name.\n");
870 return E_OUTOFMEMORY;
872 TRACE("Variable semantic: %s.\n", debugstr_a(var->semantic));
874 var->buffer_offset = v->buffer_offset + typem->buffer_offset;
875 TRACE("Variable buffer offset: %u.\n", var->buffer_offset);
877 hr = copy_variableinfo_from_type(var);
878 if (FAILED(hr)) return hr;
882 if (v->type->element_count)
884 unsigned int bufferoffset = v->buffer_offset;
886 v->elements = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, v->type->element_count * sizeof(*v->elements));
889 ERR("Failed to allocate elements memory.\n");
890 return E_OUTOFMEMORY;
893 for (i = 0; i < v->type->element_count; ++i)
895 struct d3d10_effect_variable *var = &v->elements[i];
897 var->buffer = v->buffer;
898 var->effect = v->effect;
899 var->type = v->type->elementtype;
900 set_variable_vtbl(var);
902 if (!copy_name(v->name, &var->name))
904 ERR("Failed to copy name.\n");
905 return E_OUTOFMEMORY;
907 TRACE("Variable name: %s.\n", debugstr_a(var->name));
909 if (!copy_name(v->semantic, &var->semantic))
911 ERR("Failed to copy name.\n");
912 return E_OUTOFMEMORY;
914 TRACE("Variable semantic: %s.\n", debugstr_a(var->semantic));
918 bufferoffset += v->type->stride;
920 var->buffer_offset = bufferoffset;
921 TRACE("Variable buffer offset: %u.\n", var->buffer_offset);
923 hr = copy_variableinfo_from_type(var);
924 if (FAILED(hr)) return hr;
931 static HRESULT parse_fx10_variable_head(struct d3d10_effect_variable *v, const char **ptr, const char *data)
935 read_dword(ptr, &offset);
936 TRACE("Variable name at offset %#x.\n", offset);
938 if (!copy_name(data + offset, &v->name))
940 ERR("Failed to copy name.\n");
941 return E_OUTOFMEMORY;
943 TRACE("Variable name: %s.\n", debugstr_a(v->name));
945 read_dword(ptr, &offset);
946 TRACE("Variable type info at offset %#x.\n", offset);
948 v->type = get_fx10_type(v->effect, data, offset);
951 ERR("Failed to get variable type.\n");
954 set_variable_vtbl(v);
956 return copy_variableinfo_from_type(v);
959 static HRESULT parse_fx10_annotation(struct d3d10_effect_variable *a, const char **ptr, const char *data)
963 hr = parse_fx10_variable_head(a, ptr, data);
964 if (FAILED(hr)) return hr;
966 skip_dword_unknown("annotation", ptr, 1);
968 /* mark the variable as annotation */
969 a->flag = D3D10_EFFECT_VARIABLE_ANNOTATION;
974 static HRESULT parse_fx10_anonymous_shader(struct d3d10_effect *e, struct d3d10_effect_anonymous_shader *s,
975 enum d3d10_effect_object_type otype)
977 struct d3d10_effect_variable *v = &s->shader;
978 struct d3d10_effect_type *t = &s->type;
979 const char *shader = NULL;
983 case D3D10_EOT_VERTEXSHADER:
984 shader = "vertexshader";
985 t->basetype = D3D10_SVT_VERTEXSHADER;
988 case D3D10_EOT_PIXELSHADER:
989 shader = "pixelshader";
990 t->basetype = D3D10_SVT_PIXELSHADER;
993 case D3D10_EOT_GEOMETRYSHADER:
994 shader = "geometryshader";
995 t->basetype = D3D10_SVT_GEOMETRYSHADER;
999 FIXME("Unhandled object type %#x.\n", otype);
1003 if (!copy_name(shader, &t->name))
1005 ERR("Failed to copy name.\n");
1006 return E_OUTOFMEMORY;
1008 TRACE("Type name: %s.\n", debugstr_a(t->name));
1010 t->type_class = D3D10_SVC_OBJECT;
1012 t->ID3D10EffectType_iface.lpVtbl = &d3d10_effect_type_vtbl;
1016 set_variable_vtbl(v);
1018 if (!copy_name("$Anonymous", &v->name))
1020 ERR("Failed to copy semantic.\n");
1021 return E_OUTOFMEMORY;
1023 TRACE("Variable name: %s.\n", debugstr_a(v->name));
1025 if (!copy_name(NULL, &v->semantic))
1027 ERR("Failed to copy semantic.\n");
1028 return E_OUTOFMEMORY;
1030 TRACE("Variable semantic: %s.\n", debugstr_a(v->semantic));
1035 static const struct d3d10_effect_state_property_info *get_property_info(UINT id)
1039 for (i = 0; i < sizeof(property_info) / sizeof(*property_info); ++i)
1041 if (property_info[i].id == id)
1042 return &property_info[i];
1048 static const struct d3d10_effect_state_storage_info *get_storage_info(D3D_SHADER_VARIABLE_TYPE id)
1052 for (i = 0; i < sizeof(d3d10_effect_state_storage_info) / sizeof(*d3d10_effect_state_storage_info); ++i)
1054 if (d3d10_effect_state_storage_info[i].id == id)
1055 return &d3d10_effect_state_storage_info[i];
1061 static BOOL read_float_value(DWORD value, D3D_SHADER_VARIABLE_TYPE in_type, float *out_data, UINT idx)
1065 case D3D10_SVT_FLOAT:
1066 out_data[idx] = *(float *)&value;
1070 out_data[idx] = (INT)value;
1074 FIXME("Unhandled in_type %#x.\n", in_type);
1079 static BOOL read_int32_value(DWORD value, D3D_SHADER_VARIABLE_TYPE in_type, INT *out_data, UINT idx)
1083 case D3D10_SVT_FLOAT:
1084 out_data[idx] = *(float *)&value;
1088 case D3D10_SVT_UINT:
1089 case D3D10_SVT_BOOL:
1090 out_data[idx] = value;
1094 FIXME("Unhandled in_type %#x.\n", in_type);
1099 static BOOL read_int8_value(DWORD value, D3D_SHADER_VARIABLE_TYPE in_type, INT8 *out_data, UINT idx)
1104 case D3D10_SVT_UINT:
1105 out_data[idx] = value;
1109 FIXME("Unhandled in_type %#x.\n", in_type);
1114 static BOOL read_value_list(const char *ptr, D3D_SHADER_VARIABLE_TYPE out_type,
1115 UINT out_base, UINT out_size, void *out_data)
1117 D3D_SHADER_VARIABLE_TYPE in_type;
1121 read_dword(&ptr, &count);
1122 if (count != out_size)
1125 TRACE("%u values:\n", count);
1126 for (i = 0; i < count; ++i)
1128 UINT out_idx = out_base * out_size + i;
1130 read_dword(&ptr, &t);
1131 read_dword(&ptr, &value);
1133 in_type = d3d10_variable_type(t, FALSE);
1134 TRACE("\t%s: %#x.\n", debug_d3d10_shader_variable_type(in_type), value);
1138 case D3D10_SVT_FLOAT:
1139 if (!read_float_value(value, in_type, out_data, out_idx))
1144 case D3D10_SVT_UINT:
1145 case D3D10_SVT_BOOL:
1146 if (!read_int32_value(value, in_type, out_data, out_idx))
1150 case D3D10_SVT_UINT8:
1151 if (!read_int8_value(value, in_type, out_data, out_idx))
1156 FIXME("Unhandled out_type %#x.\n", out_type);
1164 static BOOL parse_fx10_state_group(const char **ptr, const char *data,
1165 D3D_SHADER_VARIABLE_TYPE container_type, void *container)
1167 const struct d3d10_effect_state_property_info *property_info;
1174 read_dword(ptr, &count);
1175 TRACE("Property count: %#x.\n", count);
1177 for (i = 0; i < count; ++i)
1179 read_dword(ptr, &id);
1180 read_dword(ptr, &idx);
1181 skip_dword_unknown("read property", ptr, 1);
1182 read_dword(ptr, &value_offset);
1184 if (!(property_info = get_property_info(id)))
1186 FIXME("Failed to find property info for property %#x.\n", id);
1190 TRACE("Property %s[%#x] = value list @ offset %#x.\n",
1191 property_info->name, idx, value_offset);
1193 if (property_info->container_type != container_type)
1195 ERR("Invalid container type %#x for property %#x.\n", container_type, id);
1199 if (idx >= property_info->count)
1201 ERR("Invalid index %#x for property %#x.\n", idx, id);
1205 if (!read_value_list(data + value_offset, property_info->type, idx,
1206 property_info->size, (char *)container + property_info->offset))
1208 ERR("Failed to read values for property %#x.\n", id);
1216 static HRESULT parse_fx10_object(struct d3d10_effect_object *o, const char **ptr, const char *data)
1218 ID3D10EffectVariable *variable = &null_variable.ID3D10EffectVariable_iface;
1219 const char *data_ptr = NULL;
1221 enum d3d10_effect_object_operation operation;
1223 struct d3d10_effect *effect = o->pass->technique->effect;
1224 ID3D10Effect *e = &effect->ID3D10Effect_iface;
1225 DWORD tmp, variable_idx = 0;
1227 read_dword(ptr, &o->type);
1228 TRACE("Effect object is of type %#x.\n", o->type);
1230 read_dword(ptr, &tmp);
1231 TRACE("Effect object index %#x.\n", tmp);
1233 read_dword(ptr, &operation);
1234 TRACE("Effect object operation %#x.\n", operation);
1236 read_dword(ptr, &offset);
1237 TRACE("Effect object idx is at offset %#x.\n", offset);
1241 case D3D10_EOO_VALUE:
1242 TRACE("Copy variable values\n");
1246 case D3D10_EOT_VERTEXSHADER:
1247 TRACE("Vertex shader\n");
1248 variable = &anonymous_vs.ID3D10EffectVariable_iface;
1251 case D3D10_EOT_PIXELSHADER:
1252 TRACE("Pixel shader\n");
1253 variable = &anonymous_ps.ID3D10EffectVariable_iface;
1256 case D3D10_EOT_GEOMETRYSHADER:
1257 TRACE("Geometry shader\n");
1258 variable = &anonymous_gs.ID3D10EffectVariable_iface;
1261 case D3D10_EOT_STENCIL_REF:
1262 if (!read_value_list(data + offset, D3D10_SVT_UINT, 0, 1, &o->pass->stencil_ref))
1264 ERR("Failed to read stencil ref.\n");
1269 case D3D10_EOT_SAMPLE_MASK:
1270 if (!read_value_list(data + offset, D3D10_SVT_UINT, 0, 1, &o->pass->sample_mask))
1272 FIXME("Failed to read sample mask.\n");
1277 case D3D10_EOT_BLEND_FACTOR:
1278 if (!read_value_list(data + offset, D3D10_SVT_FLOAT, 0, 4, &o->pass->blend_factor[0]))
1280 FIXME("Failed to read blend factor.\n");
1286 FIXME("Unhandled object type %#x\n", o->type);
1291 case D3D10_EOO_PARSED_OBJECT:
1292 /* This is a local object, we've parsed in parse_fx10_local_object. */
1293 TRACE("Variable name %s.\n", debugstr_a(data + offset));
1295 variable = e->lpVtbl->GetVariableByName(e, data + offset);
1298 case D3D10_EOO_PARSED_OBJECT_INDEX:
1299 /* This is a local object, we've parsed in parse_fx10_local_object, which has an array index. */
1300 data_ptr = data + offset;
1301 read_dword(&data_ptr, &offset);
1302 read_dword(&data_ptr, &variable_idx);
1303 TRACE("Variable name %s[%u].\n", debugstr_a(data + offset), variable_idx);
1305 variable = e->lpVtbl->GetVariableByName(e, data + offset);
1308 case D3D10_EOO_ANONYMOUS_SHADER:
1309 TRACE("Anonymous shader\n");
1311 /* check anonymous_shader_current for validity */
1312 if (effect->anonymous_shader_current >= effect->anonymous_shader_count)
1314 ERR("Anonymous shader count is wrong!\n");
1318 data_ptr = data + offset;
1319 read_dword(&data_ptr, &offset);
1320 TRACE("Effect object starts at offset %#x.\n", offset);
1322 data_ptr = data + offset;
1324 hr = parse_fx10_anonymous_shader(effect, &effect->anonymous_shaders[effect->anonymous_shader_current], o->type);
1325 if (FAILED(hr)) return hr;
1327 variable = &effect->anonymous_shaders[effect->anonymous_shader_current].shader.ID3D10EffectVariable_iface;
1328 ++effect->anonymous_shader_current;
1332 case D3D10_EOT_VERTEXSHADER:
1333 case D3D10_EOT_PIXELSHADER:
1334 case D3D10_EOT_GEOMETRYSHADER:
1335 if (FAILED(hr = parse_shader(variable, data_ptr)))
1340 FIXME("Unhandled object type %#x\n", o->type);
1346 FIXME("Unhandled operation %#x.\n", operation);
1352 case D3D10_EOT_VERTEXSHADER:
1354 ID3D10EffectShaderVariable *sv = variable->lpVtbl->AsShader(variable);
1355 if (FAILED(hr = sv->lpVtbl->GetVertexShader(sv, variable_idx, &o->object.vs)))
1357 o->pass->vs.pShaderVariable = sv;
1358 o->pass->vs.ShaderIndex = variable_idx;
1362 case D3D10_EOT_PIXELSHADER:
1364 ID3D10EffectShaderVariable *sv = variable->lpVtbl->AsShader(variable);
1365 if (FAILED(hr = sv->lpVtbl->GetPixelShader(sv, variable_idx, &o->object.ps)))
1367 o->pass->ps.pShaderVariable = sv;
1368 o->pass->ps.ShaderIndex = variable_idx;
1372 case D3D10_EOT_GEOMETRYSHADER:
1374 ID3D10EffectShaderVariable *sv = variable->lpVtbl->AsShader(variable);
1375 if (FAILED(hr = sv->lpVtbl->GetGeometryShader(sv, variable_idx, &o->object.gs)))
1377 o->pass->gs.pShaderVariable = sv;
1378 o->pass->gs.ShaderIndex = variable_idx;
1382 case D3D10_EOT_RASTERIZER_STATE:
1383 case D3D10_EOT_DEPTH_STENCIL_STATE:
1384 case D3D10_EOT_BLEND_STATE:
1385 case D3D10_EOT_STENCIL_REF:
1386 case D3D10_EOT_BLEND_FACTOR:
1387 case D3D10_EOT_SAMPLE_MASK:
1391 FIXME("Unhandled object type %#x.\n", o->type);
1398 static HRESULT parse_fx10_pass(struct d3d10_effect_pass *p, const char **ptr, const char *data)
1404 read_dword(ptr, &offset);
1405 TRACE("Pass name at offset %#x.\n", offset);
1407 if (!copy_name(data + offset, &p->name))
1409 ERR("Failed to copy name.\n");
1410 return E_OUTOFMEMORY;
1412 TRACE("Pass name: %s.\n", debugstr_a(p->name));
1414 read_dword(ptr, &p->object_count);
1415 TRACE("Pass has %u effect objects.\n", p->object_count);
1417 read_dword(ptr, &p->annotation_count);
1418 TRACE("Pass has %u annotations.\n", p->annotation_count);
1420 p->annotations = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, p->annotation_count * sizeof(*p->annotations));
1421 if (!p->annotations)
1423 ERR("Failed to allocate pass annotations memory.\n");
1424 return E_OUTOFMEMORY;
1427 for (i = 0; i < p->annotation_count; ++i)
1429 struct d3d10_effect_variable *a = &p->annotations[i];
1431 a->effect = p->technique->effect;
1432 a->buffer = &null_local_buffer;
1434 hr = parse_fx10_annotation(a, ptr, data);
1435 if (FAILED(hr)) return hr;
1438 p->objects = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, p->object_count * sizeof(*p->objects));
1441 ERR("Failed to allocate effect objects memory.\n");
1442 return E_OUTOFMEMORY;
1445 p->vs.pShaderVariable = (ID3D10EffectShaderVariable *)&null_shader_variable.ID3D10EffectVariable_iface;
1446 p->ps.pShaderVariable = (ID3D10EffectShaderVariable *)&null_shader_variable.ID3D10EffectVariable_iface;
1447 p->gs.pShaderVariable = (ID3D10EffectShaderVariable *)&null_shader_variable.ID3D10EffectVariable_iface;
1449 for (i = 0; i < p->object_count; ++i)
1451 struct d3d10_effect_object *o = &p->objects[i];
1455 hr = parse_fx10_object(o, ptr, data);
1456 if (FAILED(hr)) return hr;
1462 static HRESULT parse_fx10_technique(struct d3d10_effect_technique *t, const char **ptr, const char *data)
1468 read_dword(ptr, &offset);
1469 TRACE("Technique name at offset %#x.\n", offset);
1471 if (!copy_name(data + offset, &t->name))
1473 ERR("Failed to copy name.\n");
1474 return E_OUTOFMEMORY;
1476 TRACE("Technique name: %s.\n", debugstr_a(t->name));
1478 read_dword(ptr, &t->pass_count);
1479 TRACE("Technique has %u passes\n", t->pass_count);
1481 read_dword(ptr, &t->annotation_count);
1482 TRACE("Technique has %u annotations.\n", t->annotation_count);
1484 t->annotations = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, t->annotation_count * sizeof(*t->annotations));
1485 if (!t->annotations)
1487 ERR("Failed to allocate technique annotations memory.\n");
1488 return E_OUTOFMEMORY;
1491 for (i = 0; i < t->annotation_count; ++i)
1493 struct d3d10_effect_variable *a = &t->annotations[i];
1495 a->effect = t->effect;
1496 a->buffer = &null_local_buffer;
1498 hr = parse_fx10_annotation(a, ptr, data);
1499 if (FAILED(hr)) return hr;
1502 t->passes = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, t->pass_count * sizeof(*t->passes));
1505 ERR("Failed to allocate passes memory\n");
1506 return E_OUTOFMEMORY;
1509 for (i = 0; i < t->pass_count; ++i)
1511 struct d3d10_effect_pass *p = &t->passes[i];
1513 p->ID3D10EffectPass_iface.lpVtbl = &d3d10_effect_pass_vtbl;
1516 hr = parse_fx10_pass(p, ptr, data);
1517 if (FAILED(hr)) return hr;
1523 static HRESULT parse_fx10_variable(struct d3d10_effect_variable *v, const char **ptr, const char *data)
1529 hr = parse_fx10_variable_head(v, ptr, data);
1530 if (FAILED(hr)) return hr;
1532 read_dword(ptr, &offset);
1533 TRACE("Variable semantic at offset %#x.\n", offset);
1535 if (!copy_name(data + offset, &v->semantic))
1537 ERR("Failed to copy semantic.\n");
1538 return E_OUTOFMEMORY;
1540 TRACE("Variable semantic: %s.\n", debugstr_a(v->semantic));
1542 read_dword(ptr, &v->buffer_offset);
1543 TRACE("Variable offset in buffer: %#x.\n", v->buffer_offset);
1545 skip_dword_unknown("variable", ptr, 1);
1547 read_dword(ptr, &v->flag);
1548 TRACE("Variable flag: %#x.\n", v->flag);
1550 read_dword(ptr, &v->annotation_count);
1551 TRACE("Variable has %u annotations.\n", v->annotation_count);
1553 v->annotations = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, v->annotation_count * sizeof(*v->annotations));
1554 if (!v->annotations)
1556 ERR("Failed to allocate variable annotations memory.\n");
1557 return E_OUTOFMEMORY;
1560 for (i = 0; i < v->annotation_count; ++i)
1562 struct d3d10_effect_variable *a = &v->annotations[i];
1564 a->effect = v->effect;
1565 a->buffer = &null_local_buffer;
1567 hr = parse_fx10_annotation(a, ptr, data);
1568 if (FAILED(hr)) return hr;
1574 static HRESULT parse_fx10_local_variable(struct d3d10_effect_variable *v, const char **ptr, const char *data)
1580 hr = parse_fx10_variable_head(v, ptr, data);
1581 if (FAILED(hr)) return hr;
1583 read_dword(ptr, &offset);
1584 TRACE("Variable semantic at offset %#x.\n", offset);
1586 if (!copy_name(data + offset, &v->semantic))
1588 ERR("Failed to copy semantic.\n");
1589 return E_OUTOFMEMORY;
1591 TRACE("Variable semantic: %s.\n", debugstr_a(v->semantic));
1593 skip_dword_unknown("local variable", ptr, 1);
1595 switch (v->type->basetype)
1597 case D3D10_SVT_TEXTURE1D:
1598 case D3D10_SVT_TEXTURE1DARRAY:
1599 case D3D10_SVT_TEXTURE2D:
1600 case D3D10_SVT_TEXTURE2DARRAY:
1601 case D3D10_SVT_TEXTURE2DMS:
1602 case D3D10_SVT_TEXTURE2DMSARRAY:
1603 case D3D10_SVT_TEXTURE3D:
1604 case D3D10_SVT_TEXTURECUBE:
1605 case D3D10_SVT_RENDERTARGETVIEW:
1606 case D3D10_SVT_DEPTHSTENCILVIEW:
1607 case D3D10_SVT_BUFFER:
1608 TRACE("SVT could not have elements.\n");
1611 case D3D10_SVT_VERTEXSHADER:
1612 case D3D10_SVT_PIXELSHADER:
1613 case D3D10_SVT_GEOMETRYSHADER:
1614 TRACE("Shader type is %s\n", debug_d3d10_shader_variable_type(v->type->basetype));
1615 for (i = 0; i < max(v->type->element_count, 1); ++i)
1617 DWORD shader_offset;
1618 struct d3d10_effect_variable *var;
1620 if (!v->type->element_count)
1626 var = &v->elements[i];
1629 read_dword(ptr, &shader_offset);
1630 TRACE("Shader offset: %#x.\n", shader_offset);
1632 hr = parse_shader(&var->ID3D10EffectVariable_iface, data + shader_offset);
1633 if (FAILED(hr)) return hr;
1637 case D3D10_SVT_DEPTHSTENCIL:
1638 case D3D10_SVT_BLEND:
1639 case D3D10_SVT_RASTERIZER:
1640 case D3D10_SVT_SAMPLER:
1642 const struct d3d10_effect_state_storage_info *storage_info;
1643 unsigned int count = max(v->type->element_count, 1);
1644 struct d3d10_effect_state_object_variable *s;
1646 if (!(storage_info = get_storage_info(v->type->basetype)))
1648 FIXME("Failed to get backing store info for type %s.\n",
1649 debug_d3d10_shader_variable_type(v->type->basetype));
1653 if (storage_info->size > sizeof(s->desc))
1655 ERR("Invalid storage size %#lx.\n", storage_info->size);
1659 for (i = 0; i < count; ++i)
1661 struct d3d10_effect_variable *var;
1663 if (v->type->element_count)
1664 var = &v->elements[i];
1668 if (!(s = HeapAlloc(GetProcessHeap(), 0, sizeof(*s))))
1670 ERR("Failed to allocate backing store memory.\n");
1671 return E_OUTOFMEMORY;
1674 memcpy(&s->desc, storage_info->default_state, storage_info->size);
1675 if (!parse_fx10_state_group(ptr, data, var->type->basetype, &s->desc))
1677 ERR("Failed to read property list.\n");
1678 HeapFree(GetProcessHeap(), 0, s);
1688 FIXME("Unhandled case %s.\n", debug_d3d10_shader_variable_type(v->type->basetype));
1692 read_dword(ptr, &v->annotation_count);
1693 TRACE("Variable has %u annotations.\n", v->annotation_count);
1695 v->annotations = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, v->annotation_count * sizeof(*v->annotations));
1696 if (!v->annotations)
1698 ERR("Failed to allocate variable annotations memory.\n");
1699 return E_OUTOFMEMORY;
1702 for (i = 0; i < v->annotation_count; ++i)
1704 struct d3d10_effect_variable *a = &v->annotations[i];
1706 a->effect = v->effect;
1707 a->buffer = &null_local_buffer;
1709 hr = parse_fx10_annotation(a, ptr, data);
1710 if (FAILED(hr)) return hr;
1716 static HRESULT parse_fx10_local_buffer(struct d3d10_effect_variable *l, const char **ptr, const char *data)
1720 D3D10_CBUFFER_TYPE d3d10_cbuffer_type;
1722 unsigned int stride = 0;
1724 /* Generate our own type, it isn't in the fx blob. */
1725 l->type = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*l->type));
1728 ERR("Failed to allocate local buffer type memory.\n");
1729 return E_OUTOFMEMORY;
1731 l->type->ID3D10EffectType_iface.lpVtbl = &d3d10_effect_type_vtbl;
1732 l->type->type_class = D3D10_SVC_OBJECT;
1733 l->type->effect = l->effect;
1735 read_dword(ptr, &offset);
1736 TRACE("Local buffer name at offset %#x.\n", offset);
1738 if (!copy_name(data + offset, &l->name))
1740 ERR("Failed to copy name.\n");
1741 return E_OUTOFMEMORY;
1743 TRACE("Local buffer name: %s.\n", debugstr_a(l->name));
1745 read_dword(ptr, &l->data_size);
1746 TRACE("Local buffer data size: %#x.\n", l->data_size);
1748 read_dword(ptr, &d3d10_cbuffer_type);
1749 TRACE("Local buffer type: %#x.\n", d3d10_cbuffer_type);
1751 switch(d3d10_cbuffer_type)
1753 case D3D10_CT_CBUFFER:
1754 l->type->basetype = D3D10_SVT_CBUFFER;
1755 if (!copy_name("cbuffer", &l->type->name))
1757 ERR("Failed to copy name.\n");
1758 return E_OUTOFMEMORY;
1762 case D3D10_CT_TBUFFER:
1763 l->type->basetype = D3D10_SVT_TBUFFER;
1764 if (!copy_name("tbuffer", &l->type->name))
1766 ERR("Failed to copy name.\n");
1767 return E_OUTOFMEMORY;
1772 ERR("Unexpected D3D10_CBUFFER_TYPE %#x!\n", d3d10_cbuffer_type);
1776 read_dword(ptr, &l->type->member_count);
1777 TRACE("Local buffer member count: %#x.\n", l->type->member_count);
1779 skip_dword_unknown("local buffer", ptr, 1);
1781 read_dword(ptr, &l->annotation_count);
1782 TRACE("Local buffer has %u annotations.\n", l->annotation_count);
1784 l->annotations = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, l->annotation_count * sizeof(*l->annotations));
1785 if (!l->annotations)
1787 ERR("Failed to allocate local buffer annotations memory.\n");
1788 return E_OUTOFMEMORY;
1791 for (i = 0; i < l->annotation_count; ++i)
1793 struct d3d10_effect_variable *a = &l->annotations[i];
1795 a->effect = l->effect;
1796 a->buffer = &null_local_buffer;
1798 hr = parse_fx10_annotation(a, ptr, data);
1799 if (FAILED(hr)) return hr;
1802 l->members = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, l->type->member_count * sizeof(*l->members));
1805 ERR("Failed to allocate members memory.\n");
1806 return E_OUTOFMEMORY;
1809 l->type->members = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, l->type->member_count * sizeof(*l->type->members));
1810 if (!l->type->members)
1812 ERR("Failed to allocate type members memory.\n");
1813 return E_OUTOFMEMORY;
1816 for (i = 0; i < l->type->member_count; ++i)
1818 struct d3d10_effect_variable *v = &l->members[i];
1819 struct d3d10_effect_type_member *typem = &l->type->members[i];
1822 v->effect = l->effect;
1824 hr = parse_fx10_variable(v, ptr, data);
1825 if (FAILED(hr)) return hr;
1828 * Copy the values from the variable type to the constant buffers type
1829 * members structure, because it is our own generated type.
1831 typem->type = v->type;
1833 if (!copy_name(v->name, &typem->name))
1835 ERR("Failed to copy name.\n");
1836 return E_OUTOFMEMORY;
1838 TRACE("Variable name: %s.\n", debugstr_a(typem->name));
1840 if (!copy_name(v->semantic, &typem->semantic))
1842 ERR("Failed to copy name.\n");
1843 return E_OUTOFMEMORY;
1845 TRACE("Variable semantic: %s.\n", debugstr_a(typem->semantic));
1847 typem->buffer_offset = v->buffer_offset;
1848 TRACE("Variable buffer offset: %u.\n", typem->buffer_offset);
1850 l->type->size_packed += v->type->size_packed;
1853 * For the complete constantbuffer the size_unpacked = stride,
1854 * the stride is calculated like this:
1856 * 1) if the constant buffer variables are packed with packoffset
1857 * - stride = the highest used constant
1858 * - the complete stride has to be a multiple of 0x10
1860 * 2) if the constant buffer variables are NOT packed with packoffset
1861 * - sum of unpacked size for all variables which fit in a 0x10 part
1862 * - if the size exceeds a 0x10 part, the rest of the old part is skipped
1863 * and a new part is started
1864 * - if the variable is a struct it is always used a new part
1865 * - the complete stride has to be a multiple of 0x10
1868 * 0x4, 0x4, 0x4, 0x8, 0x4, 0x14, 0x4
1869 * part 0x10 0x10 0x20 -> 0x40
1871 if (v->flag & D3D10_EFFECT_VARIABLE_EXPLICIT_BIND_POINT)
1873 if ((v->type->size_unpacked + v->buffer_offset) > stride)
1875 stride = v->type->size_unpacked + v->buffer_offset;
1880 if (v->type->type_class == D3D10_SVC_STRUCT)
1882 stride = (stride + 0xf) & ~0xf;
1885 if ( ((stride & 0xf) + v->type->size_unpacked) > 0x10)
1887 stride = (stride + 0xf) & ~0xf;
1890 stride += v->type->size_unpacked;
1893 l->type->stride = l->type->size_unpacked = (stride + 0xf) & ~0xf;
1895 TRACE("Constant buffer:\n");
1896 TRACE("\tType name: %s.\n", debugstr_a(l->type->name));
1897 TRACE("\tElement count: %u.\n", l->type->element_count);
1898 TRACE("\tMember count: %u.\n", l->type->member_count);
1899 TRACE("\tUnpacked size: %#x.\n", l->type->size_unpacked);
1900 TRACE("\tStride: %#x.\n", l->type->stride);
1901 TRACE("\tPacked size %#x.\n", l->type->size_packed);
1902 TRACE("\tBasetype: %s.\n", debug_d3d10_shader_variable_type(l->type->basetype));
1903 TRACE("\tTypeclass: %s.\n", debug_d3d10_shader_variable_class(l->type->type_class));
1908 static int d3d10_effect_type_compare(const void *key, const struct wine_rb_entry *entry)
1910 const struct d3d10_effect_type *t = WINE_RB_ENTRY_VALUE(entry, const struct d3d10_effect_type, entry);
1911 const DWORD *id = key;
1916 static void d3d10_effect_type_member_destroy(struct d3d10_effect_type_member *typem)
1918 TRACE("effect type member %p.\n", typem);
1920 /* Do not release typem->type, it will be covered by d3d10_effect_type_destroy(). */
1921 HeapFree(GetProcessHeap(), 0, typem->semantic);
1922 HeapFree(GetProcessHeap(), 0, typem->name);
1925 static void d3d10_effect_type_destroy(struct wine_rb_entry *entry, void *context)
1927 struct d3d10_effect_type *t = WINE_RB_ENTRY_VALUE(entry, struct d3d10_effect_type, entry);
1929 TRACE("effect type %p.\n", t);
1933 HeapFree(GetProcessHeap(), 0, t->elementtype->name);
1934 HeapFree(GetProcessHeap(), 0, t->elementtype);
1941 for (i = 0; i < t->member_count; ++i)
1943 d3d10_effect_type_member_destroy(&t->members[i]);
1945 HeapFree(GetProcessHeap(), 0, t->members);
1948 HeapFree(GetProcessHeap(), 0, t->name);
1949 HeapFree(GetProcessHeap(), 0, t);
1952 static const struct wine_rb_functions d3d10_effect_type_rb_functions =
1957 d3d10_effect_type_compare,
1960 static HRESULT parse_fx10_body(struct d3d10_effect *e, const char *data, DWORD data_size)
1962 const char *ptr = data + e->index_offset;
1966 if (wine_rb_init(&e->types, &d3d10_effect_type_rb_functions) == -1)
1968 ERR("Failed to initialize type rbtree.\n");
1972 e->local_buffers = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, e->local_buffer_count * sizeof(*e->local_buffers));
1973 if (!e->local_buffers)
1975 ERR("Failed to allocate local buffer memory.\n");
1976 return E_OUTOFMEMORY;
1979 e->local_variables = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, e->local_variable_count * sizeof(*e->local_variables));
1980 if (!e->local_variables)
1982 ERR("Failed to allocate local variable memory.\n");
1983 return E_OUTOFMEMORY;
1986 e->anonymous_shaders = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, e->anonymous_shader_count * sizeof(*e->anonymous_shaders));
1987 if (!e->anonymous_shaders)
1989 ERR("Failed to allocate anonymous shaders memory\n");
1990 return E_OUTOFMEMORY;
1993 e->used_shaders = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, e->used_shader_count * sizeof(*e->used_shaders));
1994 if (!e->used_shaders)
1996 ERR("Failed to allocate used shaders memory\n");
1997 return E_OUTOFMEMORY;
2000 e->techniques = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, e->technique_count * sizeof(*e->techniques));
2003 ERR("Failed to allocate techniques memory\n");
2004 return E_OUTOFMEMORY;
2007 for (i = 0; i < e->local_buffer_count; ++i)
2009 struct d3d10_effect_variable *l = &e->local_buffers[i];
2010 l->ID3D10EffectVariable_iface.lpVtbl = (const ID3D10EffectVariableVtbl *)&d3d10_effect_constant_buffer_vtbl;
2012 l->buffer = &null_local_buffer;
2014 hr = parse_fx10_local_buffer(l, &ptr, data);
2015 if (FAILED(hr)) return hr;
2018 for (i = 0; i < e->local_variable_count; ++i)
2020 struct d3d10_effect_variable *v = &e->local_variables[i];
2023 v->ID3D10EffectVariable_iface.lpVtbl = &d3d10_effect_variable_vtbl;
2024 v->buffer = &null_local_buffer;
2026 hr = parse_fx10_local_variable(v, &ptr, data);
2027 if (FAILED(hr)) return hr;
2030 for (i = 0; i < e->technique_count; ++i)
2032 struct d3d10_effect_technique *t = &e->techniques[i];
2034 t->ID3D10EffectTechnique_iface.lpVtbl = &d3d10_effect_technique_vtbl;
2037 hr = parse_fx10_technique(t, &ptr, data);
2038 if (FAILED(hr)) return hr;
2044 static HRESULT parse_fx10(struct d3d10_effect *e, const char *data, DWORD data_size)
2046 const char *ptr = data;
2049 /* Compiled target version (e.g. fx_4_0=0xfeff1001, fx_4_1=0xfeff1011). */
2050 read_dword(&ptr, &e->version);
2051 TRACE("Target: %#x\n", e->version);
2053 read_dword(&ptr, &e->local_buffer_count);
2054 TRACE("Local buffer count: %u.\n", e->local_buffer_count);
2056 read_dword(&ptr, &e->variable_count);
2057 TRACE("Variable count: %u\n", e->variable_count);
2059 read_dword(&ptr, &e->local_variable_count);
2060 TRACE("Object count: %u\n", e->local_variable_count);
2062 read_dword(&ptr, &e->sharedbuffers_count);
2063 TRACE("Sharedbuffers count: %u\n", e->sharedbuffers_count);
2065 /* Number of variables in shared buffers? */
2066 read_dword(&ptr, &unknown);
2067 FIXME("Unknown 0: %u\n", unknown);
2069 read_dword(&ptr, &e->sharedobjects_count);
2070 TRACE("Sharedobjects count: %u\n", e->sharedobjects_count);
2072 read_dword(&ptr, &e->technique_count);
2073 TRACE("Technique count: %u\n", e->technique_count);
2075 read_dword(&ptr, &e->index_offset);
2076 TRACE("Index offset: %#x\n", e->index_offset);
2078 read_dword(&ptr, &unknown);
2079 FIXME("Unknown 1: %u\n", unknown);
2081 read_dword(&ptr, &e->texture_count);
2082 TRACE("Texture count: %u\n", e->texture_count);
2084 read_dword(&ptr, &e->dephstencilstate_count);
2085 TRACE("Depthstencilstate count: %u\n", e->dephstencilstate_count);
2087 read_dword(&ptr, &e->blendstate_count);
2088 TRACE("Blendstate count: %u\n", e->blendstate_count);
2090 read_dword(&ptr, &e->rasterizerstate_count);
2091 TRACE("Rasterizerstate count: %u\n", e->rasterizerstate_count);
2093 read_dword(&ptr, &e->samplerstate_count);
2094 TRACE("Samplerstate count: %u\n", e->samplerstate_count);
2096 read_dword(&ptr, &e->rendertargetview_count);
2097 TRACE("Rendertargetview count: %u\n", e->rendertargetview_count);
2099 read_dword(&ptr, &e->depthstencilview_count);
2100 TRACE("Depthstencilview count: %u\n", e->depthstencilview_count);
2102 read_dword(&ptr, &e->used_shader_count);
2103 TRACE("Used shader count: %u\n", e->used_shader_count);
2105 read_dword(&ptr, &e->anonymous_shader_count);
2106 TRACE("Anonymous shader count: %u\n", e->anonymous_shader_count);
2108 return parse_fx10_body(e, ptr, data_size - (ptr - data));
2111 static HRESULT fx10_chunk_handler(const char *data, DWORD data_size, DWORD tag, void *ctx)
2113 struct d3d10_effect *e = ctx;
2115 TRACE("tag: %s.\n", debugstr_an((const char *)&tag, 4));
2117 TRACE("chunk size: %#x\n", data_size);
2122 return parse_fx10(e, data, data_size);
2125 FIXME("Unhandled chunk %s.\n", debugstr_an((const char *)&tag, 4));
2130 HRESULT d3d10_effect_parse(struct d3d10_effect *This, const void *data, SIZE_T data_size)
2132 return parse_dxbc(data, data_size, fx10_chunk_handler, This);
2135 static HRESULT d3d10_effect_object_apply(struct d3d10_effect_object *o)
2137 ID3D10Device *device = o->pass->technique->effect->device;
2139 TRACE("effect object %p, type %#x.\n", o, o->type);
2143 case D3D10_EOT_VERTEXSHADER:
2144 ID3D10Device_VSSetShader(device, o->object.vs);
2147 case D3D10_EOT_PIXELSHADER:
2148 ID3D10Device_PSSetShader(device, o->object.ps);
2151 case D3D10_EOT_GEOMETRYSHADER:
2152 ID3D10Device_GSSetShader(device, o->object.gs);
2156 FIXME("Unhandled effect object type %#x.\n", o->type);
2161 static void d3d10_effect_shader_variable_destroy(struct d3d10_effect_shader_variable *s,
2162 D3D10_SHADER_VARIABLE_TYPE type)
2164 shader_free_signature(&s->input_signature);
2165 shader_free_signature(&s->output_signature);
2169 case D3D10_SVT_VERTEXSHADER:
2171 ID3D10VertexShader_Release(s->shader.vs);
2174 case D3D10_SVT_PIXELSHADER:
2176 ID3D10PixelShader_Release(s->shader.ps);
2179 case D3D10_SVT_GEOMETRYSHADER:
2181 ID3D10GeometryShader_Release(s->shader.gs);
2185 FIXME("Unhandled shader type %s.\n", debug_d3d10_shader_variable_type(type));
2190 static void d3d10_effect_variable_destroy(struct d3d10_effect_variable *v)
2194 TRACE("variable %p.\n", v);
2196 HeapFree(GetProcessHeap(), 0, v->name);
2197 HeapFree(GetProcessHeap(), 0, v->semantic);
2200 for (i = 0; i < v->annotation_count; ++i)
2202 d3d10_effect_variable_destroy(&v->annotations[i]);
2204 HeapFree(GetProcessHeap(), 0, v->annotations);
2209 for (i = 0; i < v->type->member_count; ++i)
2211 d3d10_effect_variable_destroy(&v->members[i]);
2213 HeapFree(GetProcessHeap(), 0, v->members);
2218 for (i = 0; i < v->type->element_count; ++i)
2220 d3d10_effect_variable_destroy(&v->elements[i]);
2222 HeapFree(GetProcessHeap(), 0, v->elements);
2227 switch(v->type->basetype)
2229 case D3D10_SVT_VERTEXSHADER:
2230 case D3D10_SVT_PIXELSHADER:
2231 case D3D10_SVT_GEOMETRYSHADER:
2232 d3d10_effect_shader_variable_destroy(v->data, v->type->basetype);
2238 HeapFree(GetProcessHeap(), 0, v->data);
2242 static void d3d10_effect_object_destroy(struct d3d10_effect_object *o)
2246 case D3D10_EOT_VERTEXSHADER:
2248 ID3D10VertexShader_Release(o->object.vs);
2251 case D3D10_EOT_PIXELSHADER:
2253 ID3D10PixelShader_Release(o->object.ps);
2256 case D3D10_EOT_GEOMETRYSHADER:
2258 ID3D10GeometryShader_Release(o->object.gs);
2266 static void d3d10_effect_pass_destroy(struct d3d10_effect_pass *p)
2270 TRACE("pass %p\n", p);
2272 HeapFree(GetProcessHeap(), 0, p->name);
2276 for (i = 0; i < p->object_count; ++i)
2278 d3d10_effect_object_destroy(&p->objects[i]);
2280 HeapFree(GetProcessHeap(), 0, p->objects);
2285 for (i = 0; i < p->annotation_count; ++i)
2287 d3d10_effect_variable_destroy(&p->annotations[i]);
2289 HeapFree(GetProcessHeap(), 0, p->annotations);
2293 static void d3d10_effect_technique_destroy(struct d3d10_effect_technique *t)
2297 TRACE("technique %p\n", t);
2299 HeapFree(GetProcessHeap(), 0, t->name);
2302 for (i = 0; i < t->pass_count; ++i)
2304 d3d10_effect_pass_destroy(&t->passes[i]);
2306 HeapFree(GetProcessHeap(), 0, t->passes);
2311 for (i = 0; i < t->annotation_count; ++i)
2313 d3d10_effect_variable_destroy(&t->annotations[i]);
2315 HeapFree(GetProcessHeap(), 0, t->annotations);
2319 static void d3d10_effect_local_buffer_destroy(struct d3d10_effect_variable *l)
2323 TRACE("local buffer %p.\n", l);
2325 HeapFree(GetProcessHeap(), 0, l->name);
2328 for (i = 0; i < l->type->member_count; ++i)
2330 d3d10_effect_variable_destroy(&l->members[i]);
2332 HeapFree(GetProcessHeap(), 0, l->members);
2335 if (l->type->members)
2337 for (i = 0; i < l->type->member_count; ++i)
2339 /* Do not release l->type->members[i].type, it will be covered by d3d10_effect_type_destroy(). */
2340 HeapFree(GetProcessHeap(), 0, l->type->members[i].semantic);
2341 HeapFree(GetProcessHeap(), 0, l->type->members[i].name);
2343 HeapFree(GetProcessHeap(), 0, l->type->members);
2345 HeapFree(GetProcessHeap(), 0, l->type->name);
2346 HeapFree(GetProcessHeap(), 0, l->type);
2350 for (i = 0; i < l->annotation_count; ++i)
2352 d3d10_effect_variable_destroy(&l->annotations[i]);
2354 HeapFree(GetProcessHeap(), 0, l->annotations);
2358 /* IUnknown methods */
2360 static inline struct d3d10_effect *impl_from_ID3D10Effect(ID3D10Effect *iface)
2362 return CONTAINING_RECORD(iface, struct d3d10_effect, ID3D10Effect_iface);
2365 static HRESULT STDMETHODCALLTYPE d3d10_effect_QueryInterface(ID3D10Effect *iface, REFIID riid, void **object)
2367 TRACE("iface %p, riid %s, object %p\n", iface, debugstr_guid(riid), object);
2369 if (IsEqualGUID(riid, &IID_ID3D10Effect)
2370 || IsEqualGUID(riid, &IID_IUnknown))
2372 IUnknown_AddRef(iface);
2377 WARN("%s not implemented, returning E_NOINTERFACE\n", debugstr_guid(riid));
2380 return E_NOINTERFACE;
2383 static ULONG STDMETHODCALLTYPE d3d10_effect_AddRef(ID3D10Effect *iface)
2385 struct d3d10_effect *This = impl_from_ID3D10Effect(iface);
2386 ULONG refcount = InterlockedIncrement(&This->refcount);
2388 TRACE("%p increasing refcount to %u\n", This, refcount);
2393 static ULONG STDMETHODCALLTYPE d3d10_effect_Release(ID3D10Effect *iface)
2395 struct d3d10_effect *This = impl_from_ID3D10Effect(iface);
2396 ULONG refcount = InterlockedDecrement(&This->refcount);
2398 TRACE("%p decreasing refcount to %u\n", This, refcount);
2404 if (This->techniques)
2406 for (i = 0; i < This->technique_count; ++i)
2408 d3d10_effect_technique_destroy(&This->techniques[i]);
2410 HeapFree(GetProcessHeap(), 0, This->techniques);
2413 if (This->local_variables)
2415 for (i = 0; i < This->local_variable_count; ++i)
2417 d3d10_effect_variable_destroy(&This->local_variables[i]);
2419 HeapFree(GetProcessHeap(), 0, This->local_variables);
2422 if (This->local_buffers)
2424 for (i = 0; i < This->local_buffer_count; ++i)
2426 d3d10_effect_local_buffer_destroy(&This->local_buffers[i]);
2428 HeapFree(GetProcessHeap(), 0, This->local_buffers);
2431 if (This->anonymous_shaders)
2433 for (i = 0; i < This->anonymous_shader_count; ++i)
2435 d3d10_effect_variable_destroy(&This->anonymous_shaders[i].shader);
2436 HeapFree(GetProcessHeap(), 0, This->anonymous_shaders[i].type.name);
2438 HeapFree(GetProcessHeap(), 0, This->anonymous_shaders);
2441 HeapFree(GetProcessHeap(), 0, This->used_shaders);
2443 wine_rb_destroy(&This->types, d3d10_effect_type_destroy, NULL);
2445 ID3D10Device_Release(This->device);
2446 HeapFree(GetProcessHeap(), 0, This);
2452 /* ID3D10Effect methods */
2454 static BOOL STDMETHODCALLTYPE d3d10_effect_IsValid(ID3D10Effect *iface)
2456 FIXME("iface %p stub!\n", iface);
2461 static BOOL STDMETHODCALLTYPE d3d10_effect_IsPool(ID3D10Effect *iface)
2463 FIXME("iface %p stub!\n", iface);
2468 static HRESULT STDMETHODCALLTYPE d3d10_effect_GetDevice(ID3D10Effect *iface, ID3D10Device **device)
2470 struct d3d10_effect *This = impl_from_ID3D10Effect(iface);
2472 TRACE("iface %p, device %p\n", iface, device);
2474 ID3D10Device_AddRef(This->device);
2475 *device = This->device;
2480 static HRESULT STDMETHODCALLTYPE d3d10_effect_GetDesc(ID3D10Effect *iface, D3D10_EFFECT_DESC *desc)
2482 FIXME("iface %p, desc %p stub!\n", iface, desc);
2487 static struct ID3D10EffectConstantBuffer * STDMETHODCALLTYPE d3d10_effect_GetConstantBufferByIndex(ID3D10Effect *iface,
2490 struct d3d10_effect *This = impl_from_ID3D10Effect(iface);
2491 struct d3d10_effect_variable *l;
2493 TRACE("iface %p, index %u\n", iface, index);
2495 if (index >= This->local_buffer_count)
2497 WARN("Invalid index specified\n");
2498 return (ID3D10EffectConstantBuffer *)&null_local_buffer;
2501 l = &This->local_buffers[index];
2503 TRACE("Returning buffer %p, %s.\n", l, debugstr_a(l->name));
2505 return (ID3D10EffectConstantBuffer *)l;
2508 static struct ID3D10EffectConstantBuffer * STDMETHODCALLTYPE d3d10_effect_GetConstantBufferByName(ID3D10Effect *iface,
2511 struct d3d10_effect *This = impl_from_ID3D10Effect(iface);
2514 TRACE("iface %p, name %s.\n", iface, debugstr_a(name));
2516 for (i = 0; i < This->local_buffer_count; ++i)
2518 struct d3d10_effect_variable *l = &This->local_buffers[i];
2520 if (!strcmp(l->name, name))
2522 TRACE("Returning buffer %p.\n", l);
2523 return (ID3D10EffectConstantBuffer *)l;
2527 WARN("Invalid name specified\n");
2529 return (ID3D10EffectConstantBuffer *)&null_local_buffer;
2532 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_GetVariableByIndex(ID3D10Effect *iface, UINT index)
2534 struct d3d10_effect *This = impl_from_ID3D10Effect(iface);
2537 TRACE("iface %p, index %u\n", iface, index);
2539 for (i = 0; i < This->local_buffer_count; ++i)
2541 struct d3d10_effect_variable *l = &This->local_buffers[i];
2543 if (index < l->type->member_count)
2545 struct d3d10_effect_variable *v = &l->members[index];
2547 TRACE("Returning variable %p.\n", v);
2548 return &v->ID3D10EffectVariable_iface;
2550 index -= l->type->member_count;
2553 if (index < This->local_variable_count)
2555 struct d3d10_effect_variable *v = &This->local_variables[index];
2557 TRACE("Returning variable %p.\n", v);
2558 return &v->ID3D10EffectVariable_iface;
2561 WARN("Invalid index specified\n");
2563 return &null_variable.ID3D10EffectVariable_iface;
2566 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_GetVariableByName(ID3D10Effect *iface, LPCSTR name)
2568 struct d3d10_effect *This = impl_from_ID3D10Effect(iface);
2571 TRACE("iface %p, name %s.\n", iface, debugstr_a(name));
2575 WARN("Invalid name specified\n");
2576 return &null_variable.ID3D10EffectVariable_iface;
2579 for (i = 0; i < This->local_buffer_count; ++i)
2581 struct d3d10_effect_variable *l = &This->local_buffers[i];
2584 for (j = 0; j < l->type->member_count; ++j)
2586 struct d3d10_effect_variable *v = &l->members[j];
2588 if (!strcmp(v->name, name))
2590 TRACE("Returning variable %p.\n", v);
2591 return &v->ID3D10EffectVariable_iface;
2596 for (i = 0; i < This->local_variable_count; ++i)
2598 struct d3d10_effect_variable *v = &This->local_variables[i];
2600 if (!strcmp(v->name, name))
2602 TRACE("Returning variable %p.\n", v);
2603 return &v->ID3D10EffectVariable_iface;
2607 WARN("Invalid name specified\n");
2609 return &null_variable.ID3D10EffectVariable_iface;
2612 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_GetVariableBySemantic(ID3D10Effect *iface,
2615 struct d3d10_effect *This = impl_from_ID3D10Effect(iface);
2618 TRACE("iface %p, semantic %s\n", iface, debugstr_a(semantic));
2622 WARN("Invalid semantic specified\n");
2623 return &null_variable.ID3D10EffectVariable_iface;
2626 for (i = 0; i < This->local_buffer_count; ++i)
2628 struct d3d10_effect_variable *l = &This->local_buffers[i];
2631 for (j = 0; j < l->type->member_count; ++j)
2633 struct d3d10_effect_variable *v = &l->members[j];
2635 if (!strcmp(v->semantic, semantic))
2637 TRACE("Returning variable %p.\n", v);
2638 return &v->ID3D10EffectVariable_iface;
2643 for (i = 0; i < This->local_variable_count; ++i)
2645 struct d3d10_effect_variable *v = &This->local_variables[i];
2647 if (!strcmp(v->semantic, semantic))
2649 TRACE("Returning variable %p.\n", v);
2650 return &v->ID3D10EffectVariable_iface;
2654 WARN("Invalid semantic specified\n");
2656 return &null_variable.ID3D10EffectVariable_iface;
2659 static struct ID3D10EffectTechnique * STDMETHODCALLTYPE d3d10_effect_GetTechniqueByIndex(ID3D10Effect *iface,
2662 struct d3d10_effect *This = impl_from_ID3D10Effect(iface);
2663 struct d3d10_effect_technique *t;
2665 TRACE("iface %p, index %u\n", iface, index);
2667 if (index >= This->technique_count)
2669 WARN("Invalid index specified\n");
2670 return &null_technique.ID3D10EffectTechnique_iface;
2673 t = &This->techniques[index];
2675 TRACE("Returning technique %p, %s.\n", t, debugstr_a(t->name));
2677 return &t->ID3D10EffectTechnique_iface;
2680 static struct ID3D10EffectTechnique * STDMETHODCALLTYPE d3d10_effect_GetTechniqueByName(ID3D10Effect *iface,
2683 struct d3d10_effect *This = impl_from_ID3D10Effect(iface);
2686 TRACE("iface %p, name %s.\n", iface, debugstr_a(name));
2690 WARN("Invalid name specified\n");
2691 return &null_technique.ID3D10EffectTechnique_iface;
2694 for (i = 0; i < This->technique_count; ++i)
2696 struct d3d10_effect_technique *t = &This->techniques[i];
2697 if (!strcmp(t->name, name))
2699 TRACE("Returning technique %p\n", t);
2700 return &t->ID3D10EffectTechnique_iface;
2704 WARN("Invalid name specified\n");
2706 return &null_technique.ID3D10EffectTechnique_iface;
2709 static HRESULT STDMETHODCALLTYPE d3d10_effect_Optimize(ID3D10Effect *iface)
2711 FIXME("iface %p stub!\n", iface);
2716 static BOOL STDMETHODCALLTYPE d3d10_effect_IsOptimized(ID3D10Effect *iface)
2718 FIXME("iface %p stub!\n", iface);
2723 const struct ID3D10EffectVtbl d3d10_effect_vtbl =
2725 /* IUnknown methods */
2726 d3d10_effect_QueryInterface,
2727 d3d10_effect_AddRef,
2728 d3d10_effect_Release,
2729 /* ID3D10Effect methods */
2730 d3d10_effect_IsValid,
2731 d3d10_effect_IsPool,
2732 d3d10_effect_GetDevice,
2733 d3d10_effect_GetDesc,
2734 d3d10_effect_GetConstantBufferByIndex,
2735 d3d10_effect_GetConstantBufferByName,
2736 d3d10_effect_GetVariableByIndex,
2737 d3d10_effect_GetVariableByName,
2738 d3d10_effect_GetVariableBySemantic,
2739 d3d10_effect_GetTechniqueByIndex,
2740 d3d10_effect_GetTechniqueByName,
2741 d3d10_effect_Optimize,
2742 d3d10_effect_IsOptimized,
2745 /* ID3D10EffectTechnique methods */
2747 static inline struct d3d10_effect_technique *impl_from_ID3D10EffectTechnique(ID3D10EffectTechnique *iface)
2749 return CONTAINING_RECORD(iface, struct d3d10_effect_technique, ID3D10EffectTechnique_iface);
2752 static BOOL STDMETHODCALLTYPE d3d10_effect_technique_IsValid(ID3D10EffectTechnique *iface)
2754 struct d3d10_effect_technique *This = impl_from_ID3D10EffectTechnique(iface);
2756 TRACE("iface %p\n", iface);
2758 return This != &null_technique;
2761 static HRESULT STDMETHODCALLTYPE d3d10_effect_technique_GetDesc(ID3D10EffectTechnique *iface,
2762 D3D10_TECHNIQUE_DESC *desc)
2764 struct d3d10_effect_technique *This = impl_from_ID3D10EffectTechnique(iface);
2766 TRACE("iface %p, desc %p\n", iface, desc);
2768 if(This == &null_technique)
2770 WARN("Null technique specified\n");
2776 WARN("Invalid argument specified\n");
2777 return E_INVALIDARG;
2780 desc->Name = This->name;
2781 desc->Passes = This->pass_count;
2782 desc->Annotations = This->annotation_count;
2787 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_technique_GetAnnotationByIndex(
2788 ID3D10EffectTechnique *iface, UINT index)
2790 struct d3d10_effect_technique *This = impl_from_ID3D10EffectTechnique(iface);
2791 struct d3d10_effect_variable *a;
2793 TRACE("iface %p, index %u\n", iface, index);
2795 if (index >= This->annotation_count)
2797 WARN("Invalid index specified\n");
2798 return &null_variable.ID3D10EffectVariable_iface;
2801 a = &This->annotations[index];
2803 TRACE("Returning annotation %p, %s\n", a, debugstr_a(a->name));
2805 return &a->ID3D10EffectVariable_iface;
2808 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_technique_GetAnnotationByName(
2809 ID3D10EffectTechnique *iface, LPCSTR name)
2811 struct d3d10_effect_technique *This = impl_from_ID3D10EffectTechnique(iface);
2814 TRACE("iface %p, name %s.\n", iface, debugstr_a(name));
2816 for (i = 0; i < This->annotation_count; ++i)
2818 struct d3d10_effect_variable *a = &This->annotations[i];
2819 if (!strcmp(a->name, name))
2821 TRACE("Returning annotation %p\n", a);
2822 return &a->ID3D10EffectVariable_iface;
2826 WARN("Invalid name specified\n");
2828 return &null_variable.ID3D10EffectVariable_iface;
2831 static struct ID3D10EffectPass * STDMETHODCALLTYPE d3d10_effect_technique_GetPassByIndex(ID3D10EffectTechnique *iface,
2834 struct d3d10_effect_technique *This = impl_from_ID3D10EffectTechnique(iface);
2835 struct d3d10_effect_pass *p;
2837 TRACE("iface %p, index %u\n", iface, index);
2839 if (index >= This->pass_count)
2841 WARN("Invalid index specified\n");
2842 return &null_pass.ID3D10EffectPass_iface;
2845 p = &This->passes[index];
2847 TRACE("Returning pass %p, %s.\n", p, debugstr_a(p->name));
2849 return &p->ID3D10EffectPass_iface;
2852 static struct ID3D10EffectPass * STDMETHODCALLTYPE d3d10_effect_technique_GetPassByName(ID3D10EffectTechnique *iface,
2855 struct d3d10_effect_technique *This = impl_from_ID3D10EffectTechnique(iface);
2858 TRACE("iface %p, name %s.\n", iface, debugstr_a(name));
2860 /* Do not check for name==NULL, W7/DX10 crashes in that case. */
2862 for (i = 0; i < This->pass_count; ++i)
2864 struct d3d10_effect_pass *p = &This->passes[i];
2865 if (!strcmp(p->name, name))
2867 TRACE("Returning pass %p\n", p);
2868 return &p->ID3D10EffectPass_iface;
2872 WARN("Invalid name specified\n");
2874 return &null_pass.ID3D10EffectPass_iface;
2877 static HRESULT STDMETHODCALLTYPE d3d10_effect_technique_ComputeStateBlockMask(ID3D10EffectTechnique *iface,
2878 D3D10_STATE_BLOCK_MASK *mask)
2880 FIXME("iface %p,mask %p stub!\n", iface, mask);
2885 static const struct ID3D10EffectTechniqueVtbl d3d10_effect_technique_vtbl =
2887 /* ID3D10EffectTechnique methods */
2888 d3d10_effect_technique_IsValid,
2889 d3d10_effect_technique_GetDesc,
2890 d3d10_effect_technique_GetAnnotationByIndex,
2891 d3d10_effect_technique_GetAnnotationByName,
2892 d3d10_effect_technique_GetPassByIndex,
2893 d3d10_effect_technique_GetPassByName,
2894 d3d10_effect_technique_ComputeStateBlockMask,
2897 /* ID3D10EffectPass methods */
2899 static inline struct d3d10_effect_pass *impl_from_ID3D10EffectPass(ID3D10EffectPass *iface)
2901 return CONTAINING_RECORD(iface, struct d3d10_effect_pass, ID3D10EffectPass_iface);
2904 static BOOL STDMETHODCALLTYPE d3d10_effect_pass_IsValid(ID3D10EffectPass *iface)
2906 struct d3d10_effect_pass *This = impl_from_ID3D10EffectPass(iface);
2908 TRACE("iface %p\n", iface);
2910 return This != &null_pass;
2913 static HRESULT STDMETHODCALLTYPE d3d10_effect_pass_GetDesc(ID3D10EffectPass *iface,
2914 D3D10_PASS_DESC *desc)
2916 struct d3d10_effect_pass *This = impl_from_ID3D10EffectPass(iface);
2917 struct d3d10_effect_shader_variable *s;
2919 FIXME("iface %p, desc %p partial stub!\n", iface, desc);
2921 if(This == &null_pass)
2923 WARN("Null pass specified\n");
2929 WARN("Invalid argument specified\n");
2930 return E_INVALIDARG;
2933 memset(desc, 0, sizeof(*desc));
2934 desc->Name = This->name;
2936 if ((s = impl_from_ID3D10EffectVariable((ID3D10EffectVariable *)This->vs.pShaderVariable)->data))
2938 desc->pIAInputSignature = (BYTE *)s->input_signature.signature;
2939 desc->IAInputSignatureSize = s->input_signature.signature_size;
2942 desc->StencilRef = This->stencil_ref;
2943 desc->SampleMask = This->sample_mask;
2944 memcpy(desc->BlendFactor, This->blend_factor, 4 * sizeof(float));
2949 static HRESULT STDMETHODCALLTYPE d3d10_effect_pass_GetVertexShaderDesc(ID3D10EffectPass *iface,
2950 D3D10_PASS_SHADER_DESC *desc)
2952 struct d3d10_effect_pass *This = impl_from_ID3D10EffectPass(iface);
2954 TRACE("iface %p, desc %p\n", iface, desc);
2956 if (This == &null_pass)
2958 WARN("Null pass specified\n");
2964 WARN("Invalid argument specified\n");
2965 return E_INVALIDARG;
2973 static HRESULT STDMETHODCALLTYPE d3d10_effect_pass_GetGeometryShaderDesc(ID3D10EffectPass *iface,
2974 D3D10_PASS_SHADER_DESC *desc)
2976 struct d3d10_effect_pass *This = impl_from_ID3D10EffectPass(iface);
2978 TRACE("iface %p, desc %p\n", iface, desc);
2980 if (This == &null_pass)
2982 WARN("Null pass specified\n");
2988 WARN("Invalid argument specified\n");
2989 return E_INVALIDARG;
2997 static HRESULT STDMETHODCALLTYPE d3d10_effect_pass_GetPixelShaderDesc(ID3D10EffectPass *iface,
2998 D3D10_PASS_SHADER_DESC *desc)
3000 struct d3d10_effect_pass *This = impl_from_ID3D10EffectPass(iface);
3002 TRACE("iface %p, desc %p\n", iface, desc);
3004 if (This == &null_pass)
3006 WARN("Null pass specified\n");
3012 WARN("Invalid argument specified\n");
3013 return E_INVALIDARG;
3021 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_pass_GetAnnotationByIndex(ID3D10EffectPass *iface,
3024 struct d3d10_effect_pass *This = impl_from_ID3D10EffectPass(iface);
3025 struct d3d10_effect_variable *a;
3027 TRACE("iface %p, index %u\n", iface, index);
3029 if (index >= This->annotation_count)
3031 WARN("Invalid index specified\n");
3032 return &null_variable.ID3D10EffectVariable_iface;
3035 a = &This->annotations[index];
3037 TRACE("Returning annotation %p, %s\n", a, debugstr_a(a->name));
3039 return &a->ID3D10EffectVariable_iface;
3042 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_pass_GetAnnotationByName(ID3D10EffectPass *iface,
3045 struct d3d10_effect_pass *This = impl_from_ID3D10EffectPass(iface);
3048 TRACE("iface %p, name %s.\n", iface, debugstr_a(name));
3050 for (i = 0; i < This->annotation_count; ++i)
3052 struct d3d10_effect_variable *a = &This->annotations[i];
3053 if (!strcmp(a->name, name))
3055 TRACE("Returning annotation %p\n", a);
3056 return &a->ID3D10EffectVariable_iface;
3060 WARN("Invalid name specified\n");
3062 return &null_variable.ID3D10EffectVariable_iface;
3065 static HRESULT STDMETHODCALLTYPE d3d10_effect_pass_Apply(ID3D10EffectPass *iface, UINT flags)
3067 struct d3d10_effect_pass *This = impl_from_ID3D10EffectPass(iface);
3071 TRACE("iface %p, flags %#x\n", iface, flags);
3073 if (flags) FIXME("Ignoring flags (%#x)\n", flags);
3075 for (i = 0; i < This->object_count; ++i)
3077 hr = d3d10_effect_object_apply(&This->objects[i]);
3078 if (FAILED(hr)) break;
3084 static HRESULT STDMETHODCALLTYPE d3d10_effect_pass_ComputeStateBlockMask(ID3D10EffectPass *iface,
3085 D3D10_STATE_BLOCK_MASK *mask)
3087 FIXME("iface %p, mask %p stub!\n", iface, mask);
3092 static const struct ID3D10EffectPassVtbl d3d10_effect_pass_vtbl =
3094 /* ID3D10EffectPass methods */
3095 d3d10_effect_pass_IsValid,
3096 d3d10_effect_pass_GetDesc,
3097 d3d10_effect_pass_GetVertexShaderDesc,
3098 d3d10_effect_pass_GetGeometryShaderDesc,
3099 d3d10_effect_pass_GetPixelShaderDesc,
3100 d3d10_effect_pass_GetAnnotationByIndex,
3101 d3d10_effect_pass_GetAnnotationByName,
3102 d3d10_effect_pass_Apply,
3103 d3d10_effect_pass_ComputeStateBlockMask,
3106 /* ID3D10EffectVariable methods */
3108 static BOOL STDMETHODCALLTYPE d3d10_effect_variable_IsValid(ID3D10EffectVariable *iface)
3110 TRACE("iface %p\n", iface);
3112 return impl_from_ID3D10EffectVariable(iface) != &null_variable;
3115 static struct ID3D10EffectType * STDMETHODCALLTYPE d3d10_effect_variable_GetType(ID3D10EffectVariable *iface)
3117 struct d3d10_effect_variable *This = impl_from_ID3D10EffectVariable(iface);
3119 TRACE("iface %p\n", iface);
3121 return &This->type->ID3D10EffectType_iface;
3124 static HRESULT STDMETHODCALLTYPE d3d10_effect_variable_GetDesc(ID3D10EffectVariable *iface,
3125 D3D10_EFFECT_VARIABLE_DESC *desc)
3127 struct d3d10_effect_variable *This = impl_from_ID3D10EffectVariable(iface);
3129 TRACE("iface %p, desc %p\n", iface, desc);
3131 if (!iface->lpVtbl->IsValid(iface))
3133 WARN("Null variable specified\n");
3139 WARN("Invalid argument specified\n");
3140 return E_INVALIDARG;
3143 /* FIXME: This isn't correct. Anonymous shaders let desc->ExplicitBindPoint untouched, but normal shaders set it! */
3144 memset(desc, 0, sizeof(*desc));
3145 desc->Name = This->name;
3146 desc->Semantic = This->semantic;
3147 desc->Flags = This->flag;
3148 desc->Annotations = This->annotation_count;
3149 desc->BufferOffset = This->buffer_offset;
3151 if (This->flag & D3D10_EFFECT_VARIABLE_EXPLICIT_BIND_POINT)
3153 desc->ExplicitBindPoint = This->buffer_offset;
3159 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_variable_GetAnnotationByIndex(
3160 ID3D10EffectVariable *iface, UINT index)
3162 struct d3d10_effect_variable *This = impl_from_ID3D10EffectVariable(iface);
3163 struct d3d10_effect_variable *a;
3165 TRACE("iface %p, index %u\n", iface, index);
3167 if (index >= This->annotation_count)
3169 WARN("Invalid index specified\n");
3170 return &null_variable.ID3D10EffectVariable_iface;
3173 a = &This->annotations[index];
3175 TRACE("Returning annotation %p, %s\n", a, debugstr_a(a->name));
3177 return &a->ID3D10EffectVariable_iface;
3180 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_variable_GetAnnotationByName(
3181 ID3D10EffectVariable *iface, LPCSTR name)
3183 struct d3d10_effect_variable *This = impl_from_ID3D10EffectVariable(iface);
3186 TRACE("iface %p, name %s.\n", iface, debugstr_a(name));
3188 for (i = 0; i < This->annotation_count; ++i)
3190 struct d3d10_effect_variable *a = &This->annotations[i];
3191 if (!strcmp(a->name, name))
3193 TRACE("Returning annotation %p\n", a);
3194 return &a->ID3D10EffectVariable_iface;
3198 WARN("Invalid name specified\n");
3200 return &null_variable.ID3D10EffectVariable_iface;
3203 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_variable_GetMemberByIndex(
3204 ID3D10EffectVariable *iface, UINT index)
3206 struct d3d10_effect_variable *This = impl_from_ID3D10EffectVariable(iface);
3207 struct d3d10_effect_variable *m;
3209 TRACE("iface %p, index %u\n", iface, index);
3211 if (index >= This->type->member_count)
3213 WARN("Invalid index specified\n");
3214 return &null_variable.ID3D10EffectVariable_iface;
3217 m = &This->members[index];
3219 TRACE("Returning member %p, %s\n", m, debugstr_a(m->name));
3221 return &m->ID3D10EffectVariable_iface;
3224 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_variable_GetMemberByName(
3225 ID3D10EffectVariable *iface, LPCSTR name)
3227 struct d3d10_effect_variable *This = impl_from_ID3D10EffectVariable(iface);
3230 TRACE("iface %p, name %s.\n", iface, debugstr_a(name));
3234 WARN("Invalid name specified\n");
3235 return &null_variable.ID3D10EffectVariable_iface;
3238 for (i = 0; i < This->type->member_count; ++i)
3240 struct d3d10_effect_variable *m = &This->members[i];
3244 if (!strcmp(m->name, name))
3246 TRACE("Returning member %p\n", m);
3247 return &m->ID3D10EffectVariable_iface;
3252 WARN("Invalid name specified\n");
3254 return &null_variable.ID3D10EffectVariable_iface;
3257 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_variable_GetMemberBySemantic(
3258 ID3D10EffectVariable *iface, LPCSTR semantic)
3260 struct d3d10_effect_variable *This = impl_from_ID3D10EffectVariable(iface);
3263 TRACE("iface %p, semantic %s.\n", iface, debugstr_a(semantic));
3267 WARN("Invalid semantic specified\n");
3268 return &null_variable.ID3D10EffectVariable_iface;
3271 for (i = 0; i < This->type->member_count; ++i)
3273 struct d3d10_effect_variable *m = &This->members[i];
3277 if (!strcmp(m->semantic, semantic))
3279 TRACE("Returning member %p\n", m);
3280 return &m->ID3D10EffectVariable_iface;
3285 WARN("Invalid semantic specified\n");
3287 return &null_variable.ID3D10EffectVariable_iface;
3290 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_variable_GetElement(
3291 ID3D10EffectVariable *iface, UINT index)
3293 struct d3d10_effect_variable *This = impl_from_ID3D10EffectVariable(iface);
3294 struct d3d10_effect_variable *v;
3296 TRACE("iface %p, index %u\n", iface, index);
3298 if (index >= This->type->element_count)
3300 WARN("Invalid index specified\n");
3301 return &null_variable.ID3D10EffectVariable_iface;
3304 v = &This->elements[index];
3306 TRACE("Returning element %p, %s\n", v, debugstr_a(v->name));
3308 return &v->ID3D10EffectVariable_iface;
3311 static struct ID3D10EffectConstantBuffer * STDMETHODCALLTYPE d3d10_effect_variable_GetParentConstantBuffer(
3312 ID3D10EffectVariable *iface)
3314 struct d3d10_effect_variable *This = impl_from_ID3D10EffectVariable(iface);
3316 TRACE("iface %p\n", iface);
3318 return (ID3D10EffectConstantBuffer *)This->buffer;
3321 static struct ID3D10EffectScalarVariable * STDMETHODCALLTYPE d3d10_effect_variable_AsScalar(
3322 ID3D10EffectVariable *iface)
3324 struct d3d10_effect_variable *This = impl_from_ID3D10EffectVariable(iface);
3326 TRACE("iface %p\n", iface);
3328 if (This->ID3D10EffectVariable_iface.lpVtbl == (const ID3D10EffectVariableVtbl *)&d3d10_effect_scalar_variable_vtbl)
3329 return (ID3D10EffectScalarVariable *)&This->ID3D10EffectVariable_iface;
3331 return (ID3D10EffectScalarVariable *)&null_scalar_variable.ID3D10EffectVariable_iface;
3334 static struct ID3D10EffectVectorVariable * STDMETHODCALLTYPE d3d10_effect_variable_AsVector(
3335 ID3D10EffectVariable *iface)
3337 struct d3d10_effect_variable *This = impl_from_ID3D10EffectVariable(iface);
3339 TRACE("iface %p\n", iface);
3341 if (This->ID3D10EffectVariable_iface.lpVtbl == (const ID3D10EffectVariableVtbl *)&d3d10_effect_vector_variable_vtbl)
3342 return (ID3D10EffectVectorVariable *)&This->ID3D10EffectVariable_iface;
3344 return (ID3D10EffectVectorVariable *)&null_vector_variable.ID3D10EffectVariable_iface;
3347 static struct ID3D10EffectMatrixVariable * STDMETHODCALLTYPE d3d10_effect_variable_AsMatrix(
3348 ID3D10EffectVariable *iface)
3350 struct d3d10_effect_variable *This = impl_from_ID3D10EffectVariable(iface);
3352 TRACE("iface %p\n", iface);
3354 if (This->ID3D10EffectVariable_iface.lpVtbl == (const ID3D10EffectVariableVtbl *)&d3d10_effect_matrix_variable_vtbl)
3355 return (ID3D10EffectMatrixVariable *)&This->ID3D10EffectVariable_iface;
3357 return (ID3D10EffectMatrixVariable *)&null_matrix_variable.ID3D10EffectVariable_iface;
3360 static struct ID3D10EffectStringVariable * STDMETHODCALLTYPE d3d10_effect_variable_AsString(
3361 ID3D10EffectVariable *iface)
3363 struct d3d10_effect_variable *This = impl_from_ID3D10EffectVariable(iface);
3365 TRACE("iface %p\n", iface);
3367 if (This->ID3D10EffectVariable_iface.lpVtbl == (const ID3D10EffectVariableVtbl *)&d3d10_effect_string_variable_vtbl)
3368 return (ID3D10EffectStringVariable *)&This->ID3D10EffectVariable_iface;
3370 return (ID3D10EffectStringVariable *)&null_string_variable.ID3D10EffectVariable_iface;
3373 static struct ID3D10EffectShaderResourceVariable * STDMETHODCALLTYPE d3d10_effect_variable_AsShaderResource(
3374 ID3D10EffectVariable *iface)
3376 struct d3d10_effect_variable *This = impl_from_ID3D10EffectVariable(iface);
3378 TRACE("iface %p\n", iface);
3380 if (This->ID3D10EffectVariable_iface.lpVtbl == (const ID3D10EffectVariableVtbl *)&d3d10_effect_shader_resource_variable_vtbl)
3381 return (ID3D10EffectShaderResourceVariable *)&This->ID3D10EffectVariable_iface;
3383 return (ID3D10EffectShaderResourceVariable *)&null_shader_resource_variable.ID3D10EffectVariable_iface;
3386 static struct ID3D10EffectRenderTargetViewVariable * STDMETHODCALLTYPE d3d10_effect_variable_AsRenderTargetView(
3387 ID3D10EffectVariable *iface)
3389 struct d3d10_effect_variable *This = impl_from_ID3D10EffectVariable(iface);
3391 TRACE("iface %p\n", iface);
3393 if (This->ID3D10EffectVariable_iface.lpVtbl == (const ID3D10EffectVariableVtbl *)&d3d10_effect_render_target_view_variable_vtbl)
3394 return (ID3D10EffectRenderTargetViewVariable *)&This->ID3D10EffectVariable_iface;
3396 return (ID3D10EffectRenderTargetViewVariable *)&null_render_target_view_variable.ID3D10EffectVariable_iface;
3399 static struct ID3D10EffectDepthStencilViewVariable * STDMETHODCALLTYPE d3d10_effect_variable_AsDepthStencilView(
3400 ID3D10EffectVariable *iface)
3402 struct d3d10_effect_variable *This = impl_from_ID3D10EffectVariable(iface);
3404 TRACE("iface %p\n", iface);
3406 if (This->ID3D10EffectVariable_iface.lpVtbl == (const ID3D10EffectVariableVtbl *)&d3d10_effect_depth_stencil_view_variable_vtbl)
3407 return (ID3D10EffectDepthStencilViewVariable *)&This->ID3D10EffectVariable_iface;
3409 return (ID3D10EffectDepthStencilViewVariable *)&null_depth_stencil_view_variable.ID3D10EffectVariable_iface;
3412 static struct ID3D10EffectConstantBuffer * STDMETHODCALLTYPE d3d10_effect_variable_AsConstantBuffer(
3413 ID3D10EffectVariable *iface)
3415 struct d3d10_effect_variable *This = impl_from_ID3D10EffectVariable(iface);
3417 TRACE("iface %p\n", iface);
3419 if (This->ID3D10EffectVariable_iface.lpVtbl == (const ID3D10EffectVariableVtbl *)&d3d10_effect_constant_buffer_vtbl)
3420 return (ID3D10EffectConstantBuffer *)&This->ID3D10EffectVariable_iface;
3422 return (ID3D10EffectConstantBuffer *)&null_local_buffer.ID3D10EffectVariable_iface;
3425 static struct ID3D10EffectShaderVariable * STDMETHODCALLTYPE d3d10_effect_variable_AsShader(
3426 ID3D10EffectVariable *iface)
3428 struct d3d10_effect_variable *This = impl_from_ID3D10EffectVariable(iface);
3430 TRACE("iface %p\n", iface);
3432 if (This->ID3D10EffectVariable_iface.lpVtbl == (const ID3D10EffectVariableVtbl *)&d3d10_effect_shader_variable_vtbl)
3433 return (ID3D10EffectShaderVariable *)&This->ID3D10EffectVariable_iface;
3435 return (ID3D10EffectShaderVariable *)&null_shader_variable.ID3D10EffectVariable_iface;
3438 static struct ID3D10EffectBlendVariable * STDMETHODCALLTYPE d3d10_effect_variable_AsBlend(ID3D10EffectVariable *iface)
3440 struct d3d10_effect_variable *This = impl_from_ID3D10EffectVariable(iface);
3442 TRACE("iface %p\n", iface);
3444 if (This->ID3D10EffectVariable_iface.lpVtbl == (const ID3D10EffectVariableVtbl *)&d3d10_effect_blend_variable_vtbl)
3445 return (ID3D10EffectBlendVariable *)&This->ID3D10EffectVariable_iface;
3447 return (ID3D10EffectBlendVariable *)&null_blend_variable.ID3D10EffectVariable_iface;
3450 static struct ID3D10EffectDepthStencilVariable * STDMETHODCALLTYPE d3d10_effect_variable_AsDepthStencil(
3451 ID3D10EffectVariable *iface)
3453 struct d3d10_effect_variable *This = impl_from_ID3D10EffectVariable(iface);
3455 TRACE("iface %p\n", iface);
3457 if (This->ID3D10EffectVariable_iface.lpVtbl == (const ID3D10EffectVariableVtbl *)&d3d10_effect_depth_stencil_variable_vtbl)
3458 return (ID3D10EffectDepthStencilVariable *)&This->ID3D10EffectVariable_iface;
3460 return (ID3D10EffectDepthStencilVariable *)&null_depth_stencil_variable.ID3D10EffectVariable_iface;
3463 static struct ID3D10EffectRasterizerVariable * STDMETHODCALLTYPE d3d10_effect_variable_AsRasterizer(
3464 ID3D10EffectVariable *iface)
3466 struct d3d10_effect_variable *This = impl_from_ID3D10EffectVariable(iface);
3468 TRACE("iface %p\n", iface);
3470 if (This->ID3D10EffectVariable_iface.lpVtbl == (const ID3D10EffectVariableVtbl *)&d3d10_effect_rasterizer_variable_vtbl)
3471 return (ID3D10EffectRasterizerVariable *)&This->ID3D10EffectVariable_iface;
3473 return (ID3D10EffectRasterizerVariable *)&null_rasterizer_variable.ID3D10EffectVariable_iface;
3476 static struct ID3D10EffectSamplerVariable * STDMETHODCALLTYPE d3d10_effect_variable_AsSampler(
3477 ID3D10EffectVariable *iface)
3479 struct d3d10_effect_variable *This = impl_from_ID3D10EffectVariable(iface);
3481 TRACE("iface %p\n", iface);
3483 if (This->ID3D10EffectVariable_iface.lpVtbl == (const ID3D10EffectVariableVtbl *)&d3d10_effect_sampler_variable_vtbl)
3484 return (ID3D10EffectSamplerVariable *)&This->ID3D10EffectVariable_iface;
3486 return (ID3D10EffectSamplerVariable *)&null_sampler_variable.ID3D10EffectVariable_iface;
3489 static HRESULT STDMETHODCALLTYPE d3d10_effect_variable_SetRawValue(ID3D10EffectVariable *iface,
3490 void *data, UINT offset, UINT count)
3492 FIXME("iface %p, data %p, offset %u, count %u stub!\n", iface, data, offset, count);
3497 static HRESULT STDMETHODCALLTYPE d3d10_effect_variable_GetRawValue(ID3D10EffectVariable *iface,
3498 void *data, UINT offset, UINT count)
3500 FIXME("iface %p, data %p, offset %u, count %u stub!\n", iface, data, offset, count);
3505 static const struct ID3D10EffectVariableVtbl d3d10_effect_variable_vtbl =
3507 /* ID3D10EffectVariable methods */
3508 d3d10_effect_variable_IsValid,
3509 d3d10_effect_variable_GetType,
3510 d3d10_effect_variable_GetDesc,
3511 d3d10_effect_variable_GetAnnotationByIndex,
3512 d3d10_effect_variable_GetAnnotationByName,
3513 d3d10_effect_variable_GetMemberByIndex,
3514 d3d10_effect_variable_GetMemberByName,
3515 d3d10_effect_variable_GetMemberBySemantic,
3516 d3d10_effect_variable_GetElement,
3517 d3d10_effect_variable_GetParentConstantBuffer,
3518 d3d10_effect_variable_AsScalar,
3519 d3d10_effect_variable_AsVector,
3520 d3d10_effect_variable_AsMatrix,
3521 d3d10_effect_variable_AsString,
3522 d3d10_effect_variable_AsShaderResource,
3523 d3d10_effect_variable_AsRenderTargetView,
3524 d3d10_effect_variable_AsDepthStencilView,
3525 d3d10_effect_variable_AsConstantBuffer,
3526 d3d10_effect_variable_AsShader,
3527 d3d10_effect_variable_AsBlend,
3528 d3d10_effect_variable_AsDepthStencil,
3529 d3d10_effect_variable_AsRasterizer,
3530 d3d10_effect_variable_AsSampler,
3531 d3d10_effect_variable_SetRawValue,
3532 d3d10_effect_variable_GetRawValue,
3535 /* ID3D10EffectVariable methods */
3536 static BOOL STDMETHODCALLTYPE d3d10_effect_constant_buffer_IsValid(ID3D10EffectConstantBuffer *iface)
3538 TRACE("iface %p\n", iface);
3540 return (struct d3d10_effect_variable *)iface != &null_local_buffer;
3543 static struct ID3D10EffectType * STDMETHODCALLTYPE d3d10_effect_constant_buffer_GetType(ID3D10EffectConstantBuffer *iface)
3545 return d3d10_effect_variable_GetType((ID3D10EffectVariable *)iface);
3548 static HRESULT STDMETHODCALLTYPE d3d10_effect_constant_buffer_GetDesc(ID3D10EffectConstantBuffer *iface,
3549 D3D10_EFFECT_VARIABLE_DESC *desc)
3551 return d3d10_effect_variable_GetDesc((ID3D10EffectVariable *)iface, desc);
3554 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_constant_buffer_GetAnnotationByIndex(
3555 ID3D10EffectConstantBuffer *iface, UINT index)
3557 return d3d10_effect_variable_GetAnnotationByIndex((ID3D10EffectVariable *)iface, index);
3560 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_constant_buffer_GetAnnotationByName(
3561 ID3D10EffectConstantBuffer *iface, LPCSTR name)
3563 return d3d10_effect_variable_GetAnnotationByName((ID3D10EffectVariable *)iface, name);
3566 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_constant_buffer_GetMemberByIndex(
3567 ID3D10EffectConstantBuffer *iface, UINT index)
3569 return d3d10_effect_variable_GetMemberByIndex((ID3D10EffectVariable *)iface, index);
3572 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_constant_buffer_GetMemberByName(
3573 ID3D10EffectConstantBuffer *iface, LPCSTR name)
3575 return d3d10_effect_variable_GetMemberByName((ID3D10EffectVariable *)iface, name);
3578 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_constant_buffer_GetMemberBySemantic(
3579 ID3D10EffectConstantBuffer *iface, LPCSTR semantic)
3581 return d3d10_effect_variable_GetMemberBySemantic((ID3D10EffectVariable *)iface, semantic);
3584 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_constant_buffer_GetElement(
3585 ID3D10EffectConstantBuffer *iface, UINT index)
3587 return d3d10_effect_variable_GetElement((ID3D10EffectVariable *)iface, index);
3590 static struct ID3D10EffectConstantBuffer * STDMETHODCALLTYPE d3d10_effect_constant_buffer_GetParentConstantBuffer(
3591 ID3D10EffectConstantBuffer *iface)
3593 return d3d10_effect_variable_GetParentConstantBuffer((ID3D10EffectVariable *)iface);
3596 static struct ID3D10EffectScalarVariable * STDMETHODCALLTYPE d3d10_effect_constant_buffer_AsScalar(
3597 ID3D10EffectConstantBuffer *iface)
3599 return d3d10_effect_variable_AsScalar((ID3D10EffectVariable *)iface);
3602 static struct ID3D10EffectVectorVariable * STDMETHODCALLTYPE d3d10_effect_constant_buffer_AsVector(
3603 ID3D10EffectConstantBuffer *iface)
3605 return d3d10_effect_variable_AsVector((ID3D10EffectVariable *)iface);
3608 static struct ID3D10EffectMatrixVariable * STDMETHODCALLTYPE d3d10_effect_constant_buffer_AsMatrix(
3609 ID3D10EffectConstantBuffer *iface)
3611 return d3d10_effect_variable_AsMatrix((ID3D10EffectVariable *)iface);
3614 static struct ID3D10EffectStringVariable * STDMETHODCALLTYPE d3d10_effect_constant_buffer_AsString(
3615 ID3D10EffectConstantBuffer *iface)
3617 return d3d10_effect_variable_AsString((ID3D10EffectVariable *)iface);
3620 static struct ID3D10EffectShaderResourceVariable * STDMETHODCALLTYPE d3d10_effect_constant_buffer_AsShaderResource(
3621 ID3D10EffectConstantBuffer *iface)
3623 return d3d10_effect_variable_AsShaderResource((ID3D10EffectVariable *)iface);
3626 static struct ID3D10EffectRenderTargetViewVariable * STDMETHODCALLTYPE d3d10_effect_constant_buffer_AsRenderTargetView(
3627 ID3D10EffectConstantBuffer *iface)
3629 return d3d10_effect_variable_AsRenderTargetView((ID3D10EffectVariable *)iface);
3632 static struct ID3D10EffectDepthStencilViewVariable * STDMETHODCALLTYPE d3d10_effect_constant_buffer_AsDepthStencilView(
3633 ID3D10EffectConstantBuffer *iface)
3635 return d3d10_effect_variable_AsDepthStencilView((ID3D10EffectVariable *)iface);
3638 static struct ID3D10EffectConstantBuffer * STDMETHODCALLTYPE d3d10_effect_constant_buffer_AsConstantBuffer(
3639 ID3D10EffectConstantBuffer *iface)
3641 return d3d10_effect_variable_AsConstantBuffer((ID3D10EffectVariable *)iface);
3644 static struct ID3D10EffectShaderVariable * STDMETHODCALLTYPE d3d10_effect_constant_buffer_AsShader(
3645 ID3D10EffectConstantBuffer *iface)
3647 return d3d10_effect_variable_AsShader((ID3D10EffectVariable *)iface);
3650 static struct ID3D10EffectBlendVariable * STDMETHODCALLTYPE d3d10_effect_constant_buffer_AsBlend(ID3D10EffectConstantBuffer *iface)
3652 return d3d10_effect_variable_AsBlend((ID3D10EffectVariable *)iface);
3655 static struct ID3D10EffectDepthStencilVariable * STDMETHODCALLTYPE d3d10_effect_constant_buffer_AsDepthStencil(
3656 ID3D10EffectConstantBuffer *iface)
3658 return d3d10_effect_variable_AsDepthStencil((ID3D10EffectVariable *)iface);
3661 static struct ID3D10EffectRasterizerVariable * STDMETHODCALLTYPE d3d10_effect_constant_buffer_AsRasterizer(
3662 ID3D10EffectConstantBuffer *iface)
3664 return d3d10_effect_variable_AsRasterizer((ID3D10EffectVariable *)iface);
3667 static struct ID3D10EffectSamplerVariable * STDMETHODCALLTYPE d3d10_effect_constant_buffer_AsSampler(
3668 ID3D10EffectConstantBuffer *iface)
3670 return d3d10_effect_variable_AsSampler((ID3D10EffectVariable *)iface);
3673 static HRESULT STDMETHODCALLTYPE d3d10_effect_constant_buffer_SetRawValue(ID3D10EffectConstantBuffer *iface,
3674 void *data, UINT offset, UINT count)
3676 return d3d10_effect_variable_SetRawValue((ID3D10EffectVariable *)iface, data, offset, count);
3679 static HRESULT STDMETHODCALLTYPE d3d10_effect_constant_buffer_GetRawValue(ID3D10EffectConstantBuffer *iface,
3680 void *data, UINT offset, UINT count)
3682 return d3d10_effect_variable_GetRawValue((ID3D10EffectVariable *)iface, data, offset, count);
3685 /* ID3D10EffectConstantBuffer methods */
3686 static HRESULT STDMETHODCALLTYPE d3d10_effect_constant_buffer_SetConstantBuffer(ID3D10EffectConstantBuffer *iface,
3687 ID3D10Buffer *buffer)
3689 FIXME("iface %p, buffer %p stub!\n", iface, buffer);
3694 static HRESULT STDMETHODCALLTYPE d3d10_effect_constant_buffer_GetConstantBuffer(ID3D10EffectConstantBuffer *iface,
3695 ID3D10Buffer **buffer)
3697 FIXME("iface %p, buffer %p stub!\n", iface, buffer);
3702 static HRESULT STDMETHODCALLTYPE d3d10_effect_constant_buffer_SetTextureBuffer(ID3D10EffectConstantBuffer *iface,
3703 ID3D10ShaderResourceView *view)
3705 FIXME("iface %p, view %p stub!\n", iface, view);
3710 static HRESULT STDMETHODCALLTYPE d3d10_effect_constant_buffer_GetTextureBuffer(ID3D10EffectConstantBuffer *iface,
3711 ID3D10ShaderResourceView **view)
3713 FIXME("iface %p, view %p stub!\n", iface, view);
3718 static const struct ID3D10EffectConstantBufferVtbl d3d10_effect_constant_buffer_vtbl =
3720 /* ID3D10EffectVariable methods */
3721 d3d10_effect_constant_buffer_IsValid,
3722 d3d10_effect_constant_buffer_GetType,
3723 d3d10_effect_constant_buffer_GetDesc,
3724 d3d10_effect_constant_buffer_GetAnnotationByIndex,
3725 d3d10_effect_constant_buffer_GetAnnotationByName,
3726 d3d10_effect_constant_buffer_GetMemberByIndex,
3727 d3d10_effect_constant_buffer_GetMemberByName,
3728 d3d10_effect_constant_buffer_GetMemberBySemantic,
3729 d3d10_effect_constant_buffer_GetElement,
3730 d3d10_effect_constant_buffer_GetParentConstantBuffer,
3731 d3d10_effect_constant_buffer_AsScalar,
3732 d3d10_effect_constant_buffer_AsVector,
3733 d3d10_effect_constant_buffer_AsMatrix,
3734 d3d10_effect_constant_buffer_AsString,
3735 d3d10_effect_constant_buffer_AsShaderResource,
3736 d3d10_effect_constant_buffer_AsRenderTargetView,
3737 d3d10_effect_constant_buffer_AsDepthStencilView,
3738 d3d10_effect_constant_buffer_AsConstantBuffer,
3739 d3d10_effect_constant_buffer_AsShader,
3740 d3d10_effect_constant_buffer_AsBlend,
3741 d3d10_effect_constant_buffer_AsDepthStencil,
3742 d3d10_effect_constant_buffer_AsRasterizer,
3743 d3d10_effect_constant_buffer_AsSampler,
3744 d3d10_effect_constant_buffer_SetRawValue,
3745 d3d10_effect_constant_buffer_GetRawValue,
3746 /* ID3D10EffectConstantBuffer methods */
3747 d3d10_effect_constant_buffer_SetConstantBuffer,
3748 d3d10_effect_constant_buffer_GetConstantBuffer,
3749 d3d10_effect_constant_buffer_SetTextureBuffer,
3750 d3d10_effect_constant_buffer_GetTextureBuffer,
3753 /* ID3D10EffectVariable methods */
3755 static BOOL STDMETHODCALLTYPE d3d10_effect_scalar_variable_IsValid(ID3D10EffectScalarVariable *iface)
3757 TRACE("iface %p\n", iface);
3759 return (struct d3d10_effect_variable *)iface != &null_scalar_variable;
3762 static struct ID3D10EffectType * STDMETHODCALLTYPE d3d10_effect_scalar_variable_GetType(
3763 ID3D10EffectScalarVariable *iface)
3765 return d3d10_effect_variable_GetType((ID3D10EffectVariable *)iface);
3768 static HRESULT STDMETHODCALLTYPE d3d10_effect_scalar_variable_GetDesc(ID3D10EffectScalarVariable *iface,
3769 D3D10_EFFECT_VARIABLE_DESC *desc)
3771 return d3d10_effect_variable_GetDesc((ID3D10EffectVariable *)iface, desc);
3774 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_scalar_variable_GetAnnotationByIndex(
3775 ID3D10EffectScalarVariable *iface, UINT index)
3777 return d3d10_effect_variable_GetAnnotationByIndex((ID3D10EffectVariable *)iface, index);
3780 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_scalar_variable_GetAnnotationByName(
3781 ID3D10EffectScalarVariable *iface, LPCSTR name)
3783 return d3d10_effect_variable_GetAnnotationByName((ID3D10EffectVariable *)iface, name);
3786 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_scalar_variable_GetMemberByIndex(
3787 ID3D10EffectScalarVariable *iface, UINT index)
3789 return d3d10_effect_variable_GetMemberByIndex((ID3D10EffectVariable *)iface, index);
3792 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_scalar_variable_GetMemberByName(
3793 ID3D10EffectScalarVariable *iface, LPCSTR name)
3795 return d3d10_effect_variable_GetMemberByName((ID3D10EffectVariable *)iface, name);
3798 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_scalar_variable_GetMemberBySemantic(
3799 ID3D10EffectScalarVariable *iface, LPCSTR semantic)
3801 return d3d10_effect_variable_GetMemberBySemantic((ID3D10EffectVariable *)iface, semantic);
3804 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_scalar_variable_GetElement(
3805 ID3D10EffectScalarVariable *iface, UINT index)
3807 return d3d10_effect_variable_GetElement((ID3D10EffectVariable *)iface, index);
3810 static struct ID3D10EffectConstantBuffer * STDMETHODCALLTYPE d3d10_effect_scalar_variable_GetParentConstantBuffer(
3811 ID3D10EffectScalarVariable *iface)
3813 return d3d10_effect_variable_GetParentConstantBuffer((ID3D10EffectVariable *)iface);
3816 static struct ID3D10EffectScalarVariable * STDMETHODCALLTYPE d3d10_effect_scalar_variable_AsScalar(
3817 ID3D10EffectScalarVariable *iface)
3819 return d3d10_effect_variable_AsScalar((ID3D10EffectVariable *)iface);
3822 static struct ID3D10EffectVectorVariable * STDMETHODCALLTYPE d3d10_effect_scalar_variable_AsVector(
3823 ID3D10EffectScalarVariable *iface)
3825 return d3d10_effect_variable_AsVector((ID3D10EffectVariable *)iface);
3828 static struct ID3D10EffectMatrixVariable * STDMETHODCALLTYPE d3d10_effect_scalar_variable_AsMatrix(
3829 ID3D10EffectScalarVariable *iface)
3831 return d3d10_effect_variable_AsMatrix((ID3D10EffectVariable *)iface);
3834 static struct ID3D10EffectStringVariable * STDMETHODCALLTYPE d3d10_effect_scalar_variable_AsString(
3835 ID3D10EffectScalarVariable *iface)
3837 return d3d10_effect_variable_AsString((ID3D10EffectVariable *)iface);
3840 static struct ID3D10EffectShaderResourceVariable * STDMETHODCALLTYPE d3d10_effect_scalar_variable_AsShaderResource(
3841 ID3D10EffectScalarVariable *iface)
3843 return d3d10_effect_variable_AsShaderResource((ID3D10EffectVariable *)iface);
3846 static struct ID3D10EffectRenderTargetViewVariable * STDMETHODCALLTYPE d3d10_effect_scalar_variable_AsRenderTargetView(
3847 ID3D10EffectScalarVariable *iface)
3849 return d3d10_effect_variable_AsRenderTargetView((ID3D10EffectVariable *)iface);
3852 static struct ID3D10EffectDepthStencilViewVariable * STDMETHODCALLTYPE d3d10_effect_scalar_variable_AsDepthStencilView(
3853 ID3D10EffectScalarVariable *iface)
3855 return d3d10_effect_variable_AsDepthStencilView((ID3D10EffectVariable *)iface);
3858 static struct ID3D10EffectConstantBuffer * STDMETHODCALLTYPE d3d10_effect_scalar_variable_AsConstantBuffer(
3859 ID3D10EffectScalarVariable *iface)
3861 return d3d10_effect_variable_AsConstantBuffer((ID3D10EffectVariable *)iface);
3864 static struct ID3D10EffectShaderVariable * STDMETHODCALLTYPE d3d10_effect_scalar_variable_AsShader(
3865 ID3D10EffectScalarVariable *iface)
3867 return d3d10_effect_variable_AsShader((ID3D10EffectVariable *)iface);
3870 static struct ID3D10EffectBlendVariable * STDMETHODCALLTYPE d3d10_effect_scalar_variable_AsBlend(
3871 ID3D10EffectScalarVariable *iface)
3873 return d3d10_effect_variable_AsBlend((ID3D10EffectVariable *)iface);
3876 static struct ID3D10EffectDepthStencilVariable * STDMETHODCALLTYPE d3d10_effect_scalar_variable_AsDepthStencil(
3877 ID3D10EffectScalarVariable *iface)
3879 return d3d10_effect_variable_AsDepthStencil((ID3D10EffectVariable *)iface);
3882 static struct ID3D10EffectRasterizerVariable * STDMETHODCALLTYPE d3d10_effect_scalar_variable_AsRasterizer(
3883 ID3D10EffectScalarVariable *iface)
3885 return d3d10_effect_variable_AsRasterizer((ID3D10EffectVariable *)iface);
3888 static struct ID3D10EffectSamplerVariable * STDMETHODCALLTYPE d3d10_effect_scalar_variable_AsSampler(
3889 ID3D10EffectScalarVariable *iface)
3891 return d3d10_effect_variable_AsSampler((ID3D10EffectVariable *)iface);
3894 static HRESULT STDMETHODCALLTYPE d3d10_effect_scalar_variable_SetRawValue(ID3D10EffectScalarVariable *iface,
3895 void *data, UINT offset, UINT count)
3897 return d3d10_effect_variable_SetRawValue((ID3D10EffectVariable *)iface, data, offset, count);
3900 static HRESULT STDMETHODCALLTYPE d3d10_effect_scalar_variable_GetRawValue(ID3D10EffectScalarVariable *iface,
3901 void *data, UINT offset, UINT count)
3903 return d3d10_effect_variable_GetRawValue((ID3D10EffectVariable *)iface, data, offset, count);
3906 /* ID3D10EffectScalarVariable methods */
3908 static HRESULT STDMETHODCALLTYPE d3d10_effect_scalar_variable_SetFloat(ID3D10EffectScalarVariable *iface,
3911 FIXME("iface %p, value %.8e stub!\n", iface, value);
3916 static HRESULT STDMETHODCALLTYPE d3d10_effect_scalar_variable_GetFloat(ID3D10EffectScalarVariable *iface,
3919 FIXME("iface %p, value %p stub!\n", iface, value);
3924 static HRESULT STDMETHODCALLTYPE d3d10_effect_scalar_variable_SetFloatArray(ID3D10EffectScalarVariable *iface,
3925 float *values, UINT offset, UINT count)
3927 FIXME("iface %p, values %p, offset %u, count %u stub!\n", iface, values, offset, count);
3932 static HRESULT STDMETHODCALLTYPE d3d10_effect_scalar_variable_GetFloatArray(ID3D10EffectScalarVariable *iface,
3933 float *values, UINT offset, UINT count)
3935 FIXME("iface %p, values %p, offset %u, count %u stub!\n", iface, values, offset, count);
3940 static HRESULT STDMETHODCALLTYPE d3d10_effect_scalar_variable_SetInt(ID3D10EffectScalarVariable *iface,
3943 FIXME("iface %p, value %d stub!\n", iface, value);
3948 static HRESULT STDMETHODCALLTYPE d3d10_effect_scalar_variable_GetInt(ID3D10EffectScalarVariable *iface,
3951 FIXME("iface %p, value %p stub!\n", iface, value);
3956 static HRESULT STDMETHODCALLTYPE d3d10_effect_scalar_variable_SetIntArray(ID3D10EffectScalarVariable *iface,
3957 int *values, UINT offset, UINT count)
3959 FIXME("iface %p, values %p, offset %u, count %u stub!\n", iface, values, offset, count);
3964 static HRESULT STDMETHODCALLTYPE d3d10_effect_scalar_variable_GetIntArray(ID3D10EffectScalarVariable *iface,
3965 int *values, UINT offset, UINT count)
3967 FIXME("iface %p, values %p, offset %u, count %u stub!\n", iface, values, offset, count);
3972 static HRESULT STDMETHODCALLTYPE d3d10_effect_scalar_variable_SetBool(ID3D10EffectScalarVariable *iface,
3975 FIXME("iface %p, value %d stub!\n", iface, value);
3980 static HRESULT STDMETHODCALLTYPE d3d10_effect_scalar_variable_GetBool(ID3D10EffectScalarVariable *iface,
3983 FIXME("iface %p, value %p stub!\n", iface, value);
3988 static HRESULT STDMETHODCALLTYPE d3d10_effect_scalar_variable_SetBoolArray(ID3D10EffectScalarVariable *iface,
3989 BOOL *values, UINT offset, UINT count)
3991 FIXME("iface %p, values %p, offset %u, count %u stub!\n", iface, values, offset, count);
3996 static HRESULT STDMETHODCALLTYPE d3d10_effect_scalar_variable_GetBoolArray(ID3D10EffectScalarVariable *iface,
3997 BOOL *values, UINT offset, UINT count)
3999 FIXME("iface %p, values %p, offset %u, count %u stub!\n", iface, values, offset, count);
4004 static const struct ID3D10EffectScalarVariableVtbl d3d10_effect_scalar_variable_vtbl =
4006 /* ID3D10EffectVariable methods */
4007 d3d10_effect_scalar_variable_IsValid,
4008 d3d10_effect_scalar_variable_GetType,
4009 d3d10_effect_scalar_variable_GetDesc,
4010 d3d10_effect_scalar_variable_GetAnnotationByIndex,
4011 d3d10_effect_scalar_variable_GetAnnotationByName,
4012 d3d10_effect_scalar_variable_GetMemberByIndex,
4013 d3d10_effect_scalar_variable_GetMemberByName,
4014 d3d10_effect_scalar_variable_GetMemberBySemantic,
4015 d3d10_effect_scalar_variable_GetElement,
4016 d3d10_effect_scalar_variable_GetParentConstantBuffer,
4017 d3d10_effect_scalar_variable_AsScalar,
4018 d3d10_effect_scalar_variable_AsVector,
4019 d3d10_effect_scalar_variable_AsMatrix,
4020 d3d10_effect_scalar_variable_AsString,
4021 d3d10_effect_scalar_variable_AsShaderResource,
4022 d3d10_effect_scalar_variable_AsRenderTargetView,
4023 d3d10_effect_scalar_variable_AsDepthStencilView,
4024 d3d10_effect_scalar_variable_AsConstantBuffer,
4025 d3d10_effect_scalar_variable_AsShader,
4026 d3d10_effect_scalar_variable_AsBlend,
4027 d3d10_effect_scalar_variable_AsDepthStencil,
4028 d3d10_effect_scalar_variable_AsRasterizer,
4029 d3d10_effect_scalar_variable_AsSampler,
4030 d3d10_effect_scalar_variable_SetRawValue,
4031 d3d10_effect_scalar_variable_GetRawValue,
4032 /* ID3D10EffectScalarVariable methods */
4033 d3d10_effect_scalar_variable_SetFloat,
4034 d3d10_effect_scalar_variable_GetFloat,
4035 d3d10_effect_scalar_variable_SetFloatArray,
4036 d3d10_effect_scalar_variable_GetFloatArray,
4037 d3d10_effect_scalar_variable_SetInt,
4038 d3d10_effect_scalar_variable_GetInt,
4039 d3d10_effect_scalar_variable_SetIntArray,
4040 d3d10_effect_scalar_variable_GetIntArray,
4041 d3d10_effect_scalar_variable_SetBool,
4042 d3d10_effect_scalar_variable_GetBool,
4043 d3d10_effect_scalar_variable_SetBoolArray,
4044 d3d10_effect_scalar_variable_GetBoolArray,
4047 /* ID3D10EffectVariable methods */
4049 static BOOL STDMETHODCALLTYPE d3d10_effect_vector_variable_IsValid(ID3D10EffectVectorVariable *iface)
4051 TRACE("iface %p\n", iface);
4053 return (struct d3d10_effect_variable *)iface != &null_vector_variable;
4056 static struct ID3D10EffectType * STDMETHODCALLTYPE d3d10_effect_vector_variable_GetType(
4057 ID3D10EffectVectorVariable *iface)
4059 return d3d10_effect_variable_GetType((ID3D10EffectVariable *)iface);
4062 static HRESULT STDMETHODCALLTYPE d3d10_effect_vector_variable_GetDesc(ID3D10EffectVectorVariable *iface,
4063 D3D10_EFFECT_VARIABLE_DESC *desc)
4065 return d3d10_effect_variable_GetDesc((ID3D10EffectVariable *)iface, desc);
4068 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_vector_variable_GetAnnotationByIndex(
4069 ID3D10EffectVectorVariable *iface, UINT index)
4071 return d3d10_effect_variable_GetAnnotationByIndex((ID3D10EffectVariable *)iface, index);
4074 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_vector_variable_GetAnnotationByName(
4075 ID3D10EffectVectorVariable *iface, LPCSTR name)
4077 return d3d10_effect_variable_GetAnnotationByName((ID3D10EffectVariable *)iface, name);
4080 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_vector_variable_GetMemberByIndex(
4081 ID3D10EffectVectorVariable *iface, UINT index)
4083 return d3d10_effect_variable_GetMemberByIndex((ID3D10EffectVariable *)iface, index);
4086 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_vector_variable_GetMemberByName(
4087 ID3D10EffectVectorVariable *iface, LPCSTR name)
4089 return d3d10_effect_variable_GetMemberByName((ID3D10EffectVariable *)iface, name);
4092 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_vector_variable_GetMemberBySemantic(
4093 ID3D10EffectVectorVariable *iface, LPCSTR semantic)
4095 return d3d10_effect_variable_GetMemberBySemantic((ID3D10EffectVariable *)iface, semantic);
4098 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_vector_variable_GetElement(
4099 ID3D10EffectVectorVariable *iface, UINT index)
4101 return d3d10_effect_variable_GetElement((ID3D10EffectVariable *)iface, index);
4104 static struct ID3D10EffectConstantBuffer * STDMETHODCALLTYPE d3d10_effect_vector_variable_GetParentConstantBuffer(
4105 ID3D10EffectVectorVariable *iface)
4107 return d3d10_effect_variable_GetParentConstantBuffer((ID3D10EffectVariable *)iface);
4110 static struct ID3D10EffectScalarVariable * STDMETHODCALLTYPE d3d10_effect_vector_variable_AsScalar(
4111 ID3D10EffectVectorVariable *iface)
4113 return d3d10_effect_variable_AsScalar((ID3D10EffectVariable *)iface);
4116 static struct ID3D10EffectVectorVariable * STDMETHODCALLTYPE d3d10_effect_vector_variable_AsVector(
4117 ID3D10EffectVectorVariable *iface)
4119 return d3d10_effect_variable_AsVector((ID3D10EffectVariable *)iface);
4122 static struct ID3D10EffectMatrixVariable * STDMETHODCALLTYPE d3d10_effect_vector_variable_AsMatrix(
4123 ID3D10EffectVectorVariable *iface)
4125 return d3d10_effect_variable_AsMatrix((ID3D10EffectVariable *)iface);
4128 static struct ID3D10EffectStringVariable * STDMETHODCALLTYPE d3d10_effect_vector_variable_AsString(
4129 ID3D10EffectVectorVariable *iface)
4131 return d3d10_effect_variable_AsString((ID3D10EffectVariable *)iface);
4134 static struct ID3D10EffectShaderResourceVariable * STDMETHODCALLTYPE d3d10_effect_vector_variable_AsShaderResource(
4135 ID3D10EffectVectorVariable *iface)
4137 return d3d10_effect_variable_AsShaderResource((ID3D10EffectVariable *)iface);
4140 static struct ID3D10EffectRenderTargetViewVariable * STDMETHODCALLTYPE d3d10_effect_vector_variable_AsRenderTargetView(
4141 ID3D10EffectVectorVariable *iface)
4143 return d3d10_effect_variable_AsRenderTargetView((ID3D10EffectVariable *)iface);
4146 static struct ID3D10EffectDepthStencilViewVariable * STDMETHODCALLTYPE d3d10_effect_vector_variable_AsDepthStencilView(
4147 ID3D10EffectVectorVariable *iface)
4149 return d3d10_effect_variable_AsDepthStencilView((ID3D10EffectVariable *)iface);
4152 static struct ID3D10EffectConstantBuffer * STDMETHODCALLTYPE d3d10_effect_vector_variable_AsConstantBuffer(
4153 ID3D10EffectVectorVariable *iface)
4155 return d3d10_effect_variable_AsConstantBuffer((ID3D10EffectVariable *)iface);
4158 static struct ID3D10EffectShaderVariable * STDMETHODCALLTYPE d3d10_effect_vector_variable_AsShader(
4159 ID3D10EffectVectorVariable *iface)
4161 return d3d10_effect_variable_AsShader((ID3D10EffectVariable *)iface);
4164 static struct ID3D10EffectBlendVariable * STDMETHODCALLTYPE d3d10_effect_vector_variable_AsBlend(
4165 ID3D10EffectVectorVariable *iface)
4167 return d3d10_effect_variable_AsBlend((ID3D10EffectVariable *)iface);
4170 static struct ID3D10EffectDepthStencilVariable * STDMETHODCALLTYPE d3d10_effect_vector_variable_AsDepthStencil(
4171 ID3D10EffectVectorVariable *iface)
4173 return d3d10_effect_variable_AsDepthStencil((ID3D10EffectVariable *)iface);
4176 static struct ID3D10EffectRasterizerVariable * STDMETHODCALLTYPE d3d10_effect_vector_variable_AsRasterizer(
4177 ID3D10EffectVectorVariable *iface)
4179 return d3d10_effect_variable_AsRasterizer((ID3D10EffectVariable *)iface);
4182 static struct ID3D10EffectSamplerVariable * STDMETHODCALLTYPE d3d10_effect_vector_variable_AsSampler(
4183 ID3D10EffectVectorVariable *iface)
4185 return d3d10_effect_variable_AsSampler((ID3D10EffectVariable *)iface);
4188 static HRESULT STDMETHODCALLTYPE d3d10_effect_vector_variable_SetRawValue(ID3D10EffectVectorVariable *iface,
4189 void *data, UINT offset, UINT count)
4191 return d3d10_effect_variable_SetRawValue((ID3D10EffectVariable *)iface, data, offset, count);
4194 static HRESULT STDMETHODCALLTYPE d3d10_effect_vector_variable_GetRawValue(ID3D10EffectVectorVariable *iface,
4195 void *data, UINT offset, UINT count)
4197 return d3d10_effect_variable_GetRawValue((ID3D10EffectVariable *)iface, data, offset, count);
4200 /* ID3D10EffectVectorVariable methods */
4202 static HRESULT STDMETHODCALLTYPE d3d10_effect_vector_variable_SetBoolVector(ID3D10EffectVectorVariable *iface,
4205 FIXME("iface %p, value %p stub!\n", iface, value);
4210 static HRESULT STDMETHODCALLTYPE d3d10_effect_vector_variable_SetIntVector(ID3D10EffectVectorVariable *iface,
4213 FIXME("iface %p, value %p stub!\n", iface, value);
4218 static HRESULT STDMETHODCALLTYPE d3d10_effect_vector_variable_SetFloatVector(ID3D10EffectVectorVariable *iface,
4221 FIXME("iface %p, value %p stub!\n", iface, value);
4226 static HRESULT STDMETHODCALLTYPE d3d10_effect_vector_variable_GetBoolVector(ID3D10EffectVectorVariable *iface,
4229 FIXME("iface %p, value %p stub!\n", iface, value);
4234 static HRESULT STDMETHODCALLTYPE d3d10_effect_vector_variable_GetIntVector(ID3D10EffectVectorVariable *iface,
4237 FIXME("iface %p, value %p stub!\n", iface, value);
4242 static HRESULT STDMETHODCALLTYPE d3d10_effect_vector_variable_GetFloatVector(ID3D10EffectVectorVariable *iface,
4245 FIXME("iface %p, value %p stub!\n", iface, value);
4250 static HRESULT STDMETHODCALLTYPE d3d10_effect_vector_variable_SetBoolVectorArray(ID3D10EffectVectorVariable *iface,
4251 BOOL *values, UINT offset, UINT count)
4253 FIXME("iface %p, values %p, offset %u, count %u stub!\n", iface, values, offset, count);
4258 static HRESULT STDMETHODCALLTYPE d3d10_effect_vector_variable_SetIntVectorArray(ID3D10EffectVectorVariable *iface,
4259 int *values, UINT offset, UINT count)
4261 FIXME("iface %p, values %p, offset %u, count %u stub!\n", iface, values, offset, count);
4266 static HRESULT STDMETHODCALLTYPE d3d10_effect_vector_variable_SetFloatVectorArray(ID3D10EffectVectorVariable *iface,
4267 float *values, UINT offset, UINT count)
4269 FIXME("iface %p, values %p, offset %u, count %u stub!\n", iface, values, offset, count);
4274 static HRESULT STDMETHODCALLTYPE d3d10_effect_vector_variable_GetBoolVectorArray(ID3D10EffectVectorVariable *iface,
4275 BOOL *values, UINT offset, UINT count)
4277 FIXME("iface %p, values %p, offset %u, count %u stub!\n", iface, values, offset, count);
4282 static HRESULT STDMETHODCALLTYPE d3d10_effect_vector_variable_GetIntVectorArray(ID3D10EffectVectorVariable *iface,
4283 int *values, UINT offset, UINT count)
4285 FIXME("iface %p, values %p, offset %u, count %u stub!\n", iface, values, offset, count);
4290 static HRESULT STDMETHODCALLTYPE d3d10_effect_vector_variable_GetFloatVectorArray(ID3D10EffectVectorVariable *iface,
4291 float *values, UINT offset, UINT count)
4293 FIXME("iface %p, values %p, offset %u, count %u stub!\n", iface, values, offset, count);
4298 static const struct ID3D10EffectVectorVariableVtbl d3d10_effect_vector_variable_vtbl =
4300 /* ID3D10EffectVariable methods */
4301 d3d10_effect_vector_variable_IsValid,
4302 d3d10_effect_vector_variable_GetType,
4303 d3d10_effect_vector_variable_GetDesc,
4304 d3d10_effect_vector_variable_GetAnnotationByIndex,
4305 d3d10_effect_vector_variable_GetAnnotationByName,
4306 d3d10_effect_vector_variable_GetMemberByIndex,
4307 d3d10_effect_vector_variable_GetMemberByName,
4308 d3d10_effect_vector_variable_GetMemberBySemantic,
4309 d3d10_effect_vector_variable_GetElement,
4310 d3d10_effect_vector_variable_GetParentConstantBuffer,
4311 d3d10_effect_vector_variable_AsScalar,
4312 d3d10_effect_vector_variable_AsVector,
4313 d3d10_effect_vector_variable_AsMatrix,
4314 d3d10_effect_vector_variable_AsString,
4315 d3d10_effect_vector_variable_AsShaderResource,
4316 d3d10_effect_vector_variable_AsRenderTargetView,
4317 d3d10_effect_vector_variable_AsDepthStencilView,
4318 d3d10_effect_vector_variable_AsConstantBuffer,
4319 d3d10_effect_vector_variable_AsShader,
4320 d3d10_effect_vector_variable_AsBlend,
4321 d3d10_effect_vector_variable_AsDepthStencil,
4322 d3d10_effect_vector_variable_AsRasterizer,
4323 d3d10_effect_vector_variable_AsSampler,
4324 d3d10_effect_vector_variable_SetRawValue,
4325 d3d10_effect_vector_variable_GetRawValue,
4326 /* ID3D10EffectVectorVariable methods */
4327 d3d10_effect_vector_variable_SetBoolVector,
4328 d3d10_effect_vector_variable_SetIntVector,
4329 d3d10_effect_vector_variable_SetFloatVector,
4330 d3d10_effect_vector_variable_GetBoolVector,
4331 d3d10_effect_vector_variable_GetIntVector,
4332 d3d10_effect_vector_variable_GetFloatVector,
4333 d3d10_effect_vector_variable_SetBoolVectorArray,
4334 d3d10_effect_vector_variable_SetIntVectorArray,
4335 d3d10_effect_vector_variable_SetFloatVectorArray,
4336 d3d10_effect_vector_variable_GetBoolVectorArray,
4337 d3d10_effect_vector_variable_GetIntVectorArray,
4338 d3d10_effect_vector_variable_GetFloatVectorArray,
4341 /* ID3D10EffectVariable methods */
4343 static BOOL STDMETHODCALLTYPE d3d10_effect_matrix_variable_IsValid(ID3D10EffectMatrixVariable *iface)
4345 TRACE("iface %p\n", iface);
4347 return (struct d3d10_effect_variable *)iface != &null_matrix_variable;
4350 static struct ID3D10EffectType * STDMETHODCALLTYPE d3d10_effect_matrix_variable_GetType(
4351 ID3D10EffectMatrixVariable *iface)
4353 return d3d10_effect_variable_GetType((ID3D10EffectVariable *)iface);
4356 static HRESULT STDMETHODCALLTYPE d3d10_effect_matrix_variable_GetDesc(ID3D10EffectMatrixVariable *iface,
4357 D3D10_EFFECT_VARIABLE_DESC *desc)
4359 return d3d10_effect_variable_GetDesc((ID3D10EffectVariable *)iface, desc);
4362 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_matrix_variable_GetAnnotationByIndex(
4363 ID3D10EffectMatrixVariable *iface, UINT index)
4365 return d3d10_effect_variable_GetAnnotationByIndex((ID3D10EffectVariable *)iface, index);
4368 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_matrix_variable_GetAnnotationByName(
4369 ID3D10EffectMatrixVariable *iface, LPCSTR name)
4371 return d3d10_effect_variable_GetAnnotationByName((ID3D10EffectVariable *)iface, name);
4374 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_matrix_variable_GetMemberByIndex(
4375 ID3D10EffectMatrixVariable *iface, UINT index)
4377 return d3d10_effect_variable_GetMemberByIndex((ID3D10EffectVariable *)iface, index);
4380 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_matrix_variable_GetMemberByName(
4381 ID3D10EffectMatrixVariable *iface, LPCSTR name)
4383 return d3d10_effect_variable_GetMemberByName((ID3D10EffectVariable *)iface, name);
4386 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_matrix_variable_GetMemberBySemantic(
4387 ID3D10EffectMatrixVariable *iface, LPCSTR semantic)
4389 return d3d10_effect_variable_GetMemberBySemantic((ID3D10EffectVariable *)iface, semantic);
4392 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_matrix_variable_GetElement(
4393 ID3D10EffectMatrixVariable *iface, UINT index)
4395 return d3d10_effect_variable_GetElement((ID3D10EffectVariable *)iface, index);
4398 static struct ID3D10EffectConstantBuffer * STDMETHODCALLTYPE d3d10_effect_matrix_variable_GetParentConstantBuffer(
4399 ID3D10EffectMatrixVariable *iface)
4401 return d3d10_effect_variable_GetParentConstantBuffer((ID3D10EffectVariable *)iface);
4404 static struct ID3D10EffectScalarVariable * STDMETHODCALLTYPE d3d10_effect_matrix_variable_AsScalar(
4405 ID3D10EffectMatrixVariable *iface)
4407 return d3d10_effect_variable_AsScalar((ID3D10EffectVariable *)iface);
4410 static struct ID3D10EffectVectorVariable * STDMETHODCALLTYPE d3d10_effect_matrix_variable_AsVector(
4411 ID3D10EffectMatrixVariable *iface)
4413 return d3d10_effect_variable_AsVector((ID3D10EffectVariable *)iface);
4416 static struct ID3D10EffectMatrixVariable * STDMETHODCALLTYPE d3d10_effect_matrix_variable_AsMatrix(
4417 ID3D10EffectMatrixVariable *iface)
4419 return d3d10_effect_variable_AsMatrix((ID3D10EffectVariable *)iface);
4422 static struct ID3D10EffectStringVariable * STDMETHODCALLTYPE d3d10_effect_matrix_variable_AsString(
4423 ID3D10EffectMatrixVariable *iface)
4425 return d3d10_effect_variable_AsString((ID3D10EffectVariable *)iface);
4428 static struct ID3D10EffectShaderResourceVariable * STDMETHODCALLTYPE d3d10_effect_matrix_variable_AsShaderResource(
4429 ID3D10EffectMatrixVariable *iface)
4431 return d3d10_effect_variable_AsShaderResource((ID3D10EffectVariable *)iface);
4434 static struct ID3D10EffectRenderTargetViewVariable * STDMETHODCALLTYPE d3d10_effect_matrix_variable_AsRenderTargetView(
4435 ID3D10EffectMatrixVariable *iface)
4437 return d3d10_effect_variable_AsRenderTargetView((ID3D10EffectVariable *)iface);
4440 static struct ID3D10EffectDepthStencilViewVariable * STDMETHODCALLTYPE d3d10_effect_matrix_variable_AsDepthStencilView(
4441 ID3D10EffectMatrixVariable *iface)
4443 return d3d10_effect_variable_AsDepthStencilView((ID3D10EffectVariable *)iface);
4446 static struct ID3D10EffectConstantBuffer * STDMETHODCALLTYPE d3d10_effect_matrix_variable_AsConstantBuffer(
4447 ID3D10EffectMatrixVariable *iface)
4449 return d3d10_effect_variable_AsConstantBuffer((ID3D10EffectVariable *)iface);
4452 static struct ID3D10EffectShaderVariable * STDMETHODCALLTYPE d3d10_effect_matrix_variable_AsShader(
4453 ID3D10EffectMatrixVariable *iface)
4455 return d3d10_effect_variable_AsShader((ID3D10EffectVariable *)iface);
4458 static struct ID3D10EffectBlendVariable * STDMETHODCALLTYPE d3d10_effect_matrix_variable_AsBlend(
4459 ID3D10EffectMatrixVariable *iface)
4461 return d3d10_effect_variable_AsBlend((ID3D10EffectVariable *)iface);
4464 static struct ID3D10EffectDepthStencilVariable * STDMETHODCALLTYPE d3d10_effect_matrix_variable_AsDepthStencil(
4465 ID3D10EffectMatrixVariable *iface)
4467 return d3d10_effect_variable_AsDepthStencil((ID3D10EffectVariable *)iface);
4470 static struct ID3D10EffectRasterizerVariable * STDMETHODCALLTYPE d3d10_effect_matrix_variable_AsRasterizer(
4471 ID3D10EffectMatrixVariable *iface)
4473 return d3d10_effect_variable_AsRasterizer((ID3D10EffectVariable *)iface);
4476 static struct ID3D10EffectSamplerVariable * STDMETHODCALLTYPE d3d10_effect_matrix_variable_AsSampler(
4477 ID3D10EffectMatrixVariable *iface)
4479 return d3d10_effect_variable_AsSampler((ID3D10EffectVariable *)iface);
4482 static HRESULT STDMETHODCALLTYPE d3d10_effect_matrix_variable_SetRawValue(ID3D10EffectMatrixVariable *iface,
4483 void *data, UINT offset, UINT count)
4485 return d3d10_effect_variable_SetRawValue((ID3D10EffectVariable *)iface, data, offset, count);
4488 static HRESULT STDMETHODCALLTYPE d3d10_effect_matrix_variable_GetRawValue(ID3D10EffectMatrixVariable *iface,
4489 void *data, UINT offset, UINT count)
4491 return d3d10_effect_variable_GetRawValue((ID3D10EffectVariable *)iface, data, offset, count);
4494 /* ID3D10EffectMatrixVariable methods */
4496 static HRESULT STDMETHODCALLTYPE d3d10_effect_matrix_variable_SetMatrix(ID3D10EffectMatrixVariable *iface,
4499 FIXME("iface %p, data %p stub!\n", iface, data);
4504 static HRESULT STDMETHODCALLTYPE d3d10_effect_matrix_variable_GetMatrix(ID3D10EffectMatrixVariable *iface,
4507 FIXME("iface %p, data %p stub!\n", iface, data);
4512 static HRESULT STDMETHODCALLTYPE d3d10_effect_matrix_variable_SetMatrixArray(ID3D10EffectMatrixVariable *iface,
4513 float *data, UINT offset, UINT count)
4515 FIXME("iface %p, data %p, offset %u, count %u stub!\n", iface, data, offset, count);
4520 static HRESULT STDMETHODCALLTYPE d3d10_effect_matrix_variable_GetMatrixArray(ID3D10EffectMatrixVariable *iface,
4521 float *data, UINT offset, UINT count)
4523 FIXME("iface %p, data %p, offset %u, count %u stub!\n", iface, data, offset, count);
4528 static HRESULT STDMETHODCALLTYPE d3d10_effect_matrix_variable_SetMatrixTranspose(ID3D10EffectMatrixVariable *iface,
4531 FIXME("iface %p, data %p stub!\n", iface, data);
4536 static HRESULT STDMETHODCALLTYPE d3d10_effect_matrix_variable_GetMatrixTranspose(ID3D10EffectMatrixVariable *iface,
4539 FIXME("iface %p, data %p stub!\n", iface, data);
4544 static HRESULT STDMETHODCALLTYPE d3d10_effect_matrix_variable_SetMatrixTransposeArray(ID3D10EffectMatrixVariable *iface,
4545 float *data, UINT offset, UINT count)
4547 FIXME("iface %p, data %p, offset %u, count %u stub!\n", iface, data, offset, count);
4552 static HRESULT STDMETHODCALLTYPE d3d10_effect_matrix_variable_GetMatrixTransposeArray(ID3D10EffectMatrixVariable *iface,
4553 float *data, UINT offset, UINT count)
4555 FIXME("iface %p, data %p, offset %u, count %u stub!\n", iface, data, offset, count);
4561 static const struct ID3D10EffectMatrixVariableVtbl d3d10_effect_matrix_variable_vtbl =
4563 /* ID3D10EffectVariable methods */
4564 d3d10_effect_matrix_variable_IsValid,
4565 d3d10_effect_matrix_variable_GetType,
4566 d3d10_effect_matrix_variable_GetDesc,
4567 d3d10_effect_matrix_variable_GetAnnotationByIndex,
4568 d3d10_effect_matrix_variable_GetAnnotationByName,
4569 d3d10_effect_matrix_variable_GetMemberByIndex,
4570 d3d10_effect_matrix_variable_GetMemberByName,
4571 d3d10_effect_matrix_variable_GetMemberBySemantic,
4572 d3d10_effect_matrix_variable_GetElement,
4573 d3d10_effect_matrix_variable_GetParentConstantBuffer,
4574 d3d10_effect_matrix_variable_AsScalar,
4575 d3d10_effect_matrix_variable_AsVector,
4576 d3d10_effect_matrix_variable_AsMatrix,
4577 d3d10_effect_matrix_variable_AsString,
4578 d3d10_effect_matrix_variable_AsShaderResource,
4579 d3d10_effect_matrix_variable_AsRenderTargetView,
4580 d3d10_effect_matrix_variable_AsDepthStencilView,
4581 d3d10_effect_matrix_variable_AsConstantBuffer,
4582 d3d10_effect_matrix_variable_AsShader,
4583 d3d10_effect_matrix_variable_AsBlend,
4584 d3d10_effect_matrix_variable_AsDepthStencil,
4585 d3d10_effect_matrix_variable_AsRasterizer,
4586 d3d10_effect_matrix_variable_AsSampler,
4587 d3d10_effect_matrix_variable_SetRawValue,
4588 d3d10_effect_matrix_variable_GetRawValue,
4589 /* ID3D10EffectMatrixVariable methods */
4590 d3d10_effect_matrix_variable_SetMatrix,
4591 d3d10_effect_matrix_variable_GetMatrix,
4592 d3d10_effect_matrix_variable_SetMatrixArray,
4593 d3d10_effect_matrix_variable_GetMatrixArray,
4594 d3d10_effect_matrix_variable_SetMatrixTranspose,
4595 d3d10_effect_matrix_variable_GetMatrixTranspose,
4596 d3d10_effect_matrix_variable_SetMatrixTransposeArray,
4597 d3d10_effect_matrix_variable_GetMatrixTransposeArray,
4600 /* ID3D10EffectVariable methods */
4602 static BOOL STDMETHODCALLTYPE d3d10_effect_string_variable_IsValid(ID3D10EffectStringVariable *iface)
4604 TRACE("iface %p\n", iface);
4606 return (struct d3d10_effect_variable *)iface != &null_string_variable;
4609 static struct ID3D10EffectType * STDMETHODCALLTYPE d3d10_effect_string_variable_GetType(
4610 ID3D10EffectStringVariable *iface)
4612 return d3d10_effect_variable_GetType((ID3D10EffectVariable *)iface);
4615 static HRESULT STDMETHODCALLTYPE d3d10_effect_string_variable_GetDesc(ID3D10EffectStringVariable *iface,
4616 D3D10_EFFECT_VARIABLE_DESC *desc)
4618 return d3d10_effect_variable_GetDesc((ID3D10EffectVariable *)iface, desc);
4621 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_string_variable_GetAnnotationByIndex(
4622 ID3D10EffectStringVariable *iface, UINT index)
4624 return d3d10_effect_variable_GetAnnotationByIndex((ID3D10EffectVariable *)iface, index);
4627 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_string_variable_GetAnnotationByName(
4628 ID3D10EffectStringVariable *iface, LPCSTR name)
4630 return d3d10_effect_variable_GetAnnotationByName((ID3D10EffectVariable *)iface, name);
4633 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_string_variable_GetMemberByIndex(
4634 ID3D10EffectStringVariable *iface, UINT index)
4636 return d3d10_effect_variable_GetMemberByIndex((ID3D10EffectVariable *)iface, index);
4639 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_string_variable_GetMemberByName(
4640 ID3D10EffectStringVariable *iface, LPCSTR name)
4642 return d3d10_effect_variable_GetMemberByName((ID3D10EffectVariable *)iface, name);
4645 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_string_variable_GetMemberBySemantic(
4646 ID3D10EffectStringVariable *iface, LPCSTR semantic)
4648 return d3d10_effect_variable_GetMemberBySemantic((ID3D10EffectVariable *)iface, semantic);
4651 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_string_variable_GetElement(
4652 ID3D10EffectStringVariable *iface, UINT index)
4654 return d3d10_effect_variable_GetElement((ID3D10EffectVariable *)iface, index);
4657 static struct ID3D10EffectConstantBuffer * STDMETHODCALLTYPE d3d10_effect_string_variable_GetParentConstantBuffer(
4658 ID3D10EffectStringVariable *iface)
4660 return d3d10_effect_variable_GetParentConstantBuffer((ID3D10EffectVariable *)iface);
4663 static struct ID3D10EffectScalarVariable * STDMETHODCALLTYPE d3d10_effect_string_variable_AsScalar(
4664 ID3D10EffectStringVariable *iface)
4666 return d3d10_effect_variable_AsScalar((ID3D10EffectVariable *)iface);
4669 static struct ID3D10EffectVectorVariable * STDMETHODCALLTYPE d3d10_effect_string_variable_AsVector(
4670 ID3D10EffectStringVariable *iface)
4672 return d3d10_effect_variable_AsVector((ID3D10EffectVariable *)iface);
4675 static struct ID3D10EffectMatrixVariable * STDMETHODCALLTYPE d3d10_effect_string_variable_AsMatrix(
4676 ID3D10EffectStringVariable *iface)
4678 return d3d10_effect_variable_AsMatrix((ID3D10EffectVariable *)iface);
4681 static struct ID3D10EffectStringVariable * STDMETHODCALLTYPE d3d10_effect_string_variable_AsString(
4682 ID3D10EffectStringVariable *iface)
4684 return d3d10_effect_variable_AsString((ID3D10EffectVariable *)iface);
4687 static struct ID3D10EffectShaderResourceVariable * STDMETHODCALLTYPE d3d10_effect_string_variable_AsShaderResource(
4688 ID3D10EffectStringVariable *iface)
4690 return d3d10_effect_variable_AsShaderResource((ID3D10EffectVariable *)iface);
4693 static struct ID3D10EffectRenderTargetViewVariable * STDMETHODCALLTYPE d3d10_effect_string_variable_AsRenderTargetView(
4694 ID3D10EffectStringVariable *iface)
4696 return d3d10_effect_variable_AsRenderTargetView((ID3D10EffectVariable *)iface);
4699 static struct ID3D10EffectDepthStencilViewVariable * STDMETHODCALLTYPE d3d10_effect_string_variable_AsDepthStencilView(
4700 ID3D10EffectStringVariable *iface)
4702 return d3d10_effect_variable_AsDepthStencilView((ID3D10EffectVariable *)iface);
4705 static struct ID3D10EffectConstantBuffer * STDMETHODCALLTYPE d3d10_effect_string_variable_AsConstantBuffer(
4706 ID3D10EffectStringVariable *iface)
4708 return d3d10_effect_variable_AsConstantBuffer((ID3D10EffectVariable *)iface);
4711 static struct ID3D10EffectShaderVariable * STDMETHODCALLTYPE d3d10_effect_string_variable_AsShader(
4712 ID3D10EffectStringVariable *iface)
4714 return d3d10_effect_variable_AsShader((ID3D10EffectVariable *)iface);
4717 static struct ID3D10EffectBlendVariable * STDMETHODCALLTYPE d3d10_effect_string_variable_AsBlend(
4718 ID3D10EffectStringVariable *iface)
4720 return d3d10_effect_variable_AsBlend((ID3D10EffectVariable *)iface);
4723 static struct ID3D10EffectDepthStencilVariable * STDMETHODCALLTYPE d3d10_effect_string_variable_AsDepthStencil(
4724 ID3D10EffectStringVariable *iface)
4726 return d3d10_effect_variable_AsDepthStencil((ID3D10EffectVariable *)iface);
4729 static struct ID3D10EffectRasterizerVariable * STDMETHODCALLTYPE d3d10_effect_string_variable_AsRasterizer(
4730 ID3D10EffectStringVariable *iface)
4732 return d3d10_effect_variable_AsRasterizer((ID3D10EffectVariable *)iface);
4735 static struct ID3D10EffectSamplerVariable * STDMETHODCALLTYPE d3d10_effect_string_variable_AsSampler(
4736 ID3D10EffectStringVariable *iface)
4738 return d3d10_effect_variable_AsSampler((ID3D10EffectVariable *)iface);
4741 static HRESULT STDMETHODCALLTYPE d3d10_effect_string_variable_SetRawValue(ID3D10EffectStringVariable *iface,
4742 void *data, UINT offset, UINT count)
4744 return d3d10_effect_variable_SetRawValue((ID3D10EffectVariable *)iface, data, offset, count);
4747 static HRESULT STDMETHODCALLTYPE d3d10_effect_string_variable_GetRawValue(ID3D10EffectStringVariable *iface,
4748 void *data, UINT offset, UINT count)
4750 return d3d10_effect_variable_GetRawValue((ID3D10EffectVariable *)iface, data, offset, count);
4753 /* ID3D10EffectStringVariable methods */
4755 static HRESULT STDMETHODCALLTYPE d3d10_effect_string_variable_GetString(ID3D10EffectStringVariable *iface,
4758 FIXME("iface %p, str %p stub!\n", iface, str);
4763 static HRESULT STDMETHODCALLTYPE d3d10_effect_string_variable_GetStringArray(ID3D10EffectStringVariable *iface,
4764 LPCSTR *strs, UINT offset, UINT count)
4766 FIXME("iface %p, strs %p, offset %u, count %u stub!\n", iface, strs, offset, count);
4772 static const struct ID3D10EffectStringVariableVtbl d3d10_effect_string_variable_vtbl =
4774 /* ID3D10EffectVariable methods */
4775 d3d10_effect_string_variable_IsValid,
4776 d3d10_effect_string_variable_GetType,
4777 d3d10_effect_string_variable_GetDesc,
4778 d3d10_effect_string_variable_GetAnnotationByIndex,
4779 d3d10_effect_string_variable_GetAnnotationByName,
4780 d3d10_effect_string_variable_GetMemberByIndex,
4781 d3d10_effect_string_variable_GetMemberByName,
4782 d3d10_effect_string_variable_GetMemberBySemantic,
4783 d3d10_effect_string_variable_GetElement,
4784 d3d10_effect_string_variable_GetParentConstantBuffer,
4785 d3d10_effect_string_variable_AsScalar,
4786 d3d10_effect_string_variable_AsVector,
4787 d3d10_effect_string_variable_AsMatrix,
4788 d3d10_effect_string_variable_AsString,
4789 d3d10_effect_string_variable_AsShaderResource,
4790 d3d10_effect_string_variable_AsRenderTargetView,
4791 d3d10_effect_string_variable_AsDepthStencilView,
4792 d3d10_effect_string_variable_AsConstantBuffer,
4793 d3d10_effect_string_variable_AsShader,
4794 d3d10_effect_string_variable_AsBlend,
4795 d3d10_effect_string_variable_AsDepthStencil,
4796 d3d10_effect_string_variable_AsRasterizer,
4797 d3d10_effect_string_variable_AsSampler,
4798 d3d10_effect_string_variable_SetRawValue,
4799 d3d10_effect_string_variable_GetRawValue,
4800 /* ID3D10EffectStringVariable methods */
4801 d3d10_effect_string_variable_GetString,
4802 d3d10_effect_string_variable_GetStringArray,
4805 /* ID3D10EffectVariable methods */
4807 static BOOL STDMETHODCALLTYPE d3d10_effect_shader_resource_variable_IsValid(ID3D10EffectShaderResourceVariable *iface)
4809 TRACE("iface %p\n", iface);
4811 return (struct d3d10_effect_variable *)iface != &null_shader_resource_variable;
4814 static struct ID3D10EffectType * STDMETHODCALLTYPE d3d10_effect_shader_resource_variable_GetType(
4815 ID3D10EffectShaderResourceVariable *iface)
4817 return d3d10_effect_variable_GetType((ID3D10EffectVariable *)iface);
4820 static HRESULT STDMETHODCALLTYPE d3d10_effect_shader_resource_variable_GetDesc(
4821 ID3D10EffectShaderResourceVariable *iface, D3D10_EFFECT_VARIABLE_DESC *desc)
4823 return d3d10_effect_variable_GetDesc((ID3D10EffectVariable *)iface, desc);
4826 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_shader_resource_variable_GetAnnotationByIndex(
4827 ID3D10EffectShaderResourceVariable *iface, UINT index)
4829 return d3d10_effect_variable_GetAnnotationByIndex((ID3D10EffectVariable *)iface, index);
4832 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_shader_resource_variable_GetAnnotationByName(
4833 ID3D10EffectShaderResourceVariable *iface, LPCSTR name)
4835 return d3d10_effect_variable_GetAnnotationByName((ID3D10EffectVariable *)iface, name);
4838 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_shader_resource_variable_GetMemberByIndex(
4839 ID3D10EffectShaderResourceVariable *iface, UINT index)
4841 return d3d10_effect_variable_GetMemberByIndex((ID3D10EffectVariable *)iface, index);
4844 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_shader_resource_variable_GetMemberByName(
4845 ID3D10EffectShaderResourceVariable *iface, LPCSTR name)
4847 return d3d10_effect_variable_GetMemberByName((ID3D10EffectVariable *)iface, name);
4850 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_shader_resource_variable_GetMemberBySemantic(
4851 ID3D10EffectShaderResourceVariable *iface, LPCSTR semantic)
4853 return d3d10_effect_variable_GetMemberBySemantic((ID3D10EffectVariable *)iface, semantic);
4856 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_shader_resource_variable_GetElement(
4857 ID3D10EffectShaderResourceVariable *iface, UINT index)
4859 return d3d10_effect_variable_GetElement((ID3D10EffectVariable *)iface, index);
4862 static struct ID3D10EffectConstantBuffer * STDMETHODCALLTYPE d3d10_effect_shader_resource_variable_GetParentConstantBuffer(
4863 ID3D10EffectShaderResourceVariable *iface)
4865 return d3d10_effect_variable_GetParentConstantBuffer((ID3D10EffectVariable *)iface);
4868 static struct ID3D10EffectScalarVariable * STDMETHODCALLTYPE d3d10_effect_shader_resource_variable_AsScalar(
4869 ID3D10EffectShaderResourceVariable *iface)
4871 return d3d10_effect_variable_AsScalar((ID3D10EffectVariable *)iface);
4874 static struct ID3D10EffectVectorVariable * STDMETHODCALLTYPE d3d10_effect_shader_resource_variable_AsVector(
4875 ID3D10EffectShaderResourceVariable *iface)
4877 return d3d10_effect_variable_AsVector((ID3D10EffectVariable *)iface);
4880 static struct ID3D10EffectMatrixVariable * STDMETHODCALLTYPE d3d10_effect_shader_resource_variable_AsMatrix(
4881 ID3D10EffectShaderResourceVariable *iface)
4883 return d3d10_effect_variable_AsMatrix((ID3D10EffectVariable *)iface);
4886 static struct ID3D10EffectStringVariable * STDMETHODCALLTYPE d3d10_effect_shader_resource_variable_AsString(
4887 ID3D10EffectShaderResourceVariable *iface)
4889 return d3d10_effect_variable_AsString((ID3D10EffectVariable *)iface);
4892 static struct ID3D10EffectShaderResourceVariable * STDMETHODCALLTYPE d3d10_effect_shader_resource_variable_AsShaderResource(
4893 ID3D10EffectShaderResourceVariable *iface)
4895 return d3d10_effect_variable_AsShaderResource((ID3D10EffectVariable *)iface);
4898 static struct ID3D10EffectRenderTargetViewVariable * STDMETHODCALLTYPE d3d10_effect_shader_resource_variable_AsRenderTargetView(
4899 ID3D10EffectShaderResourceVariable *iface)
4901 return d3d10_effect_variable_AsRenderTargetView((ID3D10EffectVariable *)iface);
4904 static struct ID3D10EffectDepthStencilViewVariable * STDMETHODCALLTYPE d3d10_effect_shader_resource_variable_AsDepthStencilView(
4905 ID3D10EffectShaderResourceVariable *iface)
4907 return d3d10_effect_variable_AsDepthStencilView((ID3D10EffectVariable *)iface);
4910 static struct ID3D10EffectConstantBuffer * STDMETHODCALLTYPE d3d10_effect_shader_resource_variable_AsConstantBuffer(
4911 ID3D10EffectShaderResourceVariable *iface)
4913 return d3d10_effect_variable_AsConstantBuffer((ID3D10EffectVariable *)iface);
4916 static struct ID3D10EffectShaderVariable * STDMETHODCALLTYPE d3d10_effect_shader_resource_variable_AsShader(
4917 ID3D10EffectShaderResourceVariable *iface)
4919 return d3d10_effect_variable_AsShader((ID3D10EffectVariable *)iface);
4922 static struct ID3D10EffectBlendVariable * STDMETHODCALLTYPE d3d10_effect_shader_resource_variable_AsBlend(
4923 ID3D10EffectShaderResourceVariable *iface)
4925 return d3d10_effect_variable_AsBlend((ID3D10EffectVariable *)iface);
4928 static struct ID3D10EffectDepthStencilVariable * STDMETHODCALLTYPE d3d10_effect_shader_resource_variable_AsDepthStencil(
4929 ID3D10EffectShaderResourceVariable *iface)
4931 return d3d10_effect_variable_AsDepthStencil((ID3D10EffectVariable *)iface);
4934 static struct ID3D10EffectRasterizerVariable * STDMETHODCALLTYPE d3d10_effect_shader_resource_variable_AsRasterizer(
4935 ID3D10EffectShaderResourceVariable *iface)
4937 return d3d10_effect_variable_AsRasterizer((ID3D10EffectVariable *)iface);
4940 static struct ID3D10EffectSamplerVariable * STDMETHODCALLTYPE d3d10_effect_shader_resource_variable_AsSampler(
4941 ID3D10EffectShaderResourceVariable *iface)
4943 return d3d10_effect_variable_AsSampler((ID3D10EffectVariable *)iface);
4946 static HRESULT STDMETHODCALLTYPE d3d10_effect_shader_resource_variable_SetRawValue(
4947 ID3D10EffectShaderResourceVariable *iface, void *data, UINT offset, UINT count)
4949 return d3d10_effect_variable_SetRawValue((ID3D10EffectVariable *)iface, data, offset, count);
4952 static HRESULT STDMETHODCALLTYPE d3d10_effect_shader_resource_variable_GetRawValue(
4953 ID3D10EffectShaderResourceVariable *iface, void *data, UINT offset, UINT count)
4955 return d3d10_effect_variable_GetRawValue((ID3D10EffectVariable *)iface, data, offset, count);
4958 /* ID3D10EffectShaderResourceVariable methods */
4960 static HRESULT STDMETHODCALLTYPE d3d10_effect_shader_resource_variable_SetResource(
4961 ID3D10EffectShaderResourceVariable *iface, ID3D10ShaderResourceView *resource)
4963 FIXME("iface %p, resource %p stub!\n", iface, resource);
4968 static HRESULT STDMETHODCALLTYPE d3d10_effect_shader_resource_variable_GetResource(
4969 ID3D10EffectShaderResourceVariable *iface, ID3D10ShaderResourceView **resource)
4971 FIXME("iface %p, resource %p stub!\n", iface, resource);
4976 static HRESULT STDMETHODCALLTYPE d3d10_effect_shader_resource_variable_SetResourceArray(
4977 ID3D10EffectShaderResourceVariable *iface, ID3D10ShaderResourceView **resources, UINT offset, UINT count)
4979 FIXME("iface %p, resources %p, offset %u, count %u stub!\n", iface, resources, offset, count);
4984 static HRESULT STDMETHODCALLTYPE d3d10_effect_shader_resource_variable_GetResourceArray(
4985 ID3D10EffectShaderResourceVariable *iface, ID3D10ShaderResourceView **resources, UINT offset, UINT count)
4987 FIXME("iface %p, resources %p, offset %u, count %u stub!\n", iface, resources, offset, count);
4993 static const struct ID3D10EffectShaderResourceVariableVtbl d3d10_effect_shader_resource_variable_vtbl =
4995 /* ID3D10EffectVariable methods */
4996 d3d10_effect_shader_resource_variable_IsValid,
4997 d3d10_effect_shader_resource_variable_GetType,
4998 d3d10_effect_shader_resource_variable_GetDesc,
4999 d3d10_effect_shader_resource_variable_GetAnnotationByIndex,
5000 d3d10_effect_shader_resource_variable_GetAnnotationByName,
5001 d3d10_effect_shader_resource_variable_GetMemberByIndex,
5002 d3d10_effect_shader_resource_variable_GetMemberByName,
5003 d3d10_effect_shader_resource_variable_GetMemberBySemantic,
5004 d3d10_effect_shader_resource_variable_GetElement,
5005 d3d10_effect_shader_resource_variable_GetParentConstantBuffer,
5006 d3d10_effect_shader_resource_variable_AsScalar,
5007 d3d10_effect_shader_resource_variable_AsVector,
5008 d3d10_effect_shader_resource_variable_AsMatrix,
5009 d3d10_effect_shader_resource_variable_AsString,
5010 d3d10_effect_shader_resource_variable_AsShaderResource,
5011 d3d10_effect_shader_resource_variable_AsRenderTargetView,
5012 d3d10_effect_shader_resource_variable_AsDepthStencilView,
5013 d3d10_effect_shader_resource_variable_AsConstantBuffer,
5014 d3d10_effect_shader_resource_variable_AsShader,
5015 d3d10_effect_shader_resource_variable_AsBlend,
5016 d3d10_effect_shader_resource_variable_AsDepthStencil,
5017 d3d10_effect_shader_resource_variable_AsRasterizer,
5018 d3d10_effect_shader_resource_variable_AsSampler,
5019 d3d10_effect_shader_resource_variable_SetRawValue,
5020 d3d10_effect_shader_resource_variable_GetRawValue,
5021 /* ID3D10EffectShaderResourceVariable methods */
5022 d3d10_effect_shader_resource_variable_SetResource,
5023 d3d10_effect_shader_resource_variable_GetResource,
5024 d3d10_effect_shader_resource_variable_SetResourceArray,
5025 d3d10_effect_shader_resource_variable_GetResourceArray,
5028 /* ID3D10EffectVariable methods */
5030 static BOOL STDMETHODCALLTYPE d3d10_effect_render_target_view_variable_IsValid(
5031 ID3D10EffectRenderTargetViewVariable *iface)
5033 TRACE("iface %p\n", iface);
5035 return (struct d3d10_effect_variable *)iface != &null_render_target_view_variable;
5038 static struct ID3D10EffectType * STDMETHODCALLTYPE d3d10_effect_render_target_view_variable_GetType(
5039 ID3D10EffectRenderTargetViewVariable *iface)
5041 return d3d10_effect_variable_GetType((ID3D10EffectVariable *)iface);
5044 static HRESULT STDMETHODCALLTYPE d3d10_effect_render_target_view_variable_GetDesc(
5045 ID3D10EffectRenderTargetViewVariable *iface, D3D10_EFFECT_VARIABLE_DESC *desc)
5047 return d3d10_effect_variable_GetDesc((ID3D10EffectVariable *)iface, desc);
5050 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_render_target_view_variable_GetAnnotationByIndex(
5051 ID3D10EffectRenderTargetViewVariable *iface, UINT index)
5053 return d3d10_effect_variable_GetAnnotationByIndex((ID3D10EffectVariable *)iface, index);
5056 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_render_target_view_variable_GetAnnotationByName(
5057 ID3D10EffectRenderTargetViewVariable *iface, LPCSTR name)
5059 return d3d10_effect_variable_GetAnnotationByName((ID3D10EffectVariable *)iface, name);
5062 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_render_target_view_variable_GetMemberByIndex(
5063 ID3D10EffectRenderTargetViewVariable *iface, UINT index)
5065 return d3d10_effect_variable_GetMemberByIndex((ID3D10EffectVariable *)iface, index);
5068 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_render_target_view_variable_GetMemberByName(
5069 ID3D10EffectRenderTargetViewVariable *iface, LPCSTR name)
5071 return d3d10_effect_variable_GetMemberByName((ID3D10EffectVariable *)iface, name);
5074 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_render_target_view_variable_GetMemberBySemantic(
5075 ID3D10EffectRenderTargetViewVariable *iface, LPCSTR semantic)
5077 return d3d10_effect_variable_GetMemberBySemantic((ID3D10EffectVariable *)iface, semantic);
5080 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_render_target_view_variable_GetElement(
5081 ID3D10EffectRenderTargetViewVariable *iface, UINT index)
5083 return d3d10_effect_variable_GetElement((ID3D10EffectVariable *)iface, index);
5086 static struct ID3D10EffectConstantBuffer * STDMETHODCALLTYPE d3d10_effect_render_target_view_variable_GetParentConstantBuffer(
5087 ID3D10EffectRenderTargetViewVariable *iface)
5089 return d3d10_effect_variable_GetParentConstantBuffer((ID3D10EffectVariable *)iface);
5092 static struct ID3D10EffectScalarVariable * STDMETHODCALLTYPE d3d10_effect_render_target_view_variable_AsScalar(
5093 ID3D10EffectRenderTargetViewVariable *iface)
5095 return d3d10_effect_variable_AsScalar((ID3D10EffectVariable *)iface);
5098 static struct ID3D10EffectVectorVariable * STDMETHODCALLTYPE d3d10_effect_render_target_view_variable_AsVector(
5099 ID3D10EffectRenderTargetViewVariable *iface)
5101 return d3d10_effect_variable_AsVector((ID3D10EffectVariable *)iface);
5104 static struct ID3D10EffectMatrixVariable * STDMETHODCALLTYPE d3d10_effect_render_target_view_variable_AsMatrix(
5105 ID3D10EffectRenderTargetViewVariable *iface)
5107 return d3d10_effect_variable_AsMatrix((ID3D10EffectVariable *)iface);
5110 static struct ID3D10EffectStringVariable * STDMETHODCALLTYPE d3d10_effect_render_target_view_variable_AsString(
5111 ID3D10EffectRenderTargetViewVariable *iface)
5113 return d3d10_effect_variable_AsString((ID3D10EffectVariable *)iface);
5116 static struct ID3D10EffectShaderResourceVariable * STDMETHODCALLTYPE d3d10_effect_render_target_view_variable_AsShaderResource(
5117 ID3D10EffectRenderTargetViewVariable *iface)
5119 return d3d10_effect_variable_AsShaderResource((ID3D10EffectVariable *)iface);
5122 static struct ID3D10EffectRenderTargetViewVariable * STDMETHODCALLTYPE d3d10_effect_render_target_view_variable_AsRenderTargetView(
5123 ID3D10EffectRenderTargetViewVariable *iface)
5125 return d3d10_effect_variable_AsRenderTargetView((ID3D10EffectVariable *)iface);
5128 static struct ID3D10EffectDepthStencilViewVariable * STDMETHODCALLTYPE d3d10_effect_render_target_view_variable_AsDepthStencilView(
5129 ID3D10EffectRenderTargetViewVariable *iface)
5131 return d3d10_effect_variable_AsDepthStencilView((ID3D10EffectVariable *)iface);
5134 static struct ID3D10EffectConstantBuffer * STDMETHODCALLTYPE d3d10_effect_render_target_view_variable_AsConstantBuffer(
5135 ID3D10EffectRenderTargetViewVariable *iface)
5137 return d3d10_effect_variable_AsConstantBuffer((ID3D10EffectVariable *)iface);
5140 static struct ID3D10EffectShaderVariable * STDMETHODCALLTYPE d3d10_effect_render_target_view_variable_AsShader(
5141 ID3D10EffectRenderTargetViewVariable *iface)
5143 return d3d10_effect_variable_AsShader((ID3D10EffectVariable *)iface);
5146 static struct ID3D10EffectBlendVariable * STDMETHODCALLTYPE d3d10_effect_render_target_view_variable_AsBlend(
5147 ID3D10EffectRenderTargetViewVariable *iface)
5149 return d3d10_effect_variable_AsBlend((ID3D10EffectVariable *)iface);
5152 static struct ID3D10EffectDepthStencilVariable * STDMETHODCALLTYPE d3d10_effect_render_target_view_variable_AsDepthStencil(
5153 ID3D10EffectRenderTargetViewVariable *iface)
5155 return d3d10_effect_variable_AsDepthStencil((ID3D10EffectVariable *)iface);
5158 static struct ID3D10EffectRasterizerVariable * STDMETHODCALLTYPE d3d10_effect_render_target_view_variable_AsRasterizer(
5159 ID3D10EffectRenderTargetViewVariable *iface)
5161 return d3d10_effect_variable_AsRasterizer((ID3D10EffectVariable *)iface);
5164 static struct ID3D10EffectSamplerVariable * STDMETHODCALLTYPE d3d10_effect_render_target_view_variable_AsSampler(
5165 ID3D10EffectRenderTargetViewVariable *iface)
5167 return d3d10_effect_variable_AsSampler((ID3D10EffectVariable *)iface);
5170 static HRESULT STDMETHODCALLTYPE d3d10_effect_render_target_view_variable_SetRawValue(
5171 ID3D10EffectRenderTargetViewVariable *iface, void *data, UINT offset, UINT count)
5173 return d3d10_effect_variable_SetRawValue((ID3D10EffectVariable *)iface, data, offset, count);
5176 static HRESULT STDMETHODCALLTYPE d3d10_effect_render_target_view_variable_GetRawValue(
5177 ID3D10EffectRenderTargetViewVariable *iface, void *data, UINT offset, UINT count)
5179 return d3d10_effect_variable_GetRawValue((ID3D10EffectVariable *)iface, data, offset, count);
5182 /* ID3D10EffectRenderTargetViewVariable methods */
5184 static HRESULT STDMETHODCALLTYPE d3d10_effect_render_target_view_variable_SetRenderTarget(
5185 ID3D10EffectRenderTargetViewVariable *iface, ID3D10RenderTargetView *view)
5187 FIXME("iface %p, view %p stub!\n", iface, view);
5192 static HRESULT STDMETHODCALLTYPE d3d10_effect_render_target_view_variable_GetRenderTarget(
5193 ID3D10EffectRenderTargetViewVariable *iface, ID3D10RenderTargetView **view)
5195 FIXME("iface %p, view %p stub!\n", iface, view);
5200 static HRESULT STDMETHODCALLTYPE d3d10_effect_render_target_view_variable_SetRenderTargetArray(
5201 ID3D10EffectRenderTargetViewVariable *iface, ID3D10RenderTargetView **views, UINT offset, UINT count)
5203 FIXME("iface %p, views %p, offset %u, count %u stub!\n", iface, views, offset, count);
5208 static HRESULT STDMETHODCALLTYPE d3d10_effect_render_target_view_variable_GetRenderTargetArray(
5209 ID3D10EffectRenderTargetViewVariable *iface, ID3D10RenderTargetView **views, UINT offset, UINT count)
5211 FIXME("iface %p, views %p, offset %u, count %u stub!\n", iface, views, offset, count);
5217 static const struct ID3D10EffectRenderTargetViewVariableVtbl d3d10_effect_render_target_view_variable_vtbl =
5219 /* ID3D10EffectVariable methods */
5220 d3d10_effect_render_target_view_variable_IsValid,
5221 d3d10_effect_render_target_view_variable_GetType,
5222 d3d10_effect_render_target_view_variable_GetDesc,
5223 d3d10_effect_render_target_view_variable_GetAnnotationByIndex,
5224 d3d10_effect_render_target_view_variable_GetAnnotationByName,
5225 d3d10_effect_render_target_view_variable_GetMemberByIndex,
5226 d3d10_effect_render_target_view_variable_GetMemberByName,
5227 d3d10_effect_render_target_view_variable_GetMemberBySemantic,
5228 d3d10_effect_render_target_view_variable_GetElement,
5229 d3d10_effect_render_target_view_variable_GetParentConstantBuffer,
5230 d3d10_effect_render_target_view_variable_AsScalar,
5231 d3d10_effect_render_target_view_variable_AsVector,
5232 d3d10_effect_render_target_view_variable_AsMatrix,
5233 d3d10_effect_render_target_view_variable_AsString,
5234 d3d10_effect_render_target_view_variable_AsShaderResource,
5235 d3d10_effect_render_target_view_variable_AsRenderTargetView,
5236 d3d10_effect_render_target_view_variable_AsDepthStencilView,
5237 d3d10_effect_render_target_view_variable_AsConstantBuffer,
5238 d3d10_effect_render_target_view_variable_AsShader,
5239 d3d10_effect_render_target_view_variable_AsBlend,
5240 d3d10_effect_render_target_view_variable_AsDepthStencil,
5241 d3d10_effect_render_target_view_variable_AsRasterizer,
5242 d3d10_effect_render_target_view_variable_AsSampler,
5243 d3d10_effect_render_target_view_variable_SetRawValue,
5244 d3d10_effect_render_target_view_variable_GetRawValue,
5245 /* ID3D10EffectRenderTargetViewVariable methods */
5246 d3d10_effect_render_target_view_variable_SetRenderTarget,
5247 d3d10_effect_render_target_view_variable_GetRenderTarget,
5248 d3d10_effect_render_target_view_variable_SetRenderTargetArray,
5249 d3d10_effect_render_target_view_variable_GetRenderTargetArray,
5252 /* ID3D10EffectVariable methods */
5254 static BOOL STDMETHODCALLTYPE d3d10_effect_depth_stencil_view_variable_IsValid(
5255 ID3D10EffectDepthStencilViewVariable *iface)
5257 TRACE("iface %p\n", iface);
5259 return (struct d3d10_effect_variable *)iface != &null_depth_stencil_view_variable;
5262 static struct ID3D10EffectType * STDMETHODCALLTYPE d3d10_effect_depth_stencil_view_variable_GetType(
5263 ID3D10EffectDepthStencilViewVariable *iface)
5265 return d3d10_effect_variable_GetType((ID3D10EffectVariable *)iface);
5268 static HRESULT STDMETHODCALLTYPE d3d10_effect_depth_stencil_view_variable_GetDesc(
5269 ID3D10EffectDepthStencilViewVariable *iface, D3D10_EFFECT_VARIABLE_DESC *desc)
5271 return d3d10_effect_variable_GetDesc((ID3D10EffectVariable *)iface, desc);
5274 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_depth_stencil_view_variable_GetAnnotationByIndex(
5275 ID3D10EffectDepthStencilViewVariable *iface, UINT index)
5277 return d3d10_effect_variable_GetAnnotationByIndex((ID3D10EffectVariable *)iface, index);
5280 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_depth_stencil_view_variable_GetAnnotationByName(
5281 ID3D10EffectDepthStencilViewVariable *iface, LPCSTR name)
5283 return d3d10_effect_variable_GetAnnotationByName((ID3D10EffectVariable *)iface, name);
5286 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_depth_stencil_view_variable_GetMemberByIndex(
5287 ID3D10EffectDepthStencilViewVariable *iface, UINT index)
5289 return d3d10_effect_variable_GetMemberByIndex((ID3D10EffectVariable *)iface, index);
5292 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_depth_stencil_view_variable_GetMemberByName(
5293 ID3D10EffectDepthStencilViewVariable *iface, LPCSTR name)
5295 return d3d10_effect_variable_GetMemberByName((ID3D10EffectVariable *)iface, name);
5298 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_depth_stencil_view_variable_GetMemberBySemantic(
5299 ID3D10EffectDepthStencilViewVariable *iface, LPCSTR semantic)
5301 return d3d10_effect_variable_GetMemberBySemantic((ID3D10EffectVariable *)iface, semantic);
5304 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_depth_stencil_view_variable_GetElement(
5305 ID3D10EffectDepthStencilViewVariable *iface, UINT index)
5307 return d3d10_effect_variable_GetElement((ID3D10EffectVariable *)iface, index);
5310 static struct ID3D10EffectConstantBuffer * STDMETHODCALLTYPE d3d10_effect_depth_stencil_view_variable_GetParentConstantBuffer(
5311 ID3D10EffectDepthStencilViewVariable *iface)
5313 return d3d10_effect_variable_GetParentConstantBuffer((ID3D10EffectVariable *)iface);
5316 static struct ID3D10EffectScalarVariable * STDMETHODCALLTYPE d3d10_effect_depth_stencil_view_variable_AsScalar(
5317 ID3D10EffectDepthStencilViewVariable *iface)
5319 return d3d10_effect_variable_AsScalar((ID3D10EffectVariable *)iface);
5322 static struct ID3D10EffectVectorVariable * STDMETHODCALLTYPE d3d10_effect_depth_stencil_view_variable_AsVector(
5323 ID3D10EffectDepthStencilViewVariable *iface)
5325 return d3d10_effect_variable_AsVector((ID3D10EffectVariable *)iface);
5328 static struct ID3D10EffectMatrixVariable * STDMETHODCALLTYPE d3d10_effect_depth_stencil_view_variable_AsMatrix(
5329 ID3D10EffectDepthStencilViewVariable *iface)
5331 return d3d10_effect_variable_AsMatrix((ID3D10EffectVariable *)iface);
5334 static struct ID3D10EffectStringVariable * STDMETHODCALLTYPE d3d10_effect_depth_stencil_view_variable_AsString(
5335 ID3D10EffectDepthStencilViewVariable *iface)
5337 return d3d10_effect_variable_AsString((ID3D10EffectVariable *)iface);
5340 static struct ID3D10EffectShaderResourceVariable * STDMETHODCALLTYPE d3d10_effect_depth_stencil_view_variable_AsShaderResource(
5341 ID3D10EffectDepthStencilViewVariable *iface)
5343 return d3d10_effect_variable_AsShaderResource((ID3D10EffectVariable *)iface);
5346 static struct ID3D10EffectRenderTargetViewVariable * STDMETHODCALLTYPE d3d10_effect_depth_stencil_view_variable_AsRenderTargetView(
5347 ID3D10EffectDepthStencilViewVariable *iface)
5349 return d3d10_effect_variable_AsRenderTargetView((ID3D10EffectVariable *)iface);
5352 static struct ID3D10EffectDepthStencilViewVariable * STDMETHODCALLTYPE d3d10_effect_depth_stencil_view_variable_AsDepthStencilView(
5353 ID3D10EffectDepthStencilViewVariable *iface)
5355 return d3d10_effect_variable_AsDepthStencilView((ID3D10EffectVariable *)iface);
5358 static struct ID3D10EffectConstantBuffer * STDMETHODCALLTYPE d3d10_effect_depth_stencil_view_variable_AsConstantBuffer(
5359 ID3D10EffectDepthStencilViewVariable *iface)
5361 return d3d10_effect_variable_AsConstantBuffer((ID3D10EffectVariable *)iface);
5364 static struct ID3D10EffectShaderVariable * STDMETHODCALLTYPE d3d10_effect_depth_stencil_view_variable_AsShader(
5365 ID3D10EffectDepthStencilViewVariable *iface)
5367 return d3d10_effect_variable_AsShader((ID3D10EffectVariable *)iface);
5370 static struct ID3D10EffectBlendVariable * STDMETHODCALLTYPE d3d10_effect_depth_stencil_view_variable_AsBlend(
5371 ID3D10EffectDepthStencilViewVariable *iface)
5373 return d3d10_effect_variable_AsBlend((ID3D10EffectVariable *)iface);
5376 static struct ID3D10EffectDepthStencilVariable * STDMETHODCALLTYPE d3d10_effect_depth_stencil_view_variable_AsDepthStencil(
5377 ID3D10EffectDepthStencilViewVariable *iface)
5379 return d3d10_effect_variable_AsDepthStencil((ID3D10EffectVariable *)iface);
5382 static struct ID3D10EffectRasterizerVariable * STDMETHODCALLTYPE d3d10_effect_depth_stencil_view_variable_AsRasterizer(
5383 ID3D10EffectDepthStencilViewVariable *iface)
5385 return d3d10_effect_variable_AsRasterizer((ID3D10EffectVariable *)iface);
5388 static struct ID3D10EffectSamplerVariable * STDMETHODCALLTYPE d3d10_effect_depth_stencil_view_variable_AsSampler(
5389 ID3D10EffectDepthStencilViewVariable *iface)
5391 return d3d10_effect_variable_AsSampler((ID3D10EffectVariable *)iface);
5394 static HRESULT STDMETHODCALLTYPE d3d10_effect_depth_stencil_view_variable_SetRawValue(
5395 ID3D10EffectDepthStencilViewVariable *iface, void *data, UINT offset, UINT count)
5397 return d3d10_effect_variable_SetRawValue((ID3D10EffectVariable *)iface, data, offset, count);
5400 static HRESULT STDMETHODCALLTYPE d3d10_effect_depth_stencil_view_variable_GetRawValue(
5401 ID3D10EffectDepthStencilViewVariable *iface, void *data, UINT offset, UINT count)
5403 return d3d10_effect_variable_GetRawValue((ID3D10EffectVariable *)iface, data, offset, count);
5406 /* ID3D10EffectDepthStencilViewVariable methods */
5408 static HRESULT STDMETHODCALLTYPE d3d10_effect_depth_stencil_view_variable_SetDepthStencil(
5409 ID3D10EffectDepthStencilViewVariable *iface, ID3D10DepthStencilView *view)
5411 FIXME("iface %p, view %p stub!\n", iface, view);
5416 static HRESULT STDMETHODCALLTYPE d3d10_effect_depth_stencil_view_variable_GetDepthStencil(
5417 ID3D10EffectDepthStencilViewVariable *iface, ID3D10DepthStencilView **view)
5419 FIXME("iface %p, view %p stub!\n", iface, view);
5424 static HRESULT STDMETHODCALLTYPE d3d10_effect_depth_stencil_view_variable_SetDepthStencilArray(
5425 ID3D10EffectDepthStencilViewVariable *iface, ID3D10DepthStencilView **views, UINT offset, UINT count)
5427 FIXME("iface %p, views %p, offset %u, count %u stub!\n", iface, views, offset, count);
5432 static HRESULT STDMETHODCALLTYPE d3d10_effect_depth_stencil_view_variable_GetDepthStencilArray(
5433 ID3D10EffectDepthStencilViewVariable *iface, ID3D10DepthStencilView **views, UINT offset, UINT count)
5435 FIXME("iface %p, views %p, offset %u, count %u stub!\n", iface, views, offset, count);
5441 static const struct ID3D10EffectDepthStencilViewVariableVtbl d3d10_effect_depth_stencil_view_variable_vtbl =
5443 /* ID3D10EffectVariable methods */
5444 d3d10_effect_depth_stencil_view_variable_IsValid,
5445 d3d10_effect_depth_stencil_view_variable_GetType,
5446 d3d10_effect_depth_stencil_view_variable_GetDesc,
5447 d3d10_effect_depth_stencil_view_variable_GetAnnotationByIndex,
5448 d3d10_effect_depth_stencil_view_variable_GetAnnotationByName,
5449 d3d10_effect_depth_stencil_view_variable_GetMemberByIndex,
5450 d3d10_effect_depth_stencil_view_variable_GetMemberByName,
5451 d3d10_effect_depth_stencil_view_variable_GetMemberBySemantic,
5452 d3d10_effect_depth_stencil_view_variable_GetElement,
5453 d3d10_effect_depth_stencil_view_variable_GetParentConstantBuffer,
5454 d3d10_effect_depth_stencil_view_variable_AsScalar,
5455 d3d10_effect_depth_stencil_view_variable_AsVector,
5456 d3d10_effect_depth_stencil_view_variable_AsMatrix,
5457 d3d10_effect_depth_stencil_view_variable_AsString,
5458 d3d10_effect_depth_stencil_view_variable_AsShaderResource,
5459 d3d10_effect_depth_stencil_view_variable_AsRenderTargetView,
5460 d3d10_effect_depth_stencil_view_variable_AsDepthStencilView,
5461 d3d10_effect_depth_stencil_view_variable_AsConstantBuffer,
5462 d3d10_effect_depth_stencil_view_variable_AsShader,
5463 d3d10_effect_depth_stencil_view_variable_AsBlend,
5464 d3d10_effect_depth_stencil_view_variable_AsDepthStencil,
5465 d3d10_effect_depth_stencil_view_variable_AsRasterizer,
5466 d3d10_effect_depth_stencil_view_variable_AsSampler,
5467 d3d10_effect_depth_stencil_view_variable_SetRawValue,
5468 d3d10_effect_depth_stencil_view_variable_GetRawValue,
5469 /* ID3D10EffectDepthStencilViewVariable methods */
5470 d3d10_effect_depth_stencil_view_variable_SetDepthStencil,
5471 d3d10_effect_depth_stencil_view_variable_GetDepthStencil,
5472 d3d10_effect_depth_stencil_view_variable_SetDepthStencilArray,
5473 d3d10_effect_depth_stencil_view_variable_GetDepthStencilArray,
5476 /* ID3D10EffectVariable methods */
5478 static BOOL STDMETHODCALLTYPE d3d10_effect_shader_variable_IsValid(ID3D10EffectShaderVariable *iface)
5480 TRACE("iface %p\n", iface);
5482 return (struct d3d10_effect_variable *)iface != &null_shader_variable;
5485 static struct ID3D10EffectType * STDMETHODCALLTYPE d3d10_effect_shader_variable_GetType(
5486 ID3D10EffectShaderVariable *iface)
5488 return d3d10_effect_variable_GetType((ID3D10EffectVariable *)iface);
5491 static HRESULT STDMETHODCALLTYPE d3d10_effect_shader_variable_GetDesc(ID3D10EffectShaderVariable *iface,
5492 D3D10_EFFECT_VARIABLE_DESC *desc)
5494 return d3d10_effect_variable_GetDesc((ID3D10EffectVariable *)iface, desc);
5497 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_shader_variable_GetAnnotationByIndex(
5498 ID3D10EffectShaderVariable *iface, UINT index)
5500 return d3d10_effect_variable_GetAnnotationByIndex((ID3D10EffectVariable *)iface, index);
5503 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_shader_variable_GetAnnotationByName(
5504 ID3D10EffectShaderVariable *iface, LPCSTR name)
5506 return d3d10_effect_variable_GetAnnotationByName((ID3D10EffectVariable *)iface, name);
5509 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_shader_variable_GetMemberByIndex(
5510 ID3D10EffectShaderVariable *iface, UINT index)
5512 return d3d10_effect_variable_GetMemberByIndex((ID3D10EffectVariable *)iface, index);
5515 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_shader_variable_GetMemberByName(
5516 ID3D10EffectShaderVariable *iface, LPCSTR name)
5518 return d3d10_effect_variable_GetMemberByName((ID3D10EffectVariable *)iface, name);
5521 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_shader_variable_GetMemberBySemantic(
5522 ID3D10EffectShaderVariable *iface, LPCSTR semantic)
5524 return d3d10_effect_variable_GetMemberBySemantic((ID3D10EffectVariable *)iface, semantic);
5527 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_shader_variable_GetElement(
5528 ID3D10EffectShaderVariable *iface, UINT index)
5530 return d3d10_effect_variable_GetElement((ID3D10EffectVariable *)iface, index);
5533 static struct ID3D10EffectConstantBuffer * STDMETHODCALLTYPE d3d10_effect_shader_variable_GetParentConstantBuffer(
5534 ID3D10EffectShaderVariable *iface)
5536 return d3d10_effect_variable_GetParentConstantBuffer((ID3D10EffectVariable *)iface);
5539 static struct ID3D10EffectScalarVariable * STDMETHODCALLTYPE d3d10_effect_shader_variable_AsScalar(
5540 ID3D10EffectShaderVariable *iface)
5542 return d3d10_effect_variable_AsScalar((ID3D10EffectVariable *)iface);
5545 static struct ID3D10EffectVectorVariable * STDMETHODCALLTYPE d3d10_effect_shader_variable_AsVector(
5546 ID3D10EffectShaderVariable *iface)
5548 return d3d10_effect_variable_AsVector((ID3D10EffectVariable *)iface);
5551 static struct ID3D10EffectMatrixVariable * STDMETHODCALLTYPE d3d10_effect_shader_variable_AsMatrix(
5552 ID3D10EffectShaderVariable *iface)
5554 return d3d10_effect_variable_AsMatrix((ID3D10EffectVariable *)iface);
5557 static struct ID3D10EffectStringVariable * STDMETHODCALLTYPE d3d10_effect_shader_variable_AsString(
5558 ID3D10EffectShaderVariable *iface)
5560 return d3d10_effect_variable_AsString((ID3D10EffectVariable *)iface);
5563 static struct ID3D10EffectShaderResourceVariable * STDMETHODCALLTYPE d3d10_effect_shader_variable_AsShaderResource(
5564 ID3D10EffectShaderVariable *iface)
5566 return d3d10_effect_variable_AsShaderResource((ID3D10EffectVariable *)iface);
5569 static struct ID3D10EffectRenderTargetViewVariable * STDMETHODCALLTYPE d3d10_effect_shader_variable_AsRenderTargetView(
5570 ID3D10EffectShaderVariable *iface)
5572 return d3d10_effect_variable_AsRenderTargetView((ID3D10EffectVariable *)iface);
5575 static struct ID3D10EffectDepthStencilViewVariable * STDMETHODCALLTYPE d3d10_effect_shader_variable_AsDepthStencilView(
5576 ID3D10EffectShaderVariable *iface)
5578 return d3d10_effect_variable_AsDepthStencilView((ID3D10EffectVariable *)iface);
5581 static struct ID3D10EffectConstantBuffer * STDMETHODCALLTYPE d3d10_effect_shader_variable_AsConstantBuffer(
5582 ID3D10EffectShaderVariable *iface)
5584 return d3d10_effect_variable_AsConstantBuffer((ID3D10EffectVariable *)iface);
5587 static struct ID3D10EffectShaderVariable * STDMETHODCALLTYPE d3d10_effect_shader_variable_AsShader(
5588 ID3D10EffectShaderVariable *iface)
5590 return d3d10_effect_variable_AsShader((ID3D10EffectVariable *)iface);
5593 static struct ID3D10EffectBlendVariable * STDMETHODCALLTYPE d3d10_effect_shader_variable_AsBlend(
5594 ID3D10EffectShaderVariable *iface)
5596 return d3d10_effect_variable_AsBlend((ID3D10EffectVariable *)iface);
5599 static struct ID3D10EffectDepthStencilVariable * STDMETHODCALLTYPE d3d10_effect_shader_variable_AsDepthStencil(
5600 ID3D10EffectShaderVariable *iface)
5602 return d3d10_effect_variable_AsDepthStencil((ID3D10EffectVariable *)iface);
5605 static struct ID3D10EffectRasterizerVariable * STDMETHODCALLTYPE d3d10_effect_shader_variable_AsRasterizer(
5606 ID3D10EffectShaderVariable *iface)
5608 return d3d10_effect_variable_AsRasterizer((ID3D10EffectVariable *)iface);
5611 static struct ID3D10EffectSamplerVariable * STDMETHODCALLTYPE d3d10_effect_shader_variable_AsSampler(
5612 ID3D10EffectShaderVariable *iface)
5614 return d3d10_effect_variable_AsSampler((ID3D10EffectVariable *)iface);
5617 static HRESULT STDMETHODCALLTYPE d3d10_effect_shader_variable_SetRawValue(
5618 ID3D10EffectShaderVariable *iface, void *data, UINT offset, UINT count)
5620 return d3d10_effect_variable_SetRawValue((ID3D10EffectVariable *)iface, data, offset, count);
5623 static HRESULT STDMETHODCALLTYPE d3d10_effect_shader_variable_GetRawValue(
5624 ID3D10EffectShaderVariable *iface, void *data, UINT offset, UINT count)
5626 return d3d10_effect_variable_GetRawValue((ID3D10EffectVariable *)iface, data, offset, count);
5629 /* ID3D10EffectShaderVariable methods */
5631 static HRESULT STDMETHODCALLTYPE d3d10_effect_shader_variable_GetShaderDesc(
5632 ID3D10EffectShaderVariable *iface, UINT index, D3D10_EFFECT_SHADER_DESC *desc)
5634 FIXME("iface %p, index %u, desc %p stub!\n", iface, index, desc);
5639 static HRESULT STDMETHODCALLTYPE d3d10_effect_shader_variable_GetVertexShader(
5640 ID3D10EffectShaderVariable *iface, UINT index, ID3D10VertexShader **shader)
5642 struct d3d10_effect_variable *v = impl_from_ID3D10EffectVariable((ID3D10EffectVariable *)iface);
5643 struct d3d10_effect_shader_variable *s;
5645 TRACE("iface %p, index %u, shader %p.\n", iface, index, shader);
5647 if (v->type->element_count)
5648 v = impl_from_ID3D10EffectVariable(iface->lpVtbl->GetElement(iface, index));
5650 if (v->type->basetype != D3D10_SVT_VERTEXSHADER)
5652 WARN("Shader is not a vertex shader.\n");
5657 if ((*shader = s->shader.vs))
5658 ID3D10VertexShader_AddRef(*shader);
5663 static HRESULT STDMETHODCALLTYPE d3d10_effect_shader_variable_GetGeometryShader(
5664 ID3D10EffectShaderVariable *iface, UINT index, ID3D10GeometryShader **shader)
5666 struct d3d10_effect_variable *v = impl_from_ID3D10EffectVariable((ID3D10EffectVariable *)iface);
5667 struct d3d10_effect_shader_variable *s;
5669 TRACE("iface %p, index %u, shader %p.\n", iface, index, shader);
5671 if (v->type->element_count)
5672 v = impl_from_ID3D10EffectVariable(iface->lpVtbl->GetElement(iface, index));
5674 if (v->type->basetype != D3D10_SVT_GEOMETRYSHADER)
5676 WARN("Shader is not a geometry shader.\n");
5681 if ((*shader = s->shader.gs))
5682 ID3D10GeometryShader_AddRef(*shader);
5687 static HRESULT STDMETHODCALLTYPE d3d10_effect_shader_variable_GetPixelShader(
5688 ID3D10EffectShaderVariable *iface, UINT index, ID3D10PixelShader **shader)
5690 struct d3d10_effect_variable *v = impl_from_ID3D10EffectVariable((ID3D10EffectVariable *)iface);
5691 struct d3d10_effect_shader_variable *s;
5693 TRACE("iface %p, index %u, shader %p.\n", iface, index, shader);
5695 if (v->type->element_count)
5696 v = impl_from_ID3D10EffectVariable(iface->lpVtbl->GetElement(iface, index));
5698 if (v->type->basetype != D3D10_SVT_PIXELSHADER)
5700 WARN("Shader is not a pixel shader.\n");
5705 if ((*shader = s->shader.ps))
5706 ID3D10PixelShader_AddRef(*shader);
5711 static HRESULT STDMETHODCALLTYPE d3d10_effect_shader_variable_GetInputSignatureElementDesc(
5712 ID3D10EffectShaderVariable *iface, UINT shader_index, UINT element_index,
5713 D3D10_SIGNATURE_PARAMETER_DESC *desc)
5715 struct d3d10_effect_variable *This = (struct d3d10_effect_variable *)iface;
5716 struct d3d10_effect_shader_variable *s;
5717 D3D10_SIGNATURE_PARAMETER_DESC *d;
5719 TRACE("iface %p, shader_index %u, element_index %u, desc %p\n",
5720 iface, shader_index, element_index, desc);
5722 if (!iface->lpVtbl->IsValid(iface))
5724 WARN("Null variable specified\n");
5728 /* Check shader_index, this crashes on W7/DX10 */
5729 if (shader_index >= This->effect->used_shader_count)
5731 WARN("This should crash on W7/DX10!\n");
5735 s = This->effect->used_shaders[shader_index]->data;
5736 if (!s->input_signature.signature)
5738 WARN("No shader signature\n");
5739 return D3DERR_INVALIDCALL;
5742 /* Check desc for NULL, this crashes on W7/DX10 */
5745 WARN("This should crash on W7/DX10!\n");
5749 if (element_index >= s->input_signature.element_count)
5751 WARN("Invalid element index specified\n");
5752 return E_INVALIDARG;
5755 d = &s->input_signature.elements[element_index];
5756 desc->SemanticName = d->SemanticName;
5757 desc->SemanticIndex = d->SemanticIndex;
5758 desc->SystemValueType = d->SystemValueType;
5759 desc->ComponentType = d->ComponentType;
5760 desc->Register = d->Register;
5761 desc->ReadWriteMask = d->ReadWriteMask;
5762 desc->Mask = d->Mask;
5767 static HRESULT STDMETHODCALLTYPE d3d10_effect_shader_variable_GetOutputSignatureElementDesc(
5768 ID3D10EffectShaderVariable *iface, UINT shader_index, UINT element_index,
5769 D3D10_SIGNATURE_PARAMETER_DESC *desc)
5771 struct d3d10_effect_variable *This = (struct d3d10_effect_variable *)iface;
5772 struct d3d10_effect_shader_variable *s;
5773 D3D10_SIGNATURE_PARAMETER_DESC *d;
5775 TRACE("iface %p, shader_index %u, element_index %u, desc %p\n",
5776 iface, shader_index, element_index, desc);
5778 if (!iface->lpVtbl->IsValid(iface))
5780 WARN("Null variable specified\n");
5784 /* Check shader_index, this crashes on W7/DX10 */
5785 if (shader_index >= This->effect->used_shader_count)
5787 WARN("This should crash on W7/DX10!\n");
5791 s = This->effect->used_shaders[shader_index]->data;
5792 if (!s->output_signature.signature)
5794 WARN("No shader signature\n");
5795 return D3DERR_INVALIDCALL;
5798 /* Check desc for NULL, this crashes on W7/DX10 */
5801 WARN("This should crash on W7/DX10!\n");
5805 if (element_index >= s->output_signature.element_count)
5807 WARN("Invalid element index specified\n");
5808 return E_INVALIDARG;
5811 d = &s->output_signature.elements[element_index];
5812 desc->SemanticName = d->SemanticName;
5813 desc->SemanticIndex = d->SemanticIndex;
5814 desc->SystemValueType = d->SystemValueType;
5815 desc->ComponentType = d->ComponentType;
5816 desc->Register = d->Register;
5817 desc->ReadWriteMask = d->ReadWriteMask;
5818 desc->Mask = d->Mask;
5824 static const struct ID3D10EffectShaderVariableVtbl d3d10_effect_shader_variable_vtbl =
5826 /* ID3D10EffectVariable methods */
5827 d3d10_effect_shader_variable_IsValid,
5828 d3d10_effect_shader_variable_GetType,
5829 d3d10_effect_shader_variable_GetDesc,
5830 d3d10_effect_shader_variable_GetAnnotationByIndex,
5831 d3d10_effect_shader_variable_GetAnnotationByName,
5832 d3d10_effect_shader_variable_GetMemberByIndex,
5833 d3d10_effect_shader_variable_GetMemberByName,
5834 d3d10_effect_shader_variable_GetMemberBySemantic,
5835 d3d10_effect_shader_variable_GetElement,
5836 d3d10_effect_shader_variable_GetParentConstantBuffer,
5837 d3d10_effect_shader_variable_AsScalar,
5838 d3d10_effect_shader_variable_AsVector,
5839 d3d10_effect_shader_variable_AsMatrix,
5840 d3d10_effect_shader_variable_AsString,
5841 d3d10_effect_shader_variable_AsShaderResource,
5842 d3d10_effect_shader_variable_AsRenderTargetView,
5843 d3d10_effect_shader_variable_AsDepthStencilView,
5844 d3d10_effect_shader_variable_AsConstantBuffer,
5845 d3d10_effect_shader_variable_AsShader,
5846 d3d10_effect_shader_variable_AsBlend,
5847 d3d10_effect_shader_variable_AsDepthStencil,
5848 d3d10_effect_shader_variable_AsRasterizer,
5849 d3d10_effect_shader_variable_AsSampler,
5850 d3d10_effect_shader_variable_SetRawValue,
5851 d3d10_effect_shader_variable_GetRawValue,
5852 /* ID3D10EffectShaderVariable methods */
5853 d3d10_effect_shader_variable_GetShaderDesc,
5854 d3d10_effect_shader_variable_GetVertexShader,
5855 d3d10_effect_shader_variable_GetGeometryShader,
5856 d3d10_effect_shader_variable_GetPixelShader,
5857 d3d10_effect_shader_variable_GetInputSignatureElementDesc,
5858 d3d10_effect_shader_variable_GetOutputSignatureElementDesc,
5861 /* ID3D10EffectVariable methods */
5863 static BOOL STDMETHODCALLTYPE d3d10_effect_blend_variable_IsValid(ID3D10EffectBlendVariable *iface)
5865 TRACE("iface %p\n", iface);
5867 return (struct d3d10_effect_variable *)iface != &null_blend_variable;
5870 static struct ID3D10EffectType * STDMETHODCALLTYPE d3d10_effect_blend_variable_GetType(
5871 ID3D10EffectBlendVariable *iface)
5873 return d3d10_effect_variable_GetType((ID3D10EffectVariable *)iface);
5876 static HRESULT STDMETHODCALLTYPE d3d10_effect_blend_variable_GetDesc(ID3D10EffectBlendVariable *iface,
5877 D3D10_EFFECT_VARIABLE_DESC *desc)
5879 return d3d10_effect_variable_GetDesc((ID3D10EffectVariable *)iface, desc);
5882 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_blend_variable_GetAnnotationByIndex(
5883 ID3D10EffectBlendVariable *iface, UINT index)
5885 return d3d10_effect_variable_GetAnnotationByIndex((ID3D10EffectVariable *)iface, index);
5888 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_blend_variable_GetAnnotationByName(
5889 ID3D10EffectBlendVariable *iface, LPCSTR name)
5891 return d3d10_effect_variable_GetAnnotationByName((ID3D10EffectVariable *)iface, name);
5894 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_blend_variable_GetMemberByIndex(
5895 ID3D10EffectBlendVariable *iface, UINT index)
5897 return d3d10_effect_variable_GetMemberByIndex((ID3D10EffectVariable *)iface, index);
5900 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_blend_variable_GetMemberByName(
5901 ID3D10EffectBlendVariable *iface, LPCSTR name)
5903 return d3d10_effect_variable_GetMemberByName((ID3D10EffectVariable *)iface, name);
5906 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_blend_variable_GetMemberBySemantic(
5907 ID3D10EffectBlendVariable *iface, LPCSTR semantic)
5909 return d3d10_effect_variable_GetMemberBySemantic((ID3D10EffectVariable *)iface, semantic);
5912 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_blend_variable_GetElement(
5913 ID3D10EffectBlendVariable *iface, UINT index)
5915 return d3d10_effect_variable_GetElement((ID3D10EffectVariable *)iface, index);
5918 static struct ID3D10EffectConstantBuffer * STDMETHODCALLTYPE d3d10_effect_blend_variable_GetParentConstantBuffer(
5919 ID3D10EffectBlendVariable *iface)
5921 return d3d10_effect_variable_GetParentConstantBuffer((ID3D10EffectVariable *)iface);
5924 static struct ID3D10EffectScalarVariable * STDMETHODCALLTYPE d3d10_effect_blend_variable_AsScalar(
5925 ID3D10EffectBlendVariable *iface)
5927 return d3d10_effect_variable_AsScalar((ID3D10EffectVariable *)iface);
5930 static struct ID3D10EffectVectorVariable * STDMETHODCALLTYPE d3d10_effect_blend_variable_AsVector(
5931 ID3D10EffectBlendVariable *iface)
5933 return d3d10_effect_variable_AsVector((ID3D10EffectVariable *)iface);
5936 static struct ID3D10EffectMatrixVariable * STDMETHODCALLTYPE d3d10_effect_blend_variable_AsMatrix(
5937 ID3D10EffectBlendVariable *iface)
5939 return d3d10_effect_variable_AsMatrix((ID3D10EffectVariable *)iface);
5942 static struct ID3D10EffectStringVariable * STDMETHODCALLTYPE d3d10_effect_blend_variable_AsString(
5943 ID3D10EffectBlendVariable *iface)
5945 return d3d10_effect_variable_AsString((ID3D10EffectVariable *)iface);
5948 static struct ID3D10EffectShaderResourceVariable * STDMETHODCALLTYPE d3d10_effect_blend_variable_AsShaderResource(
5949 ID3D10EffectBlendVariable *iface)
5951 return d3d10_effect_variable_AsShaderResource((ID3D10EffectVariable *)iface);
5954 static struct ID3D10EffectRenderTargetViewVariable * STDMETHODCALLTYPE d3d10_effect_blend_variable_AsRenderTargetView(
5955 ID3D10EffectBlendVariable *iface)
5957 return d3d10_effect_variable_AsRenderTargetView((ID3D10EffectVariable *)iface);
5960 static struct ID3D10EffectDepthStencilViewVariable * STDMETHODCALLTYPE d3d10_effect_blend_variable_AsDepthStencilView(
5961 ID3D10EffectBlendVariable *iface)
5963 return d3d10_effect_variable_AsDepthStencilView((ID3D10EffectVariable *)iface);
5966 static struct ID3D10EffectConstantBuffer * STDMETHODCALLTYPE d3d10_effect_blend_variable_AsConstantBuffer(
5967 ID3D10EffectBlendVariable *iface)
5969 return d3d10_effect_variable_AsConstantBuffer((ID3D10EffectVariable *)iface);
5972 static struct ID3D10EffectShaderVariable * STDMETHODCALLTYPE d3d10_effect_blend_variable_AsShader(
5973 ID3D10EffectBlendVariable *iface)
5975 return d3d10_effect_variable_AsShader((ID3D10EffectVariable *)iface);
5978 static struct ID3D10EffectBlendVariable * STDMETHODCALLTYPE d3d10_effect_blend_variable_AsBlend(
5979 ID3D10EffectBlendVariable *iface)
5981 return d3d10_effect_variable_AsBlend((ID3D10EffectVariable *)iface);
5984 static struct ID3D10EffectDepthStencilVariable * STDMETHODCALLTYPE d3d10_effect_blend_variable_AsDepthStencil(
5985 ID3D10EffectBlendVariable *iface)
5987 return d3d10_effect_variable_AsDepthStencil((ID3D10EffectVariable *)iface);
5990 static struct ID3D10EffectRasterizerVariable * STDMETHODCALLTYPE d3d10_effect_blend_variable_AsRasterizer(
5991 ID3D10EffectBlendVariable *iface)
5993 return d3d10_effect_variable_AsRasterizer((ID3D10EffectVariable *)iface);
5996 static struct ID3D10EffectSamplerVariable * STDMETHODCALLTYPE d3d10_effect_blend_variable_AsSampler(
5997 ID3D10EffectBlendVariable *iface)
5999 return d3d10_effect_variable_AsSampler((ID3D10EffectVariable *)iface);
6002 static HRESULT STDMETHODCALLTYPE d3d10_effect_blend_variable_SetRawValue(ID3D10EffectBlendVariable *iface,
6003 void *data, UINT offset, UINT count)
6005 return d3d10_effect_variable_SetRawValue((ID3D10EffectVariable *)iface, data, offset, count);
6008 static HRESULT STDMETHODCALLTYPE d3d10_effect_blend_variable_GetRawValue(ID3D10EffectBlendVariable *iface,
6009 void *data, UINT offset, UINT count)
6011 return d3d10_effect_variable_GetRawValue((ID3D10EffectVariable *)iface, data, offset, count);
6014 /* ID3D10EffectBlendVariable methods */
6016 static HRESULT STDMETHODCALLTYPE d3d10_effect_blend_variable_GetBlendState(ID3D10EffectBlendVariable *iface,
6017 UINT index, ID3D10BlendState **blend_state)
6019 FIXME("iface %p, index %u, blend_state %p stub!\n", iface, index, blend_state);
6024 static HRESULT STDMETHODCALLTYPE d3d10_effect_blend_variable_GetBackingStore(ID3D10EffectBlendVariable *iface,
6025 UINT index, D3D10_BLEND_DESC *desc)
6027 struct d3d10_effect_variable *v = impl_from_ID3D10EffectVariable((ID3D10EffectVariable *)iface);
6028 struct d3d10_effect_state_object_variable *s;
6030 TRACE("iface %p, index %u, desc %p.\n", iface, index, desc);
6032 if (v->type->element_count)
6033 v = impl_from_ID3D10EffectVariable(iface->lpVtbl->GetElement(iface, index));
6035 if (v->type->basetype != D3D10_SVT_BLEND)
6037 WARN("Variable is not a blend state.\n");
6042 *desc = s->desc.blend;
6048 static const struct ID3D10EffectBlendVariableVtbl d3d10_effect_blend_variable_vtbl =
6050 /* ID3D10EffectVariable methods */
6051 d3d10_effect_blend_variable_IsValid,
6052 d3d10_effect_blend_variable_GetType,
6053 d3d10_effect_blend_variable_GetDesc,
6054 d3d10_effect_blend_variable_GetAnnotationByIndex,
6055 d3d10_effect_blend_variable_GetAnnotationByName,
6056 d3d10_effect_blend_variable_GetMemberByIndex,
6057 d3d10_effect_blend_variable_GetMemberByName,
6058 d3d10_effect_blend_variable_GetMemberBySemantic,
6059 d3d10_effect_blend_variable_GetElement,
6060 d3d10_effect_blend_variable_GetParentConstantBuffer,
6061 d3d10_effect_blend_variable_AsScalar,
6062 d3d10_effect_blend_variable_AsVector,
6063 d3d10_effect_blend_variable_AsMatrix,
6064 d3d10_effect_blend_variable_AsString,
6065 d3d10_effect_blend_variable_AsShaderResource,
6066 d3d10_effect_blend_variable_AsRenderTargetView,
6067 d3d10_effect_blend_variable_AsDepthStencilView,
6068 d3d10_effect_blend_variable_AsConstantBuffer,
6069 d3d10_effect_blend_variable_AsShader,
6070 d3d10_effect_blend_variable_AsBlend,
6071 d3d10_effect_blend_variable_AsDepthStencil,
6072 d3d10_effect_blend_variable_AsRasterizer,
6073 d3d10_effect_blend_variable_AsSampler,
6074 d3d10_effect_blend_variable_SetRawValue,
6075 d3d10_effect_blend_variable_GetRawValue,
6076 /* ID3D10EffectBlendVariable methods */
6077 d3d10_effect_blend_variable_GetBlendState,
6078 d3d10_effect_blend_variable_GetBackingStore,
6081 /* ID3D10EffectVariable methods */
6083 static BOOL STDMETHODCALLTYPE d3d10_effect_depth_stencil_variable_IsValid(ID3D10EffectDepthStencilVariable *iface)
6085 TRACE("iface %p\n", iface);
6087 return (struct d3d10_effect_variable *)iface != &null_depth_stencil_variable;
6090 static struct ID3D10EffectType * STDMETHODCALLTYPE d3d10_effect_depth_stencil_variable_GetType(
6091 ID3D10EffectDepthStencilVariable *iface)
6093 return d3d10_effect_variable_GetType((ID3D10EffectVariable *)iface);
6096 static HRESULT STDMETHODCALLTYPE d3d10_effect_depth_stencil_variable_GetDesc(ID3D10EffectDepthStencilVariable *iface,
6097 D3D10_EFFECT_VARIABLE_DESC *desc)
6099 return d3d10_effect_variable_GetDesc((ID3D10EffectVariable *)iface, desc);
6102 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_depth_stencil_variable_GetAnnotationByIndex(
6103 ID3D10EffectDepthStencilVariable *iface, UINT index)
6105 return d3d10_effect_variable_GetAnnotationByIndex((ID3D10EffectVariable *)iface, index);
6108 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_depth_stencil_variable_GetAnnotationByName(
6109 ID3D10EffectDepthStencilVariable *iface, LPCSTR name)
6111 return d3d10_effect_variable_GetAnnotationByName((ID3D10EffectVariable *)iface, name);
6114 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_depth_stencil_variable_GetMemberByIndex(
6115 ID3D10EffectDepthStencilVariable *iface, UINT index)
6117 return d3d10_effect_variable_GetMemberByIndex((ID3D10EffectVariable *)iface, index);
6120 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_depth_stencil_variable_GetMemberByName(
6121 ID3D10EffectDepthStencilVariable *iface, LPCSTR name)
6123 return d3d10_effect_variable_GetMemberByName((ID3D10EffectVariable *)iface, name);
6126 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_depth_stencil_variable_GetMemberBySemantic(
6127 ID3D10EffectDepthStencilVariable *iface, LPCSTR semantic)
6129 return d3d10_effect_variable_GetMemberBySemantic((ID3D10EffectVariable *)iface, semantic);
6132 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_depth_stencil_variable_GetElement(
6133 ID3D10EffectDepthStencilVariable *iface, UINT index)
6135 return d3d10_effect_variable_GetElement((ID3D10EffectVariable *)iface, index);
6138 static struct ID3D10EffectConstantBuffer * STDMETHODCALLTYPE d3d10_effect_depth_stencil_variable_GetParentConstantBuffer(
6139 ID3D10EffectDepthStencilVariable *iface)
6141 return d3d10_effect_variable_GetParentConstantBuffer((ID3D10EffectVariable *)iface);
6144 static struct ID3D10EffectScalarVariable * STDMETHODCALLTYPE d3d10_effect_depth_stencil_variable_AsScalar(
6145 ID3D10EffectDepthStencilVariable *iface)
6147 return d3d10_effect_variable_AsScalar((ID3D10EffectVariable *)iface);
6150 static struct ID3D10EffectVectorVariable * STDMETHODCALLTYPE d3d10_effect_depth_stencil_variable_AsVector(
6151 ID3D10EffectDepthStencilVariable *iface)
6153 return d3d10_effect_variable_AsVector((ID3D10EffectVariable *)iface);
6156 static struct ID3D10EffectMatrixVariable * STDMETHODCALLTYPE d3d10_effect_depth_stencil_variable_AsMatrix(
6157 ID3D10EffectDepthStencilVariable *iface)
6159 return d3d10_effect_variable_AsMatrix((ID3D10EffectVariable *)iface);
6162 static struct ID3D10EffectStringVariable * STDMETHODCALLTYPE d3d10_effect_depth_stencil_variable_AsString(
6163 ID3D10EffectDepthStencilVariable *iface)
6165 return d3d10_effect_variable_AsString((ID3D10EffectVariable *)iface);
6168 static struct ID3D10EffectShaderResourceVariable * STDMETHODCALLTYPE d3d10_effect_depth_stencil_variable_AsShaderResource(
6169 ID3D10EffectDepthStencilVariable *iface)
6171 return d3d10_effect_variable_AsShaderResource((ID3D10EffectVariable *)iface);
6174 static struct ID3D10EffectRenderTargetViewVariable * STDMETHODCALLTYPE d3d10_effect_depth_stencil_variable_AsRenderTargetView(
6175 ID3D10EffectDepthStencilVariable *iface)
6177 return d3d10_effect_variable_AsRenderTargetView((ID3D10EffectVariable *)iface);
6180 static struct ID3D10EffectDepthStencilViewVariable * STDMETHODCALLTYPE d3d10_effect_depth_stencil_variable_AsDepthStencilView(
6181 ID3D10EffectDepthStencilVariable *iface)
6183 return d3d10_effect_variable_AsDepthStencilView((ID3D10EffectVariable *)iface);
6186 static struct ID3D10EffectConstantBuffer * STDMETHODCALLTYPE d3d10_effect_depth_stencil_variable_AsConstantBuffer(
6187 ID3D10EffectDepthStencilVariable *iface)
6189 return d3d10_effect_variable_AsConstantBuffer((ID3D10EffectVariable *)iface);
6192 static struct ID3D10EffectShaderVariable * STDMETHODCALLTYPE d3d10_effect_depth_stencil_variable_AsShader(
6193 ID3D10EffectDepthStencilVariable *iface)
6195 return d3d10_effect_variable_AsShader((ID3D10EffectVariable *)iface);
6198 static struct ID3D10EffectBlendVariable * STDMETHODCALLTYPE d3d10_effect_depth_stencil_variable_AsBlend(
6199 ID3D10EffectDepthStencilVariable *iface)
6201 return d3d10_effect_variable_AsBlend((ID3D10EffectVariable *)iface);
6204 static struct ID3D10EffectDepthStencilVariable * STDMETHODCALLTYPE d3d10_effect_depth_stencil_variable_AsDepthStencil(
6205 ID3D10EffectDepthStencilVariable *iface)
6207 return d3d10_effect_variable_AsDepthStencil((ID3D10EffectVariable *)iface);
6210 static struct ID3D10EffectRasterizerVariable * STDMETHODCALLTYPE d3d10_effect_depth_stencil_variable_AsRasterizer(
6211 ID3D10EffectDepthStencilVariable *iface)
6213 return d3d10_effect_variable_AsRasterizer((ID3D10EffectVariable *)iface);
6216 static struct ID3D10EffectSamplerVariable * STDMETHODCALLTYPE d3d10_effect_depth_stencil_variable_AsSampler(
6217 ID3D10EffectDepthStencilVariable *iface)
6219 return d3d10_effect_variable_AsSampler((ID3D10EffectVariable *)iface);
6222 static HRESULT STDMETHODCALLTYPE d3d10_effect_depth_stencil_variable_SetRawValue(ID3D10EffectDepthStencilVariable *iface,
6223 void *data, UINT offset, UINT count)
6225 return d3d10_effect_variable_SetRawValue((ID3D10EffectVariable *)iface, data, offset, count);
6228 static HRESULT STDMETHODCALLTYPE d3d10_effect_depth_stencil_variable_GetRawValue(ID3D10EffectDepthStencilVariable *iface,
6229 void *data, UINT offset, UINT count)
6231 return d3d10_effect_variable_GetRawValue((ID3D10EffectVariable *)iface, data, offset, count);
6234 /* ID3D10EffectDepthStencilVariable methods */
6236 static HRESULT STDMETHODCALLTYPE d3d10_effect_depth_stencil_variable_GetDepthStencilState(ID3D10EffectDepthStencilVariable *iface,
6237 UINT index, ID3D10DepthStencilState **depth_stencil_state)
6239 FIXME("iface %p, index %u, depth_stencil_state %p stub!\n", iface, index, depth_stencil_state);
6244 static HRESULT STDMETHODCALLTYPE d3d10_effect_depth_stencil_variable_GetBackingStore(ID3D10EffectDepthStencilVariable *iface,
6245 UINT index, D3D10_DEPTH_STENCIL_DESC *desc)
6247 struct d3d10_effect_variable *v = impl_from_ID3D10EffectVariable((ID3D10EffectVariable *)iface);
6248 struct d3d10_effect_state_object_variable *s;
6250 TRACE("iface %p, index %u, desc %p.\n", iface, index, desc);
6252 if (v->type->element_count)
6253 v = impl_from_ID3D10EffectVariable(iface->lpVtbl->GetElement(iface, index));
6255 if (v->type->basetype != D3D10_SVT_DEPTHSTENCIL)
6257 WARN("Variable is not a depth stencil state.\n");
6262 *desc = s->desc.depth_stencil;
6268 static const struct ID3D10EffectDepthStencilVariableVtbl d3d10_effect_depth_stencil_variable_vtbl =
6270 /* ID3D10EffectVariable methods */
6271 d3d10_effect_depth_stencil_variable_IsValid,
6272 d3d10_effect_depth_stencil_variable_GetType,
6273 d3d10_effect_depth_stencil_variable_GetDesc,
6274 d3d10_effect_depth_stencil_variable_GetAnnotationByIndex,
6275 d3d10_effect_depth_stencil_variable_GetAnnotationByName,
6276 d3d10_effect_depth_stencil_variable_GetMemberByIndex,
6277 d3d10_effect_depth_stencil_variable_GetMemberByName,
6278 d3d10_effect_depth_stencil_variable_GetMemberBySemantic,
6279 d3d10_effect_depth_stencil_variable_GetElement,
6280 d3d10_effect_depth_stencil_variable_GetParentConstantBuffer,
6281 d3d10_effect_depth_stencil_variable_AsScalar,
6282 d3d10_effect_depth_stencil_variable_AsVector,
6283 d3d10_effect_depth_stencil_variable_AsMatrix,
6284 d3d10_effect_depth_stencil_variable_AsString,
6285 d3d10_effect_depth_stencil_variable_AsShaderResource,
6286 d3d10_effect_depth_stencil_variable_AsRenderTargetView,
6287 d3d10_effect_depth_stencil_variable_AsDepthStencilView,
6288 d3d10_effect_depth_stencil_variable_AsConstantBuffer,
6289 d3d10_effect_depth_stencil_variable_AsShader,
6290 d3d10_effect_depth_stencil_variable_AsBlend,
6291 d3d10_effect_depth_stencil_variable_AsDepthStencil,
6292 d3d10_effect_depth_stencil_variable_AsRasterizer,
6293 d3d10_effect_depth_stencil_variable_AsSampler,
6294 d3d10_effect_depth_stencil_variable_SetRawValue,
6295 d3d10_effect_depth_stencil_variable_GetRawValue,
6296 /* ID3D10EffectDepthStencilVariable methods */
6297 d3d10_effect_depth_stencil_variable_GetDepthStencilState,
6298 d3d10_effect_depth_stencil_variable_GetBackingStore,
6301 /* ID3D10EffectVariable methods */
6303 static BOOL STDMETHODCALLTYPE d3d10_effect_rasterizer_variable_IsValid(ID3D10EffectRasterizerVariable *iface)
6305 TRACE("iface %p\n", iface);
6307 return (struct d3d10_effect_variable *)iface != &null_rasterizer_variable;
6310 static struct ID3D10EffectType * STDMETHODCALLTYPE d3d10_effect_rasterizer_variable_GetType(
6311 ID3D10EffectRasterizerVariable *iface)
6313 return d3d10_effect_variable_GetType((ID3D10EffectVariable *)iface);
6316 static HRESULT STDMETHODCALLTYPE d3d10_effect_rasterizer_variable_GetDesc(ID3D10EffectRasterizerVariable *iface,
6317 D3D10_EFFECT_VARIABLE_DESC *desc)
6319 return d3d10_effect_variable_GetDesc((ID3D10EffectVariable *)iface, desc);
6322 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_rasterizer_variable_GetAnnotationByIndex(
6323 ID3D10EffectRasterizerVariable *iface, UINT index)
6325 return d3d10_effect_variable_GetAnnotationByIndex((ID3D10EffectVariable *)iface, index);
6328 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_rasterizer_variable_GetAnnotationByName(
6329 ID3D10EffectRasterizerVariable *iface, LPCSTR name)
6331 return d3d10_effect_variable_GetAnnotationByName((ID3D10EffectVariable *)iface, name);
6334 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_rasterizer_variable_GetMemberByIndex(
6335 ID3D10EffectRasterizerVariable *iface, UINT index)
6337 return d3d10_effect_variable_GetMemberByIndex((ID3D10EffectVariable *)iface, index);
6340 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_rasterizer_variable_GetMemberByName(
6341 ID3D10EffectRasterizerVariable *iface, LPCSTR name)
6343 return d3d10_effect_variable_GetMemberByName((ID3D10EffectVariable *)iface, name);
6346 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_rasterizer_variable_GetMemberBySemantic(
6347 ID3D10EffectRasterizerVariable *iface, LPCSTR semantic)
6349 return d3d10_effect_variable_GetMemberBySemantic((ID3D10EffectVariable *)iface, semantic);
6352 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_rasterizer_variable_GetElement(
6353 ID3D10EffectRasterizerVariable *iface, UINT index)
6355 return d3d10_effect_variable_GetElement((ID3D10EffectVariable *)iface, index);
6358 static struct ID3D10EffectConstantBuffer * STDMETHODCALLTYPE d3d10_effect_rasterizer_variable_GetParentConstantBuffer(
6359 ID3D10EffectRasterizerVariable *iface)
6361 return d3d10_effect_variable_GetParentConstantBuffer((ID3D10EffectVariable *)iface);
6364 static struct ID3D10EffectScalarVariable * STDMETHODCALLTYPE d3d10_effect_rasterizer_variable_AsScalar(
6365 ID3D10EffectRasterizerVariable *iface)
6367 return d3d10_effect_variable_AsScalar((ID3D10EffectVariable *)iface);
6370 static struct ID3D10EffectVectorVariable * STDMETHODCALLTYPE d3d10_effect_rasterizer_variable_AsVector(
6371 ID3D10EffectRasterizerVariable *iface)
6373 return d3d10_effect_variable_AsVector((ID3D10EffectVariable *)iface);
6376 static struct ID3D10EffectMatrixVariable * STDMETHODCALLTYPE d3d10_effect_rasterizer_variable_AsMatrix(
6377 ID3D10EffectRasterizerVariable *iface)
6379 return d3d10_effect_variable_AsMatrix((ID3D10EffectVariable *)iface);
6382 static struct ID3D10EffectStringVariable * STDMETHODCALLTYPE d3d10_effect_rasterizer_variable_AsString(
6383 ID3D10EffectRasterizerVariable *iface)
6385 return d3d10_effect_variable_AsString((ID3D10EffectVariable *)iface);
6388 static struct ID3D10EffectShaderResourceVariable * STDMETHODCALLTYPE d3d10_effect_rasterizer_variable_AsShaderResource(
6389 ID3D10EffectRasterizerVariable *iface)
6391 return d3d10_effect_variable_AsShaderResource((ID3D10EffectVariable *)iface);
6394 static struct ID3D10EffectRenderTargetViewVariable * STDMETHODCALLTYPE d3d10_effect_rasterizer_variable_AsRenderTargetView(
6395 ID3D10EffectRasterizerVariable *iface)
6397 return d3d10_effect_variable_AsRenderTargetView((ID3D10EffectVariable *)iface);
6400 static struct ID3D10EffectDepthStencilViewVariable * STDMETHODCALLTYPE d3d10_effect_rasterizer_variable_AsDepthStencilView(
6401 ID3D10EffectRasterizerVariable *iface)
6403 return d3d10_effect_variable_AsDepthStencilView((ID3D10EffectVariable *)iface);
6406 static struct ID3D10EffectConstantBuffer * STDMETHODCALLTYPE d3d10_effect_rasterizer_variable_AsConstantBuffer(
6407 ID3D10EffectRasterizerVariable *iface)
6409 return d3d10_effect_variable_AsConstantBuffer((ID3D10EffectVariable *)iface);
6412 static struct ID3D10EffectShaderVariable * STDMETHODCALLTYPE d3d10_effect_rasterizer_variable_AsShader(
6413 ID3D10EffectRasterizerVariable *iface)
6415 return d3d10_effect_variable_AsShader((ID3D10EffectVariable *)iface);
6418 static struct ID3D10EffectBlendVariable * STDMETHODCALLTYPE d3d10_effect_rasterizer_variable_AsBlend(
6419 ID3D10EffectRasterizerVariable *iface)
6421 return d3d10_effect_variable_AsBlend((ID3D10EffectVariable *)iface);
6424 static struct ID3D10EffectDepthStencilVariable * STDMETHODCALLTYPE d3d10_effect_rasterizer_variable_AsDepthStencil(
6425 ID3D10EffectRasterizerVariable *iface)
6427 return d3d10_effect_variable_AsDepthStencil((ID3D10EffectVariable *)iface);
6430 static struct ID3D10EffectRasterizerVariable * STDMETHODCALLTYPE d3d10_effect_rasterizer_variable_AsRasterizer(
6431 ID3D10EffectRasterizerVariable *iface)
6433 return d3d10_effect_variable_AsRasterizer((ID3D10EffectVariable *)iface);
6436 static struct ID3D10EffectSamplerVariable * STDMETHODCALLTYPE d3d10_effect_rasterizer_variable_AsSampler(
6437 ID3D10EffectRasterizerVariable *iface)
6439 return d3d10_effect_variable_AsSampler((ID3D10EffectVariable *)iface);
6442 static HRESULT STDMETHODCALLTYPE d3d10_effect_rasterizer_variable_SetRawValue(ID3D10EffectRasterizerVariable *iface,
6443 void *data, UINT offset, UINT count)
6445 return d3d10_effect_variable_SetRawValue((ID3D10EffectVariable *)iface, data, offset, count);
6448 static HRESULT STDMETHODCALLTYPE d3d10_effect_rasterizer_variable_GetRawValue(ID3D10EffectRasterizerVariable *iface,
6449 void *data, UINT offset, UINT count)
6451 return d3d10_effect_variable_GetRawValue((ID3D10EffectVariable *)iface, data, offset, count);
6454 /* ID3D10EffectRasterizerVariable methods */
6456 static HRESULT STDMETHODCALLTYPE d3d10_effect_rasterizer_variable_GetRasterizerState(ID3D10EffectRasterizerVariable *iface,
6457 UINT index, ID3D10RasterizerState **rasterizer_state)
6459 FIXME("iface %p, index %u, rasterizer_state %p stub!\n", iface, index, rasterizer_state);
6464 static HRESULT STDMETHODCALLTYPE d3d10_effect_rasterizer_variable_GetBackingStore(ID3D10EffectRasterizerVariable *iface,
6465 UINT index, D3D10_RASTERIZER_DESC *desc)
6467 struct d3d10_effect_variable *v = impl_from_ID3D10EffectVariable((ID3D10EffectVariable *)iface);
6468 struct d3d10_effect_state_object_variable *s;
6470 TRACE("iface %p, index %u, desc %p.\n", iface, index, desc);
6472 if (v->type->element_count)
6473 v = impl_from_ID3D10EffectVariable(iface->lpVtbl->GetElement(iface, index));
6475 if (v->type->basetype != D3D10_SVT_RASTERIZER)
6477 WARN("Variable is not a rasterizer state.\n");
6482 *desc = s->desc.rasterizer;
6488 static const struct ID3D10EffectRasterizerVariableVtbl d3d10_effect_rasterizer_variable_vtbl =
6490 /* ID3D10EffectVariable methods */
6491 d3d10_effect_rasterizer_variable_IsValid,
6492 d3d10_effect_rasterizer_variable_GetType,
6493 d3d10_effect_rasterizer_variable_GetDesc,
6494 d3d10_effect_rasterizer_variable_GetAnnotationByIndex,
6495 d3d10_effect_rasterizer_variable_GetAnnotationByName,
6496 d3d10_effect_rasterizer_variable_GetMemberByIndex,
6497 d3d10_effect_rasterizer_variable_GetMemberByName,
6498 d3d10_effect_rasterizer_variable_GetMemberBySemantic,
6499 d3d10_effect_rasterizer_variable_GetElement,
6500 d3d10_effect_rasterizer_variable_GetParentConstantBuffer,
6501 d3d10_effect_rasterizer_variable_AsScalar,
6502 d3d10_effect_rasterizer_variable_AsVector,
6503 d3d10_effect_rasterizer_variable_AsMatrix,
6504 d3d10_effect_rasterizer_variable_AsString,
6505 d3d10_effect_rasterizer_variable_AsShaderResource,
6506 d3d10_effect_rasterizer_variable_AsRenderTargetView,
6507 d3d10_effect_rasterizer_variable_AsDepthStencilView,
6508 d3d10_effect_rasterizer_variable_AsConstantBuffer,
6509 d3d10_effect_rasterizer_variable_AsShader,
6510 d3d10_effect_rasterizer_variable_AsBlend,
6511 d3d10_effect_rasterizer_variable_AsDepthStencil,
6512 d3d10_effect_rasterizer_variable_AsRasterizer,
6513 d3d10_effect_rasterizer_variable_AsSampler,
6514 d3d10_effect_rasterizer_variable_SetRawValue,
6515 d3d10_effect_rasterizer_variable_GetRawValue,
6516 /* ID3D10EffectRasterizerVariable methods */
6517 d3d10_effect_rasterizer_variable_GetRasterizerState,
6518 d3d10_effect_rasterizer_variable_GetBackingStore,
6521 /* ID3D10EffectVariable methods */
6523 static BOOL STDMETHODCALLTYPE d3d10_effect_sampler_variable_IsValid(ID3D10EffectSamplerVariable *iface)
6525 TRACE("iface %p\n", iface);
6527 return (struct d3d10_effect_variable *)iface != &null_sampler_variable;
6530 static struct ID3D10EffectType * STDMETHODCALLTYPE d3d10_effect_sampler_variable_GetType(
6531 ID3D10EffectSamplerVariable *iface)
6533 return d3d10_effect_variable_GetType((ID3D10EffectVariable *)iface);
6536 static HRESULT STDMETHODCALLTYPE d3d10_effect_sampler_variable_GetDesc(ID3D10EffectSamplerVariable *iface,
6537 D3D10_EFFECT_VARIABLE_DESC *desc)
6539 return d3d10_effect_variable_GetDesc((ID3D10EffectVariable *)iface, desc);
6542 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_sampler_variable_GetAnnotationByIndex(
6543 ID3D10EffectSamplerVariable *iface, UINT index)
6545 return d3d10_effect_variable_GetAnnotationByIndex((ID3D10EffectVariable *)iface, index);
6548 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_sampler_variable_GetAnnotationByName(
6549 ID3D10EffectSamplerVariable *iface, LPCSTR name)
6551 return d3d10_effect_variable_GetAnnotationByName((ID3D10EffectVariable *)iface, name);
6554 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_sampler_variable_GetMemberByIndex(
6555 ID3D10EffectSamplerVariable *iface, UINT index)
6557 return d3d10_effect_variable_GetMemberByIndex((ID3D10EffectVariable *)iface, index);
6560 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_sampler_variable_GetMemberByName(
6561 ID3D10EffectSamplerVariable *iface, LPCSTR name)
6563 return d3d10_effect_variable_GetMemberByName((ID3D10EffectVariable *)iface, name);
6566 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_sampler_variable_GetMemberBySemantic(
6567 ID3D10EffectSamplerVariable *iface, LPCSTR semantic)
6569 return d3d10_effect_variable_GetMemberBySemantic((ID3D10EffectVariable *)iface, semantic);
6572 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_sampler_variable_GetElement(
6573 ID3D10EffectSamplerVariable *iface, UINT index)
6575 return d3d10_effect_variable_GetElement((ID3D10EffectVariable *)iface, index);
6578 static struct ID3D10EffectConstantBuffer * STDMETHODCALLTYPE d3d10_effect_sampler_variable_GetParentConstantBuffer(
6579 ID3D10EffectSamplerVariable *iface)
6581 return d3d10_effect_variable_GetParentConstantBuffer((ID3D10EffectVariable *)iface);
6584 static struct ID3D10EffectScalarVariable * STDMETHODCALLTYPE d3d10_effect_sampler_variable_AsScalar(
6585 ID3D10EffectSamplerVariable *iface)
6587 return d3d10_effect_variable_AsScalar((ID3D10EffectVariable *)iface);
6590 static struct ID3D10EffectVectorVariable * STDMETHODCALLTYPE d3d10_effect_sampler_variable_AsVector(
6591 ID3D10EffectSamplerVariable *iface)
6593 return d3d10_effect_variable_AsVector((ID3D10EffectVariable *)iface);
6596 static struct ID3D10EffectMatrixVariable * STDMETHODCALLTYPE d3d10_effect_sampler_variable_AsMatrix(
6597 ID3D10EffectSamplerVariable *iface)
6599 return d3d10_effect_variable_AsMatrix((ID3D10EffectVariable *)iface);
6602 static struct ID3D10EffectStringVariable * STDMETHODCALLTYPE d3d10_effect_sampler_variable_AsString(
6603 ID3D10EffectSamplerVariable *iface)
6605 return d3d10_effect_variable_AsString((ID3D10EffectVariable *)iface);
6608 static struct ID3D10EffectShaderResourceVariable * STDMETHODCALLTYPE d3d10_effect_sampler_variable_AsShaderResource(
6609 ID3D10EffectSamplerVariable *iface)
6611 return d3d10_effect_variable_AsShaderResource((ID3D10EffectVariable *)iface);
6614 static struct ID3D10EffectRenderTargetViewVariable * STDMETHODCALLTYPE d3d10_effect_sampler_variable_AsRenderTargetView(
6615 ID3D10EffectSamplerVariable *iface)
6617 return d3d10_effect_variable_AsRenderTargetView((ID3D10EffectVariable *)iface);
6620 static struct ID3D10EffectDepthStencilViewVariable * STDMETHODCALLTYPE d3d10_effect_sampler_variable_AsDepthStencilView(
6621 ID3D10EffectSamplerVariable *iface)
6623 return d3d10_effect_variable_AsDepthStencilView((ID3D10EffectVariable *)iface);
6626 static struct ID3D10EffectConstantBuffer * STDMETHODCALLTYPE d3d10_effect_sampler_variable_AsConstantBuffer(
6627 ID3D10EffectSamplerVariable *iface)
6629 return d3d10_effect_variable_AsConstantBuffer((ID3D10EffectVariable *)iface);
6632 static struct ID3D10EffectShaderVariable * STDMETHODCALLTYPE d3d10_effect_sampler_variable_AsShader(
6633 ID3D10EffectSamplerVariable *iface)
6635 return d3d10_effect_variable_AsShader((ID3D10EffectVariable *)iface);
6638 static struct ID3D10EffectBlendVariable * STDMETHODCALLTYPE d3d10_effect_sampler_variable_AsBlend(
6639 ID3D10EffectSamplerVariable *iface)
6641 return d3d10_effect_variable_AsBlend((ID3D10EffectVariable *)iface);
6644 static struct ID3D10EffectDepthStencilVariable * STDMETHODCALLTYPE d3d10_effect_sampler_variable_AsDepthStencil(
6645 ID3D10EffectSamplerVariable *iface)
6647 return d3d10_effect_variable_AsDepthStencil((ID3D10EffectVariable *)iface);
6650 static struct ID3D10EffectRasterizerVariable * STDMETHODCALLTYPE d3d10_effect_sampler_variable_AsRasterizer(
6651 ID3D10EffectSamplerVariable *iface)
6653 return d3d10_effect_variable_AsRasterizer((ID3D10EffectVariable *)iface);
6656 static struct ID3D10EffectSamplerVariable * STDMETHODCALLTYPE d3d10_effect_sampler_variable_AsSampler(
6657 ID3D10EffectSamplerVariable *iface)
6659 return d3d10_effect_variable_AsSampler((ID3D10EffectVariable *)iface);
6662 static HRESULT STDMETHODCALLTYPE d3d10_effect_sampler_variable_SetRawValue(ID3D10EffectSamplerVariable *iface,
6663 void *data, UINT offset, UINT count)
6665 return d3d10_effect_variable_SetRawValue((ID3D10EffectVariable *)iface, data, offset, count);
6668 static HRESULT STDMETHODCALLTYPE d3d10_effect_sampler_variable_GetRawValue(ID3D10EffectSamplerVariable *iface,
6669 void *data, UINT offset, UINT count)
6671 return d3d10_effect_variable_GetRawValue((ID3D10EffectVariable *)iface, data, offset, count);
6674 /* ID3D10EffectSamplerVariable methods */
6676 static HRESULT STDMETHODCALLTYPE d3d10_effect_sampler_variable_GetSampler(ID3D10EffectSamplerVariable *iface,
6677 UINT index, ID3D10SamplerState **sampler)
6679 FIXME("iface %p, index %u, sampler %p stub!\n", iface, index, sampler);
6684 static HRESULT STDMETHODCALLTYPE d3d10_effect_sampler_variable_GetBackingStore(ID3D10EffectSamplerVariable *iface,
6685 UINT index, D3D10_SAMPLER_DESC *desc)
6687 struct d3d10_effect_variable *v = impl_from_ID3D10EffectVariable((ID3D10EffectVariable *)iface);
6688 struct d3d10_effect_state_object_variable *s;
6690 TRACE("iface %p, index %u, desc %p.\n", iface, index, desc);
6692 if (v->type->element_count)
6693 v = impl_from_ID3D10EffectVariable(iface->lpVtbl->GetElement(iface, index));
6695 if (v->type->basetype != D3D10_SVT_SAMPLER)
6697 WARN("Variable is not a sampler state.\n");
6702 *desc = s->desc.sampler;
6708 static const struct ID3D10EffectSamplerVariableVtbl d3d10_effect_sampler_variable_vtbl =
6710 /* ID3D10EffectVariable methods */
6711 d3d10_effect_sampler_variable_IsValid,
6712 d3d10_effect_sampler_variable_GetType,
6713 d3d10_effect_sampler_variable_GetDesc,
6714 d3d10_effect_sampler_variable_GetAnnotationByIndex,
6715 d3d10_effect_sampler_variable_GetAnnotationByName,
6716 d3d10_effect_sampler_variable_GetMemberByIndex,
6717 d3d10_effect_sampler_variable_GetMemberByName,
6718 d3d10_effect_sampler_variable_GetMemberBySemantic,
6719 d3d10_effect_sampler_variable_GetElement,
6720 d3d10_effect_sampler_variable_GetParentConstantBuffer,
6721 d3d10_effect_sampler_variable_AsScalar,
6722 d3d10_effect_sampler_variable_AsVector,
6723 d3d10_effect_sampler_variable_AsMatrix,
6724 d3d10_effect_sampler_variable_AsString,
6725 d3d10_effect_sampler_variable_AsShaderResource,
6726 d3d10_effect_sampler_variable_AsRenderTargetView,
6727 d3d10_effect_sampler_variable_AsDepthStencilView,
6728 d3d10_effect_sampler_variable_AsConstantBuffer,
6729 d3d10_effect_sampler_variable_AsShader,
6730 d3d10_effect_sampler_variable_AsBlend,
6731 d3d10_effect_sampler_variable_AsDepthStencil,
6732 d3d10_effect_sampler_variable_AsRasterizer,
6733 d3d10_effect_sampler_variable_AsSampler,
6734 d3d10_effect_sampler_variable_SetRawValue,
6735 d3d10_effect_sampler_variable_GetRawValue,
6736 /* ID3D10EffectSamplerVariable methods */
6737 d3d10_effect_sampler_variable_GetSampler,
6738 d3d10_effect_sampler_variable_GetBackingStore,
6741 /* ID3D10EffectType methods */
6743 static inline struct d3d10_effect_type *impl_from_ID3D10EffectType(ID3D10EffectType *iface)
6745 return CONTAINING_RECORD(iface, struct d3d10_effect_type, ID3D10EffectType_iface);
6748 static BOOL STDMETHODCALLTYPE d3d10_effect_type_IsValid(ID3D10EffectType *iface)
6750 struct d3d10_effect_type *This = impl_from_ID3D10EffectType(iface);
6752 TRACE("iface %p\n", iface);
6754 return This != &null_type;
6757 static HRESULT STDMETHODCALLTYPE d3d10_effect_type_GetDesc(ID3D10EffectType *iface, D3D10_EFFECT_TYPE_DESC *desc)
6759 struct d3d10_effect_type *This = impl_from_ID3D10EffectType(iface);
6761 TRACE("iface %p, desc %p\n", iface, desc);
6763 if (This == &null_type)
6765 WARN("Null type specified\n");
6771 WARN("Invalid argument specified\n");
6772 return E_INVALIDARG;
6775 desc->TypeName = This->name;
6776 desc->Class = This->type_class;
6777 desc->Type = This->basetype;
6778 desc->Elements = This->element_count;
6779 desc->Members = This->member_count;
6780 desc->Rows = This->row_count;
6781 desc->Columns = This->column_count;
6782 desc->PackedSize = This->size_packed;
6783 desc->UnpackedSize = This->size_unpacked;
6784 desc->Stride = This->stride;
6789 static struct ID3D10EffectType * STDMETHODCALLTYPE d3d10_effect_type_GetMemberTypeByIndex(ID3D10EffectType *iface,
6792 struct d3d10_effect_type *This = impl_from_ID3D10EffectType(iface);
6793 struct d3d10_effect_type *t;
6795 TRACE("iface %p, index %u\n", iface, index);
6797 if (index >= This->member_count)
6799 WARN("Invalid index specified\n");
6800 return &null_type.ID3D10EffectType_iface;
6803 t = (&This->members[index])->type;
6805 TRACE("Returning member %p, %s\n", t, debugstr_a(t->name));
6807 return &t->ID3D10EffectType_iface;
6810 static struct ID3D10EffectType * STDMETHODCALLTYPE d3d10_effect_type_GetMemberTypeByName(ID3D10EffectType *iface,
6813 struct d3d10_effect_type *This = impl_from_ID3D10EffectType(iface);
6816 TRACE("iface %p, name %s\n", iface, debugstr_a(name));
6820 WARN("Invalid name specified\n");
6821 return &null_type.ID3D10EffectType_iface;
6824 for (i = 0; i < This->member_count; ++i)
6826 struct d3d10_effect_type_member *typem = &This->members[i];
6830 if (!strcmp(typem->name, name))
6832 TRACE("Returning type %p.\n", typem->type);
6833 return &typem->type->ID3D10EffectType_iface;
6838 WARN("Invalid name specified\n");
6840 return &null_type.ID3D10EffectType_iface;
6843 static struct ID3D10EffectType * STDMETHODCALLTYPE d3d10_effect_type_GetMemberTypeBySemantic(ID3D10EffectType *iface,
6846 struct d3d10_effect_type *This = impl_from_ID3D10EffectType(iface);
6849 TRACE("iface %p, semantic %s\n", iface, debugstr_a(semantic));
6853 WARN("Invalid semantic specified\n");
6854 return &null_type.ID3D10EffectType_iface;
6857 for (i = 0; i < This->member_count; ++i)
6859 struct d3d10_effect_type_member *typem = &This->members[i];
6861 if (typem->semantic)
6863 if (!strcmp(typem->semantic, semantic))
6865 TRACE("Returning type %p.\n", typem->type);
6866 return &typem->type->ID3D10EffectType_iface;
6871 WARN("Invalid semantic specified\n");
6873 return &null_type.ID3D10EffectType_iface;
6876 static LPCSTR STDMETHODCALLTYPE d3d10_effect_type_GetMemberName(ID3D10EffectType *iface, UINT index)
6878 struct d3d10_effect_type *This = impl_from_ID3D10EffectType(iface);
6879 struct d3d10_effect_type_member *typem;
6881 TRACE("iface %p, index %u\n", iface, index);
6883 if (index >= This->member_count)
6885 WARN("Invalid index specified\n");
6889 typem = &This->members[index];
6891 TRACE("Returning name %s\n", debugstr_a(typem->name));
6896 static LPCSTR STDMETHODCALLTYPE d3d10_effect_type_GetMemberSemantic(ID3D10EffectType *iface, UINT index)
6898 struct d3d10_effect_type *This = impl_from_ID3D10EffectType(iface);
6899 struct d3d10_effect_type_member *typem;
6901 TRACE("iface %p, index %u\n", iface, index);
6903 if (index >= This->member_count)
6905 WARN("Invalid index specified\n");
6909 typem = &This->members[index];
6911 TRACE("Returning semantic %s\n", debugstr_a(typem->semantic));
6913 return typem->semantic;
6916 static const struct ID3D10EffectTypeVtbl d3d10_effect_type_vtbl =
6918 /* ID3D10EffectType */
6919 d3d10_effect_type_IsValid,
6920 d3d10_effect_type_GetDesc,
6921 d3d10_effect_type_GetMemberTypeByIndex,
6922 d3d10_effect_type_GetMemberTypeByName,
6923 d3d10_effect_type_GetMemberTypeBySemantic,
6924 d3d10_effect_type_GetMemberName,
6925 d3d10_effect_type_GetMemberSemantic,