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(struct d3d10_effect_variable
*v
, const char *data
)
400 ID3D10Device
*device
= v
->effect
->device
;
401 struct d3d10_effect_shader_variable
*s
;
402 const char *ptr
= data
;
406 s
= HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY
, sizeof(*s
));
409 ERR("Failed to allocate shader variable memory\n");
410 return E_OUTOFMEMORY
;
415 if (v
->effect
->used_shader_current
>= v
->effect
->used_shader_count
)
417 WARN("Invalid shader? Used shader current(%u) >= used shader count(%u)\n", v
->effect
->used_shader_current
, v
->effect
->used_shader_count
);
421 v
->effect
->used_shaders
[v
->effect
->used_shader_current
] = v
;
422 ++v
->effect
->used_shader_current
;
424 if (!ptr
) return S_OK
;
426 read_dword(&ptr
, &dxbc_size
);
427 TRACE("dxbc size: %#x\n", dxbc_size
);
429 /* We got a shader VertexShader vs = NULL, so it is fine to skip this. */
430 if (!dxbc_size
) return S_OK
;
432 switch (v
->type
->basetype
)
434 case D3D10_SVT_VERTEXSHADER
:
435 hr
= ID3D10Device_CreateVertexShader(device
, ptr
, dxbc_size
, &s
->shader
.vs
);
436 if (FAILED(hr
)) return hr
;
439 case D3D10_SVT_PIXELSHADER
:
440 hr
= ID3D10Device_CreatePixelShader(device
, ptr
, dxbc_size
, &s
->shader
.ps
);
441 if (FAILED(hr
)) return hr
;
444 case D3D10_SVT_GEOMETRYSHADER
:
445 hr
= ID3D10Device_CreateGeometryShader(device
, ptr
, dxbc_size
, &s
->shader
.gs
);
446 if (FAILED(hr
)) return hr
;
450 ERR("This should not happen!\n");
454 return parse_dxbc(ptr
, dxbc_size
, shader_chunk_handler
, s
);
457 static D3D10_SHADER_VARIABLE_CLASS
d3d10_variable_class(DWORD c
, BOOL is_column_major
)
461 case 1: return D3D10_SVC_SCALAR
;
462 case 2: return D3D10_SVC_VECTOR
;
463 case 3: if (is_column_major
) return D3D10_SVC_MATRIX_COLUMNS
;
464 else return D3D10_SVC_MATRIX_ROWS
;
466 FIXME("Unknown variable class %#x.\n", c
);
471 static D3D10_SHADER_VARIABLE_TYPE
d3d10_variable_type(DWORD t
, BOOL is_object
)
477 case 1: return D3D10_SVT_STRING
;
478 case 2: return D3D10_SVT_BLEND
;
479 case 3: return D3D10_SVT_DEPTHSTENCIL
;
480 case 4: return D3D10_SVT_RASTERIZER
;
481 case 5: return D3D10_SVT_PIXELSHADER
;
482 case 6: return D3D10_SVT_VERTEXSHADER
;
483 case 7: return D3D10_SVT_GEOMETRYSHADER
;
485 case 10: return D3D10_SVT_TEXTURE1D
;
486 case 11: return D3D10_SVT_TEXTURE1DARRAY
;
487 case 12: return D3D10_SVT_TEXTURE2D
;
488 case 13: return D3D10_SVT_TEXTURE2DARRAY
;
489 case 14: return D3D10_SVT_TEXTURE2DMS
;
490 case 15: return D3D10_SVT_TEXTURE2DMSARRAY
;
491 case 16: return D3D10_SVT_TEXTURE3D
;
492 case 17: return D3D10_SVT_TEXTURECUBE
;
494 case 19: return D3D10_SVT_RENDERTARGETVIEW
;
495 case 20: return D3D10_SVT_DEPTHSTENCILVIEW
;
496 case 21: return D3D10_SVT_SAMPLER
;
497 case 22: return D3D10_SVT_BUFFER
;
499 FIXME("Unknown variable type %#x.\n", t
);
500 return D3D10_SVT_VOID
;
507 case 1: return D3D10_SVT_FLOAT
;
508 case 2: return D3D10_SVT_INT
;
509 case 3: return D3D10_SVT_UINT
;
510 case 4: return D3D10_SVT_BOOL
;
512 FIXME("Unknown variable type %#x.\n", t
);
513 return D3D10_SVT_VOID
;
518 static HRESULT
parse_fx10_type(struct d3d10_effect_type
*t
, const char *ptr
, const char *data
)
525 read_dword(&ptr
, &offset
);
526 TRACE("Type name at offset %#x.\n", offset
);
528 if (!copy_name(data
+ offset
, &t
->name
))
530 ERR("Failed to copy name.\n");
531 return E_OUTOFMEMORY
;
533 TRACE("Type name: %s.\n", debugstr_a(t
->name
));
535 read_dword(&ptr
, &unknown0
);
536 TRACE("Unknown 0: %u.\n", unknown0
);
538 read_dword(&ptr
, &t
->element_count
);
539 TRACE("Element count: %u.\n", t
->element_count
);
541 read_dword(&ptr
, &t
->size_unpacked
);
542 TRACE("Unpacked size: %#x.\n", t
->size_unpacked
);
544 read_dword(&ptr
, &t
->stride
);
545 TRACE("Stride: %#x.\n", t
->stride
);
547 read_dword(&ptr
, &t
->size_packed
);
548 TRACE("Packed size %#x.\n", t
->size_packed
);
555 read_dword(&ptr
, &typeinfo
);
556 t
->column_count
= (typeinfo
& D3D10_FX10_TYPE_COLUMN_MASK
) >> D3D10_FX10_TYPE_COLUMN_SHIFT
;
557 t
->row_count
= (typeinfo
& D3D10_FX10_TYPE_ROW_MASK
) >> D3D10_FX10_TYPE_ROW_SHIFT
;
558 t
->basetype
= d3d10_variable_type((typeinfo
& D3D10_FX10_TYPE_BASETYPE_MASK
) >> D3D10_FX10_TYPE_BASETYPE_SHIFT
, FALSE
);
559 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
);
561 TRACE("Type description: %#x.\n", typeinfo
);
562 TRACE("\tcolumns: %u.\n", t
->column_count
);
563 TRACE("\trows: %u.\n", t
->row_count
);
564 TRACE("\tbasetype: %s.\n", debug_d3d10_shader_variable_type(t
->basetype
));
565 TRACE("\tclass: %s.\n", debug_d3d10_shader_variable_class(t
->type_class
));
566 TRACE("\tunknown bits: %#x.\n", typeinfo
& ~(D3D10_FX10_TYPE_COLUMN_MASK
| D3D10_FX10_TYPE_ROW_MASK
567 | D3D10_FX10_TYPE_BASETYPE_MASK
| D3D10_FX10_TYPE_CLASS_MASK
| D3D10_FX10_TYPE_MATRIX_COLUMN_MAJOR_MASK
));
571 TRACE("Type is an object.\n");
576 t
->type_class
= D3D10_SVC_OBJECT
;
578 read_dword(&ptr
, &typeinfo
);
579 t
->basetype
= d3d10_variable_type(typeinfo
, TRUE
);
581 TRACE("Type description: %#x.\n", typeinfo
);
582 TRACE("\tbasetype: %s.\n", debug_d3d10_shader_variable_type(t
->basetype
));
583 TRACE("\tclass: %s.\n", debug_d3d10_shader_variable_class(t
->type_class
));
587 TRACE("Type is a structure.\n");
589 read_dword(&ptr
, &t
->member_count
);
590 TRACE("Member count: %u.\n", t
->member_count
);
595 t
->type_class
= D3D10_SVC_STRUCT
;
597 t
->members
= HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY
, t
->member_count
* sizeof(*t
->members
));
600 ERR("Failed to allocate members memory.\n");
601 return E_OUTOFMEMORY
;
604 for (i
= 0; i
< t
->member_count
; ++i
)
606 struct d3d10_effect_type_member
*typem
= &t
->members
[i
];
608 read_dword(&ptr
, &offset
);
609 TRACE("Member name at offset %#x.\n", offset
);
611 if (!copy_name(data
+ offset
, &typem
->name
))
613 ERR("Failed to copy name.\n");
614 return E_OUTOFMEMORY
;
616 TRACE("Member name: %s.\n", debugstr_a(typem
->name
));
618 read_dword(&ptr
, &offset
);
619 TRACE("Member semantic at offset %#x.\n", offset
);
621 if (!copy_name(data
+ offset
, &typem
->semantic
))
623 ERR("Failed to copy semantic.\n");
624 return E_OUTOFMEMORY
;
626 TRACE("Member semantic: %s.\n", debugstr_a(typem
->semantic
));
628 read_dword(&ptr
, &typem
->buffer_offset
);
629 TRACE("Member offset in struct: %#x.\n", typem
->buffer_offset
);
631 read_dword(&ptr
, &offset
);
632 TRACE("Member type info at offset %#x.\n", offset
);
634 typem
->type
= get_fx10_type(t
->effect
, data
, offset
);
637 ERR("Failed to get variable type.\n");
644 FIXME("Unhandled case %#x.\n", unknown0
);
648 if (t
->element_count
)
650 TRACE("Elementtype for type at offset: %#x\n", t
->id
);
652 /* allocate elementtype - we need only one, because all elements have the same type */
653 t
->elementtype
= HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY
, sizeof(*t
->elementtype
));
656 ERR("Failed to allocate members memory.\n");
657 return E_OUTOFMEMORY
;
660 /* create a copy of the original type with some minor changes */
661 t
->elementtype
->ID3D10EffectType_iface
.lpVtbl
= &d3d10_effect_type_vtbl
;
662 t
->elementtype
->effect
= t
->effect
;
664 if (!copy_name(t
->name
, &t
->elementtype
->name
))
666 ERR("Failed to copy name.\n");
667 return E_OUTOFMEMORY
;
669 TRACE("\tType name: %s.\n", debugstr_a(t
->elementtype
->name
));
671 t
->elementtype
->element_count
= 0;
672 TRACE("\tElement count: %u.\n", t
->elementtype
->element_count
);
675 * Not sure if this calculation is 100% correct, but a test
676 * shows that these values work.
678 t
->elementtype
->size_unpacked
= t
->size_packed
/ t
->element_count
;
679 TRACE("\tUnpacked size: %#x.\n", t
->elementtype
->size_unpacked
);
681 t
->elementtype
->stride
= t
->stride
;
682 TRACE("\tStride: %#x.\n", t
->elementtype
->stride
);
684 t
->elementtype
->size_packed
= t
->size_packed
/ t
->element_count
;
685 TRACE("\tPacked size: %#x.\n", t
->elementtype
->size_packed
);
687 t
->elementtype
->member_count
= t
->member_count
;
688 TRACE("\tMember count: %u.\n", t
->elementtype
->member_count
);
690 t
->elementtype
->column_count
= t
->column_count
;
691 TRACE("\tColumns: %u.\n", t
->elementtype
->column_count
);
693 t
->elementtype
->row_count
= t
->row_count
;
694 TRACE("\tRows: %u.\n", t
->elementtype
->row_count
);
696 t
->elementtype
->basetype
= t
->basetype
;
697 TRACE("\tBasetype: %s.\n", debug_d3d10_shader_variable_type(t
->elementtype
->basetype
));
699 t
->elementtype
->type_class
= t
->type_class
;
700 TRACE("\tClass: %s.\n", debug_d3d10_shader_variable_class(t
->elementtype
->type_class
));
702 t
->elementtype
->members
= t
->members
;
708 static struct d3d10_effect_type
*get_fx10_type(struct d3d10_effect
*effect
, const char *data
, DWORD offset
)
710 struct d3d10_effect_type
*type
;
711 struct wine_rb_entry
*entry
;
714 entry
= wine_rb_get(&effect
->types
, &offset
);
717 TRACE("Returning existing type.\n");
718 return WINE_RB_ENTRY_VALUE(entry
, struct d3d10_effect_type
, entry
);
721 type
= HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY
, sizeof(*type
));
724 ERR("Failed to allocate type memory.\n");
728 type
->ID3D10EffectType_iface
.lpVtbl
= &d3d10_effect_type_vtbl
;
730 type
->effect
= effect
;
731 hr
= parse_fx10_type(type
, data
+ offset
, data
);
734 ERR("Failed to parse type info, hr %#x.\n", hr
);
735 HeapFree(GetProcessHeap(), 0, type
);
739 if (wine_rb_put(&effect
->types
, &offset
, &type
->entry
) == -1)
741 ERR("Failed to insert type entry.\n");
742 HeapFree(GetProcessHeap(), 0, type
);
749 static void set_variable_vtbl(struct d3d10_effect_variable
*v
)
751 const ID3D10EffectVariableVtbl
**vtbl
= &v
->ID3D10EffectVariable_iface
.lpVtbl
;
753 switch (v
->type
->type_class
)
755 case D3D10_SVC_SCALAR
:
756 *vtbl
= (const ID3D10EffectVariableVtbl
*)&d3d10_effect_scalar_variable_vtbl
;
759 case D3D10_SVC_VECTOR
:
760 *vtbl
= (const ID3D10EffectVariableVtbl
*)&d3d10_effect_vector_variable_vtbl
;
763 case D3D10_SVC_MATRIX_ROWS
:
764 case D3D10_SVC_MATRIX_COLUMNS
:
765 *vtbl
= (const ID3D10EffectVariableVtbl
*)&d3d10_effect_matrix_variable_vtbl
;
768 case D3D10_SVC_STRUCT
:
769 *vtbl
= &d3d10_effect_variable_vtbl
;
772 case D3D10_SVC_OBJECT
:
773 switch(v
->type
->basetype
)
775 case D3D10_SVT_STRING
:
776 *vtbl
= (const ID3D10EffectVariableVtbl
*)&d3d10_effect_string_variable_vtbl
;
779 case D3D10_SVT_TEXTURE1D
:
780 case D3D10_SVT_TEXTURE1DARRAY
:
781 case D3D10_SVT_TEXTURE2D
:
782 case D3D10_SVT_TEXTURE2DARRAY
:
783 case D3D10_SVT_TEXTURE2DMS
:
784 case D3D10_SVT_TEXTURE2DMSARRAY
:
785 case D3D10_SVT_TEXTURE3D
:
786 case D3D10_SVT_TEXTURECUBE
:
787 case D3D10_SVT_BUFFER
: /* Either resource or constant buffer. */
788 *vtbl
= (const ID3D10EffectVariableVtbl
*)&d3d10_effect_shader_resource_variable_vtbl
;
791 case D3D10_SVT_RENDERTARGETVIEW
:
792 *vtbl
= (const ID3D10EffectVariableVtbl
*)&d3d10_effect_render_target_view_variable_vtbl
;
795 case D3D10_SVT_DEPTHSTENCILVIEW
:
796 *vtbl
= (const ID3D10EffectVariableVtbl
*)&d3d10_effect_depth_stencil_view_variable_vtbl
;
799 case D3D10_SVT_DEPTHSTENCIL
:
800 *vtbl
= (const ID3D10EffectVariableVtbl
*)&d3d10_effect_depth_stencil_variable_vtbl
;
803 case D3D10_SVT_VERTEXSHADER
:
804 case D3D10_SVT_GEOMETRYSHADER
:
805 case D3D10_SVT_PIXELSHADER
:
806 *vtbl
= (const ID3D10EffectVariableVtbl
*)&d3d10_effect_shader_variable_vtbl
;
809 case D3D10_SVT_BLEND
:
810 *vtbl
= (const ID3D10EffectVariableVtbl
*)&d3d10_effect_blend_variable_vtbl
;
813 case D3D10_SVT_RASTERIZER
:
814 *vtbl
= (const ID3D10EffectVariableVtbl
*)&d3d10_effect_rasterizer_variable_vtbl
;
817 case D3D10_SVT_SAMPLER
:
818 *vtbl
= (const ID3D10EffectVariableVtbl
*)&d3d10_effect_sampler_variable_vtbl
;
822 FIXME("Unhandled basetype %s.\n", debug_d3d10_shader_variable_type(v
->type
->basetype
));
823 *vtbl
= &d3d10_effect_variable_vtbl
;
829 FIXME("Unhandled type class %s.\n", debug_d3d10_shader_variable_class(v
->type
->type_class
));
830 *vtbl
= &d3d10_effect_variable_vtbl
;
835 static HRESULT
copy_variableinfo_from_type(struct d3d10_effect_variable
*v
)
840 if (v
->type
->member_count
)
842 v
->members
= HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY
, v
->type
->member_count
* sizeof(*v
->members
));
845 ERR("Failed to allocate members memory.\n");
846 return E_OUTOFMEMORY
;
849 for (i
= 0; i
< v
->type
->member_count
; ++i
)
851 struct d3d10_effect_variable
*var
= &v
->members
[i
];
852 struct d3d10_effect_type_member
*typem
= &v
->type
->members
[i
];
854 var
->buffer
= v
->buffer
;
855 var
->effect
= v
->effect
;
856 var
->type
= typem
->type
;
857 set_variable_vtbl(var
);
859 if (!copy_name(typem
->name
, &var
->name
))
861 ERR("Failed to copy name.\n");
862 return E_OUTOFMEMORY
;
864 TRACE("Variable name: %s.\n", debugstr_a(var
->name
));
866 if (!copy_name(typem
->semantic
, &var
->semantic
))
868 ERR("Failed to copy name.\n");
869 return E_OUTOFMEMORY
;
871 TRACE("Variable semantic: %s.\n", debugstr_a(var
->semantic
));
873 var
->buffer_offset
= v
->buffer_offset
+ typem
->buffer_offset
;
874 TRACE("Variable buffer offset: %u.\n", var
->buffer_offset
);
876 hr
= copy_variableinfo_from_type(var
);
877 if (FAILED(hr
)) return hr
;
881 if (v
->type
->element_count
)
883 unsigned int bufferoffset
= v
->buffer_offset
;
885 v
->elements
= HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY
, v
->type
->element_count
* sizeof(*v
->elements
));
888 ERR("Failed to allocate elements memory.\n");
889 return E_OUTOFMEMORY
;
892 for (i
= 0; i
< v
->type
->element_count
; ++i
)
894 struct d3d10_effect_variable
*var
= &v
->elements
[i
];
896 var
->buffer
= v
->buffer
;
897 var
->effect
= v
->effect
;
898 var
->type
= v
->type
->elementtype
;
899 set_variable_vtbl(var
);
901 if (!copy_name(v
->name
, &var
->name
))
903 ERR("Failed to copy name.\n");
904 return E_OUTOFMEMORY
;
906 TRACE("Variable name: %s.\n", debugstr_a(var
->name
));
908 if (!copy_name(v
->semantic
, &var
->semantic
))
910 ERR("Failed to copy name.\n");
911 return E_OUTOFMEMORY
;
913 TRACE("Variable semantic: %s.\n", debugstr_a(var
->semantic
));
917 bufferoffset
+= v
->type
->stride
;
919 var
->buffer_offset
= bufferoffset
;
920 TRACE("Variable buffer offset: %u.\n", var
->buffer_offset
);
922 hr
= copy_variableinfo_from_type(var
);
923 if (FAILED(hr
)) return hr
;
930 static HRESULT
parse_fx10_variable_head(struct d3d10_effect_variable
*v
, const char **ptr
, const char *data
)
934 read_dword(ptr
, &offset
);
935 TRACE("Variable name at offset %#x.\n", offset
);
937 if (!copy_name(data
+ offset
, &v
->name
))
939 ERR("Failed to copy name.\n");
940 return E_OUTOFMEMORY
;
942 TRACE("Variable name: %s.\n", debugstr_a(v
->name
));
944 read_dword(ptr
, &offset
);
945 TRACE("Variable type info at offset %#x.\n", offset
);
947 v
->type
= get_fx10_type(v
->effect
, data
, offset
);
950 ERR("Failed to get variable type.\n");
953 set_variable_vtbl(v
);
955 return copy_variableinfo_from_type(v
);
958 static HRESULT
parse_fx10_annotation(struct d3d10_effect_variable
*a
, const char **ptr
, const char *data
)
962 hr
= parse_fx10_variable_head(a
, ptr
, data
);
963 if (FAILED(hr
)) return hr
;
965 skip_dword_unknown("annotation", ptr
, 1);
967 /* mark the variable as annotation */
968 a
->flag
= D3D10_EFFECT_VARIABLE_ANNOTATION
;
973 static HRESULT
parse_fx10_anonymous_shader(struct d3d10_effect
*e
, struct d3d10_effect_anonymous_shader
*s
,
974 enum d3d10_effect_object_type otype
)
976 struct d3d10_effect_variable
*v
= &s
->shader
;
977 struct d3d10_effect_type
*t
= &s
->type
;
978 const char *shader
= NULL
;
982 case D3D10_EOT_VERTEXSHADER
:
983 shader
= "vertexshader";
984 t
->basetype
= D3D10_SVT_VERTEXSHADER
;
987 case D3D10_EOT_PIXELSHADER
:
988 shader
= "pixelshader";
989 t
->basetype
= D3D10_SVT_PIXELSHADER
;
992 case D3D10_EOT_GEOMETRYSHADER
:
993 shader
= "geometryshader";
994 t
->basetype
= D3D10_SVT_GEOMETRYSHADER
;
998 FIXME("Unhandled object type %#x.\n", otype
);
1002 if (!copy_name(shader
, &t
->name
))
1004 ERR("Failed to copy name.\n");
1005 return E_OUTOFMEMORY
;
1007 TRACE("Type name: %s.\n", debugstr_a(t
->name
));
1009 t
->type_class
= D3D10_SVC_OBJECT
;
1011 t
->ID3D10EffectType_iface
.lpVtbl
= &d3d10_effect_type_vtbl
;
1015 set_variable_vtbl(v
);
1017 if (!copy_name("$Anonymous", &v
->name
))
1019 ERR("Failed to copy semantic.\n");
1020 return E_OUTOFMEMORY
;
1022 TRACE("Variable name: %s.\n", debugstr_a(v
->name
));
1024 if (!copy_name(NULL
, &v
->semantic
))
1026 ERR("Failed to copy semantic.\n");
1027 return E_OUTOFMEMORY
;
1029 TRACE("Variable semantic: %s.\n", debugstr_a(v
->semantic
));
1034 static const struct d3d10_effect_state_property_info
*get_property_info(UINT id
)
1038 for (i
= 0; i
< sizeof(property_info
) / sizeof(*property_info
); ++i
)
1040 if (property_info
[i
].id
== id
)
1041 return &property_info
[i
];
1047 static const struct d3d10_effect_state_storage_info
*get_storage_info(D3D_SHADER_VARIABLE_TYPE id
)
1051 for (i
= 0; i
< sizeof(d3d10_effect_state_storage_info
) / sizeof(*d3d10_effect_state_storage_info
); ++i
)
1053 if (d3d10_effect_state_storage_info
[i
].id
== id
)
1054 return &d3d10_effect_state_storage_info
[i
];
1060 static BOOL
read_float_value(DWORD value
, D3D_SHADER_VARIABLE_TYPE in_type
, float *out_data
, UINT idx
)
1064 case D3D10_SVT_FLOAT
:
1065 out_data
[idx
] = *(float *)&value
;
1069 out_data
[idx
] = (INT
)value
;
1073 FIXME("Unhandled in_type %#x.\n", in_type
);
1078 static BOOL
read_int32_value(DWORD value
, D3D_SHADER_VARIABLE_TYPE in_type
, INT
*out_data
, UINT idx
)
1082 case D3D10_SVT_FLOAT
:
1083 out_data
[idx
] = *(float *)&value
;
1087 case D3D10_SVT_BOOL
:
1088 out_data
[idx
] = value
;
1092 FIXME("Unhandled in_type %#x.\n", in_type
);
1097 static BOOL
read_int8_value(DWORD value
, D3D_SHADER_VARIABLE_TYPE in_type
, INT8
*out_data
, UINT idx
)
1102 out_data
[idx
] = value
;
1106 FIXME("Unhandled in_type %#x.\n", in_type
);
1111 static BOOL
read_value_list(const char *ptr
, D3D_SHADER_VARIABLE_TYPE out_type
,
1112 UINT out_base
, UINT out_size
, void *out_data
)
1114 D3D_SHADER_VARIABLE_TYPE in_type
;
1118 read_dword(&ptr
, &count
);
1119 if (count
!= out_size
)
1122 TRACE("%u values:\n", count
);
1123 for (i
= 0; i
< count
; ++i
)
1125 UINT out_idx
= out_base
* out_size
+ i
;
1127 read_dword(&ptr
, &t
);
1128 read_dword(&ptr
, &value
);
1130 in_type
= d3d10_variable_type(t
, FALSE
);
1131 TRACE("\t%s: %#x.\n", debug_d3d10_shader_variable_type(in_type
), value
);
1135 case D3D10_SVT_FLOAT
:
1136 if (!read_float_value(value
, in_type
, out_data
, out_idx
))
1141 case D3D10_SVT_UINT
:
1142 case D3D10_SVT_BOOL
:
1143 if (!read_int32_value(value
, in_type
, out_data
, out_idx
))
1147 case D3D10_SVT_UINT8
:
1148 if (!read_int8_value(value
, in_type
, out_data
, out_idx
))
1153 FIXME("Unhandled out_type %#x.\n", out_type
);
1161 static BOOL
parse_fx10_state_group(const char **ptr
, const char *data
,
1162 D3D_SHADER_VARIABLE_TYPE container_type
, void *container
)
1164 const struct d3d10_effect_state_property_info
*property_info
;
1171 read_dword(ptr
, &count
);
1172 TRACE("Property count: %#x.\n", count
);
1174 for (i
= 0; i
< count
; ++i
)
1176 read_dword(ptr
, &id
);
1177 read_dword(ptr
, &idx
);
1178 skip_dword_unknown("read property", ptr
, 1);
1179 read_dword(ptr
, &value_offset
);
1181 if (!(property_info
= get_property_info(id
)))
1183 FIXME("Failed to find property info for property %#x.\n", id
);
1187 TRACE("Property %s[%#x] = value list @ offset %#x.\n",
1188 property_info
->name
, idx
, value_offset
);
1190 if (property_info
->container_type
!= container_type
)
1196 if (idx
>= property_info
->count
)
1202 if (!read_value_list(data
+ value_offset
, property_info
->type
, idx
,
1203 property_info
->size
, (char *)container
+ property_info
->offset
))
1213 static HRESULT
parse_fx10_object(struct d3d10_effect_object
*o
, const char **ptr
, const char *data
)
1215 const char *data_ptr
= NULL
;
1217 enum d3d10_effect_object_operation operation
;
1219 struct d3d10_effect
*effect
= o
->pass
->technique
->effect
;
1220 ID3D10Effect
*e
= &effect
->ID3D10Effect_iface
;
1222 read_dword(ptr
, &o
->type
);
1223 TRACE("Effect object is of type %#x.\n", o
->type
);
1225 read_dword(ptr
, &o
->index
);
1226 TRACE("Effect object index %#x.\n", o
->index
);
1228 read_dword(ptr
, &operation
);
1229 TRACE("Effect object operation %#x.\n", operation
);
1231 read_dword(ptr
, &offset
);
1232 TRACE("Effect object idx is at offset %#x.\n", offset
);
1236 case D3D10_EOO_VALUE
:
1237 TRACE("Copy variable values\n");
1241 case D3D10_EOT_VERTEXSHADER
:
1242 TRACE("Vertex shader\n");
1243 o
->data
= &anonymous_vs
;
1247 case D3D10_EOT_PIXELSHADER
:
1248 TRACE("Pixel shader\n");
1249 o
->data
= &anonymous_ps
;
1253 case D3D10_EOT_GEOMETRYSHADER
:
1254 TRACE("Geometry shader\n");
1255 o
->data
= &anonymous_gs
;
1259 case D3D10_EOT_STENCIL_REF
:
1260 if (!read_value_list(data
+ offset
, D3D10_SVT_UINT
, 0, 1, &o
->pass
->stencil_ref
))
1262 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");
1279 case D3D10_EOT_BLEND_FACTOR
:
1280 if (!read_value_list(data
+ offset
, D3D10_SVT_FLOAT
, 0, 4, &o
->pass
->blend_factor
[0]))
1282 FIXME("Failed to read blend factor.\n");
1290 FIXME("Unhandled object type %#x\n", o
->type
);
1296 case D3D10_EOO_PARSED_OBJECT
:
1297 /* This is a local object, we've parsed in parse_fx10_local_object. */
1298 TRACE("Shader = %s.\n", data
+ offset
);
1300 o
->data
= e
->lpVtbl
->GetVariableByName(e
, data
+ offset
);
1304 case D3D10_EOO_PARSED_OBJECT_INDEX
:
1305 /* This is a local object, we've parsed in parse_fx10_local_object, which has an array index. */
1306 data_ptr
= data
+ offset
;
1307 read_dword(&data_ptr
, &offset
);
1308 read_dword(&data_ptr
, &o
->index
);
1309 TRACE("Shader = %s[%u].\n", data
+ offset
, o
->index
);
1311 o
->data
= e
->lpVtbl
->GetVariableByName(e
, data
+ offset
);
1315 case D3D10_EOO_ANONYMOUS_SHADER
:
1316 TRACE("Anonymous shader\n");
1318 /* check anonymous_shader_current for validity */
1319 if (effect
->anonymous_shader_current
>= effect
->anonymous_shader_count
)
1321 ERR("Anonymous shader count is wrong!\n");
1325 data_ptr
= data
+ offset
;
1326 read_dword(&data_ptr
, &offset
);
1327 TRACE("Effect object starts at offset %#x.\n", offset
);
1329 data_ptr
= data
+ offset
;
1331 hr
= parse_fx10_anonymous_shader(effect
, &effect
->anonymous_shaders
[effect
->anonymous_shader_current
], o
->type
);
1332 if (FAILED(hr
)) return hr
;
1334 o
->data
= &effect
->anonymous_shaders
[effect
->anonymous_shader_current
].shader
;
1335 ++effect
->anonymous_shader_current
;
1339 case D3D10_EOT_VERTEXSHADER
:
1340 TRACE("Vertex shader\n");
1341 hr
= parse_shader(o
->data
, data_ptr
);
1344 case D3D10_EOT_PIXELSHADER
:
1345 TRACE("Pixel shader\n");
1346 hr
= parse_shader(o
->data
, data_ptr
);
1349 case D3D10_EOT_GEOMETRYSHADER
:
1350 TRACE("Geometry shader\n");
1351 hr
= parse_shader(o
->data
, data_ptr
);
1355 FIXME("Unhandled object type %#x\n", o
->type
);
1363 FIXME("Unhandled operation %#x.\n", operation
);
1370 static HRESULT
parse_fx10_pass(struct d3d10_effect_pass
*p
, const char **ptr
, const char *data
)
1376 read_dword(ptr
, &offset
);
1377 TRACE("Pass name at offset %#x.\n", offset
);
1379 if (!copy_name(data
+ offset
, &p
->name
))
1381 ERR("Failed to copy name.\n");
1382 return E_OUTOFMEMORY
;
1384 TRACE("Pass name: %s.\n", debugstr_a(p
->name
));
1386 read_dword(ptr
, &p
->object_count
);
1387 TRACE("Pass has %u effect objects.\n", p
->object_count
);
1389 read_dword(ptr
, &p
->annotation_count
);
1390 TRACE("Pass has %u annotations.\n", p
->annotation_count
);
1392 p
->annotations
= HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY
, p
->annotation_count
* sizeof(*p
->annotations
));
1393 if (!p
->annotations
)
1395 ERR("Failed to allocate pass annotations memory.\n");
1396 return E_OUTOFMEMORY
;
1399 for (i
= 0; i
< p
->annotation_count
; ++i
)
1401 struct d3d10_effect_variable
*a
= &p
->annotations
[i
];
1403 a
->effect
= p
->technique
->effect
;
1404 a
->buffer
= &null_local_buffer
;
1406 hr
= parse_fx10_annotation(a
, ptr
, data
);
1407 if (FAILED(hr
)) return hr
;
1410 p
->objects
= HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY
, p
->object_count
* sizeof(*p
->objects
));
1413 ERR("Failed to allocate effect objects memory.\n");
1414 return E_OUTOFMEMORY
;
1417 for (i
= 0; i
< p
->object_count
; ++i
)
1419 struct d3d10_effect_object
*o
= &p
->objects
[i
];
1423 hr
= parse_fx10_object(o
, ptr
, data
);
1424 if (FAILED(hr
)) return hr
;
1430 static HRESULT
parse_fx10_technique(struct d3d10_effect_technique
*t
, const char **ptr
, const char *data
)
1436 read_dword(ptr
, &offset
);
1437 TRACE("Technique name at offset %#x.\n", offset
);
1439 if (!copy_name(data
+ offset
, &t
->name
))
1441 ERR("Failed to copy name.\n");
1442 return E_OUTOFMEMORY
;
1444 TRACE("Technique name: %s.\n", debugstr_a(t
->name
));
1446 read_dword(ptr
, &t
->pass_count
);
1447 TRACE("Technique has %u passes\n", t
->pass_count
);
1449 read_dword(ptr
, &t
->annotation_count
);
1450 TRACE("Technique has %u annotations.\n", t
->annotation_count
);
1452 t
->annotations
= HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY
, t
->annotation_count
* sizeof(*t
->annotations
));
1453 if (!t
->annotations
)
1455 ERR("Failed to allocate technique annotations memory.\n");
1456 return E_OUTOFMEMORY
;
1459 for (i
= 0; i
< t
->annotation_count
; ++i
)
1461 struct d3d10_effect_variable
*a
= &t
->annotations
[i
];
1463 a
->effect
= t
->effect
;
1464 a
->buffer
= &null_local_buffer
;
1466 hr
= parse_fx10_annotation(a
, ptr
, data
);
1467 if (FAILED(hr
)) return hr
;
1470 t
->passes
= HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY
, t
->pass_count
* sizeof(*t
->passes
));
1473 ERR("Failed to allocate passes memory\n");
1474 return E_OUTOFMEMORY
;
1477 for (i
= 0; i
< t
->pass_count
; ++i
)
1479 struct d3d10_effect_pass
*p
= &t
->passes
[i
];
1481 p
->ID3D10EffectPass_iface
.lpVtbl
= &d3d10_effect_pass_vtbl
;
1484 hr
= parse_fx10_pass(p
, ptr
, data
);
1485 if (FAILED(hr
)) return hr
;
1491 static HRESULT
parse_fx10_variable(struct d3d10_effect_variable
*v
, const char **ptr
, const char *data
)
1497 hr
= parse_fx10_variable_head(v
, ptr
, data
);
1498 if (FAILED(hr
)) return hr
;
1500 read_dword(ptr
, &offset
);
1501 TRACE("Variable semantic at offset %#x.\n", offset
);
1503 if (!copy_name(data
+ offset
, &v
->semantic
))
1505 ERR("Failed to copy semantic.\n");
1506 return E_OUTOFMEMORY
;
1508 TRACE("Variable semantic: %s.\n", debugstr_a(v
->semantic
));
1510 read_dword(ptr
, &v
->buffer_offset
);
1511 TRACE("Variable offset in buffer: %#x.\n", v
->buffer_offset
);
1513 skip_dword_unknown("variable", ptr
, 1);
1515 read_dword(ptr
, &v
->flag
);
1516 TRACE("Variable flag: %#x.\n", v
->flag
);
1518 read_dword(ptr
, &v
->annotation_count
);
1519 TRACE("Variable has %u annotations.\n", v
->annotation_count
);
1521 v
->annotations
= HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY
, v
->annotation_count
* sizeof(*v
->annotations
));
1522 if (!v
->annotations
)
1524 ERR("Failed to allocate variable annotations memory.\n");
1525 return E_OUTOFMEMORY
;
1528 for (i
= 0; i
< v
->annotation_count
; ++i
)
1530 struct d3d10_effect_variable
*a
= &v
->annotations
[i
];
1532 a
->effect
= v
->effect
;
1533 a
->buffer
= &null_local_buffer
;
1535 hr
= parse_fx10_annotation(a
, ptr
, data
);
1536 if (FAILED(hr
)) return hr
;
1542 static HRESULT
parse_fx10_local_variable(struct d3d10_effect_variable
*v
, const char **ptr
, const char *data
)
1548 hr
= parse_fx10_variable_head(v
, ptr
, data
);
1549 if (FAILED(hr
)) return hr
;
1551 read_dword(ptr
, &offset
);
1552 TRACE("Variable semantic at offset %#x.\n", offset
);
1554 if (!copy_name(data
+ offset
, &v
->semantic
))
1556 ERR("Failed to copy semantic.\n");
1557 return E_OUTOFMEMORY
;
1559 TRACE("Variable semantic: %s.\n", debugstr_a(v
->semantic
));
1561 skip_dword_unknown("local variable", ptr
, 1);
1563 switch (v
->type
->basetype
)
1565 case D3D10_SVT_TEXTURE1D
:
1566 case D3D10_SVT_TEXTURE1DARRAY
:
1567 case D3D10_SVT_TEXTURE2D
:
1568 case D3D10_SVT_TEXTURE2DARRAY
:
1569 case D3D10_SVT_TEXTURE2DMS
:
1570 case D3D10_SVT_TEXTURE2DMSARRAY
:
1571 case D3D10_SVT_TEXTURE3D
:
1572 case D3D10_SVT_TEXTURECUBE
:
1573 case D3D10_SVT_RENDERTARGETVIEW
:
1574 case D3D10_SVT_DEPTHSTENCILVIEW
:
1575 case D3D10_SVT_BUFFER
:
1576 TRACE("SVT could not have elements.\n");
1579 case D3D10_SVT_VERTEXSHADER
:
1580 case D3D10_SVT_PIXELSHADER
:
1581 case D3D10_SVT_GEOMETRYSHADER
:
1582 TRACE("Shader type is %s\n", debug_d3d10_shader_variable_type(v
->type
->basetype
));
1583 for (i
= 0; i
< max(v
->type
->element_count
, 1); ++i
)
1585 DWORD shader_offset
;
1586 struct d3d10_effect_variable
*var
;
1588 if (!v
->type
->element_count
)
1594 var
= &v
->elements
[i
];
1597 read_dword(ptr
, &shader_offset
);
1598 TRACE("Shader offset: %#x.\n", shader_offset
);
1600 hr
= parse_shader(var
, data
+ shader_offset
);
1601 if (FAILED(hr
)) return hr
;
1605 case D3D10_SVT_DEPTHSTENCIL
:
1606 case D3D10_SVT_BLEND
:
1607 case D3D10_SVT_RASTERIZER
:
1608 case D3D10_SVT_SAMPLER
:
1610 const struct d3d10_effect_state_storage_info
*storage_info
;
1611 unsigned int count
= max(v
->type
->element_count
, 1);
1612 unsigned char *desc
;
1614 if (!(storage_info
= get_storage_info(v
->type
->basetype
)))
1616 FIXME("Failed to get backing store info for type %s.\n",
1617 debug_d3d10_shader_variable_type(v
->type
->basetype
));
1621 if (!(desc
= HeapAlloc(GetProcessHeap(), 0, count
* storage_info
->size
)))
1623 ERR("Failed to allocate backing store memory.\n");
1624 return E_OUTOFMEMORY
;
1627 for (i
= 0; i
< count
; ++i
)
1629 memcpy(&desc
[i
* storage_info
->size
], storage_info
->default_state
, storage_info
->size
);
1631 if (!parse_fx10_state_group(ptr
, data
, v
->type
->basetype
, &desc
[i
* storage_info
->size
]))
1633 ERR("Failed to read property list.\n");
1634 HeapFree(GetProcessHeap(), 0, desc
);
1644 FIXME("Unhandled case %s.\n", debug_d3d10_shader_variable_type(v
->type
->basetype
));
1648 read_dword(ptr
, &v
->annotation_count
);
1649 TRACE("Variable has %u annotations.\n", v
->annotation_count
);
1651 v
->annotations
= HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY
, v
->annotation_count
* sizeof(*v
->annotations
));
1652 if (!v
->annotations
)
1654 ERR("Failed to allocate variable annotations memory.\n");
1655 return E_OUTOFMEMORY
;
1658 for (i
= 0; i
< v
->annotation_count
; ++i
)
1660 struct d3d10_effect_variable
*a
= &v
->annotations
[i
];
1662 a
->effect
= v
->effect
;
1663 a
->buffer
= &null_local_buffer
;
1665 hr
= parse_fx10_annotation(a
, ptr
, data
);
1666 if (FAILED(hr
)) return hr
;
1672 static HRESULT
parse_fx10_local_buffer(struct d3d10_effect_variable
*l
, const char **ptr
, const char *data
)
1676 D3D10_CBUFFER_TYPE d3d10_cbuffer_type
;
1678 unsigned int stride
= 0;
1680 /* Generate our own type, it isn't in the fx blob. */
1681 l
->type
= HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY
, sizeof(*l
->type
));
1684 ERR("Failed to allocate local buffer type memory.\n");
1685 return E_OUTOFMEMORY
;
1687 l
->type
->ID3D10EffectType_iface
.lpVtbl
= &d3d10_effect_type_vtbl
;
1688 l
->type
->type_class
= D3D10_SVC_OBJECT
;
1689 l
->type
->effect
= l
->effect
;
1691 read_dword(ptr
, &offset
);
1692 TRACE("Local buffer name at offset %#x.\n", offset
);
1694 if (!copy_name(data
+ offset
, &l
->name
))
1696 ERR("Failed to copy name.\n");
1697 return E_OUTOFMEMORY
;
1699 TRACE("Local buffer name: %s.\n", debugstr_a(l
->name
));
1701 read_dword(ptr
, &l
->data_size
);
1702 TRACE("Local buffer data size: %#x.\n", l
->data_size
);
1704 read_dword(ptr
, &d3d10_cbuffer_type
);
1705 TRACE("Local buffer type: %#x.\n", d3d10_cbuffer_type
);
1707 switch(d3d10_cbuffer_type
)
1709 case D3D10_CT_CBUFFER
:
1710 l
->type
->basetype
= D3D10_SVT_CBUFFER
;
1711 if (!copy_name("cbuffer", &l
->type
->name
))
1713 ERR("Failed to copy name.\n");
1714 return E_OUTOFMEMORY
;
1718 case D3D10_CT_TBUFFER
:
1719 l
->type
->basetype
= D3D10_SVT_TBUFFER
;
1720 if (!copy_name("tbuffer", &l
->type
->name
))
1722 ERR("Failed to copy name.\n");
1723 return E_OUTOFMEMORY
;
1728 ERR("Unexpected D3D10_CBUFFER_TYPE %#x!\n", d3d10_cbuffer_type
);
1732 read_dword(ptr
, &l
->type
->member_count
);
1733 TRACE("Local buffer member count: %#x.\n", l
->type
->member_count
);
1735 skip_dword_unknown("local buffer", ptr
, 1);
1737 read_dword(ptr
, &l
->annotation_count
);
1738 TRACE("Local buffer has %u annotations.\n", l
->annotation_count
);
1740 l
->annotations
= HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY
, l
->annotation_count
* sizeof(*l
->annotations
));
1741 if (!l
->annotations
)
1743 ERR("Failed to allocate local buffer annotations memory.\n");
1744 return E_OUTOFMEMORY
;
1747 for (i
= 0; i
< l
->annotation_count
; ++i
)
1749 struct d3d10_effect_variable
*a
= &l
->annotations
[i
];
1751 a
->effect
= l
->effect
;
1752 a
->buffer
= &null_local_buffer
;
1754 hr
= parse_fx10_annotation(a
, ptr
, data
);
1755 if (FAILED(hr
)) return hr
;
1758 l
->members
= HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY
, l
->type
->member_count
* sizeof(*l
->members
));
1761 ERR("Failed to allocate members memory.\n");
1762 return E_OUTOFMEMORY
;
1765 l
->type
->members
= HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY
, l
->type
->member_count
* sizeof(*l
->type
->members
));
1766 if (!l
->type
->members
)
1768 ERR("Failed to allocate type members memory.\n");
1769 return E_OUTOFMEMORY
;
1772 for (i
= 0; i
< l
->type
->member_count
; ++i
)
1774 struct d3d10_effect_variable
*v
= &l
->members
[i
];
1775 struct d3d10_effect_type_member
*typem
= &l
->type
->members
[i
];
1778 v
->effect
= l
->effect
;
1780 hr
= parse_fx10_variable(v
, ptr
, data
);
1781 if (FAILED(hr
)) return hr
;
1784 * Copy the values from the variable type to the constant buffers type
1785 * members structure, because it is our own generated type.
1787 typem
->type
= v
->type
;
1789 if (!copy_name(v
->name
, &typem
->name
))
1791 ERR("Failed to copy name.\n");
1792 return E_OUTOFMEMORY
;
1794 TRACE("Variable name: %s.\n", debugstr_a(typem
->name
));
1796 if (!copy_name(v
->semantic
, &typem
->semantic
))
1798 ERR("Failed to copy name.\n");
1799 return E_OUTOFMEMORY
;
1801 TRACE("Variable semantic: %s.\n", debugstr_a(typem
->semantic
));
1803 typem
->buffer_offset
= v
->buffer_offset
;
1804 TRACE("Variable buffer offset: %u.\n", typem
->buffer_offset
);
1806 l
->type
->size_packed
+= v
->type
->size_packed
;
1809 * For the complete constantbuffer the size_unpacked = stride,
1810 * the stride is calculated like this:
1812 * 1) if the constant buffer variables are packed with packoffset
1813 * - stride = the highest used constant
1814 * - the complete stride has to be a multiple of 0x10
1816 * 2) if the constant buffer variables are NOT packed with packoffset
1817 * - sum of unpacked size for all variables which fit in a 0x10 part
1818 * - if the size exceeds a 0x10 part, the rest of the old part is skipped
1819 * and a new part is started
1820 * - if the variable is a struct it is always used a new part
1821 * - the complete stride has to be a multiple of 0x10
1824 * 0x4, 0x4, 0x4, 0x8, 0x4, 0x14, 0x4
1825 * part 0x10 0x10 0x20 -> 0x40
1827 if (v
->flag
& D3D10_EFFECT_VARIABLE_EXPLICIT_BIND_POINT
)
1829 if ((v
->type
->size_unpacked
+ v
->buffer_offset
) > stride
)
1831 stride
= v
->type
->size_unpacked
+ v
->buffer_offset
;
1836 if (v
->type
->type_class
== D3D10_SVC_STRUCT
)
1838 stride
= (stride
+ 0xf) & ~0xf;
1841 if ( ((stride
& 0xf) + v
->type
->size_unpacked
) > 0x10)
1843 stride
= (stride
+ 0xf) & ~0xf;
1846 stride
+= v
->type
->size_unpacked
;
1849 l
->type
->stride
= l
->type
->size_unpacked
= (stride
+ 0xf) & ~0xf;
1851 TRACE("Constant buffer:\n");
1852 TRACE("\tType name: %s.\n", debugstr_a(l
->type
->name
));
1853 TRACE("\tElement count: %u.\n", l
->type
->element_count
);
1854 TRACE("\tMember count: %u.\n", l
->type
->member_count
);
1855 TRACE("\tUnpacked size: %#x.\n", l
->type
->size_unpacked
);
1856 TRACE("\tStride: %#x.\n", l
->type
->stride
);
1857 TRACE("\tPacked size %#x.\n", l
->type
->size_packed
);
1858 TRACE("\tBasetype: %s.\n", debug_d3d10_shader_variable_type(l
->type
->basetype
));
1859 TRACE("\tTypeclass: %s.\n", debug_d3d10_shader_variable_class(l
->type
->type_class
));
1864 static int d3d10_effect_type_compare(const void *key
, const struct wine_rb_entry
*entry
)
1866 const struct d3d10_effect_type
*t
= WINE_RB_ENTRY_VALUE(entry
, const struct d3d10_effect_type
, entry
);
1867 const DWORD
*id
= key
;
1872 static void d3d10_effect_type_member_destroy(struct d3d10_effect_type_member
*typem
)
1874 TRACE("effect type member %p.\n", typem
);
1876 /* Do not release typem->type, it will be covered by d3d10_effect_type_destroy(). */
1877 HeapFree(GetProcessHeap(), 0, typem
->semantic
);
1878 HeapFree(GetProcessHeap(), 0, typem
->name
);
1881 static void d3d10_effect_type_destroy(struct wine_rb_entry
*entry
, void *context
)
1883 struct d3d10_effect_type
*t
= WINE_RB_ENTRY_VALUE(entry
, struct d3d10_effect_type
, entry
);
1885 TRACE("effect type %p.\n", t
);
1889 HeapFree(GetProcessHeap(), 0, t
->elementtype
->name
);
1890 HeapFree(GetProcessHeap(), 0, t
->elementtype
);
1897 for (i
= 0; i
< t
->member_count
; ++i
)
1899 d3d10_effect_type_member_destroy(&t
->members
[i
]);
1901 HeapFree(GetProcessHeap(), 0, t
->members
);
1904 HeapFree(GetProcessHeap(), 0, t
->name
);
1905 HeapFree(GetProcessHeap(), 0, t
);
1908 static const struct wine_rb_functions d3d10_effect_type_rb_functions
=
1913 d3d10_effect_type_compare
,
1916 static HRESULT
parse_fx10_body(struct d3d10_effect
*e
, const char *data
, DWORD data_size
)
1918 const char *ptr
= data
+ e
->index_offset
;
1922 if (wine_rb_init(&e
->types
, &d3d10_effect_type_rb_functions
) == -1)
1924 ERR("Failed to initialize type rbtree.\n");
1928 e
->local_buffers
= HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY
, e
->local_buffer_count
* sizeof(*e
->local_buffers
));
1929 if (!e
->local_buffers
)
1931 ERR("Failed to allocate local buffer memory.\n");
1932 return E_OUTOFMEMORY
;
1935 e
->local_variables
= HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY
, e
->local_variable_count
* sizeof(*e
->local_variables
));
1936 if (!e
->local_variables
)
1938 ERR("Failed to allocate local variable memory.\n");
1939 return E_OUTOFMEMORY
;
1942 e
->anonymous_shaders
= HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY
, e
->anonymous_shader_count
* sizeof(*e
->anonymous_shaders
));
1943 if (!e
->anonymous_shaders
)
1945 ERR("Failed to allocate anonymous shaders memory\n");
1946 return E_OUTOFMEMORY
;
1949 e
->used_shaders
= HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY
, e
->used_shader_count
* sizeof(*e
->used_shaders
));
1950 if (!e
->used_shaders
)
1952 ERR("Failed to allocate used shaders memory\n");
1953 return E_OUTOFMEMORY
;
1956 e
->techniques
= HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY
, e
->technique_count
* sizeof(*e
->techniques
));
1959 ERR("Failed to allocate techniques memory\n");
1960 return E_OUTOFMEMORY
;
1963 for (i
= 0; i
< e
->local_buffer_count
; ++i
)
1965 struct d3d10_effect_variable
*l
= &e
->local_buffers
[i
];
1966 l
->ID3D10EffectVariable_iface
.lpVtbl
= (const ID3D10EffectVariableVtbl
*)&d3d10_effect_constant_buffer_vtbl
;
1968 l
->buffer
= &null_local_buffer
;
1970 hr
= parse_fx10_local_buffer(l
, &ptr
, data
);
1971 if (FAILED(hr
)) return hr
;
1974 for (i
= 0; i
< e
->local_variable_count
; ++i
)
1976 struct d3d10_effect_variable
*v
= &e
->local_variables
[i
];
1979 v
->ID3D10EffectVariable_iface
.lpVtbl
= &d3d10_effect_variable_vtbl
;
1980 v
->buffer
= &null_local_buffer
;
1982 hr
= parse_fx10_local_variable(v
, &ptr
, data
);
1983 if (FAILED(hr
)) return hr
;
1986 for (i
= 0; i
< e
->technique_count
; ++i
)
1988 struct d3d10_effect_technique
*t
= &e
->techniques
[i
];
1990 t
->ID3D10EffectTechnique_iface
.lpVtbl
= &d3d10_effect_technique_vtbl
;
1993 hr
= parse_fx10_technique(t
, &ptr
, data
);
1994 if (FAILED(hr
)) return hr
;
2000 static HRESULT
parse_fx10(struct d3d10_effect
*e
, const char *data
, DWORD data_size
)
2002 const char *ptr
= data
;
2005 /* Compiled target version (e.g. fx_4_0=0xfeff1001, fx_4_1=0xfeff1011). */
2006 read_dword(&ptr
, &e
->version
);
2007 TRACE("Target: %#x\n", e
->version
);
2009 read_dword(&ptr
, &e
->local_buffer_count
);
2010 TRACE("Local buffer count: %u.\n", e
->local_buffer_count
);
2012 read_dword(&ptr
, &e
->variable_count
);
2013 TRACE("Variable count: %u\n", e
->variable_count
);
2015 read_dword(&ptr
, &e
->local_variable_count
);
2016 TRACE("Object count: %u\n", e
->local_variable_count
);
2018 read_dword(&ptr
, &e
->sharedbuffers_count
);
2019 TRACE("Sharedbuffers count: %u\n", e
->sharedbuffers_count
);
2021 /* Number of variables in shared buffers? */
2022 read_dword(&ptr
, &unknown
);
2023 FIXME("Unknown 0: %u\n", unknown
);
2025 read_dword(&ptr
, &e
->sharedobjects_count
);
2026 TRACE("Sharedobjects count: %u\n", e
->sharedobjects_count
);
2028 read_dword(&ptr
, &e
->technique_count
);
2029 TRACE("Technique count: %u\n", e
->technique_count
);
2031 read_dword(&ptr
, &e
->index_offset
);
2032 TRACE("Index offset: %#x\n", e
->index_offset
);
2034 read_dword(&ptr
, &unknown
);
2035 FIXME("Unknown 1: %u\n", unknown
);
2037 read_dword(&ptr
, &e
->texture_count
);
2038 TRACE("Texture count: %u\n", e
->texture_count
);
2040 read_dword(&ptr
, &e
->dephstencilstate_count
);
2041 TRACE("Depthstencilstate count: %u\n", e
->dephstencilstate_count
);
2043 read_dword(&ptr
, &e
->blendstate_count
);
2044 TRACE("Blendstate count: %u\n", e
->blendstate_count
);
2046 read_dword(&ptr
, &e
->rasterizerstate_count
);
2047 TRACE("Rasterizerstate count: %u\n", e
->rasterizerstate_count
);
2049 read_dword(&ptr
, &e
->samplerstate_count
);
2050 TRACE("Samplerstate count: %u\n", e
->samplerstate_count
);
2052 read_dword(&ptr
, &e
->rendertargetview_count
);
2053 TRACE("Rendertargetview count: %u\n", e
->rendertargetview_count
);
2055 read_dword(&ptr
, &e
->depthstencilview_count
);
2056 TRACE("Depthstencilview count: %u\n", e
->depthstencilview_count
);
2058 read_dword(&ptr
, &e
->used_shader_count
);
2059 TRACE("Used shader count: %u\n", e
->used_shader_count
);
2061 read_dword(&ptr
, &e
->anonymous_shader_count
);
2062 TRACE("Anonymous shader count: %u\n", e
->anonymous_shader_count
);
2064 return parse_fx10_body(e
, ptr
, data_size
- (ptr
- data
));
2067 static HRESULT
fx10_chunk_handler(const char *data
, DWORD data_size
, DWORD tag
, void *ctx
)
2069 struct d3d10_effect
*e
= ctx
;
2071 TRACE("tag: %s.\n", debugstr_an((const char *)&tag
, 4));
2073 TRACE("chunk size: %#x\n", data_size
);
2078 return parse_fx10(e
, data
, data_size
);
2081 FIXME("Unhandled chunk %s.\n", debugstr_an((const char *)&tag
, 4));
2086 HRESULT
d3d10_effect_parse(struct d3d10_effect
*This
, const void *data
, SIZE_T data_size
)
2088 return parse_dxbc(data
, data_size
, fx10_chunk_handler
, This
);
2091 static HRESULT
d3d10_effect_object_apply(struct d3d10_effect_object
*o
)
2093 ID3D10Device
*device
= o
->pass
->technique
->effect
->device
;
2094 struct d3d10_effect_variable
*v
= (struct d3d10_effect_variable
*) o
->data
;
2096 TRACE("effect object %p, type %#x.\n", o
, o
->type
);
2100 case D3D10_EOT_VERTEXSHADER
:
2101 ID3D10Device_VSSetShader(device
, ((struct d3d10_effect_shader_variable
*)v
->data
)->shader
.vs
);
2104 case D3D10_EOT_PIXELSHADER
:
2105 ID3D10Device_PSSetShader(device
, ((struct d3d10_effect_shader_variable
*)v
->data
)->shader
.ps
);
2108 case D3D10_EOT_GEOMETRYSHADER
:
2109 ID3D10Device_GSSetShader(device
, ((struct d3d10_effect_shader_variable
*)v
->data
)->shader
.gs
);
2113 FIXME("Unhandled effect object type %#x.\n", o
->type
);
2118 static void d3d10_effect_variable_destroy(struct d3d10_effect_variable
*v
)
2122 TRACE("variable %p.\n", v
);
2124 HeapFree(GetProcessHeap(), 0, v
->name
);
2125 HeapFree(GetProcessHeap(), 0, v
->semantic
);
2128 for (i
= 0; i
< v
->annotation_count
; ++i
)
2130 d3d10_effect_variable_destroy(&v
->annotations
[i
]);
2132 HeapFree(GetProcessHeap(), 0, v
->annotations
);
2137 for (i
= 0; i
< v
->type
->member_count
; ++i
)
2139 d3d10_effect_variable_destroy(&v
->members
[i
]);
2141 HeapFree(GetProcessHeap(), 0, v
->members
);
2146 for (i
= 0; i
< v
->type
->element_count
; ++i
)
2148 d3d10_effect_variable_destroy(&v
->elements
[i
]);
2150 HeapFree(GetProcessHeap(), 0, v
->elements
);
2155 switch(v
->type
->basetype
)
2157 case D3D10_SVT_VERTEXSHADER
:
2158 case D3D10_SVT_PIXELSHADER
:
2159 case D3D10_SVT_GEOMETRYSHADER
:
2160 shader_free_signature(&((struct d3d10_effect_shader_variable
*)v
->data
)->input_signature
);
2161 shader_free_signature(&((struct d3d10_effect_shader_variable
*)v
->data
)->output_signature
);
2167 HeapFree(GetProcessHeap(), 0, v
->data
);
2171 static void d3d10_effect_pass_destroy(struct d3d10_effect_pass
*p
)
2175 TRACE("pass %p\n", p
);
2177 HeapFree(GetProcessHeap(), 0, p
->name
);
2178 HeapFree(GetProcessHeap(), 0, p
->objects
);
2182 for (i
= 0; i
< p
->annotation_count
; ++i
)
2184 d3d10_effect_variable_destroy(&p
->annotations
[i
]);
2186 HeapFree(GetProcessHeap(), 0, p
->annotations
);
2190 static void d3d10_effect_technique_destroy(struct d3d10_effect_technique
*t
)
2194 TRACE("technique %p\n", t
);
2196 HeapFree(GetProcessHeap(), 0, t
->name
);
2199 for (i
= 0; i
< t
->pass_count
; ++i
)
2201 d3d10_effect_pass_destroy(&t
->passes
[i
]);
2203 HeapFree(GetProcessHeap(), 0, t
->passes
);
2208 for (i
= 0; i
< t
->annotation_count
; ++i
)
2210 d3d10_effect_variable_destroy(&t
->annotations
[i
]);
2212 HeapFree(GetProcessHeap(), 0, t
->annotations
);
2216 static void d3d10_effect_local_buffer_destroy(struct d3d10_effect_variable
*l
)
2220 TRACE("local buffer %p.\n", l
);
2222 HeapFree(GetProcessHeap(), 0, l
->name
);
2225 for (i
= 0; i
< l
->type
->member_count
; ++i
)
2227 d3d10_effect_variable_destroy(&l
->members
[i
]);
2229 HeapFree(GetProcessHeap(), 0, l
->members
);
2232 if (l
->type
->members
)
2234 for (i
= 0; i
< l
->type
->member_count
; ++i
)
2236 /* Do not release l->type->members[i].type, it will be covered by d3d10_effect_type_destroy(). */
2237 HeapFree(GetProcessHeap(), 0, l
->type
->members
[i
].semantic
);
2238 HeapFree(GetProcessHeap(), 0, l
->type
->members
[i
].name
);
2240 HeapFree(GetProcessHeap(), 0, l
->type
->members
);
2242 HeapFree(GetProcessHeap(), 0, l
->type
->name
);
2243 HeapFree(GetProcessHeap(), 0, l
->type
);
2247 for (i
= 0; i
< l
->annotation_count
; ++i
)
2249 d3d10_effect_variable_destroy(&l
->annotations
[i
]);
2251 HeapFree(GetProcessHeap(), 0, l
->annotations
);
2255 /* IUnknown methods */
2257 static inline struct d3d10_effect
*impl_from_ID3D10Effect(ID3D10Effect
*iface
)
2259 return CONTAINING_RECORD(iface
, struct d3d10_effect
, ID3D10Effect_iface
);
2262 static HRESULT STDMETHODCALLTYPE
d3d10_effect_QueryInterface(ID3D10Effect
*iface
, REFIID riid
, void **object
)
2264 TRACE("iface %p, riid %s, object %p\n", iface
, debugstr_guid(riid
), object
);
2266 if (IsEqualGUID(riid
, &IID_ID3D10Effect
)
2267 || IsEqualGUID(riid
, &IID_IUnknown
))
2269 IUnknown_AddRef(iface
);
2274 WARN("%s not implemented, returning E_NOINTERFACE\n", debugstr_guid(riid
));
2277 return E_NOINTERFACE
;
2280 static ULONG STDMETHODCALLTYPE
d3d10_effect_AddRef(ID3D10Effect
*iface
)
2282 struct d3d10_effect
*This
= impl_from_ID3D10Effect(iface
);
2283 ULONG refcount
= InterlockedIncrement(&This
->refcount
);
2285 TRACE("%p increasing refcount to %u\n", This
, refcount
);
2290 static ULONG STDMETHODCALLTYPE
d3d10_effect_Release(ID3D10Effect
*iface
)
2292 struct d3d10_effect
*This
= impl_from_ID3D10Effect(iface
);
2293 ULONG refcount
= InterlockedDecrement(&This
->refcount
);
2295 TRACE("%p decreasing refcount to %u\n", This
, refcount
);
2301 if (This
->techniques
)
2303 for (i
= 0; i
< This
->technique_count
; ++i
)
2305 d3d10_effect_technique_destroy(&This
->techniques
[i
]);
2307 HeapFree(GetProcessHeap(), 0, This
->techniques
);
2310 if (This
->local_variables
)
2312 for (i
= 0; i
< This
->local_variable_count
; ++i
)
2314 d3d10_effect_variable_destroy(&This
->local_variables
[i
]);
2316 HeapFree(GetProcessHeap(), 0, This
->local_variables
);
2319 if (This
->local_buffers
)
2321 for (i
= 0; i
< This
->local_buffer_count
; ++i
)
2323 d3d10_effect_local_buffer_destroy(&This
->local_buffers
[i
]);
2325 HeapFree(GetProcessHeap(), 0, This
->local_buffers
);
2328 if (This
->anonymous_shaders
)
2330 for (i
= 0; i
< This
->anonymous_shader_count
; ++i
)
2332 d3d10_effect_variable_destroy(&This
->anonymous_shaders
[i
].shader
);
2333 HeapFree(GetProcessHeap(), 0, This
->anonymous_shaders
[i
].type
.name
);
2335 HeapFree(GetProcessHeap(), 0, This
->anonymous_shaders
);
2338 HeapFree(GetProcessHeap(), 0, This
->used_shaders
);
2340 wine_rb_destroy(&This
->types
, d3d10_effect_type_destroy
, NULL
);
2342 ID3D10Device_Release(This
->device
);
2343 HeapFree(GetProcessHeap(), 0, This
);
2349 /* ID3D10Effect methods */
2351 static BOOL STDMETHODCALLTYPE
d3d10_effect_IsValid(ID3D10Effect
*iface
)
2353 FIXME("iface %p stub!\n", iface
);
2358 static BOOL STDMETHODCALLTYPE
d3d10_effect_IsPool(ID3D10Effect
*iface
)
2360 FIXME("iface %p stub!\n", iface
);
2365 static HRESULT STDMETHODCALLTYPE
d3d10_effect_GetDevice(ID3D10Effect
*iface
, ID3D10Device
**device
)
2367 struct d3d10_effect
*This
= impl_from_ID3D10Effect(iface
);
2369 TRACE("iface %p, device %p\n", iface
, device
);
2371 ID3D10Device_AddRef(This
->device
);
2372 *device
= This
->device
;
2377 static HRESULT STDMETHODCALLTYPE
d3d10_effect_GetDesc(ID3D10Effect
*iface
, D3D10_EFFECT_DESC
*desc
)
2379 FIXME("iface %p, desc %p stub!\n", iface
, desc
);
2384 static struct ID3D10EffectConstantBuffer
* STDMETHODCALLTYPE
d3d10_effect_GetConstantBufferByIndex(ID3D10Effect
*iface
,
2387 struct d3d10_effect
*This
= impl_from_ID3D10Effect(iface
);
2388 struct d3d10_effect_variable
*l
;
2390 TRACE("iface %p, index %u\n", iface
, index
);
2392 if (index
>= This
->local_buffer_count
)
2394 WARN("Invalid index specified\n");
2395 return (ID3D10EffectConstantBuffer
*)&null_local_buffer
;
2398 l
= &This
->local_buffers
[index
];
2400 TRACE("Returning buffer %p, %s.\n", l
, debugstr_a(l
->name
));
2402 return (ID3D10EffectConstantBuffer
*)l
;
2405 static struct ID3D10EffectConstantBuffer
* STDMETHODCALLTYPE
d3d10_effect_GetConstantBufferByName(ID3D10Effect
*iface
,
2408 struct d3d10_effect
*This
= impl_from_ID3D10Effect(iface
);
2411 TRACE("iface %p, name %s.\n", iface
, debugstr_a(name
));
2413 for (i
= 0; i
< This
->local_buffer_count
; ++i
)
2415 struct d3d10_effect_variable
*l
= &This
->local_buffers
[i
];
2417 if (!strcmp(l
->name
, name
))
2419 TRACE("Returning buffer %p.\n", l
);
2420 return (ID3D10EffectConstantBuffer
*)l
;
2424 WARN("Invalid name specified\n");
2426 return (ID3D10EffectConstantBuffer
*)&null_local_buffer
;
2429 static struct ID3D10EffectVariable
* STDMETHODCALLTYPE
d3d10_effect_GetVariableByIndex(ID3D10Effect
*iface
, UINT index
)
2431 struct d3d10_effect
*This
= impl_from_ID3D10Effect(iface
);
2434 TRACE("iface %p, index %u\n", iface
, index
);
2436 for (i
= 0; i
< This
->local_buffer_count
; ++i
)
2438 struct d3d10_effect_variable
*l
= &This
->local_buffers
[i
];
2440 if (index
< l
->type
->member_count
)
2442 struct d3d10_effect_variable
*v
= &l
->members
[index
];
2444 TRACE("Returning variable %p.\n", v
);
2445 return &v
->ID3D10EffectVariable_iface
;
2447 index
-= l
->type
->member_count
;
2450 if (index
< This
->local_variable_count
)
2452 struct d3d10_effect_variable
*v
= &This
->local_variables
[index
];
2454 TRACE("Returning variable %p.\n", v
);
2455 return &v
->ID3D10EffectVariable_iface
;
2458 WARN("Invalid index specified\n");
2460 return &null_variable
.ID3D10EffectVariable_iface
;
2463 static struct ID3D10EffectVariable
* STDMETHODCALLTYPE
d3d10_effect_GetVariableByName(ID3D10Effect
*iface
, LPCSTR name
)
2465 struct d3d10_effect
*This
= impl_from_ID3D10Effect(iface
);
2468 TRACE("iface %p, name %s.\n", iface
, debugstr_a(name
));
2472 WARN("Invalid name specified\n");
2473 return &null_variable
.ID3D10EffectVariable_iface
;
2476 for (i
= 0; i
< This
->local_buffer_count
; ++i
)
2478 struct d3d10_effect_variable
*l
= &This
->local_buffers
[i
];
2481 for (j
= 0; j
< l
->type
->member_count
; ++j
)
2483 struct d3d10_effect_variable
*v
= &l
->members
[j
];
2485 if (!strcmp(v
->name
, name
))
2487 TRACE("Returning variable %p.\n", v
);
2488 return &v
->ID3D10EffectVariable_iface
;
2493 for (i
= 0; i
< This
->local_variable_count
; ++i
)
2495 struct d3d10_effect_variable
*v
= &This
->local_variables
[i
];
2497 if (!strcmp(v
->name
, name
))
2499 TRACE("Returning variable %p.\n", v
);
2500 return &v
->ID3D10EffectVariable_iface
;
2504 WARN("Invalid name specified\n");
2506 return &null_variable
.ID3D10EffectVariable_iface
;
2509 static struct ID3D10EffectVariable
* STDMETHODCALLTYPE
d3d10_effect_GetVariableBySemantic(ID3D10Effect
*iface
,
2512 struct d3d10_effect
*This
= impl_from_ID3D10Effect(iface
);
2515 TRACE("iface %p, semantic %s\n", iface
, debugstr_a(semantic
));
2519 WARN("Invalid semantic specified\n");
2520 return &null_variable
.ID3D10EffectVariable_iface
;
2523 for (i
= 0; i
< This
->local_buffer_count
; ++i
)
2525 struct d3d10_effect_variable
*l
= &This
->local_buffers
[i
];
2528 for (j
= 0; j
< l
->type
->member_count
; ++j
)
2530 struct d3d10_effect_variable
*v
= &l
->members
[j
];
2532 if (!strcmp(v
->semantic
, semantic
))
2534 TRACE("Returning variable %p.\n", v
);
2535 return &v
->ID3D10EffectVariable_iface
;
2540 for (i
= 0; i
< This
->local_variable_count
; ++i
)
2542 struct d3d10_effect_variable
*v
= &This
->local_variables
[i
];
2544 if (!strcmp(v
->semantic
, semantic
))
2546 TRACE("Returning variable %p.\n", v
);
2547 return &v
->ID3D10EffectVariable_iface
;
2551 WARN("Invalid semantic specified\n");
2553 return &null_variable
.ID3D10EffectVariable_iface
;
2556 static struct ID3D10EffectTechnique
* STDMETHODCALLTYPE
d3d10_effect_GetTechniqueByIndex(ID3D10Effect
*iface
,
2559 struct d3d10_effect
*This
= impl_from_ID3D10Effect(iface
);
2560 struct d3d10_effect_technique
*t
;
2562 TRACE("iface %p, index %u\n", iface
, index
);
2564 if (index
>= This
->technique_count
)
2566 WARN("Invalid index specified\n");
2567 return &null_technique
.ID3D10EffectTechnique_iface
;
2570 t
= &This
->techniques
[index
];
2572 TRACE("Returning technique %p, %s.\n", t
, debugstr_a(t
->name
));
2574 return &t
->ID3D10EffectTechnique_iface
;
2577 static struct ID3D10EffectTechnique
* STDMETHODCALLTYPE
d3d10_effect_GetTechniqueByName(ID3D10Effect
*iface
,
2580 struct d3d10_effect
*This
= impl_from_ID3D10Effect(iface
);
2583 TRACE("iface %p, name %s.\n", iface
, debugstr_a(name
));
2587 WARN("Invalid name specified\n");
2588 return &null_technique
.ID3D10EffectTechnique_iface
;
2591 for (i
= 0; i
< This
->technique_count
; ++i
)
2593 struct d3d10_effect_technique
*t
= &This
->techniques
[i
];
2594 if (!strcmp(t
->name
, name
))
2596 TRACE("Returning technique %p\n", t
);
2597 return &t
->ID3D10EffectTechnique_iface
;
2601 WARN("Invalid name specified\n");
2603 return &null_technique
.ID3D10EffectTechnique_iface
;
2606 static HRESULT STDMETHODCALLTYPE
d3d10_effect_Optimize(ID3D10Effect
*iface
)
2608 FIXME("iface %p stub!\n", iface
);
2613 static BOOL STDMETHODCALLTYPE
d3d10_effect_IsOptimized(ID3D10Effect
*iface
)
2615 FIXME("iface %p stub!\n", iface
);
2620 const struct ID3D10EffectVtbl d3d10_effect_vtbl
=
2622 /* IUnknown methods */
2623 d3d10_effect_QueryInterface
,
2624 d3d10_effect_AddRef
,
2625 d3d10_effect_Release
,
2626 /* ID3D10Effect methods */
2627 d3d10_effect_IsValid
,
2628 d3d10_effect_IsPool
,
2629 d3d10_effect_GetDevice
,
2630 d3d10_effect_GetDesc
,
2631 d3d10_effect_GetConstantBufferByIndex
,
2632 d3d10_effect_GetConstantBufferByName
,
2633 d3d10_effect_GetVariableByIndex
,
2634 d3d10_effect_GetVariableByName
,
2635 d3d10_effect_GetVariableBySemantic
,
2636 d3d10_effect_GetTechniqueByIndex
,
2637 d3d10_effect_GetTechniqueByName
,
2638 d3d10_effect_Optimize
,
2639 d3d10_effect_IsOptimized
,
2642 /* ID3D10EffectTechnique methods */
2644 static inline struct d3d10_effect_technique
*impl_from_ID3D10EffectTechnique(ID3D10EffectTechnique
*iface
)
2646 return CONTAINING_RECORD(iface
, struct d3d10_effect_technique
, ID3D10EffectTechnique_iface
);
2649 static BOOL STDMETHODCALLTYPE
d3d10_effect_technique_IsValid(ID3D10EffectTechnique
*iface
)
2651 struct d3d10_effect_technique
*This
= impl_from_ID3D10EffectTechnique(iface
);
2653 TRACE("iface %p\n", iface
);
2655 return This
!= &null_technique
;
2658 static HRESULT STDMETHODCALLTYPE
d3d10_effect_technique_GetDesc(ID3D10EffectTechnique
*iface
,
2659 D3D10_TECHNIQUE_DESC
*desc
)
2661 struct d3d10_effect_technique
*This
= impl_from_ID3D10EffectTechnique(iface
);
2663 TRACE("iface %p, desc %p\n", iface
, desc
);
2665 if(This
== &null_technique
)
2667 WARN("Null technique specified\n");
2673 WARN("Invalid argument specified\n");
2674 return E_INVALIDARG
;
2677 desc
->Name
= This
->name
;
2678 desc
->Passes
= This
->pass_count
;
2679 desc
->Annotations
= This
->annotation_count
;
2684 static struct ID3D10EffectVariable
* STDMETHODCALLTYPE
d3d10_effect_technique_GetAnnotationByIndex(
2685 ID3D10EffectTechnique
*iface
, UINT index
)
2687 struct d3d10_effect_technique
*This
= impl_from_ID3D10EffectTechnique(iface
);
2688 struct d3d10_effect_variable
*a
;
2690 TRACE("iface %p, index %u\n", iface
, index
);
2692 if (index
>= This
->annotation_count
)
2694 WARN("Invalid index specified\n");
2695 return &null_variable
.ID3D10EffectVariable_iface
;
2698 a
= &This
->annotations
[index
];
2700 TRACE("Returning annotation %p, %s\n", a
, debugstr_a(a
->name
));
2702 return &a
->ID3D10EffectVariable_iface
;
2705 static struct ID3D10EffectVariable
* STDMETHODCALLTYPE
d3d10_effect_technique_GetAnnotationByName(
2706 ID3D10EffectTechnique
*iface
, LPCSTR name
)
2708 struct d3d10_effect_technique
*This
= impl_from_ID3D10EffectTechnique(iface
);
2711 TRACE("iface %p, name %s.\n", iface
, debugstr_a(name
));
2713 for (i
= 0; i
< This
->annotation_count
; ++i
)
2715 struct d3d10_effect_variable
*a
= &This
->annotations
[i
];
2716 if (!strcmp(a
->name
, name
))
2718 TRACE("Returning annotation %p\n", a
);
2719 return &a
->ID3D10EffectVariable_iface
;
2723 WARN("Invalid name specified\n");
2725 return &null_variable
.ID3D10EffectVariable_iface
;
2728 static struct ID3D10EffectPass
* STDMETHODCALLTYPE
d3d10_effect_technique_GetPassByIndex(ID3D10EffectTechnique
*iface
,
2731 struct d3d10_effect_technique
*This
= impl_from_ID3D10EffectTechnique(iface
);
2732 struct d3d10_effect_pass
*p
;
2734 TRACE("iface %p, index %u\n", iface
, index
);
2736 if (index
>= This
->pass_count
)
2738 WARN("Invalid index specified\n");
2739 return &null_pass
.ID3D10EffectPass_iface
;
2742 p
= &This
->passes
[index
];
2744 TRACE("Returning pass %p, %s.\n", p
, debugstr_a(p
->name
));
2746 return &p
->ID3D10EffectPass_iface
;
2749 static struct ID3D10EffectPass
* STDMETHODCALLTYPE
d3d10_effect_technique_GetPassByName(ID3D10EffectTechnique
*iface
,
2752 struct d3d10_effect_technique
*This
= impl_from_ID3D10EffectTechnique(iface
);
2755 TRACE("iface %p, name %s.\n", iface
, debugstr_a(name
));
2757 /* Do not check for name==NULL, W7/DX10 crashes in that case. */
2759 for (i
= 0; i
< This
->pass_count
; ++i
)
2761 struct d3d10_effect_pass
*p
= &This
->passes
[i
];
2762 if (!strcmp(p
->name
, name
))
2764 TRACE("Returning pass %p\n", p
);
2765 return &p
->ID3D10EffectPass_iface
;
2769 WARN("Invalid name specified\n");
2771 return &null_pass
.ID3D10EffectPass_iface
;
2774 static HRESULT STDMETHODCALLTYPE
d3d10_effect_technique_ComputeStateBlockMask(ID3D10EffectTechnique
*iface
,
2775 D3D10_STATE_BLOCK_MASK
*mask
)
2777 FIXME("iface %p,mask %p stub!\n", iface
, mask
);
2782 static const struct ID3D10EffectTechniqueVtbl d3d10_effect_technique_vtbl
=
2784 /* ID3D10EffectTechnique methods */
2785 d3d10_effect_technique_IsValid
,
2786 d3d10_effect_technique_GetDesc
,
2787 d3d10_effect_technique_GetAnnotationByIndex
,
2788 d3d10_effect_technique_GetAnnotationByName
,
2789 d3d10_effect_technique_GetPassByIndex
,
2790 d3d10_effect_technique_GetPassByName
,
2791 d3d10_effect_technique_ComputeStateBlockMask
,
2794 /* ID3D10EffectPass methods */
2796 static inline struct d3d10_effect_pass
*impl_from_ID3D10EffectPass(ID3D10EffectPass
*iface
)
2798 return CONTAINING_RECORD(iface
, struct d3d10_effect_pass
, ID3D10EffectPass_iface
);
2801 static BOOL STDMETHODCALLTYPE
d3d10_effect_pass_IsValid(ID3D10EffectPass
*iface
)
2803 struct d3d10_effect_pass
*This
= impl_from_ID3D10EffectPass(iface
);
2805 TRACE("iface %p\n", iface
);
2807 return This
!= &null_pass
;
2810 static HRESULT STDMETHODCALLTYPE
d3d10_effect_pass_GetDesc(ID3D10EffectPass
*iface
,
2811 D3D10_PASS_DESC
*desc
)
2813 struct d3d10_effect_pass
*This
= impl_from_ID3D10EffectPass(iface
);
2816 FIXME("iface %p, desc %p partial stub!\n", iface
, desc
);
2818 if(This
== &null_pass
)
2820 WARN("Null pass specified\n");
2826 WARN("Invalid argument specified\n");
2827 return E_INVALIDARG
;
2830 memset(desc
, 0, sizeof(*desc
));
2831 desc
->Name
= This
->name
;
2832 for (i
= 0; i
< This
->object_count
; ++i
)
2834 struct d3d10_effect_object
*o
= &This
->objects
[i
];
2835 if (o
->type
== D3D10_EOT_VERTEXSHADER
)
2837 struct d3d10_effect_variable
*v
= o
->data
;
2838 struct d3d10_effect_shader_variable
*s
= v
->data
;
2839 desc
->pIAInputSignature
= (BYTE
*)s
->input_signature
.signature
;
2840 desc
->IAInputSignatureSize
= s
->input_signature
.signature_size
;
2845 desc
->StencilRef
= This
->stencil_ref
;
2846 desc
->SampleMask
= This
->sample_mask
;
2847 memcpy(desc
->BlendFactor
, This
->blend_factor
, 4 * sizeof(float));
2852 static HRESULT STDMETHODCALLTYPE
d3d10_effect_pass_GetVertexShaderDesc(ID3D10EffectPass
*iface
,
2853 D3D10_PASS_SHADER_DESC
*desc
)
2855 struct d3d10_effect_pass
*This
= impl_from_ID3D10EffectPass(iface
);
2858 TRACE("iface %p, desc %p\n", iface
, desc
);
2860 if (This
== &null_pass
)
2862 WARN("Null pass specified\n");
2868 WARN("Invalid argument specified\n");
2869 return E_INVALIDARG
;
2872 for (i
= 0; i
< This
->object_count
; ++i
)
2874 struct d3d10_effect_object
*o
= &This
->objects
[i
];
2876 if (o
->type
== D3D10_EOT_VERTEXSHADER
)
2878 desc
->pShaderVariable
= o
->data
;
2879 desc
->ShaderIndex
= o
->index
;
2884 TRACE("Returning null_shader_variable\n");
2885 desc
->pShaderVariable
= (ID3D10EffectShaderVariable
*)&null_shader_variable
;
2886 desc
->ShaderIndex
= 0;
2891 static HRESULT STDMETHODCALLTYPE
d3d10_effect_pass_GetGeometryShaderDesc(ID3D10EffectPass
*iface
,
2892 D3D10_PASS_SHADER_DESC
*desc
)
2894 struct d3d10_effect_pass
*This
= impl_from_ID3D10EffectPass(iface
);
2897 TRACE("iface %p, desc %p\n", iface
, desc
);
2899 if (This
== &null_pass
)
2901 WARN("Null pass specified\n");
2907 WARN("Invalid argument specified\n");
2908 return E_INVALIDARG
;
2911 for (i
= 0; i
< This
->object_count
; ++i
)
2913 struct d3d10_effect_object
*o
= &This
->objects
[i
];
2915 if (o
->type
== D3D10_EOT_GEOMETRYSHADER
)
2917 desc
->pShaderVariable
= o
->data
;
2918 desc
->ShaderIndex
= o
->index
;
2923 TRACE("Returning null_shader_variable\n");
2924 desc
->pShaderVariable
= (ID3D10EffectShaderVariable
*)&null_shader_variable
;
2925 desc
->ShaderIndex
= 0;
2930 static HRESULT STDMETHODCALLTYPE
d3d10_effect_pass_GetPixelShaderDesc(ID3D10EffectPass
*iface
,
2931 D3D10_PASS_SHADER_DESC
*desc
)
2933 struct d3d10_effect_pass
*This
= impl_from_ID3D10EffectPass(iface
);
2936 TRACE("iface %p, desc %p\n", iface
, desc
);
2938 if (This
== &null_pass
)
2940 WARN("Null pass specified\n");
2946 WARN("Invalid argument specified\n");
2947 return E_INVALIDARG
;
2950 for (i
= 0; i
< This
->object_count
; ++i
)
2952 struct d3d10_effect_object
*o
= &This
->objects
[i
];
2954 if (o
->type
== D3D10_EOT_PIXELSHADER
)
2956 desc
->pShaderVariable
= o
->data
;
2957 desc
->ShaderIndex
= o
->index
;
2962 TRACE("Returning null_shader_variable\n");
2963 desc
->pShaderVariable
= (ID3D10EffectShaderVariable
*)&null_shader_variable
;
2964 desc
->ShaderIndex
= 0;
2969 static struct ID3D10EffectVariable
* STDMETHODCALLTYPE
d3d10_effect_pass_GetAnnotationByIndex(ID3D10EffectPass
*iface
,
2972 struct d3d10_effect_pass
*This
= impl_from_ID3D10EffectPass(iface
);
2973 struct d3d10_effect_variable
*a
;
2975 TRACE("iface %p, index %u\n", iface
, index
);
2977 if (index
>= This
->annotation_count
)
2979 WARN("Invalid index specified\n");
2980 return &null_variable
.ID3D10EffectVariable_iface
;
2983 a
= &This
->annotations
[index
];
2985 TRACE("Returning annotation %p, %s\n", a
, debugstr_a(a
->name
));
2987 return &a
->ID3D10EffectVariable_iface
;
2990 static struct ID3D10EffectVariable
* STDMETHODCALLTYPE
d3d10_effect_pass_GetAnnotationByName(ID3D10EffectPass
*iface
,
2993 struct d3d10_effect_pass
*This
= impl_from_ID3D10EffectPass(iface
);
2996 TRACE("iface %p, name %s.\n", iface
, debugstr_a(name
));
2998 for (i
= 0; i
< This
->annotation_count
; ++i
)
3000 struct d3d10_effect_variable
*a
= &This
->annotations
[i
];
3001 if (!strcmp(a
->name
, name
))
3003 TRACE("Returning annotation %p\n", a
);
3004 return &a
->ID3D10EffectVariable_iface
;
3008 WARN("Invalid name specified\n");
3010 return &null_variable
.ID3D10EffectVariable_iface
;
3013 static HRESULT STDMETHODCALLTYPE
d3d10_effect_pass_Apply(ID3D10EffectPass
*iface
, UINT flags
)
3015 struct d3d10_effect_pass
*This
= impl_from_ID3D10EffectPass(iface
);
3019 TRACE("iface %p, flags %#x\n", iface
, flags
);
3021 if (flags
) FIXME("Ignoring flags (%#x)\n", flags
);
3023 for (i
= 0; i
< This
->object_count
; ++i
)
3025 hr
= d3d10_effect_object_apply(&This
->objects
[i
]);
3026 if (FAILED(hr
)) break;
3032 static HRESULT STDMETHODCALLTYPE
d3d10_effect_pass_ComputeStateBlockMask(ID3D10EffectPass
*iface
,
3033 D3D10_STATE_BLOCK_MASK
*mask
)
3035 FIXME("iface %p, mask %p stub!\n", iface
, mask
);
3040 static const struct ID3D10EffectPassVtbl d3d10_effect_pass_vtbl
=
3042 /* ID3D10EffectPass methods */
3043 d3d10_effect_pass_IsValid
,
3044 d3d10_effect_pass_GetDesc
,
3045 d3d10_effect_pass_GetVertexShaderDesc
,
3046 d3d10_effect_pass_GetGeometryShaderDesc
,
3047 d3d10_effect_pass_GetPixelShaderDesc
,
3048 d3d10_effect_pass_GetAnnotationByIndex
,
3049 d3d10_effect_pass_GetAnnotationByName
,
3050 d3d10_effect_pass_Apply
,
3051 d3d10_effect_pass_ComputeStateBlockMask
,
3054 /* ID3D10EffectVariable methods */
3056 static BOOL STDMETHODCALLTYPE
d3d10_effect_variable_IsValid(ID3D10EffectVariable
*iface
)
3058 TRACE("iface %p\n", iface
);
3060 return impl_from_ID3D10EffectVariable(iface
) != &null_variable
;
3063 static struct ID3D10EffectType
* STDMETHODCALLTYPE
d3d10_effect_variable_GetType(ID3D10EffectVariable
*iface
)
3065 struct d3d10_effect_variable
*This
= impl_from_ID3D10EffectVariable(iface
);
3067 TRACE("iface %p\n", iface
);
3069 return &This
->type
->ID3D10EffectType_iface
;
3072 static HRESULT STDMETHODCALLTYPE
d3d10_effect_variable_GetDesc(ID3D10EffectVariable
*iface
,
3073 D3D10_EFFECT_VARIABLE_DESC
*desc
)
3075 struct d3d10_effect_variable
*This
= impl_from_ID3D10EffectVariable(iface
);
3077 TRACE("iface %p, desc %p\n", iface
, desc
);
3079 if (!iface
->lpVtbl
->IsValid(iface
))
3081 WARN("Null variable specified\n");
3087 WARN("Invalid argument specified\n");
3088 return E_INVALIDARG
;
3091 /* FIXME: This isn't correct. Anonymous shaders let desc->ExplicitBindPoint untouched, but normal shaders set it! */
3092 memset(desc
, 0, sizeof(*desc
));
3093 desc
->Name
= This
->name
;
3094 desc
->Semantic
= This
->semantic
;
3095 desc
->Flags
= This
->flag
;
3096 desc
->Annotations
= This
->annotation_count
;
3097 desc
->BufferOffset
= This
->buffer_offset
;
3099 if (This
->flag
& D3D10_EFFECT_VARIABLE_EXPLICIT_BIND_POINT
)
3101 desc
->ExplicitBindPoint
= This
->buffer_offset
;
3107 static struct ID3D10EffectVariable
* STDMETHODCALLTYPE
d3d10_effect_variable_GetAnnotationByIndex(
3108 ID3D10EffectVariable
*iface
, UINT index
)
3110 struct d3d10_effect_variable
*This
= impl_from_ID3D10EffectVariable(iface
);
3111 struct d3d10_effect_variable
*a
;
3113 TRACE("iface %p, index %u\n", iface
, index
);
3115 if (index
>= This
->annotation_count
)
3117 WARN("Invalid index specified\n");
3118 return &null_variable
.ID3D10EffectVariable_iface
;
3121 a
= &This
->annotations
[index
];
3123 TRACE("Returning annotation %p, %s\n", a
, debugstr_a(a
->name
));
3125 return &a
->ID3D10EffectVariable_iface
;
3128 static struct ID3D10EffectVariable
* STDMETHODCALLTYPE
d3d10_effect_variable_GetAnnotationByName(
3129 ID3D10EffectVariable
*iface
, LPCSTR name
)
3131 struct d3d10_effect_variable
*This
= impl_from_ID3D10EffectVariable(iface
);
3134 TRACE("iface %p, name %s.\n", iface
, debugstr_a(name
));
3136 for (i
= 0; i
< This
->annotation_count
; ++i
)
3138 struct d3d10_effect_variable
*a
= &This
->annotations
[i
];
3139 if (!strcmp(a
->name
, name
))
3141 TRACE("Returning annotation %p\n", a
);
3142 return &a
->ID3D10EffectVariable_iface
;
3146 WARN("Invalid name specified\n");
3148 return &null_variable
.ID3D10EffectVariable_iface
;
3151 static struct ID3D10EffectVariable
* STDMETHODCALLTYPE
d3d10_effect_variable_GetMemberByIndex(
3152 ID3D10EffectVariable
*iface
, UINT index
)
3154 struct d3d10_effect_variable
*This
= impl_from_ID3D10EffectVariable(iface
);
3155 struct d3d10_effect_variable
*m
;
3157 TRACE("iface %p, index %u\n", iface
, index
);
3159 if (index
>= This
->type
->member_count
)
3161 WARN("Invalid index specified\n");
3162 return &null_variable
.ID3D10EffectVariable_iface
;
3165 m
= &This
->members
[index
];
3167 TRACE("Returning member %p, %s\n", m
, debugstr_a(m
->name
));
3169 return &m
->ID3D10EffectVariable_iface
;
3172 static struct ID3D10EffectVariable
* STDMETHODCALLTYPE
d3d10_effect_variable_GetMemberByName(
3173 ID3D10EffectVariable
*iface
, LPCSTR name
)
3175 struct d3d10_effect_variable
*This
= impl_from_ID3D10EffectVariable(iface
);
3178 TRACE("iface %p, name %s.\n", iface
, debugstr_a(name
));
3182 WARN("Invalid name specified\n");
3183 return &null_variable
.ID3D10EffectVariable_iface
;
3186 for (i
= 0; i
< This
->type
->member_count
; ++i
)
3188 struct d3d10_effect_variable
*m
= &This
->members
[i
];
3192 if (!strcmp(m
->name
, name
))
3194 TRACE("Returning member %p\n", m
);
3195 return &m
->ID3D10EffectVariable_iface
;
3200 WARN("Invalid name specified\n");
3202 return &null_variable
.ID3D10EffectVariable_iface
;
3205 static struct ID3D10EffectVariable
* STDMETHODCALLTYPE
d3d10_effect_variable_GetMemberBySemantic(
3206 ID3D10EffectVariable
*iface
, LPCSTR semantic
)
3208 struct d3d10_effect_variable
*This
= impl_from_ID3D10EffectVariable(iface
);
3211 TRACE("iface %p, semantic %s.\n", iface
, debugstr_a(semantic
));
3215 WARN("Invalid semantic specified\n");
3216 return &null_variable
.ID3D10EffectVariable_iface
;
3219 for (i
= 0; i
< This
->type
->member_count
; ++i
)
3221 struct d3d10_effect_variable
*m
= &This
->members
[i
];
3225 if (!strcmp(m
->semantic
, semantic
))
3227 TRACE("Returning member %p\n", m
);
3228 return &m
->ID3D10EffectVariable_iface
;
3233 WARN("Invalid semantic specified\n");
3235 return &null_variable
.ID3D10EffectVariable_iface
;
3238 static struct ID3D10EffectVariable
* STDMETHODCALLTYPE
d3d10_effect_variable_GetElement(
3239 ID3D10EffectVariable
*iface
, UINT index
)
3241 struct d3d10_effect_variable
*This
= impl_from_ID3D10EffectVariable(iface
);
3242 struct d3d10_effect_variable
*v
;
3244 TRACE("iface %p, index %u\n", iface
, index
);
3246 if (index
>= This
->type
->element_count
)
3248 WARN("Invalid index specified\n");
3249 return &null_variable
.ID3D10EffectVariable_iface
;
3252 v
= &This
->elements
[index
];
3254 TRACE("Returning element %p, %s\n", v
, debugstr_a(v
->name
));
3256 return &v
->ID3D10EffectVariable_iface
;
3259 static struct ID3D10EffectConstantBuffer
* STDMETHODCALLTYPE
d3d10_effect_variable_GetParentConstantBuffer(
3260 ID3D10EffectVariable
*iface
)
3262 struct d3d10_effect_variable
*This
= impl_from_ID3D10EffectVariable(iface
);
3264 TRACE("iface %p\n", iface
);
3266 return (ID3D10EffectConstantBuffer
*)This
->buffer
;
3269 static struct ID3D10EffectScalarVariable
* STDMETHODCALLTYPE
d3d10_effect_variable_AsScalar(
3270 ID3D10EffectVariable
*iface
)
3272 struct d3d10_effect_variable
*This
= impl_from_ID3D10EffectVariable(iface
);
3274 TRACE("iface %p\n", iface
);
3276 if (This
->ID3D10EffectVariable_iface
.lpVtbl
== (const ID3D10EffectVariableVtbl
*)&d3d10_effect_scalar_variable_vtbl
)
3277 return (ID3D10EffectScalarVariable
*)&This
->ID3D10EffectVariable_iface
;
3279 return (ID3D10EffectScalarVariable
*)&null_scalar_variable
.ID3D10EffectVariable_iface
;
3282 static struct ID3D10EffectVectorVariable
* STDMETHODCALLTYPE
d3d10_effect_variable_AsVector(
3283 ID3D10EffectVariable
*iface
)
3285 struct d3d10_effect_variable
*This
= impl_from_ID3D10EffectVariable(iface
);
3287 TRACE("iface %p\n", iface
);
3289 if (This
->ID3D10EffectVariable_iface
.lpVtbl
== (const ID3D10EffectVariableVtbl
*)&d3d10_effect_vector_variable_vtbl
)
3290 return (ID3D10EffectVectorVariable
*)&This
->ID3D10EffectVariable_iface
;
3292 return (ID3D10EffectVectorVariable
*)&null_vector_variable
.ID3D10EffectVariable_iface
;
3295 static struct ID3D10EffectMatrixVariable
* STDMETHODCALLTYPE
d3d10_effect_variable_AsMatrix(
3296 ID3D10EffectVariable
*iface
)
3298 struct d3d10_effect_variable
*This
= impl_from_ID3D10EffectVariable(iface
);
3300 TRACE("iface %p\n", iface
);
3302 if (This
->ID3D10EffectVariable_iface
.lpVtbl
== (const ID3D10EffectVariableVtbl
*)&d3d10_effect_matrix_variable_vtbl
)
3303 return (ID3D10EffectMatrixVariable
*)&This
->ID3D10EffectVariable_iface
;
3305 return (ID3D10EffectMatrixVariable
*)&null_matrix_variable
.ID3D10EffectVariable_iface
;
3308 static struct ID3D10EffectStringVariable
* STDMETHODCALLTYPE
d3d10_effect_variable_AsString(
3309 ID3D10EffectVariable
*iface
)
3311 struct d3d10_effect_variable
*This
= impl_from_ID3D10EffectVariable(iface
);
3313 TRACE("iface %p\n", iface
);
3315 if (This
->ID3D10EffectVariable_iface
.lpVtbl
== (const ID3D10EffectVariableVtbl
*)&d3d10_effect_string_variable_vtbl
)
3316 return (ID3D10EffectStringVariable
*)&This
->ID3D10EffectVariable_iface
;
3318 return (ID3D10EffectStringVariable
*)&null_string_variable
.ID3D10EffectVariable_iface
;
3321 static struct ID3D10EffectShaderResourceVariable
* STDMETHODCALLTYPE
d3d10_effect_variable_AsShaderResource(
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_shader_resource_variable_vtbl
)
3329 return (ID3D10EffectShaderResourceVariable
*)&This
->ID3D10EffectVariable_iface
;
3331 return (ID3D10EffectShaderResourceVariable
*)&null_shader_resource_variable
.ID3D10EffectVariable_iface
;
3334 static struct ID3D10EffectRenderTargetViewVariable
* STDMETHODCALLTYPE
d3d10_effect_variable_AsRenderTargetView(
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_render_target_view_variable_vtbl
)
3342 return (ID3D10EffectRenderTargetViewVariable
*)&This
->ID3D10EffectVariable_iface
;
3344 return (ID3D10EffectRenderTargetViewVariable
*)&null_render_target_view_variable
.ID3D10EffectVariable_iface
;
3347 static struct ID3D10EffectDepthStencilViewVariable
* STDMETHODCALLTYPE
d3d10_effect_variable_AsDepthStencilView(
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_depth_stencil_view_variable_vtbl
)
3355 return (ID3D10EffectDepthStencilViewVariable
*)&This
->ID3D10EffectVariable_iface
;
3357 return (ID3D10EffectDepthStencilViewVariable
*)&null_depth_stencil_view_variable
.ID3D10EffectVariable_iface
;
3360 static struct ID3D10EffectConstantBuffer
* STDMETHODCALLTYPE
d3d10_effect_variable_AsConstantBuffer(
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_constant_buffer_vtbl
)
3368 return (ID3D10EffectConstantBuffer
*)&This
->ID3D10EffectVariable_iface
;
3370 return (ID3D10EffectConstantBuffer
*)&null_local_buffer
.ID3D10EffectVariable_iface
;
3373 static struct ID3D10EffectShaderVariable
* STDMETHODCALLTYPE
d3d10_effect_variable_AsShader(
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_variable_vtbl
)
3381 return (ID3D10EffectShaderVariable
*)&This
->ID3D10EffectVariable_iface
;
3383 return (ID3D10EffectShaderVariable
*)&null_shader_variable
.ID3D10EffectVariable_iface
;
3386 static struct ID3D10EffectBlendVariable
* STDMETHODCALLTYPE
d3d10_effect_variable_AsBlend(ID3D10EffectVariable
*iface
)
3388 struct d3d10_effect_variable
*This
= impl_from_ID3D10EffectVariable(iface
);
3390 TRACE("iface %p\n", iface
);
3392 if (This
->ID3D10EffectVariable_iface
.lpVtbl
== (const ID3D10EffectVariableVtbl
*)&d3d10_effect_blend_variable_vtbl
)
3393 return (ID3D10EffectBlendVariable
*)&This
->ID3D10EffectVariable_iface
;
3395 return (ID3D10EffectBlendVariable
*)&null_blend_variable
.ID3D10EffectVariable_iface
;
3398 static struct ID3D10EffectDepthStencilVariable
* STDMETHODCALLTYPE
d3d10_effect_variable_AsDepthStencil(
3399 ID3D10EffectVariable
*iface
)
3401 struct d3d10_effect_variable
*This
= impl_from_ID3D10EffectVariable(iface
);
3403 TRACE("iface %p\n", iface
);
3405 if (This
->ID3D10EffectVariable_iface
.lpVtbl
== (const ID3D10EffectVariableVtbl
*)&d3d10_effect_depth_stencil_variable_vtbl
)
3406 return (ID3D10EffectDepthStencilVariable
*)&This
->ID3D10EffectVariable_iface
;
3408 return (ID3D10EffectDepthStencilVariable
*)&null_depth_stencil_variable
.ID3D10EffectVariable_iface
;
3411 static struct ID3D10EffectRasterizerVariable
* STDMETHODCALLTYPE
d3d10_effect_variable_AsRasterizer(
3412 ID3D10EffectVariable
*iface
)
3414 struct d3d10_effect_variable
*This
= impl_from_ID3D10EffectVariable(iface
);
3416 TRACE("iface %p\n", iface
);
3418 if (This
->ID3D10EffectVariable_iface
.lpVtbl
== (const ID3D10EffectVariableVtbl
*)&d3d10_effect_rasterizer_variable_vtbl
)
3419 return (ID3D10EffectRasterizerVariable
*)&This
->ID3D10EffectVariable_iface
;
3421 return (ID3D10EffectRasterizerVariable
*)&null_rasterizer_variable
.ID3D10EffectVariable_iface
;
3424 static struct ID3D10EffectSamplerVariable
* STDMETHODCALLTYPE
d3d10_effect_variable_AsSampler(
3425 ID3D10EffectVariable
*iface
)
3427 struct d3d10_effect_variable
*This
= impl_from_ID3D10EffectVariable(iface
);
3429 TRACE("iface %p\n", iface
);
3431 if (This
->ID3D10EffectVariable_iface
.lpVtbl
== (const ID3D10EffectVariableVtbl
*)&d3d10_effect_sampler_variable_vtbl
)
3432 return (ID3D10EffectSamplerVariable
*)&This
->ID3D10EffectVariable_iface
;
3434 return (ID3D10EffectSamplerVariable
*)&null_sampler_variable
.ID3D10EffectVariable_iface
;
3437 static HRESULT STDMETHODCALLTYPE
d3d10_effect_variable_SetRawValue(ID3D10EffectVariable
*iface
,
3438 void *data
, UINT offset
, UINT count
)
3440 FIXME("iface %p, data %p, offset %u, count %u stub!\n", iface
, data
, offset
, count
);
3445 static HRESULT STDMETHODCALLTYPE
d3d10_effect_variable_GetRawValue(ID3D10EffectVariable
*iface
,
3446 void *data
, UINT offset
, UINT count
)
3448 FIXME("iface %p, data %p, offset %u, count %u stub!\n", iface
, data
, offset
, count
);
3453 static const struct ID3D10EffectVariableVtbl d3d10_effect_variable_vtbl
=
3455 /* ID3D10EffectVariable methods */
3456 d3d10_effect_variable_IsValid
,
3457 d3d10_effect_variable_GetType
,
3458 d3d10_effect_variable_GetDesc
,
3459 d3d10_effect_variable_GetAnnotationByIndex
,
3460 d3d10_effect_variable_GetAnnotationByName
,
3461 d3d10_effect_variable_GetMemberByIndex
,
3462 d3d10_effect_variable_GetMemberByName
,
3463 d3d10_effect_variable_GetMemberBySemantic
,
3464 d3d10_effect_variable_GetElement
,
3465 d3d10_effect_variable_GetParentConstantBuffer
,
3466 d3d10_effect_variable_AsScalar
,
3467 d3d10_effect_variable_AsVector
,
3468 d3d10_effect_variable_AsMatrix
,
3469 d3d10_effect_variable_AsString
,
3470 d3d10_effect_variable_AsShaderResource
,
3471 d3d10_effect_variable_AsRenderTargetView
,
3472 d3d10_effect_variable_AsDepthStencilView
,
3473 d3d10_effect_variable_AsConstantBuffer
,
3474 d3d10_effect_variable_AsShader
,
3475 d3d10_effect_variable_AsBlend
,
3476 d3d10_effect_variable_AsDepthStencil
,
3477 d3d10_effect_variable_AsRasterizer
,
3478 d3d10_effect_variable_AsSampler
,
3479 d3d10_effect_variable_SetRawValue
,
3480 d3d10_effect_variable_GetRawValue
,
3483 /* ID3D10EffectVariable methods */
3484 static BOOL STDMETHODCALLTYPE
d3d10_effect_constant_buffer_IsValid(ID3D10EffectConstantBuffer
*iface
)
3486 TRACE("iface %p\n", iface
);
3488 return (struct d3d10_effect_variable
*)iface
!= &null_local_buffer
;
3491 static struct ID3D10EffectType
* STDMETHODCALLTYPE
d3d10_effect_constant_buffer_GetType(ID3D10EffectConstantBuffer
*iface
)
3493 return d3d10_effect_variable_GetType((ID3D10EffectVariable
*)iface
);
3496 static HRESULT STDMETHODCALLTYPE
d3d10_effect_constant_buffer_GetDesc(ID3D10EffectConstantBuffer
*iface
,
3497 D3D10_EFFECT_VARIABLE_DESC
*desc
)
3499 return d3d10_effect_variable_GetDesc((ID3D10EffectVariable
*)iface
, desc
);
3502 static struct ID3D10EffectVariable
* STDMETHODCALLTYPE
d3d10_effect_constant_buffer_GetAnnotationByIndex(
3503 ID3D10EffectConstantBuffer
*iface
, UINT index
)
3505 return d3d10_effect_variable_GetAnnotationByIndex((ID3D10EffectVariable
*)iface
, index
);
3508 static struct ID3D10EffectVariable
* STDMETHODCALLTYPE
d3d10_effect_constant_buffer_GetAnnotationByName(
3509 ID3D10EffectConstantBuffer
*iface
, LPCSTR name
)
3511 return d3d10_effect_variable_GetAnnotationByName((ID3D10EffectVariable
*)iface
, name
);
3514 static struct ID3D10EffectVariable
* STDMETHODCALLTYPE
d3d10_effect_constant_buffer_GetMemberByIndex(
3515 ID3D10EffectConstantBuffer
*iface
, UINT index
)
3517 return d3d10_effect_variable_GetMemberByIndex((ID3D10EffectVariable
*)iface
, index
);
3520 static struct ID3D10EffectVariable
* STDMETHODCALLTYPE
d3d10_effect_constant_buffer_GetMemberByName(
3521 ID3D10EffectConstantBuffer
*iface
, LPCSTR name
)
3523 return d3d10_effect_variable_GetMemberByName((ID3D10EffectVariable
*)iface
, name
);
3526 static struct ID3D10EffectVariable
* STDMETHODCALLTYPE
d3d10_effect_constant_buffer_GetMemberBySemantic(
3527 ID3D10EffectConstantBuffer
*iface
, LPCSTR semantic
)
3529 return d3d10_effect_variable_GetMemberBySemantic((ID3D10EffectVariable
*)iface
, semantic
);
3532 static struct ID3D10EffectVariable
* STDMETHODCALLTYPE
d3d10_effect_constant_buffer_GetElement(
3533 ID3D10EffectConstantBuffer
*iface
, UINT index
)
3535 return d3d10_effect_variable_GetElement((ID3D10EffectVariable
*)iface
, index
);
3538 static struct ID3D10EffectConstantBuffer
* STDMETHODCALLTYPE
d3d10_effect_constant_buffer_GetParentConstantBuffer(
3539 ID3D10EffectConstantBuffer
*iface
)
3541 return d3d10_effect_variable_GetParentConstantBuffer((ID3D10EffectVariable
*)iface
);
3544 static struct ID3D10EffectScalarVariable
* STDMETHODCALLTYPE
d3d10_effect_constant_buffer_AsScalar(
3545 ID3D10EffectConstantBuffer
*iface
)
3547 return d3d10_effect_variable_AsScalar((ID3D10EffectVariable
*)iface
);
3550 static struct ID3D10EffectVectorVariable
* STDMETHODCALLTYPE
d3d10_effect_constant_buffer_AsVector(
3551 ID3D10EffectConstantBuffer
*iface
)
3553 return d3d10_effect_variable_AsVector((ID3D10EffectVariable
*)iface
);
3556 static struct ID3D10EffectMatrixVariable
* STDMETHODCALLTYPE
d3d10_effect_constant_buffer_AsMatrix(
3557 ID3D10EffectConstantBuffer
*iface
)
3559 return d3d10_effect_variable_AsMatrix((ID3D10EffectVariable
*)iface
);
3562 static struct ID3D10EffectStringVariable
* STDMETHODCALLTYPE
d3d10_effect_constant_buffer_AsString(
3563 ID3D10EffectConstantBuffer
*iface
)
3565 return d3d10_effect_variable_AsString((ID3D10EffectVariable
*)iface
);
3568 static struct ID3D10EffectShaderResourceVariable
* STDMETHODCALLTYPE
d3d10_effect_constant_buffer_AsShaderResource(
3569 ID3D10EffectConstantBuffer
*iface
)
3571 return d3d10_effect_variable_AsShaderResource((ID3D10EffectVariable
*)iface
);
3574 static struct ID3D10EffectRenderTargetViewVariable
* STDMETHODCALLTYPE
d3d10_effect_constant_buffer_AsRenderTargetView(
3575 ID3D10EffectConstantBuffer
*iface
)
3577 return d3d10_effect_variable_AsRenderTargetView((ID3D10EffectVariable
*)iface
);
3580 static struct ID3D10EffectDepthStencilViewVariable
* STDMETHODCALLTYPE
d3d10_effect_constant_buffer_AsDepthStencilView(
3581 ID3D10EffectConstantBuffer
*iface
)
3583 return d3d10_effect_variable_AsDepthStencilView((ID3D10EffectVariable
*)iface
);
3586 static struct ID3D10EffectConstantBuffer
* STDMETHODCALLTYPE
d3d10_effect_constant_buffer_AsConstantBuffer(
3587 ID3D10EffectConstantBuffer
*iface
)
3589 return d3d10_effect_variable_AsConstantBuffer((ID3D10EffectVariable
*)iface
);
3592 static struct ID3D10EffectShaderVariable
* STDMETHODCALLTYPE
d3d10_effect_constant_buffer_AsShader(
3593 ID3D10EffectConstantBuffer
*iface
)
3595 return d3d10_effect_variable_AsShader((ID3D10EffectVariable
*)iface
);
3598 static struct ID3D10EffectBlendVariable
* STDMETHODCALLTYPE
d3d10_effect_constant_buffer_AsBlend(ID3D10EffectConstantBuffer
*iface
)
3600 return d3d10_effect_variable_AsBlend((ID3D10EffectVariable
*)iface
);
3603 static struct ID3D10EffectDepthStencilVariable
* STDMETHODCALLTYPE
d3d10_effect_constant_buffer_AsDepthStencil(
3604 ID3D10EffectConstantBuffer
*iface
)
3606 return d3d10_effect_variable_AsDepthStencil((ID3D10EffectVariable
*)iface
);
3609 static struct ID3D10EffectRasterizerVariable
* STDMETHODCALLTYPE
d3d10_effect_constant_buffer_AsRasterizer(
3610 ID3D10EffectConstantBuffer
*iface
)
3612 return d3d10_effect_variable_AsRasterizer((ID3D10EffectVariable
*)iface
);
3615 static struct ID3D10EffectSamplerVariable
* STDMETHODCALLTYPE
d3d10_effect_constant_buffer_AsSampler(
3616 ID3D10EffectConstantBuffer
*iface
)
3618 return d3d10_effect_variable_AsSampler((ID3D10EffectVariable
*)iface
);
3621 static HRESULT STDMETHODCALLTYPE
d3d10_effect_constant_buffer_SetRawValue(ID3D10EffectConstantBuffer
*iface
,
3622 void *data
, UINT offset
, UINT count
)
3624 return d3d10_effect_variable_SetRawValue((ID3D10EffectVariable
*)iface
, data
, offset
, count
);
3627 static HRESULT STDMETHODCALLTYPE
d3d10_effect_constant_buffer_GetRawValue(ID3D10EffectConstantBuffer
*iface
,
3628 void *data
, UINT offset
, UINT count
)
3630 return d3d10_effect_variable_GetRawValue((ID3D10EffectVariable
*)iface
, data
, offset
, count
);
3633 /* ID3D10EffectConstantBuffer methods */
3634 static HRESULT STDMETHODCALLTYPE
d3d10_effect_constant_buffer_SetConstantBuffer(ID3D10EffectConstantBuffer
*iface
,
3635 ID3D10Buffer
*buffer
)
3637 FIXME("iface %p, buffer %p stub!\n", iface
, buffer
);
3642 static HRESULT STDMETHODCALLTYPE
d3d10_effect_constant_buffer_GetConstantBuffer(ID3D10EffectConstantBuffer
*iface
,
3643 ID3D10Buffer
**buffer
)
3645 FIXME("iface %p, buffer %p stub!\n", iface
, buffer
);
3650 static HRESULT STDMETHODCALLTYPE
d3d10_effect_constant_buffer_SetTextureBuffer(ID3D10EffectConstantBuffer
*iface
,
3651 ID3D10ShaderResourceView
*view
)
3653 FIXME("iface %p, view %p stub!\n", iface
, view
);
3658 static HRESULT STDMETHODCALLTYPE
d3d10_effect_constant_buffer_GetTextureBuffer(ID3D10EffectConstantBuffer
*iface
,
3659 ID3D10ShaderResourceView
**view
)
3661 FIXME("iface %p, view %p stub!\n", iface
, view
);
3666 static const struct ID3D10EffectConstantBufferVtbl d3d10_effect_constant_buffer_vtbl
=
3668 /* ID3D10EffectVariable methods */
3669 d3d10_effect_constant_buffer_IsValid
,
3670 d3d10_effect_constant_buffer_GetType
,
3671 d3d10_effect_constant_buffer_GetDesc
,
3672 d3d10_effect_constant_buffer_GetAnnotationByIndex
,
3673 d3d10_effect_constant_buffer_GetAnnotationByName
,
3674 d3d10_effect_constant_buffer_GetMemberByIndex
,
3675 d3d10_effect_constant_buffer_GetMemberByName
,
3676 d3d10_effect_constant_buffer_GetMemberBySemantic
,
3677 d3d10_effect_constant_buffer_GetElement
,
3678 d3d10_effect_constant_buffer_GetParentConstantBuffer
,
3679 d3d10_effect_constant_buffer_AsScalar
,
3680 d3d10_effect_constant_buffer_AsVector
,
3681 d3d10_effect_constant_buffer_AsMatrix
,
3682 d3d10_effect_constant_buffer_AsString
,
3683 d3d10_effect_constant_buffer_AsShaderResource
,
3684 d3d10_effect_constant_buffer_AsRenderTargetView
,
3685 d3d10_effect_constant_buffer_AsDepthStencilView
,
3686 d3d10_effect_constant_buffer_AsConstantBuffer
,
3687 d3d10_effect_constant_buffer_AsShader
,
3688 d3d10_effect_constant_buffer_AsBlend
,
3689 d3d10_effect_constant_buffer_AsDepthStencil
,
3690 d3d10_effect_constant_buffer_AsRasterizer
,
3691 d3d10_effect_constant_buffer_AsSampler
,
3692 d3d10_effect_constant_buffer_SetRawValue
,
3693 d3d10_effect_constant_buffer_GetRawValue
,
3694 /* ID3D10EffectConstantBuffer methods */
3695 d3d10_effect_constant_buffer_SetConstantBuffer
,
3696 d3d10_effect_constant_buffer_GetConstantBuffer
,
3697 d3d10_effect_constant_buffer_SetTextureBuffer
,
3698 d3d10_effect_constant_buffer_GetTextureBuffer
,
3701 /* ID3D10EffectVariable methods */
3703 static BOOL STDMETHODCALLTYPE
d3d10_effect_scalar_variable_IsValid(ID3D10EffectScalarVariable
*iface
)
3705 TRACE("iface %p\n", iface
);
3707 return (struct d3d10_effect_variable
*)iface
!= &null_scalar_variable
;
3710 static struct ID3D10EffectType
* STDMETHODCALLTYPE
d3d10_effect_scalar_variable_GetType(
3711 ID3D10EffectScalarVariable
*iface
)
3713 return d3d10_effect_variable_GetType((ID3D10EffectVariable
*)iface
);
3716 static HRESULT STDMETHODCALLTYPE
d3d10_effect_scalar_variable_GetDesc(ID3D10EffectScalarVariable
*iface
,
3717 D3D10_EFFECT_VARIABLE_DESC
*desc
)
3719 return d3d10_effect_variable_GetDesc((ID3D10EffectVariable
*)iface
, desc
);
3722 static struct ID3D10EffectVariable
* STDMETHODCALLTYPE
d3d10_effect_scalar_variable_GetAnnotationByIndex(
3723 ID3D10EffectScalarVariable
*iface
, UINT index
)
3725 return d3d10_effect_variable_GetAnnotationByIndex((ID3D10EffectVariable
*)iface
, index
);
3728 static struct ID3D10EffectVariable
* STDMETHODCALLTYPE
d3d10_effect_scalar_variable_GetAnnotationByName(
3729 ID3D10EffectScalarVariable
*iface
, LPCSTR name
)
3731 return d3d10_effect_variable_GetAnnotationByName((ID3D10EffectVariable
*)iface
, name
);
3734 static struct ID3D10EffectVariable
* STDMETHODCALLTYPE
d3d10_effect_scalar_variable_GetMemberByIndex(
3735 ID3D10EffectScalarVariable
*iface
, UINT index
)
3737 return d3d10_effect_variable_GetMemberByIndex((ID3D10EffectVariable
*)iface
, index
);
3740 static struct ID3D10EffectVariable
* STDMETHODCALLTYPE
d3d10_effect_scalar_variable_GetMemberByName(
3741 ID3D10EffectScalarVariable
*iface
, LPCSTR name
)
3743 return d3d10_effect_variable_GetMemberByName((ID3D10EffectVariable
*)iface
, name
);
3746 static struct ID3D10EffectVariable
* STDMETHODCALLTYPE
d3d10_effect_scalar_variable_GetMemberBySemantic(
3747 ID3D10EffectScalarVariable
*iface
, LPCSTR semantic
)
3749 return d3d10_effect_variable_GetMemberBySemantic((ID3D10EffectVariable
*)iface
, semantic
);
3752 static struct ID3D10EffectVariable
* STDMETHODCALLTYPE
d3d10_effect_scalar_variable_GetElement(
3753 ID3D10EffectScalarVariable
*iface
, UINT index
)
3755 return d3d10_effect_variable_GetElement((ID3D10EffectVariable
*)iface
, index
);
3758 static struct ID3D10EffectConstantBuffer
* STDMETHODCALLTYPE
d3d10_effect_scalar_variable_GetParentConstantBuffer(
3759 ID3D10EffectScalarVariable
*iface
)
3761 return d3d10_effect_variable_GetParentConstantBuffer((ID3D10EffectVariable
*)iface
);
3764 static struct ID3D10EffectScalarVariable
* STDMETHODCALLTYPE
d3d10_effect_scalar_variable_AsScalar(
3765 ID3D10EffectScalarVariable
*iface
)
3767 return d3d10_effect_variable_AsScalar((ID3D10EffectVariable
*)iface
);
3770 static struct ID3D10EffectVectorVariable
* STDMETHODCALLTYPE
d3d10_effect_scalar_variable_AsVector(
3771 ID3D10EffectScalarVariable
*iface
)
3773 return d3d10_effect_variable_AsVector((ID3D10EffectVariable
*)iface
);
3776 static struct ID3D10EffectMatrixVariable
* STDMETHODCALLTYPE
d3d10_effect_scalar_variable_AsMatrix(
3777 ID3D10EffectScalarVariable
*iface
)
3779 return d3d10_effect_variable_AsMatrix((ID3D10EffectVariable
*)iface
);
3782 static struct ID3D10EffectStringVariable
* STDMETHODCALLTYPE
d3d10_effect_scalar_variable_AsString(
3783 ID3D10EffectScalarVariable
*iface
)
3785 return d3d10_effect_variable_AsString((ID3D10EffectVariable
*)iface
);
3788 static struct ID3D10EffectShaderResourceVariable
* STDMETHODCALLTYPE
d3d10_effect_scalar_variable_AsShaderResource(
3789 ID3D10EffectScalarVariable
*iface
)
3791 return d3d10_effect_variable_AsShaderResource((ID3D10EffectVariable
*)iface
);
3794 static struct ID3D10EffectRenderTargetViewVariable
* STDMETHODCALLTYPE
d3d10_effect_scalar_variable_AsRenderTargetView(
3795 ID3D10EffectScalarVariable
*iface
)
3797 return d3d10_effect_variable_AsRenderTargetView((ID3D10EffectVariable
*)iface
);
3800 static struct ID3D10EffectDepthStencilViewVariable
* STDMETHODCALLTYPE
d3d10_effect_scalar_variable_AsDepthStencilView(
3801 ID3D10EffectScalarVariable
*iface
)
3803 return d3d10_effect_variable_AsDepthStencilView((ID3D10EffectVariable
*)iface
);
3806 static struct ID3D10EffectConstantBuffer
* STDMETHODCALLTYPE
d3d10_effect_scalar_variable_AsConstantBuffer(
3807 ID3D10EffectScalarVariable
*iface
)
3809 return d3d10_effect_variable_AsConstantBuffer((ID3D10EffectVariable
*)iface
);
3812 static struct ID3D10EffectShaderVariable
* STDMETHODCALLTYPE
d3d10_effect_scalar_variable_AsShader(
3813 ID3D10EffectScalarVariable
*iface
)
3815 return d3d10_effect_variable_AsShader((ID3D10EffectVariable
*)iface
);
3818 static struct ID3D10EffectBlendVariable
* STDMETHODCALLTYPE
d3d10_effect_scalar_variable_AsBlend(
3819 ID3D10EffectScalarVariable
*iface
)
3821 return d3d10_effect_variable_AsBlend((ID3D10EffectVariable
*)iface
);
3824 static struct ID3D10EffectDepthStencilVariable
* STDMETHODCALLTYPE
d3d10_effect_scalar_variable_AsDepthStencil(
3825 ID3D10EffectScalarVariable
*iface
)
3827 return d3d10_effect_variable_AsDepthStencil((ID3D10EffectVariable
*)iface
);
3830 static struct ID3D10EffectRasterizerVariable
* STDMETHODCALLTYPE
d3d10_effect_scalar_variable_AsRasterizer(
3831 ID3D10EffectScalarVariable
*iface
)
3833 return d3d10_effect_variable_AsRasterizer((ID3D10EffectVariable
*)iface
);
3836 static struct ID3D10EffectSamplerVariable
* STDMETHODCALLTYPE
d3d10_effect_scalar_variable_AsSampler(
3837 ID3D10EffectScalarVariable
*iface
)
3839 return d3d10_effect_variable_AsSampler((ID3D10EffectVariable
*)iface
);
3842 static HRESULT STDMETHODCALLTYPE
d3d10_effect_scalar_variable_SetRawValue(ID3D10EffectScalarVariable
*iface
,
3843 void *data
, UINT offset
, UINT count
)
3845 return d3d10_effect_variable_SetRawValue((ID3D10EffectVariable
*)iface
, data
, offset
, count
);
3848 static HRESULT STDMETHODCALLTYPE
d3d10_effect_scalar_variable_GetRawValue(ID3D10EffectScalarVariable
*iface
,
3849 void *data
, UINT offset
, UINT count
)
3851 return d3d10_effect_variable_GetRawValue((ID3D10EffectVariable
*)iface
, data
, offset
, count
);
3854 /* ID3D10EffectScalarVariable methods */
3856 static HRESULT STDMETHODCALLTYPE
d3d10_effect_scalar_variable_SetFloat(ID3D10EffectScalarVariable
*iface
,
3859 FIXME("iface %p, value %.8e stub!\n", iface
, value
);
3864 static HRESULT STDMETHODCALLTYPE
d3d10_effect_scalar_variable_GetFloat(ID3D10EffectScalarVariable
*iface
,
3867 FIXME("iface %p, value %p stub!\n", iface
, value
);
3872 static HRESULT STDMETHODCALLTYPE
d3d10_effect_scalar_variable_SetFloatArray(ID3D10EffectScalarVariable
*iface
,
3873 float *values
, UINT offset
, UINT count
)
3875 FIXME("iface %p, values %p, offset %u, count %u stub!\n", iface
, values
, offset
, count
);
3880 static HRESULT STDMETHODCALLTYPE
d3d10_effect_scalar_variable_GetFloatArray(ID3D10EffectScalarVariable
*iface
,
3881 float *values
, UINT offset
, UINT count
)
3883 FIXME("iface %p, values %p, offset %u, count %u stub!\n", iface
, values
, offset
, count
);
3888 static HRESULT STDMETHODCALLTYPE
d3d10_effect_scalar_variable_SetInt(ID3D10EffectScalarVariable
*iface
,
3891 FIXME("iface %p, value %d stub!\n", iface
, value
);
3896 static HRESULT STDMETHODCALLTYPE
d3d10_effect_scalar_variable_GetInt(ID3D10EffectScalarVariable
*iface
,
3899 FIXME("iface %p, value %p stub!\n", iface
, value
);
3904 static HRESULT STDMETHODCALLTYPE
d3d10_effect_scalar_variable_SetIntArray(ID3D10EffectScalarVariable
*iface
,
3905 int *values
, UINT offset
, UINT count
)
3907 FIXME("iface %p, values %p, offset %u, count %u stub!\n", iface
, values
, offset
, count
);
3912 static HRESULT STDMETHODCALLTYPE
d3d10_effect_scalar_variable_GetIntArray(ID3D10EffectScalarVariable
*iface
,
3913 int *values
, UINT offset
, UINT count
)
3915 FIXME("iface %p, values %p, offset %u, count %u stub!\n", iface
, values
, offset
, count
);
3920 static HRESULT STDMETHODCALLTYPE
d3d10_effect_scalar_variable_SetBool(ID3D10EffectScalarVariable
*iface
,
3923 FIXME("iface %p, value %d stub!\n", iface
, value
);
3928 static HRESULT STDMETHODCALLTYPE
d3d10_effect_scalar_variable_GetBool(ID3D10EffectScalarVariable
*iface
,
3931 FIXME("iface %p, value %p stub!\n", iface
, value
);
3936 static HRESULT STDMETHODCALLTYPE
d3d10_effect_scalar_variable_SetBoolArray(ID3D10EffectScalarVariable
*iface
,
3937 BOOL
*values
, UINT offset
, UINT count
)
3939 FIXME("iface %p, values %p, offset %u, count %u stub!\n", iface
, values
, offset
, count
);
3944 static HRESULT STDMETHODCALLTYPE
d3d10_effect_scalar_variable_GetBoolArray(ID3D10EffectScalarVariable
*iface
,
3945 BOOL
*values
, UINT offset
, UINT count
)
3947 FIXME("iface %p, values %p, offset %u, count %u stub!\n", iface
, values
, offset
, count
);
3952 static const struct ID3D10EffectScalarVariableVtbl d3d10_effect_scalar_variable_vtbl
=
3954 /* ID3D10EffectVariable methods */
3955 d3d10_effect_scalar_variable_IsValid
,
3956 d3d10_effect_scalar_variable_GetType
,
3957 d3d10_effect_scalar_variable_GetDesc
,
3958 d3d10_effect_scalar_variable_GetAnnotationByIndex
,
3959 d3d10_effect_scalar_variable_GetAnnotationByName
,
3960 d3d10_effect_scalar_variable_GetMemberByIndex
,
3961 d3d10_effect_scalar_variable_GetMemberByName
,
3962 d3d10_effect_scalar_variable_GetMemberBySemantic
,
3963 d3d10_effect_scalar_variable_GetElement
,
3964 d3d10_effect_scalar_variable_GetParentConstantBuffer
,
3965 d3d10_effect_scalar_variable_AsScalar
,
3966 d3d10_effect_scalar_variable_AsVector
,
3967 d3d10_effect_scalar_variable_AsMatrix
,
3968 d3d10_effect_scalar_variable_AsString
,
3969 d3d10_effect_scalar_variable_AsShaderResource
,
3970 d3d10_effect_scalar_variable_AsRenderTargetView
,
3971 d3d10_effect_scalar_variable_AsDepthStencilView
,
3972 d3d10_effect_scalar_variable_AsConstantBuffer
,
3973 d3d10_effect_scalar_variable_AsShader
,
3974 d3d10_effect_scalar_variable_AsBlend
,
3975 d3d10_effect_scalar_variable_AsDepthStencil
,
3976 d3d10_effect_scalar_variable_AsRasterizer
,
3977 d3d10_effect_scalar_variable_AsSampler
,
3978 d3d10_effect_scalar_variable_SetRawValue
,
3979 d3d10_effect_scalar_variable_GetRawValue
,
3980 /* ID3D10EffectScalarVariable methods */
3981 d3d10_effect_scalar_variable_SetFloat
,
3982 d3d10_effect_scalar_variable_GetFloat
,
3983 d3d10_effect_scalar_variable_SetFloatArray
,
3984 d3d10_effect_scalar_variable_GetFloatArray
,
3985 d3d10_effect_scalar_variable_SetInt
,
3986 d3d10_effect_scalar_variable_GetInt
,
3987 d3d10_effect_scalar_variable_SetIntArray
,
3988 d3d10_effect_scalar_variable_GetIntArray
,
3989 d3d10_effect_scalar_variable_SetBool
,
3990 d3d10_effect_scalar_variable_GetBool
,
3991 d3d10_effect_scalar_variable_SetBoolArray
,
3992 d3d10_effect_scalar_variable_GetBoolArray
,
3995 /* ID3D10EffectVariable methods */
3997 static BOOL STDMETHODCALLTYPE
d3d10_effect_vector_variable_IsValid(ID3D10EffectVectorVariable
*iface
)
3999 TRACE("iface %p\n", iface
);
4001 return (struct d3d10_effect_variable
*)iface
!= &null_vector_variable
;
4004 static struct ID3D10EffectType
* STDMETHODCALLTYPE
d3d10_effect_vector_variable_GetType(
4005 ID3D10EffectVectorVariable
*iface
)
4007 return d3d10_effect_variable_GetType((ID3D10EffectVariable
*)iface
);
4010 static HRESULT STDMETHODCALLTYPE
d3d10_effect_vector_variable_GetDesc(ID3D10EffectVectorVariable
*iface
,
4011 D3D10_EFFECT_VARIABLE_DESC
*desc
)
4013 return d3d10_effect_variable_GetDesc((ID3D10EffectVariable
*)iface
, desc
);
4016 static struct ID3D10EffectVariable
* STDMETHODCALLTYPE
d3d10_effect_vector_variable_GetAnnotationByIndex(
4017 ID3D10EffectVectorVariable
*iface
, UINT index
)
4019 return d3d10_effect_variable_GetAnnotationByIndex((ID3D10EffectVariable
*)iface
, index
);
4022 static struct ID3D10EffectVariable
* STDMETHODCALLTYPE
d3d10_effect_vector_variable_GetAnnotationByName(
4023 ID3D10EffectVectorVariable
*iface
, LPCSTR name
)
4025 return d3d10_effect_variable_GetAnnotationByName((ID3D10EffectVariable
*)iface
, name
);
4028 static struct ID3D10EffectVariable
* STDMETHODCALLTYPE
d3d10_effect_vector_variable_GetMemberByIndex(
4029 ID3D10EffectVectorVariable
*iface
, UINT index
)
4031 return d3d10_effect_variable_GetMemberByIndex((ID3D10EffectVariable
*)iface
, index
);
4034 static struct ID3D10EffectVariable
* STDMETHODCALLTYPE
d3d10_effect_vector_variable_GetMemberByName(
4035 ID3D10EffectVectorVariable
*iface
, LPCSTR name
)
4037 return d3d10_effect_variable_GetMemberByName((ID3D10EffectVariable
*)iface
, name
);
4040 static struct ID3D10EffectVariable
* STDMETHODCALLTYPE
d3d10_effect_vector_variable_GetMemberBySemantic(
4041 ID3D10EffectVectorVariable
*iface
, LPCSTR semantic
)
4043 return d3d10_effect_variable_GetMemberBySemantic((ID3D10EffectVariable
*)iface
, semantic
);
4046 static struct ID3D10EffectVariable
* STDMETHODCALLTYPE
d3d10_effect_vector_variable_GetElement(
4047 ID3D10EffectVectorVariable
*iface
, UINT index
)
4049 return d3d10_effect_variable_GetElement((ID3D10EffectVariable
*)iface
, index
);
4052 static struct ID3D10EffectConstantBuffer
* STDMETHODCALLTYPE
d3d10_effect_vector_variable_GetParentConstantBuffer(
4053 ID3D10EffectVectorVariable
*iface
)
4055 return d3d10_effect_variable_GetParentConstantBuffer((ID3D10EffectVariable
*)iface
);
4058 static struct ID3D10EffectScalarVariable
* STDMETHODCALLTYPE
d3d10_effect_vector_variable_AsScalar(
4059 ID3D10EffectVectorVariable
*iface
)
4061 return d3d10_effect_variable_AsScalar((ID3D10EffectVariable
*)iface
);
4064 static struct ID3D10EffectVectorVariable
* STDMETHODCALLTYPE
d3d10_effect_vector_variable_AsVector(
4065 ID3D10EffectVectorVariable
*iface
)
4067 return d3d10_effect_variable_AsVector((ID3D10EffectVariable
*)iface
);
4070 static struct ID3D10EffectMatrixVariable
* STDMETHODCALLTYPE
d3d10_effect_vector_variable_AsMatrix(
4071 ID3D10EffectVectorVariable
*iface
)
4073 return d3d10_effect_variable_AsMatrix((ID3D10EffectVariable
*)iface
);
4076 static struct ID3D10EffectStringVariable
* STDMETHODCALLTYPE
d3d10_effect_vector_variable_AsString(
4077 ID3D10EffectVectorVariable
*iface
)
4079 return d3d10_effect_variable_AsString((ID3D10EffectVariable
*)iface
);
4082 static struct ID3D10EffectShaderResourceVariable
* STDMETHODCALLTYPE
d3d10_effect_vector_variable_AsShaderResource(
4083 ID3D10EffectVectorVariable
*iface
)
4085 return d3d10_effect_variable_AsShaderResource((ID3D10EffectVariable
*)iface
);
4088 static struct ID3D10EffectRenderTargetViewVariable
* STDMETHODCALLTYPE
d3d10_effect_vector_variable_AsRenderTargetView(
4089 ID3D10EffectVectorVariable
*iface
)
4091 return d3d10_effect_variable_AsRenderTargetView((ID3D10EffectVariable
*)iface
);
4094 static struct ID3D10EffectDepthStencilViewVariable
* STDMETHODCALLTYPE
d3d10_effect_vector_variable_AsDepthStencilView(
4095 ID3D10EffectVectorVariable
*iface
)
4097 return d3d10_effect_variable_AsDepthStencilView((ID3D10EffectVariable
*)iface
);
4100 static struct ID3D10EffectConstantBuffer
* STDMETHODCALLTYPE
d3d10_effect_vector_variable_AsConstantBuffer(
4101 ID3D10EffectVectorVariable
*iface
)
4103 return d3d10_effect_variable_AsConstantBuffer((ID3D10EffectVariable
*)iface
);
4106 static struct ID3D10EffectShaderVariable
* STDMETHODCALLTYPE
d3d10_effect_vector_variable_AsShader(
4107 ID3D10EffectVectorVariable
*iface
)
4109 return d3d10_effect_variable_AsShader((ID3D10EffectVariable
*)iface
);
4112 static struct ID3D10EffectBlendVariable
* STDMETHODCALLTYPE
d3d10_effect_vector_variable_AsBlend(
4113 ID3D10EffectVectorVariable
*iface
)
4115 return d3d10_effect_variable_AsBlend((ID3D10EffectVariable
*)iface
);
4118 static struct ID3D10EffectDepthStencilVariable
* STDMETHODCALLTYPE
d3d10_effect_vector_variable_AsDepthStencil(
4119 ID3D10EffectVectorVariable
*iface
)
4121 return d3d10_effect_variable_AsDepthStencil((ID3D10EffectVariable
*)iface
);
4124 static struct ID3D10EffectRasterizerVariable
* STDMETHODCALLTYPE
d3d10_effect_vector_variable_AsRasterizer(
4125 ID3D10EffectVectorVariable
*iface
)
4127 return d3d10_effect_variable_AsRasterizer((ID3D10EffectVariable
*)iface
);
4130 static struct ID3D10EffectSamplerVariable
* STDMETHODCALLTYPE
d3d10_effect_vector_variable_AsSampler(
4131 ID3D10EffectVectorVariable
*iface
)
4133 return d3d10_effect_variable_AsSampler((ID3D10EffectVariable
*)iface
);
4136 static HRESULT STDMETHODCALLTYPE
d3d10_effect_vector_variable_SetRawValue(ID3D10EffectVectorVariable
*iface
,
4137 void *data
, UINT offset
, UINT count
)
4139 return d3d10_effect_variable_SetRawValue((ID3D10EffectVariable
*)iface
, data
, offset
, count
);
4142 static HRESULT STDMETHODCALLTYPE
d3d10_effect_vector_variable_GetRawValue(ID3D10EffectVectorVariable
*iface
,
4143 void *data
, UINT offset
, UINT count
)
4145 return d3d10_effect_variable_GetRawValue((ID3D10EffectVariable
*)iface
, data
, offset
, count
);
4148 /* ID3D10EffectVectorVariable methods */
4150 static HRESULT STDMETHODCALLTYPE
d3d10_effect_vector_variable_SetBoolVector(ID3D10EffectVectorVariable
*iface
,
4153 FIXME("iface %p, value %p stub!\n", iface
, value
);
4158 static HRESULT STDMETHODCALLTYPE
d3d10_effect_vector_variable_SetIntVector(ID3D10EffectVectorVariable
*iface
,
4161 FIXME("iface %p, value %p stub!\n", iface
, value
);
4166 static HRESULT STDMETHODCALLTYPE
d3d10_effect_vector_variable_SetFloatVector(ID3D10EffectVectorVariable
*iface
,
4169 FIXME("iface %p, value %p stub!\n", iface
, value
);
4174 static HRESULT STDMETHODCALLTYPE
d3d10_effect_vector_variable_GetBoolVector(ID3D10EffectVectorVariable
*iface
,
4177 FIXME("iface %p, value %p stub!\n", iface
, value
);
4182 static HRESULT STDMETHODCALLTYPE
d3d10_effect_vector_variable_GetIntVector(ID3D10EffectVectorVariable
*iface
,
4185 FIXME("iface %p, value %p stub!\n", iface
, value
);
4190 static HRESULT STDMETHODCALLTYPE
d3d10_effect_vector_variable_GetFloatVector(ID3D10EffectVectorVariable
*iface
,
4193 FIXME("iface %p, value %p stub!\n", iface
, value
);
4198 static HRESULT STDMETHODCALLTYPE
d3d10_effect_vector_variable_SetBoolVectorArray(ID3D10EffectVectorVariable
*iface
,
4199 BOOL
*values
, UINT offset
, UINT count
)
4201 FIXME("iface %p, values %p, offset %u, count %u stub!\n", iface
, values
, offset
, count
);
4206 static HRESULT STDMETHODCALLTYPE
d3d10_effect_vector_variable_SetIntVectorArray(ID3D10EffectVectorVariable
*iface
,
4207 int *values
, UINT offset
, UINT count
)
4209 FIXME("iface %p, values %p, offset %u, count %u stub!\n", iface
, values
, offset
, count
);
4214 static HRESULT STDMETHODCALLTYPE
d3d10_effect_vector_variable_SetFloatVectorArray(ID3D10EffectVectorVariable
*iface
,
4215 float *values
, UINT offset
, UINT count
)
4217 FIXME("iface %p, values %p, offset %u, count %u stub!\n", iface
, values
, offset
, count
);
4222 static HRESULT STDMETHODCALLTYPE
d3d10_effect_vector_variable_GetBoolVectorArray(ID3D10EffectVectorVariable
*iface
,
4223 BOOL
*values
, UINT offset
, UINT count
)
4225 FIXME("iface %p, values %p, offset %u, count %u stub!\n", iface
, values
, offset
, count
);
4230 static HRESULT STDMETHODCALLTYPE
d3d10_effect_vector_variable_GetIntVectorArray(ID3D10EffectVectorVariable
*iface
,
4231 int *values
, UINT offset
, UINT count
)
4233 FIXME("iface %p, values %p, offset %u, count %u stub!\n", iface
, values
, offset
, count
);
4238 static HRESULT STDMETHODCALLTYPE
d3d10_effect_vector_variable_GetFloatVectorArray(ID3D10EffectVectorVariable
*iface
,
4239 float *values
, UINT offset
, UINT count
)
4241 FIXME("iface %p, values %p, offset %u, count %u stub!\n", iface
, values
, offset
, count
);
4246 static const struct ID3D10EffectVectorVariableVtbl d3d10_effect_vector_variable_vtbl
=
4248 /* ID3D10EffectVariable methods */
4249 d3d10_effect_vector_variable_IsValid
,
4250 d3d10_effect_vector_variable_GetType
,
4251 d3d10_effect_vector_variable_GetDesc
,
4252 d3d10_effect_vector_variable_GetAnnotationByIndex
,
4253 d3d10_effect_vector_variable_GetAnnotationByName
,
4254 d3d10_effect_vector_variable_GetMemberByIndex
,
4255 d3d10_effect_vector_variable_GetMemberByName
,
4256 d3d10_effect_vector_variable_GetMemberBySemantic
,
4257 d3d10_effect_vector_variable_GetElement
,
4258 d3d10_effect_vector_variable_GetParentConstantBuffer
,
4259 d3d10_effect_vector_variable_AsScalar
,
4260 d3d10_effect_vector_variable_AsVector
,
4261 d3d10_effect_vector_variable_AsMatrix
,
4262 d3d10_effect_vector_variable_AsString
,
4263 d3d10_effect_vector_variable_AsShaderResource
,
4264 d3d10_effect_vector_variable_AsRenderTargetView
,
4265 d3d10_effect_vector_variable_AsDepthStencilView
,
4266 d3d10_effect_vector_variable_AsConstantBuffer
,
4267 d3d10_effect_vector_variable_AsShader
,
4268 d3d10_effect_vector_variable_AsBlend
,
4269 d3d10_effect_vector_variable_AsDepthStencil
,
4270 d3d10_effect_vector_variable_AsRasterizer
,
4271 d3d10_effect_vector_variable_AsSampler
,
4272 d3d10_effect_vector_variable_SetRawValue
,
4273 d3d10_effect_vector_variable_GetRawValue
,
4274 /* ID3D10EffectVectorVariable methods */
4275 d3d10_effect_vector_variable_SetBoolVector
,
4276 d3d10_effect_vector_variable_SetIntVector
,
4277 d3d10_effect_vector_variable_SetFloatVector
,
4278 d3d10_effect_vector_variable_GetBoolVector
,
4279 d3d10_effect_vector_variable_GetIntVector
,
4280 d3d10_effect_vector_variable_GetFloatVector
,
4281 d3d10_effect_vector_variable_SetBoolVectorArray
,
4282 d3d10_effect_vector_variable_SetIntVectorArray
,
4283 d3d10_effect_vector_variable_SetFloatVectorArray
,
4284 d3d10_effect_vector_variable_GetBoolVectorArray
,
4285 d3d10_effect_vector_variable_GetIntVectorArray
,
4286 d3d10_effect_vector_variable_GetFloatVectorArray
,
4289 /* ID3D10EffectVariable methods */
4291 static BOOL STDMETHODCALLTYPE
d3d10_effect_matrix_variable_IsValid(ID3D10EffectMatrixVariable
*iface
)
4293 TRACE("iface %p\n", iface
);
4295 return (struct d3d10_effect_variable
*)iface
!= &null_matrix_variable
;
4298 static struct ID3D10EffectType
* STDMETHODCALLTYPE
d3d10_effect_matrix_variable_GetType(
4299 ID3D10EffectMatrixVariable
*iface
)
4301 return d3d10_effect_variable_GetType((ID3D10EffectVariable
*)iface
);
4304 static HRESULT STDMETHODCALLTYPE
d3d10_effect_matrix_variable_GetDesc(ID3D10EffectMatrixVariable
*iface
,
4305 D3D10_EFFECT_VARIABLE_DESC
*desc
)
4307 return d3d10_effect_variable_GetDesc((ID3D10EffectVariable
*)iface
, desc
);
4310 static struct ID3D10EffectVariable
* STDMETHODCALLTYPE
d3d10_effect_matrix_variable_GetAnnotationByIndex(
4311 ID3D10EffectMatrixVariable
*iface
, UINT index
)
4313 return d3d10_effect_variable_GetAnnotationByIndex((ID3D10EffectVariable
*)iface
, index
);
4316 static struct ID3D10EffectVariable
* STDMETHODCALLTYPE
d3d10_effect_matrix_variable_GetAnnotationByName(
4317 ID3D10EffectMatrixVariable
*iface
, LPCSTR name
)
4319 return d3d10_effect_variable_GetAnnotationByName((ID3D10EffectVariable
*)iface
, name
);
4322 static struct ID3D10EffectVariable
* STDMETHODCALLTYPE
d3d10_effect_matrix_variable_GetMemberByIndex(
4323 ID3D10EffectMatrixVariable
*iface
, UINT index
)
4325 return d3d10_effect_variable_GetMemberByIndex((ID3D10EffectVariable
*)iface
, index
);
4328 static struct ID3D10EffectVariable
* STDMETHODCALLTYPE
d3d10_effect_matrix_variable_GetMemberByName(
4329 ID3D10EffectMatrixVariable
*iface
, LPCSTR name
)
4331 return d3d10_effect_variable_GetMemberByName((ID3D10EffectVariable
*)iface
, name
);
4334 static struct ID3D10EffectVariable
* STDMETHODCALLTYPE
d3d10_effect_matrix_variable_GetMemberBySemantic(
4335 ID3D10EffectMatrixVariable
*iface
, LPCSTR semantic
)
4337 return d3d10_effect_variable_GetMemberBySemantic((ID3D10EffectVariable
*)iface
, semantic
);
4340 static struct ID3D10EffectVariable
* STDMETHODCALLTYPE
d3d10_effect_matrix_variable_GetElement(
4341 ID3D10EffectMatrixVariable
*iface
, UINT index
)
4343 return d3d10_effect_variable_GetElement((ID3D10EffectVariable
*)iface
, index
);
4346 static struct ID3D10EffectConstantBuffer
* STDMETHODCALLTYPE
d3d10_effect_matrix_variable_GetParentConstantBuffer(
4347 ID3D10EffectMatrixVariable
*iface
)
4349 return d3d10_effect_variable_GetParentConstantBuffer((ID3D10EffectVariable
*)iface
);
4352 static struct ID3D10EffectScalarVariable
* STDMETHODCALLTYPE
d3d10_effect_matrix_variable_AsScalar(
4353 ID3D10EffectMatrixVariable
*iface
)
4355 return d3d10_effect_variable_AsScalar((ID3D10EffectVariable
*)iface
);
4358 static struct ID3D10EffectVectorVariable
* STDMETHODCALLTYPE
d3d10_effect_matrix_variable_AsVector(
4359 ID3D10EffectMatrixVariable
*iface
)
4361 return d3d10_effect_variable_AsVector((ID3D10EffectVariable
*)iface
);
4364 static struct ID3D10EffectMatrixVariable
* STDMETHODCALLTYPE
d3d10_effect_matrix_variable_AsMatrix(
4365 ID3D10EffectMatrixVariable
*iface
)
4367 return d3d10_effect_variable_AsMatrix((ID3D10EffectVariable
*)iface
);
4370 static struct ID3D10EffectStringVariable
* STDMETHODCALLTYPE
d3d10_effect_matrix_variable_AsString(
4371 ID3D10EffectMatrixVariable
*iface
)
4373 return d3d10_effect_variable_AsString((ID3D10EffectVariable
*)iface
);
4376 static struct ID3D10EffectShaderResourceVariable
* STDMETHODCALLTYPE
d3d10_effect_matrix_variable_AsShaderResource(
4377 ID3D10EffectMatrixVariable
*iface
)
4379 return d3d10_effect_variable_AsShaderResource((ID3D10EffectVariable
*)iface
);
4382 static struct ID3D10EffectRenderTargetViewVariable
* STDMETHODCALLTYPE
d3d10_effect_matrix_variable_AsRenderTargetView(
4383 ID3D10EffectMatrixVariable
*iface
)
4385 return d3d10_effect_variable_AsRenderTargetView((ID3D10EffectVariable
*)iface
);
4388 static struct ID3D10EffectDepthStencilViewVariable
* STDMETHODCALLTYPE
d3d10_effect_matrix_variable_AsDepthStencilView(
4389 ID3D10EffectMatrixVariable
*iface
)
4391 return d3d10_effect_variable_AsDepthStencilView((ID3D10EffectVariable
*)iface
);
4394 static struct ID3D10EffectConstantBuffer
* STDMETHODCALLTYPE
d3d10_effect_matrix_variable_AsConstantBuffer(
4395 ID3D10EffectMatrixVariable
*iface
)
4397 return d3d10_effect_variable_AsConstantBuffer((ID3D10EffectVariable
*)iface
);
4400 static struct ID3D10EffectShaderVariable
* STDMETHODCALLTYPE
d3d10_effect_matrix_variable_AsShader(
4401 ID3D10EffectMatrixVariable
*iface
)
4403 return d3d10_effect_variable_AsShader((ID3D10EffectVariable
*)iface
);
4406 static struct ID3D10EffectBlendVariable
* STDMETHODCALLTYPE
d3d10_effect_matrix_variable_AsBlend(
4407 ID3D10EffectMatrixVariable
*iface
)
4409 return d3d10_effect_variable_AsBlend((ID3D10EffectVariable
*)iface
);
4412 static struct ID3D10EffectDepthStencilVariable
* STDMETHODCALLTYPE
d3d10_effect_matrix_variable_AsDepthStencil(
4413 ID3D10EffectMatrixVariable
*iface
)
4415 return d3d10_effect_variable_AsDepthStencil((ID3D10EffectVariable
*)iface
);
4418 static struct ID3D10EffectRasterizerVariable
* STDMETHODCALLTYPE
d3d10_effect_matrix_variable_AsRasterizer(
4419 ID3D10EffectMatrixVariable
*iface
)
4421 return d3d10_effect_variable_AsRasterizer((ID3D10EffectVariable
*)iface
);
4424 static struct ID3D10EffectSamplerVariable
* STDMETHODCALLTYPE
d3d10_effect_matrix_variable_AsSampler(
4425 ID3D10EffectMatrixVariable
*iface
)
4427 return d3d10_effect_variable_AsSampler((ID3D10EffectVariable
*)iface
);
4430 static HRESULT STDMETHODCALLTYPE
d3d10_effect_matrix_variable_SetRawValue(ID3D10EffectMatrixVariable
*iface
,
4431 void *data
, UINT offset
, UINT count
)
4433 return d3d10_effect_variable_SetRawValue((ID3D10EffectVariable
*)iface
, data
, offset
, count
);
4436 static HRESULT STDMETHODCALLTYPE
d3d10_effect_matrix_variable_GetRawValue(ID3D10EffectMatrixVariable
*iface
,
4437 void *data
, UINT offset
, UINT count
)
4439 return d3d10_effect_variable_GetRawValue((ID3D10EffectVariable
*)iface
, data
, offset
, count
);
4442 /* ID3D10EffectMatrixVariable methods */
4444 static HRESULT STDMETHODCALLTYPE
d3d10_effect_matrix_variable_SetMatrix(ID3D10EffectMatrixVariable
*iface
,
4447 FIXME("iface %p, data %p stub!\n", iface
, data
);
4452 static HRESULT STDMETHODCALLTYPE
d3d10_effect_matrix_variable_GetMatrix(ID3D10EffectMatrixVariable
*iface
,
4455 FIXME("iface %p, data %p stub!\n", iface
, data
);
4460 static HRESULT STDMETHODCALLTYPE
d3d10_effect_matrix_variable_SetMatrixArray(ID3D10EffectMatrixVariable
*iface
,
4461 float *data
, UINT offset
, UINT count
)
4463 FIXME("iface %p, data %p, offset %u, count %u stub!\n", iface
, data
, offset
, count
);
4468 static HRESULT STDMETHODCALLTYPE
d3d10_effect_matrix_variable_GetMatrixArray(ID3D10EffectMatrixVariable
*iface
,
4469 float *data
, UINT offset
, UINT count
)
4471 FIXME("iface %p, data %p, offset %u, count %u stub!\n", iface
, data
, offset
, count
);
4476 static HRESULT STDMETHODCALLTYPE
d3d10_effect_matrix_variable_SetMatrixTranspose(ID3D10EffectMatrixVariable
*iface
,
4479 FIXME("iface %p, data %p stub!\n", iface
, data
);
4484 static HRESULT STDMETHODCALLTYPE
d3d10_effect_matrix_variable_GetMatrixTranspose(ID3D10EffectMatrixVariable
*iface
,
4487 FIXME("iface %p, data %p stub!\n", iface
, data
);
4492 static HRESULT STDMETHODCALLTYPE
d3d10_effect_matrix_variable_SetMatrixTransposeArray(ID3D10EffectMatrixVariable
*iface
,
4493 float *data
, UINT offset
, UINT count
)
4495 FIXME("iface %p, data %p, offset %u, count %u stub!\n", iface
, data
, offset
, count
);
4500 static HRESULT STDMETHODCALLTYPE
d3d10_effect_matrix_variable_GetMatrixTransposeArray(ID3D10EffectMatrixVariable
*iface
,
4501 float *data
, UINT offset
, UINT count
)
4503 FIXME("iface %p, data %p, offset %u, count %u stub!\n", iface
, data
, offset
, count
);
4509 static const struct ID3D10EffectMatrixVariableVtbl d3d10_effect_matrix_variable_vtbl
=
4511 /* ID3D10EffectVariable methods */
4512 d3d10_effect_matrix_variable_IsValid
,
4513 d3d10_effect_matrix_variable_GetType
,
4514 d3d10_effect_matrix_variable_GetDesc
,
4515 d3d10_effect_matrix_variable_GetAnnotationByIndex
,
4516 d3d10_effect_matrix_variable_GetAnnotationByName
,
4517 d3d10_effect_matrix_variable_GetMemberByIndex
,
4518 d3d10_effect_matrix_variable_GetMemberByName
,
4519 d3d10_effect_matrix_variable_GetMemberBySemantic
,
4520 d3d10_effect_matrix_variable_GetElement
,
4521 d3d10_effect_matrix_variable_GetParentConstantBuffer
,
4522 d3d10_effect_matrix_variable_AsScalar
,
4523 d3d10_effect_matrix_variable_AsVector
,
4524 d3d10_effect_matrix_variable_AsMatrix
,
4525 d3d10_effect_matrix_variable_AsString
,
4526 d3d10_effect_matrix_variable_AsShaderResource
,
4527 d3d10_effect_matrix_variable_AsRenderTargetView
,
4528 d3d10_effect_matrix_variable_AsDepthStencilView
,
4529 d3d10_effect_matrix_variable_AsConstantBuffer
,
4530 d3d10_effect_matrix_variable_AsShader
,
4531 d3d10_effect_matrix_variable_AsBlend
,
4532 d3d10_effect_matrix_variable_AsDepthStencil
,
4533 d3d10_effect_matrix_variable_AsRasterizer
,
4534 d3d10_effect_matrix_variable_AsSampler
,
4535 d3d10_effect_matrix_variable_SetRawValue
,
4536 d3d10_effect_matrix_variable_GetRawValue
,
4537 /* ID3D10EffectMatrixVariable methods */
4538 d3d10_effect_matrix_variable_SetMatrix
,
4539 d3d10_effect_matrix_variable_GetMatrix
,
4540 d3d10_effect_matrix_variable_SetMatrixArray
,
4541 d3d10_effect_matrix_variable_GetMatrixArray
,
4542 d3d10_effect_matrix_variable_SetMatrixTranspose
,
4543 d3d10_effect_matrix_variable_GetMatrixTranspose
,
4544 d3d10_effect_matrix_variable_SetMatrixTransposeArray
,
4545 d3d10_effect_matrix_variable_GetMatrixTransposeArray
,
4548 /* ID3D10EffectVariable methods */
4550 static BOOL STDMETHODCALLTYPE
d3d10_effect_string_variable_IsValid(ID3D10EffectStringVariable
*iface
)
4552 TRACE("iface %p\n", iface
);
4554 return (struct d3d10_effect_variable
*)iface
!= &null_string_variable
;
4557 static struct ID3D10EffectType
* STDMETHODCALLTYPE
d3d10_effect_string_variable_GetType(
4558 ID3D10EffectStringVariable
*iface
)
4560 return d3d10_effect_variable_GetType((ID3D10EffectVariable
*)iface
);
4563 static HRESULT STDMETHODCALLTYPE
d3d10_effect_string_variable_GetDesc(ID3D10EffectStringVariable
*iface
,
4564 D3D10_EFFECT_VARIABLE_DESC
*desc
)
4566 return d3d10_effect_variable_GetDesc((ID3D10EffectVariable
*)iface
, desc
);
4569 static struct ID3D10EffectVariable
* STDMETHODCALLTYPE
d3d10_effect_string_variable_GetAnnotationByIndex(
4570 ID3D10EffectStringVariable
*iface
, UINT index
)
4572 return d3d10_effect_variable_GetAnnotationByIndex((ID3D10EffectVariable
*)iface
, index
);
4575 static struct ID3D10EffectVariable
* STDMETHODCALLTYPE
d3d10_effect_string_variable_GetAnnotationByName(
4576 ID3D10EffectStringVariable
*iface
, LPCSTR name
)
4578 return d3d10_effect_variable_GetAnnotationByName((ID3D10EffectVariable
*)iface
, name
);
4581 static struct ID3D10EffectVariable
* STDMETHODCALLTYPE
d3d10_effect_string_variable_GetMemberByIndex(
4582 ID3D10EffectStringVariable
*iface
, UINT index
)
4584 return d3d10_effect_variable_GetMemberByIndex((ID3D10EffectVariable
*)iface
, index
);
4587 static struct ID3D10EffectVariable
* STDMETHODCALLTYPE
d3d10_effect_string_variable_GetMemberByName(
4588 ID3D10EffectStringVariable
*iface
, LPCSTR name
)
4590 return d3d10_effect_variable_GetMemberByName((ID3D10EffectVariable
*)iface
, name
);
4593 static struct ID3D10EffectVariable
* STDMETHODCALLTYPE
d3d10_effect_string_variable_GetMemberBySemantic(
4594 ID3D10EffectStringVariable
*iface
, LPCSTR semantic
)
4596 return d3d10_effect_variable_GetMemberBySemantic((ID3D10EffectVariable
*)iface
, semantic
);
4599 static struct ID3D10EffectVariable
* STDMETHODCALLTYPE
d3d10_effect_string_variable_GetElement(
4600 ID3D10EffectStringVariable
*iface
, UINT index
)
4602 return d3d10_effect_variable_GetElement((ID3D10EffectVariable
*)iface
, index
);
4605 static struct ID3D10EffectConstantBuffer
* STDMETHODCALLTYPE
d3d10_effect_string_variable_GetParentConstantBuffer(
4606 ID3D10EffectStringVariable
*iface
)
4608 return d3d10_effect_variable_GetParentConstantBuffer((ID3D10EffectVariable
*)iface
);
4611 static struct ID3D10EffectScalarVariable
* STDMETHODCALLTYPE
d3d10_effect_string_variable_AsScalar(
4612 ID3D10EffectStringVariable
*iface
)
4614 return d3d10_effect_variable_AsScalar((ID3D10EffectVariable
*)iface
);
4617 static struct ID3D10EffectVectorVariable
* STDMETHODCALLTYPE
d3d10_effect_string_variable_AsVector(
4618 ID3D10EffectStringVariable
*iface
)
4620 return d3d10_effect_variable_AsVector((ID3D10EffectVariable
*)iface
);
4623 static struct ID3D10EffectMatrixVariable
* STDMETHODCALLTYPE
d3d10_effect_string_variable_AsMatrix(
4624 ID3D10EffectStringVariable
*iface
)
4626 return d3d10_effect_variable_AsMatrix((ID3D10EffectVariable
*)iface
);
4629 static struct ID3D10EffectStringVariable
* STDMETHODCALLTYPE
d3d10_effect_string_variable_AsString(
4630 ID3D10EffectStringVariable
*iface
)
4632 return d3d10_effect_variable_AsString((ID3D10EffectVariable
*)iface
);
4635 static struct ID3D10EffectShaderResourceVariable
* STDMETHODCALLTYPE
d3d10_effect_string_variable_AsShaderResource(
4636 ID3D10EffectStringVariable
*iface
)
4638 return d3d10_effect_variable_AsShaderResource((ID3D10EffectVariable
*)iface
);
4641 static struct ID3D10EffectRenderTargetViewVariable
* STDMETHODCALLTYPE
d3d10_effect_string_variable_AsRenderTargetView(
4642 ID3D10EffectStringVariable
*iface
)
4644 return d3d10_effect_variable_AsRenderTargetView((ID3D10EffectVariable
*)iface
);
4647 static struct ID3D10EffectDepthStencilViewVariable
* STDMETHODCALLTYPE
d3d10_effect_string_variable_AsDepthStencilView(
4648 ID3D10EffectStringVariable
*iface
)
4650 return d3d10_effect_variable_AsDepthStencilView((ID3D10EffectVariable
*)iface
);
4653 static struct ID3D10EffectConstantBuffer
* STDMETHODCALLTYPE
d3d10_effect_string_variable_AsConstantBuffer(
4654 ID3D10EffectStringVariable
*iface
)
4656 return d3d10_effect_variable_AsConstantBuffer((ID3D10EffectVariable
*)iface
);
4659 static struct ID3D10EffectShaderVariable
* STDMETHODCALLTYPE
d3d10_effect_string_variable_AsShader(
4660 ID3D10EffectStringVariable
*iface
)
4662 return d3d10_effect_variable_AsShader((ID3D10EffectVariable
*)iface
);
4665 static struct ID3D10EffectBlendVariable
* STDMETHODCALLTYPE
d3d10_effect_string_variable_AsBlend(
4666 ID3D10EffectStringVariable
*iface
)
4668 return d3d10_effect_variable_AsBlend((ID3D10EffectVariable
*)iface
);
4671 static struct ID3D10EffectDepthStencilVariable
* STDMETHODCALLTYPE
d3d10_effect_string_variable_AsDepthStencil(
4672 ID3D10EffectStringVariable
*iface
)
4674 return d3d10_effect_variable_AsDepthStencil((ID3D10EffectVariable
*)iface
);
4677 static struct ID3D10EffectRasterizerVariable
* STDMETHODCALLTYPE
d3d10_effect_string_variable_AsRasterizer(
4678 ID3D10EffectStringVariable
*iface
)
4680 return d3d10_effect_variable_AsRasterizer((ID3D10EffectVariable
*)iface
);
4683 static struct ID3D10EffectSamplerVariable
* STDMETHODCALLTYPE
d3d10_effect_string_variable_AsSampler(
4684 ID3D10EffectStringVariable
*iface
)
4686 return d3d10_effect_variable_AsSampler((ID3D10EffectVariable
*)iface
);
4689 static HRESULT STDMETHODCALLTYPE
d3d10_effect_string_variable_SetRawValue(ID3D10EffectStringVariable
*iface
,
4690 void *data
, UINT offset
, UINT count
)
4692 return d3d10_effect_variable_SetRawValue((ID3D10EffectVariable
*)iface
, data
, offset
, count
);
4695 static HRESULT STDMETHODCALLTYPE
d3d10_effect_string_variable_GetRawValue(ID3D10EffectStringVariable
*iface
,
4696 void *data
, UINT offset
, UINT count
)
4698 return d3d10_effect_variable_GetRawValue((ID3D10EffectVariable
*)iface
, data
, offset
, count
);
4701 /* ID3D10EffectStringVariable methods */
4703 static HRESULT STDMETHODCALLTYPE
d3d10_effect_string_variable_GetString(ID3D10EffectStringVariable
*iface
,
4706 FIXME("iface %p, str %p stub!\n", iface
, str
);
4711 static HRESULT STDMETHODCALLTYPE
d3d10_effect_string_variable_GetStringArray(ID3D10EffectStringVariable
*iface
,
4712 LPCSTR
*strs
, UINT offset
, UINT count
)
4714 FIXME("iface %p, strs %p, offset %u, count %u stub!\n", iface
, strs
, offset
, count
);
4720 static const struct ID3D10EffectStringVariableVtbl d3d10_effect_string_variable_vtbl
=
4722 /* ID3D10EffectVariable methods */
4723 d3d10_effect_string_variable_IsValid
,
4724 d3d10_effect_string_variable_GetType
,
4725 d3d10_effect_string_variable_GetDesc
,
4726 d3d10_effect_string_variable_GetAnnotationByIndex
,
4727 d3d10_effect_string_variable_GetAnnotationByName
,
4728 d3d10_effect_string_variable_GetMemberByIndex
,
4729 d3d10_effect_string_variable_GetMemberByName
,
4730 d3d10_effect_string_variable_GetMemberBySemantic
,
4731 d3d10_effect_string_variable_GetElement
,
4732 d3d10_effect_string_variable_GetParentConstantBuffer
,
4733 d3d10_effect_string_variable_AsScalar
,
4734 d3d10_effect_string_variable_AsVector
,
4735 d3d10_effect_string_variable_AsMatrix
,
4736 d3d10_effect_string_variable_AsString
,
4737 d3d10_effect_string_variable_AsShaderResource
,
4738 d3d10_effect_string_variable_AsRenderTargetView
,
4739 d3d10_effect_string_variable_AsDepthStencilView
,
4740 d3d10_effect_string_variable_AsConstantBuffer
,
4741 d3d10_effect_string_variable_AsShader
,
4742 d3d10_effect_string_variable_AsBlend
,
4743 d3d10_effect_string_variable_AsDepthStencil
,
4744 d3d10_effect_string_variable_AsRasterizer
,
4745 d3d10_effect_string_variable_AsSampler
,
4746 d3d10_effect_string_variable_SetRawValue
,
4747 d3d10_effect_string_variable_GetRawValue
,
4748 /* ID3D10EffectStringVariable methods */
4749 d3d10_effect_string_variable_GetString
,
4750 d3d10_effect_string_variable_GetStringArray
,
4753 /* ID3D10EffectVariable methods */
4755 static BOOL STDMETHODCALLTYPE
d3d10_effect_shader_resource_variable_IsValid(ID3D10EffectShaderResourceVariable
*iface
)
4757 TRACE("iface %p\n", iface
);
4759 return (struct d3d10_effect_variable
*)iface
!= &null_shader_resource_variable
;
4762 static struct ID3D10EffectType
* STDMETHODCALLTYPE
d3d10_effect_shader_resource_variable_GetType(
4763 ID3D10EffectShaderResourceVariable
*iface
)
4765 return d3d10_effect_variable_GetType((ID3D10EffectVariable
*)iface
);
4768 static HRESULT STDMETHODCALLTYPE
d3d10_effect_shader_resource_variable_GetDesc(
4769 ID3D10EffectShaderResourceVariable
*iface
, D3D10_EFFECT_VARIABLE_DESC
*desc
)
4771 return d3d10_effect_variable_GetDesc((ID3D10EffectVariable
*)iface
, desc
);
4774 static struct ID3D10EffectVariable
* STDMETHODCALLTYPE
d3d10_effect_shader_resource_variable_GetAnnotationByIndex(
4775 ID3D10EffectShaderResourceVariable
*iface
, UINT index
)
4777 return d3d10_effect_variable_GetAnnotationByIndex((ID3D10EffectVariable
*)iface
, index
);
4780 static struct ID3D10EffectVariable
* STDMETHODCALLTYPE
d3d10_effect_shader_resource_variable_GetAnnotationByName(
4781 ID3D10EffectShaderResourceVariable
*iface
, LPCSTR name
)
4783 return d3d10_effect_variable_GetAnnotationByName((ID3D10EffectVariable
*)iface
, name
);
4786 static struct ID3D10EffectVariable
* STDMETHODCALLTYPE
d3d10_effect_shader_resource_variable_GetMemberByIndex(
4787 ID3D10EffectShaderResourceVariable
*iface
, UINT index
)
4789 return d3d10_effect_variable_GetMemberByIndex((ID3D10EffectVariable
*)iface
, index
);
4792 static struct ID3D10EffectVariable
* STDMETHODCALLTYPE
d3d10_effect_shader_resource_variable_GetMemberByName(
4793 ID3D10EffectShaderResourceVariable
*iface
, LPCSTR name
)
4795 return d3d10_effect_variable_GetMemberByName((ID3D10EffectVariable
*)iface
, name
);
4798 static struct ID3D10EffectVariable
* STDMETHODCALLTYPE
d3d10_effect_shader_resource_variable_GetMemberBySemantic(
4799 ID3D10EffectShaderResourceVariable
*iface
, LPCSTR semantic
)
4801 return d3d10_effect_variable_GetMemberBySemantic((ID3D10EffectVariable
*)iface
, semantic
);
4804 static struct ID3D10EffectVariable
* STDMETHODCALLTYPE
d3d10_effect_shader_resource_variable_GetElement(
4805 ID3D10EffectShaderResourceVariable
*iface
, UINT index
)
4807 return d3d10_effect_variable_GetElement((ID3D10EffectVariable
*)iface
, index
);
4810 static struct ID3D10EffectConstantBuffer
* STDMETHODCALLTYPE
d3d10_effect_shader_resource_variable_GetParentConstantBuffer(
4811 ID3D10EffectShaderResourceVariable
*iface
)
4813 return d3d10_effect_variable_GetParentConstantBuffer((ID3D10EffectVariable
*)iface
);
4816 static struct ID3D10EffectScalarVariable
* STDMETHODCALLTYPE
d3d10_effect_shader_resource_variable_AsScalar(
4817 ID3D10EffectShaderResourceVariable
*iface
)
4819 return d3d10_effect_variable_AsScalar((ID3D10EffectVariable
*)iface
);
4822 static struct ID3D10EffectVectorVariable
* STDMETHODCALLTYPE
d3d10_effect_shader_resource_variable_AsVector(
4823 ID3D10EffectShaderResourceVariable
*iface
)
4825 return d3d10_effect_variable_AsVector((ID3D10EffectVariable
*)iface
);
4828 static struct ID3D10EffectMatrixVariable
* STDMETHODCALLTYPE
d3d10_effect_shader_resource_variable_AsMatrix(
4829 ID3D10EffectShaderResourceVariable
*iface
)
4831 return d3d10_effect_variable_AsMatrix((ID3D10EffectVariable
*)iface
);
4834 static struct ID3D10EffectStringVariable
* STDMETHODCALLTYPE
d3d10_effect_shader_resource_variable_AsString(
4835 ID3D10EffectShaderResourceVariable
*iface
)
4837 return d3d10_effect_variable_AsString((ID3D10EffectVariable
*)iface
);
4840 static struct ID3D10EffectShaderResourceVariable
* STDMETHODCALLTYPE
d3d10_effect_shader_resource_variable_AsShaderResource(
4841 ID3D10EffectShaderResourceVariable
*iface
)
4843 return d3d10_effect_variable_AsShaderResource((ID3D10EffectVariable
*)iface
);
4846 static struct ID3D10EffectRenderTargetViewVariable
* STDMETHODCALLTYPE
d3d10_effect_shader_resource_variable_AsRenderTargetView(
4847 ID3D10EffectShaderResourceVariable
*iface
)
4849 return d3d10_effect_variable_AsRenderTargetView((ID3D10EffectVariable
*)iface
);
4852 static struct ID3D10EffectDepthStencilViewVariable
* STDMETHODCALLTYPE
d3d10_effect_shader_resource_variable_AsDepthStencilView(
4853 ID3D10EffectShaderResourceVariable
*iface
)
4855 return d3d10_effect_variable_AsDepthStencilView((ID3D10EffectVariable
*)iface
);
4858 static struct ID3D10EffectConstantBuffer
* STDMETHODCALLTYPE
d3d10_effect_shader_resource_variable_AsConstantBuffer(
4859 ID3D10EffectShaderResourceVariable
*iface
)
4861 return d3d10_effect_variable_AsConstantBuffer((ID3D10EffectVariable
*)iface
);
4864 static struct ID3D10EffectShaderVariable
* STDMETHODCALLTYPE
d3d10_effect_shader_resource_variable_AsShader(
4865 ID3D10EffectShaderResourceVariable
*iface
)
4867 return d3d10_effect_variable_AsShader((ID3D10EffectVariable
*)iface
);
4870 static struct ID3D10EffectBlendVariable
* STDMETHODCALLTYPE
d3d10_effect_shader_resource_variable_AsBlend(
4871 ID3D10EffectShaderResourceVariable
*iface
)
4873 return d3d10_effect_variable_AsBlend((ID3D10EffectVariable
*)iface
);
4876 static struct ID3D10EffectDepthStencilVariable
* STDMETHODCALLTYPE
d3d10_effect_shader_resource_variable_AsDepthStencil(
4877 ID3D10EffectShaderResourceVariable
*iface
)
4879 return d3d10_effect_variable_AsDepthStencil((ID3D10EffectVariable
*)iface
);
4882 static struct ID3D10EffectRasterizerVariable
* STDMETHODCALLTYPE
d3d10_effect_shader_resource_variable_AsRasterizer(
4883 ID3D10EffectShaderResourceVariable
*iface
)
4885 return d3d10_effect_variable_AsRasterizer((ID3D10EffectVariable
*)iface
);
4888 static struct ID3D10EffectSamplerVariable
* STDMETHODCALLTYPE
d3d10_effect_shader_resource_variable_AsSampler(
4889 ID3D10EffectShaderResourceVariable
*iface
)
4891 return d3d10_effect_variable_AsSampler((ID3D10EffectVariable
*)iface
);
4894 static HRESULT STDMETHODCALLTYPE
d3d10_effect_shader_resource_variable_SetRawValue(
4895 ID3D10EffectShaderResourceVariable
*iface
, void *data
, UINT offset
, UINT count
)
4897 return d3d10_effect_variable_SetRawValue((ID3D10EffectVariable
*)iface
, data
, offset
, count
);
4900 static HRESULT STDMETHODCALLTYPE
d3d10_effect_shader_resource_variable_GetRawValue(
4901 ID3D10EffectShaderResourceVariable
*iface
, void *data
, UINT offset
, UINT count
)
4903 return d3d10_effect_variable_GetRawValue((ID3D10EffectVariable
*)iface
, data
, offset
, count
);
4906 /* ID3D10EffectShaderResourceVariable methods */
4908 static HRESULT STDMETHODCALLTYPE
d3d10_effect_shader_resource_variable_SetResource(
4909 ID3D10EffectShaderResourceVariable
*iface
, ID3D10ShaderResourceView
*resource
)
4911 FIXME("iface %p, resource %p stub!\n", iface
, resource
);
4916 static HRESULT STDMETHODCALLTYPE
d3d10_effect_shader_resource_variable_GetResource(
4917 ID3D10EffectShaderResourceVariable
*iface
, ID3D10ShaderResourceView
**resource
)
4919 FIXME("iface %p, resource %p stub!\n", iface
, resource
);
4924 static HRESULT STDMETHODCALLTYPE
d3d10_effect_shader_resource_variable_SetResourceArray(
4925 ID3D10EffectShaderResourceVariable
*iface
, ID3D10ShaderResourceView
**resources
, UINT offset
, UINT count
)
4927 FIXME("iface %p, resources %p, offset %u, count %u stub!\n", iface
, resources
, offset
, count
);
4932 static HRESULT STDMETHODCALLTYPE
d3d10_effect_shader_resource_variable_GetResourceArray(
4933 ID3D10EffectShaderResourceVariable
*iface
, ID3D10ShaderResourceView
**resources
, UINT offset
, UINT count
)
4935 FIXME("iface %p, resources %p, offset %u, count %u stub!\n", iface
, resources
, offset
, count
);
4941 static const struct ID3D10EffectShaderResourceVariableVtbl d3d10_effect_shader_resource_variable_vtbl
=
4943 /* ID3D10EffectVariable methods */
4944 d3d10_effect_shader_resource_variable_IsValid
,
4945 d3d10_effect_shader_resource_variable_GetType
,
4946 d3d10_effect_shader_resource_variable_GetDesc
,
4947 d3d10_effect_shader_resource_variable_GetAnnotationByIndex
,
4948 d3d10_effect_shader_resource_variable_GetAnnotationByName
,
4949 d3d10_effect_shader_resource_variable_GetMemberByIndex
,
4950 d3d10_effect_shader_resource_variable_GetMemberByName
,
4951 d3d10_effect_shader_resource_variable_GetMemberBySemantic
,
4952 d3d10_effect_shader_resource_variable_GetElement
,
4953 d3d10_effect_shader_resource_variable_GetParentConstantBuffer
,
4954 d3d10_effect_shader_resource_variable_AsScalar
,
4955 d3d10_effect_shader_resource_variable_AsVector
,
4956 d3d10_effect_shader_resource_variable_AsMatrix
,
4957 d3d10_effect_shader_resource_variable_AsString
,
4958 d3d10_effect_shader_resource_variable_AsShaderResource
,
4959 d3d10_effect_shader_resource_variable_AsRenderTargetView
,
4960 d3d10_effect_shader_resource_variable_AsDepthStencilView
,
4961 d3d10_effect_shader_resource_variable_AsConstantBuffer
,
4962 d3d10_effect_shader_resource_variable_AsShader
,
4963 d3d10_effect_shader_resource_variable_AsBlend
,
4964 d3d10_effect_shader_resource_variable_AsDepthStencil
,
4965 d3d10_effect_shader_resource_variable_AsRasterizer
,
4966 d3d10_effect_shader_resource_variable_AsSampler
,
4967 d3d10_effect_shader_resource_variable_SetRawValue
,
4968 d3d10_effect_shader_resource_variable_GetRawValue
,
4969 /* ID3D10EffectShaderResourceVariable methods */
4970 d3d10_effect_shader_resource_variable_SetResource
,
4971 d3d10_effect_shader_resource_variable_GetResource
,
4972 d3d10_effect_shader_resource_variable_SetResourceArray
,
4973 d3d10_effect_shader_resource_variable_GetResourceArray
,
4976 /* ID3D10EffectVariable methods */
4978 static BOOL STDMETHODCALLTYPE
d3d10_effect_render_target_view_variable_IsValid(
4979 ID3D10EffectRenderTargetViewVariable
*iface
)
4981 TRACE("iface %p\n", iface
);
4983 return (struct d3d10_effect_variable
*)iface
!= &null_render_target_view_variable
;
4986 static struct ID3D10EffectType
* STDMETHODCALLTYPE
d3d10_effect_render_target_view_variable_GetType(
4987 ID3D10EffectRenderTargetViewVariable
*iface
)
4989 return d3d10_effect_variable_GetType((ID3D10EffectVariable
*)iface
);
4992 static HRESULT STDMETHODCALLTYPE
d3d10_effect_render_target_view_variable_GetDesc(
4993 ID3D10EffectRenderTargetViewVariable
*iface
, D3D10_EFFECT_VARIABLE_DESC
*desc
)
4995 return d3d10_effect_variable_GetDesc((ID3D10EffectVariable
*)iface
, desc
);
4998 static struct ID3D10EffectVariable
* STDMETHODCALLTYPE
d3d10_effect_render_target_view_variable_GetAnnotationByIndex(
4999 ID3D10EffectRenderTargetViewVariable
*iface
, UINT index
)
5001 return d3d10_effect_variable_GetAnnotationByIndex((ID3D10EffectVariable
*)iface
, index
);
5004 static struct ID3D10EffectVariable
* STDMETHODCALLTYPE
d3d10_effect_render_target_view_variable_GetAnnotationByName(
5005 ID3D10EffectRenderTargetViewVariable
*iface
, LPCSTR name
)
5007 return d3d10_effect_variable_GetAnnotationByName((ID3D10EffectVariable
*)iface
, name
);
5010 static struct ID3D10EffectVariable
* STDMETHODCALLTYPE
d3d10_effect_render_target_view_variable_GetMemberByIndex(
5011 ID3D10EffectRenderTargetViewVariable
*iface
, UINT index
)
5013 return d3d10_effect_variable_GetMemberByIndex((ID3D10EffectVariable
*)iface
, index
);
5016 static struct ID3D10EffectVariable
* STDMETHODCALLTYPE
d3d10_effect_render_target_view_variable_GetMemberByName(
5017 ID3D10EffectRenderTargetViewVariable
*iface
, LPCSTR name
)
5019 return d3d10_effect_variable_GetMemberByName((ID3D10EffectVariable
*)iface
, name
);
5022 static struct ID3D10EffectVariable
* STDMETHODCALLTYPE
d3d10_effect_render_target_view_variable_GetMemberBySemantic(
5023 ID3D10EffectRenderTargetViewVariable
*iface
, LPCSTR semantic
)
5025 return d3d10_effect_variable_GetMemberBySemantic((ID3D10EffectVariable
*)iface
, semantic
);
5028 static struct ID3D10EffectVariable
* STDMETHODCALLTYPE
d3d10_effect_render_target_view_variable_GetElement(
5029 ID3D10EffectRenderTargetViewVariable
*iface
, UINT index
)
5031 return d3d10_effect_variable_GetElement((ID3D10EffectVariable
*)iface
, index
);
5034 static struct ID3D10EffectConstantBuffer
* STDMETHODCALLTYPE
d3d10_effect_render_target_view_variable_GetParentConstantBuffer(
5035 ID3D10EffectRenderTargetViewVariable
*iface
)
5037 return d3d10_effect_variable_GetParentConstantBuffer((ID3D10EffectVariable
*)iface
);
5040 static struct ID3D10EffectScalarVariable
* STDMETHODCALLTYPE
d3d10_effect_render_target_view_variable_AsScalar(
5041 ID3D10EffectRenderTargetViewVariable
*iface
)
5043 return d3d10_effect_variable_AsScalar((ID3D10EffectVariable
*)iface
);
5046 static struct ID3D10EffectVectorVariable
* STDMETHODCALLTYPE
d3d10_effect_render_target_view_variable_AsVector(
5047 ID3D10EffectRenderTargetViewVariable
*iface
)
5049 return d3d10_effect_variable_AsVector((ID3D10EffectVariable
*)iface
);
5052 static struct ID3D10EffectMatrixVariable
* STDMETHODCALLTYPE
d3d10_effect_render_target_view_variable_AsMatrix(
5053 ID3D10EffectRenderTargetViewVariable
*iface
)
5055 return d3d10_effect_variable_AsMatrix((ID3D10EffectVariable
*)iface
);
5058 static struct ID3D10EffectStringVariable
* STDMETHODCALLTYPE
d3d10_effect_render_target_view_variable_AsString(
5059 ID3D10EffectRenderTargetViewVariable
*iface
)
5061 return d3d10_effect_variable_AsString((ID3D10EffectVariable
*)iface
);
5064 static struct ID3D10EffectShaderResourceVariable
* STDMETHODCALLTYPE
d3d10_effect_render_target_view_variable_AsShaderResource(
5065 ID3D10EffectRenderTargetViewVariable
*iface
)
5067 return d3d10_effect_variable_AsShaderResource((ID3D10EffectVariable
*)iface
);
5070 static struct ID3D10EffectRenderTargetViewVariable
* STDMETHODCALLTYPE
d3d10_effect_render_target_view_variable_AsRenderTargetView(
5071 ID3D10EffectRenderTargetViewVariable
*iface
)
5073 return d3d10_effect_variable_AsRenderTargetView((ID3D10EffectVariable
*)iface
);
5076 static struct ID3D10EffectDepthStencilViewVariable
* STDMETHODCALLTYPE
d3d10_effect_render_target_view_variable_AsDepthStencilView(
5077 ID3D10EffectRenderTargetViewVariable
*iface
)
5079 return d3d10_effect_variable_AsDepthStencilView((ID3D10EffectVariable
*)iface
);
5082 static struct ID3D10EffectConstantBuffer
* STDMETHODCALLTYPE
d3d10_effect_render_target_view_variable_AsConstantBuffer(
5083 ID3D10EffectRenderTargetViewVariable
*iface
)
5085 return d3d10_effect_variable_AsConstantBuffer((ID3D10EffectVariable
*)iface
);
5088 static struct ID3D10EffectShaderVariable
* STDMETHODCALLTYPE
d3d10_effect_render_target_view_variable_AsShader(
5089 ID3D10EffectRenderTargetViewVariable
*iface
)
5091 return d3d10_effect_variable_AsShader((ID3D10EffectVariable
*)iface
);
5094 static struct ID3D10EffectBlendVariable
* STDMETHODCALLTYPE
d3d10_effect_render_target_view_variable_AsBlend(
5095 ID3D10EffectRenderTargetViewVariable
*iface
)
5097 return d3d10_effect_variable_AsBlend((ID3D10EffectVariable
*)iface
);
5100 static struct ID3D10EffectDepthStencilVariable
* STDMETHODCALLTYPE
d3d10_effect_render_target_view_variable_AsDepthStencil(
5101 ID3D10EffectRenderTargetViewVariable
*iface
)
5103 return d3d10_effect_variable_AsDepthStencil((ID3D10EffectVariable
*)iface
);
5106 static struct ID3D10EffectRasterizerVariable
* STDMETHODCALLTYPE
d3d10_effect_render_target_view_variable_AsRasterizer(
5107 ID3D10EffectRenderTargetViewVariable
*iface
)
5109 return d3d10_effect_variable_AsRasterizer((ID3D10EffectVariable
*)iface
);
5112 static struct ID3D10EffectSamplerVariable
* STDMETHODCALLTYPE
d3d10_effect_render_target_view_variable_AsSampler(
5113 ID3D10EffectRenderTargetViewVariable
*iface
)
5115 return d3d10_effect_variable_AsSampler((ID3D10EffectVariable
*)iface
);
5118 static HRESULT STDMETHODCALLTYPE
d3d10_effect_render_target_view_variable_SetRawValue(
5119 ID3D10EffectRenderTargetViewVariable
*iface
, void *data
, UINT offset
, UINT count
)
5121 return d3d10_effect_variable_SetRawValue((ID3D10EffectVariable
*)iface
, data
, offset
, count
);
5124 static HRESULT STDMETHODCALLTYPE
d3d10_effect_render_target_view_variable_GetRawValue(
5125 ID3D10EffectRenderTargetViewVariable
*iface
, void *data
, UINT offset
, UINT count
)
5127 return d3d10_effect_variable_GetRawValue((ID3D10EffectVariable
*)iface
, data
, offset
, count
);
5130 /* ID3D10EffectRenderTargetViewVariable methods */
5132 static HRESULT STDMETHODCALLTYPE
d3d10_effect_render_target_view_variable_SetRenderTarget(
5133 ID3D10EffectRenderTargetViewVariable
*iface
, ID3D10RenderTargetView
*view
)
5135 FIXME("iface %p, view %p stub!\n", iface
, view
);
5140 static HRESULT STDMETHODCALLTYPE
d3d10_effect_render_target_view_variable_GetRenderTarget(
5141 ID3D10EffectRenderTargetViewVariable
*iface
, ID3D10RenderTargetView
**view
)
5143 FIXME("iface %p, view %p stub!\n", iface
, view
);
5148 static HRESULT STDMETHODCALLTYPE
d3d10_effect_render_target_view_variable_SetRenderTargetArray(
5149 ID3D10EffectRenderTargetViewVariable
*iface
, ID3D10RenderTargetView
**views
, UINT offset
, UINT count
)
5151 FIXME("iface %p, views %p, offset %u, count %u stub!\n", iface
, views
, offset
, count
);
5156 static HRESULT STDMETHODCALLTYPE
d3d10_effect_render_target_view_variable_GetRenderTargetArray(
5157 ID3D10EffectRenderTargetViewVariable
*iface
, ID3D10RenderTargetView
**views
, UINT offset
, UINT count
)
5159 FIXME("iface %p, views %p, offset %u, count %u stub!\n", iface
, views
, offset
, count
);
5165 static const struct ID3D10EffectRenderTargetViewVariableVtbl d3d10_effect_render_target_view_variable_vtbl
=
5167 /* ID3D10EffectVariable methods */
5168 d3d10_effect_render_target_view_variable_IsValid
,
5169 d3d10_effect_render_target_view_variable_GetType
,
5170 d3d10_effect_render_target_view_variable_GetDesc
,
5171 d3d10_effect_render_target_view_variable_GetAnnotationByIndex
,
5172 d3d10_effect_render_target_view_variable_GetAnnotationByName
,
5173 d3d10_effect_render_target_view_variable_GetMemberByIndex
,
5174 d3d10_effect_render_target_view_variable_GetMemberByName
,
5175 d3d10_effect_render_target_view_variable_GetMemberBySemantic
,
5176 d3d10_effect_render_target_view_variable_GetElement
,
5177 d3d10_effect_render_target_view_variable_GetParentConstantBuffer
,
5178 d3d10_effect_render_target_view_variable_AsScalar
,
5179 d3d10_effect_render_target_view_variable_AsVector
,
5180 d3d10_effect_render_target_view_variable_AsMatrix
,
5181 d3d10_effect_render_target_view_variable_AsString
,
5182 d3d10_effect_render_target_view_variable_AsShaderResource
,
5183 d3d10_effect_render_target_view_variable_AsRenderTargetView
,
5184 d3d10_effect_render_target_view_variable_AsDepthStencilView
,
5185 d3d10_effect_render_target_view_variable_AsConstantBuffer
,
5186 d3d10_effect_render_target_view_variable_AsShader
,
5187 d3d10_effect_render_target_view_variable_AsBlend
,
5188 d3d10_effect_render_target_view_variable_AsDepthStencil
,
5189 d3d10_effect_render_target_view_variable_AsRasterizer
,
5190 d3d10_effect_render_target_view_variable_AsSampler
,
5191 d3d10_effect_render_target_view_variable_SetRawValue
,
5192 d3d10_effect_render_target_view_variable_GetRawValue
,
5193 /* ID3D10EffectRenderTargetViewVariable methods */
5194 d3d10_effect_render_target_view_variable_SetRenderTarget
,
5195 d3d10_effect_render_target_view_variable_GetRenderTarget
,
5196 d3d10_effect_render_target_view_variable_SetRenderTargetArray
,
5197 d3d10_effect_render_target_view_variable_GetRenderTargetArray
,
5200 /* ID3D10EffectVariable methods */
5202 static BOOL STDMETHODCALLTYPE
d3d10_effect_depth_stencil_view_variable_IsValid(
5203 ID3D10EffectDepthStencilViewVariable
*iface
)
5205 TRACE("iface %p\n", iface
);
5207 return (struct d3d10_effect_variable
*)iface
!= &null_depth_stencil_view_variable
;
5210 static struct ID3D10EffectType
* STDMETHODCALLTYPE
d3d10_effect_depth_stencil_view_variable_GetType(
5211 ID3D10EffectDepthStencilViewVariable
*iface
)
5213 return d3d10_effect_variable_GetType((ID3D10EffectVariable
*)iface
);
5216 static HRESULT STDMETHODCALLTYPE
d3d10_effect_depth_stencil_view_variable_GetDesc(
5217 ID3D10EffectDepthStencilViewVariable
*iface
, D3D10_EFFECT_VARIABLE_DESC
*desc
)
5219 return d3d10_effect_variable_GetDesc((ID3D10EffectVariable
*)iface
, desc
);
5222 static struct ID3D10EffectVariable
* STDMETHODCALLTYPE
d3d10_effect_depth_stencil_view_variable_GetAnnotationByIndex(
5223 ID3D10EffectDepthStencilViewVariable
*iface
, UINT index
)
5225 return d3d10_effect_variable_GetAnnotationByIndex((ID3D10EffectVariable
*)iface
, index
);
5228 static struct ID3D10EffectVariable
* STDMETHODCALLTYPE
d3d10_effect_depth_stencil_view_variable_GetAnnotationByName(
5229 ID3D10EffectDepthStencilViewVariable
*iface
, LPCSTR name
)
5231 return d3d10_effect_variable_GetAnnotationByName((ID3D10EffectVariable
*)iface
, name
);
5234 static struct ID3D10EffectVariable
* STDMETHODCALLTYPE
d3d10_effect_depth_stencil_view_variable_GetMemberByIndex(
5235 ID3D10EffectDepthStencilViewVariable
*iface
, UINT index
)
5237 return d3d10_effect_variable_GetMemberByIndex((ID3D10EffectVariable
*)iface
, index
);
5240 static struct ID3D10EffectVariable
* STDMETHODCALLTYPE
d3d10_effect_depth_stencil_view_variable_GetMemberByName(
5241 ID3D10EffectDepthStencilViewVariable
*iface
, LPCSTR name
)
5243 return d3d10_effect_variable_GetMemberByName((ID3D10EffectVariable
*)iface
, name
);
5246 static struct ID3D10EffectVariable
* STDMETHODCALLTYPE
d3d10_effect_depth_stencil_view_variable_GetMemberBySemantic(
5247 ID3D10EffectDepthStencilViewVariable
*iface
, LPCSTR semantic
)
5249 return d3d10_effect_variable_GetMemberBySemantic((ID3D10EffectVariable
*)iface
, semantic
);
5252 static struct ID3D10EffectVariable
* STDMETHODCALLTYPE
d3d10_effect_depth_stencil_view_variable_GetElement(
5253 ID3D10EffectDepthStencilViewVariable
*iface
, UINT index
)
5255 return d3d10_effect_variable_GetElement((ID3D10EffectVariable
*)iface
, index
);
5258 static struct ID3D10EffectConstantBuffer
* STDMETHODCALLTYPE
d3d10_effect_depth_stencil_view_variable_GetParentConstantBuffer(
5259 ID3D10EffectDepthStencilViewVariable
*iface
)
5261 return d3d10_effect_variable_GetParentConstantBuffer((ID3D10EffectVariable
*)iface
);
5264 static struct ID3D10EffectScalarVariable
* STDMETHODCALLTYPE
d3d10_effect_depth_stencil_view_variable_AsScalar(
5265 ID3D10EffectDepthStencilViewVariable
*iface
)
5267 return d3d10_effect_variable_AsScalar((ID3D10EffectVariable
*)iface
);
5270 static struct ID3D10EffectVectorVariable
* STDMETHODCALLTYPE
d3d10_effect_depth_stencil_view_variable_AsVector(
5271 ID3D10EffectDepthStencilViewVariable
*iface
)
5273 return d3d10_effect_variable_AsVector((ID3D10EffectVariable
*)iface
);
5276 static struct ID3D10EffectMatrixVariable
* STDMETHODCALLTYPE
d3d10_effect_depth_stencil_view_variable_AsMatrix(
5277 ID3D10EffectDepthStencilViewVariable
*iface
)
5279 return d3d10_effect_variable_AsMatrix((ID3D10EffectVariable
*)iface
);
5282 static struct ID3D10EffectStringVariable
* STDMETHODCALLTYPE
d3d10_effect_depth_stencil_view_variable_AsString(
5283 ID3D10EffectDepthStencilViewVariable
*iface
)
5285 return d3d10_effect_variable_AsString((ID3D10EffectVariable
*)iface
);
5288 static struct ID3D10EffectShaderResourceVariable
* STDMETHODCALLTYPE
d3d10_effect_depth_stencil_view_variable_AsShaderResource(
5289 ID3D10EffectDepthStencilViewVariable
*iface
)
5291 return d3d10_effect_variable_AsShaderResource((ID3D10EffectVariable
*)iface
);
5294 static struct ID3D10EffectRenderTargetViewVariable
* STDMETHODCALLTYPE
d3d10_effect_depth_stencil_view_variable_AsRenderTargetView(
5295 ID3D10EffectDepthStencilViewVariable
*iface
)
5297 return d3d10_effect_variable_AsRenderTargetView((ID3D10EffectVariable
*)iface
);
5300 static struct ID3D10EffectDepthStencilViewVariable
* STDMETHODCALLTYPE
d3d10_effect_depth_stencil_view_variable_AsDepthStencilView(
5301 ID3D10EffectDepthStencilViewVariable
*iface
)
5303 return d3d10_effect_variable_AsDepthStencilView((ID3D10EffectVariable
*)iface
);
5306 static struct ID3D10EffectConstantBuffer
* STDMETHODCALLTYPE
d3d10_effect_depth_stencil_view_variable_AsConstantBuffer(
5307 ID3D10EffectDepthStencilViewVariable
*iface
)
5309 return d3d10_effect_variable_AsConstantBuffer((ID3D10EffectVariable
*)iface
);
5312 static struct ID3D10EffectShaderVariable
* STDMETHODCALLTYPE
d3d10_effect_depth_stencil_view_variable_AsShader(
5313 ID3D10EffectDepthStencilViewVariable
*iface
)
5315 return d3d10_effect_variable_AsShader((ID3D10EffectVariable
*)iface
);
5318 static struct ID3D10EffectBlendVariable
* STDMETHODCALLTYPE
d3d10_effect_depth_stencil_view_variable_AsBlend(
5319 ID3D10EffectDepthStencilViewVariable
*iface
)
5321 return d3d10_effect_variable_AsBlend((ID3D10EffectVariable
*)iface
);
5324 static struct ID3D10EffectDepthStencilVariable
* STDMETHODCALLTYPE
d3d10_effect_depth_stencil_view_variable_AsDepthStencil(
5325 ID3D10EffectDepthStencilViewVariable
*iface
)
5327 return d3d10_effect_variable_AsDepthStencil((ID3D10EffectVariable
*)iface
);
5330 static struct ID3D10EffectRasterizerVariable
* STDMETHODCALLTYPE
d3d10_effect_depth_stencil_view_variable_AsRasterizer(
5331 ID3D10EffectDepthStencilViewVariable
*iface
)
5333 return d3d10_effect_variable_AsRasterizer((ID3D10EffectVariable
*)iface
);
5336 static struct ID3D10EffectSamplerVariable
* STDMETHODCALLTYPE
d3d10_effect_depth_stencil_view_variable_AsSampler(
5337 ID3D10EffectDepthStencilViewVariable
*iface
)
5339 return d3d10_effect_variable_AsSampler((ID3D10EffectVariable
*)iface
);
5342 static HRESULT STDMETHODCALLTYPE
d3d10_effect_depth_stencil_view_variable_SetRawValue(
5343 ID3D10EffectDepthStencilViewVariable
*iface
, void *data
, UINT offset
, UINT count
)
5345 return d3d10_effect_variable_SetRawValue((ID3D10EffectVariable
*)iface
, data
, offset
, count
);
5348 static HRESULT STDMETHODCALLTYPE
d3d10_effect_depth_stencil_view_variable_GetRawValue(
5349 ID3D10EffectDepthStencilViewVariable
*iface
, void *data
, UINT offset
, UINT count
)
5351 return d3d10_effect_variable_GetRawValue((ID3D10EffectVariable
*)iface
, data
, offset
, count
);
5354 /* ID3D10EffectDepthStencilViewVariable methods */
5356 static HRESULT STDMETHODCALLTYPE
d3d10_effect_depth_stencil_view_variable_SetDepthStencil(
5357 ID3D10EffectDepthStencilViewVariable
*iface
, ID3D10DepthStencilView
*view
)
5359 FIXME("iface %p, view %p stub!\n", iface
, view
);
5364 static HRESULT STDMETHODCALLTYPE
d3d10_effect_depth_stencil_view_variable_GetDepthStencil(
5365 ID3D10EffectDepthStencilViewVariable
*iface
, ID3D10DepthStencilView
**view
)
5367 FIXME("iface %p, view %p stub!\n", iface
, view
);
5372 static HRESULT STDMETHODCALLTYPE
d3d10_effect_depth_stencil_view_variable_SetDepthStencilArray(
5373 ID3D10EffectDepthStencilViewVariable
*iface
, ID3D10DepthStencilView
**views
, UINT offset
, UINT count
)
5375 FIXME("iface %p, views %p, offset %u, count %u stub!\n", iface
, views
, offset
, count
);
5380 static HRESULT STDMETHODCALLTYPE
d3d10_effect_depth_stencil_view_variable_GetDepthStencilArray(
5381 ID3D10EffectDepthStencilViewVariable
*iface
, ID3D10DepthStencilView
**views
, UINT offset
, UINT count
)
5383 FIXME("iface %p, views %p, offset %u, count %u stub!\n", iface
, views
, offset
, count
);
5389 static const struct ID3D10EffectDepthStencilViewVariableVtbl d3d10_effect_depth_stencil_view_variable_vtbl
=
5391 /* ID3D10EffectVariable methods */
5392 d3d10_effect_depth_stencil_view_variable_IsValid
,
5393 d3d10_effect_depth_stencil_view_variable_GetType
,
5394 d3d10_effect_depth_stencil_view_variable_GetDesc
,
5395 d3d10_effect_depth_stencil_view_variable_GetAnnotationByIndex
,
5396 d3d10_effect_depth_stencil_view_variable_GetAnnotationByName
,
5397 d3d10_effect_depth_stencil_view_variable_GetMemberByIndex
,
5398 d3d10_effect_depth_stencil_view_variable_GetMemberByName
,
5399 d3d10_effect_depth_stencil_view_variable_GetMemberBySemantic
,
5400 d3d10_effect_depth_stencil_view_variable_GetElement
,
5401 d3d10_effect_depth_stencil_view_variable_GetParentConstantBuffer
,
5402 d3d10_effect_depth_stencil_view_variable_AsScalar
,
5403 d3d10_effect_depth_stencil_view_variable_AsVector
,
5404 d3d10_effect_depth_stencil_view_variable_AsMatrix
,
5405 d3d10_effect_depth_stencil_view_variable_AsString
,
5406 d3d10_effect_depth_stencil_view_variable_AsShaderResource
,
5407 d3d10_effect_depth_stencil_view_variable_AsRenderTargetView
,
5408 d3d10_effect_depth_stencil_view_variable_AsDepthStencilView
,
5409 d3d10_effect_depth_stencil_view_variable_AsConstantBuffer
,
5410 d3d10_effect_depth_stencil_view_variable_AsShader
,
5411 d3d10_effect_depth_stencil_view_variable_AsBlend
,
5412 d3d10_effect_depth_stencil_view_variable_AsDepthStencil
,
5413 d3d10_effect_depth_stencil_view_variable_AsRasterizer
,
5414 d3d10_effect_depth_stencil_view_variable_AsSampler
,
5415 d3d10_effect_depth_stencil_view_variable_SetRawValue
,
5416 d3d10_effect_depth_stencil_view_variable_GetRawValue
,
5417 /* ID3D10EffectDepthStencilViewVariable methods */
5418 d3d10_effect_depth_stencil_view_variable_SetDepthStencil
,
5419 d3d10_effect_depth_stencil_view_variable_GetDepthStencil
,
5420 d3d10_effect_depth_stencil_view_variable_SetDepthStencilArray
,
5421 d3d10_effect_depth_stencil_view_variable_GetDepthStencilArray
,
5424 /* ID3D10EffectVariable methods */
5426 static BOOL STDMETHODCALLTYPE
d3d10_effect_shader_variable_IsValid(ID3D10EffectShaderVariable
*iface
)
5428 TRACE("iface %p\n", iface
);
5430 return (struct d3d10_effect_variable
*)iface
!= &null_shader_variable
;
5433 static struct ID3D10EffectType
* STDMETHODCALLTYPE
d3d10_effect_shader_variable_GetType(
5434 ID3D10EffectShaderVariable
*iface
)
5436 return d3d10_effect_variable_GetType((ID3D10EffectVariable
*)iface
);
5439 static HRESULT STDMETHODCALLTYPE
d3d10_effect_shader_variable_GetDesc(ID3D10EffectShaderVariable
*iface
,
5440 D3D10_EFFECT_VARIABLE_DESC
*desc
)
5442 return d3d10_effect_variable_GetDesc((ID3D10EffectVariable
*)iface
, desc
);
5445 static struct ID3D10EffectVariable
* STDMETHODCALLTYPE
d3d10_effect_shader_variable_GetAnnotationByIndex(
5446 ID3D10EffectShaderVariable
*iface
, UINT index
)
5448 return d3d10_effect_variable_GetAnnotationByIndex((ID3D10EffectVariable
*)iface
, index
);
5451 static struct ID3D10EffectVariable
* STDMETHODCALLTYPE
d3d10_effect_shader_variable_GetAnnotationByName(
5452 ID3D10EffectShaderVariable
*iface
, LPCSTR name
)
5454 return d3d10_effect_variable_GetAnnotationByName((ID3D10EffectVariable
*)iface
, name
);
5457 static struct ID3D10EffectVariable
* STDMETHODCALLTYPE
d3d10_effect_shader_variable_GetMemberByIndex(
5458 ID3D10EffectShaderVariable
*iface
, UINT index
)
5460 return d3d10_effect_variable_GetMemberByIndex((ID3D10EffectVariable
*)iface
, index
);
5463 static struct ID3D10EffectVariable
* STDMETHODCALLTYPE
d3d10_effect_shader_variable_GetMemberByName(
5464 ID3D10EffectShaderVariable
*iface
, LPCSTR name
)
5466 return d3d10_effect_variable_GetMemberByName((ID3D10EffectVariable
*)iface
, name
);
5469 static struct ID3D10EffectVariable
* STDMETHODCALLTYPE
d3d10_effect_shader_variable_GetMemberBySemantic(
5470 ID3D10EffectShaderVariable
*iface
, LPCSTR semantic
)
5472 return d3d10_effect_variable_GetMemberBySemantic((ID3D10EffectVariable
*)iface
, semantic
);
5475 static struct ID3D10EffectVariable
* STDMETHODCALLTYPE
d3d10_effect_shader_variable_GetElement(
5476 ID3D10EffectShaderVariable
*iface
, UINT index
)
5478 return d3d10_effect_variable_GetElement((ID3D10EffectVariable
*)iface
, index
);
5481 static struct ID3D10EffectConstantBuffer
* STDMETHODCALLTYPE
d3d10_effect_shader_variable_GetParentConstantBuffer(
5482 ID3D10EffectShaderVariable
*iface
)
5484 return d3d10_effect_variable_GetParentConstantBuffer((ID3D10EffectVariable
*)iface
);
5487 static struct ID3D10EffectScalarVariable
* STDMETHODCALLTYPE
d3d10_effect_shader_variable_AsScalar(
5488 ID3D10EffectShaderVariable
*iface
)
5490 return d3d10_effect_variable_AsScalar((ID3D10EffectVariable
*)iface
);
5493 static struct ID3D10EffectVectorVariable
* STDMETHODCALLTYPE
d3d10_effect_shader_variable_AsVector(
5494 ID3D10EffectShaderVariable
*iface
)
5496 return d3d10_effect_variable_AsVector((ID3D10EffectVariable
*)iface
);
5499 static struct ID3D10EffectMatrixVariable
* STDMETHODCALLTYPE
d3d10_effect_shader_variable_AsMatrix(
5500 ID3D10EffectShaderVariable
*iface
)
5502 return d3d10_effect_variable_AsMatrix((ID3D10EffectVariable
*)iface
);
5505 static struct ID3D10EffectStringVariable
* STDMETHODCALLTYPE
d3d10_effect_shader_variable_AsString(
5506 ID3D10EffectShaderVariable
*iface
)
5508 return d3d10_effect_variable_AsString((ID3D10EffectVariable
*)iface
);
5511 static struct ID3D10EffectShaderResourceVariable
* STDMETHODCALLTYPE
d3d10_effect_shader_variable_AsShaderResource(
5512 ID3D10EffectShaderVariable
*iface
)
5514 return d3d10_effect_variable_AsShaderResource((ID3D10EffectVariable
*)iface
);
5517 static struct ID3D10EffectRenderTargetViewVariable
* STDMETHODCALLTYPE
d3d10_effect_shader_variable_AsRenderTargetView(
5518 ID3D10EffectShaderVariable
*iface
)
5520 return d3d10_effect_variable_AsRenderTargetView((ID3D10EffectVariable
*)iface
);
5523 static struct ID3D10EffectDepthStencilViewVariable
* STDMETHODCALLTYPE
d3d10_effect_shader_variable_AsDepthStencilView(
5524 ID3D10EffectShaderVariable
*iface
)
5526 return d3d10_effect_variable_AsDepthStencilView((ID3D10EffectVariable
*)iface
);
5529 static struct ID3D10EffectConstantBuffer
* STDMETHODCALLTYPE
d3d10_effect_shader_variable_AsConstantBuffer(
5530 ID3D10EffectShaderVariable
*iface
)
5532 return d3d10_effect_variable_AsConstantBuffer((ID3D10EffectVariable
*)iface
);
5535 static struct ID3D10EffectShaderVariable
* STDMETHODCALLTYPE
d3d10_effect_shader_variable_AsShader(
5536 ID3D10EffectShaderVariable
*iface
)
5538 return d3d10_effect_variable_AsShader((ID3D10EffectVariable
*)iface
);
5541 static struct ID3D10EffectBlendVariable
* STDMETHODCALLTYPE
d3d10_effect_shader_variable_AsBlend(
5542 ID3D10EffectShaderVariable
*iface
)
5544 return d3d10_effect_variable_AsBlend((ID3D10EffectVariable
*)iface
);
5547 static struct ID3D10EffectDepthStencilVariable
* STDMETHODCALLTYPE
d3d10_effect_shader_variable_AsDepthStencil(
5548 ID3D10EffectShaderVariable
*iface
)
5550 return d3d10_effect_variable_AsDepthStencil((ID3D10EffectVariable
*)iface
);
5553 static struct ID3D10EffectRasterizerVariable
* STDMETHODCALLTYPE
d3d10_effect_shader_variable_AsRasterizer(
5554 ID3D10EffectShaderVariable
*iface
)
5556 return d3d10_effect_variable_AsRasterizer((ID3D10EffectVariable
*)iface
);
5559 static struct ID3D10EffectSamplerVariable
* STDMETHODCALLTYPE
d3d10_effect_shader_variable_AsSampler(
5560 ID3D10EffectShaderVariable
*iface
)
5562 return d3d10_effect_variable_AsSampler((ID3D10EffectVariable
*)iface
);
5565 static HRESULT STDMETHODCALLTYPE
d3d10_effect_shader_variable_SetRawValue(
5566 ID3D10EffectShaderVariable
*iface
, void *data
, UINT offset
, UINT count
)
5568 return d3d10_effect_variable_SetRawValue((ID3D10EffectVariable
*)iface
, data
, offset
, count
);
5571 static HRESULT STDMETHODCALLTYPE
d3d10_effect_shader_variable_GetRawValue(
5572 ID3D10EffectShaderVariable
*iface
, void *data
, UINT offset
, UINT count
)
5574 return d3d10_effect_variable_GetRawValue((ID3D10EffectVariable
*)iface
, data
, offset
, count
);
5577 /* ID3D10EffectShaderVariable methods */
5579 static HRESULT STDMETHODCALLTYPE
d3d10_effect_shader_variable_GetShaderDesc(
5580 ID3D10EffectShaderVariable
*iface
, UINT index
, D3D10_EFFECT_SHADER_DESC
*desc
)
5582 FIXME("iface %p, index %u, desc %p stub!\n", iface
, index
, desc
);
5587 static HRESULT STDMETHODCALLTYPE
d3d10_effect_shader_variable_GetVertexShader(
5588 ID3D10EffectShaderVariable
*iface
, UINT index
, ID3D10VertexShader
**shader
)
5590 FIXME("iface %p, index %u, shader %p stub!\n", iface
, index
, shader
);
5595 static HRESULT STDMETHODCALLTYPE
d3d10_effect_shader_variable_GetGeometryShader(
5596 ID3D10EffectShaderVariable
*iface
, UINT index
, ID3D10GeometryShader
**shader
)
5598 FIXME("iface %p, index %u, shader %p stub!\n", iface
, index
, shader
);
5603 static HRESULT STDMETHODCALLTYPE
d3d10_effect_shader_variable_GetPixelShader(
5604 ID3D10EffectShaderVariable
*iface
, UINT index
, ID3D10PixelShader
**shader
)
5606 FIXME("iface %p, index %u, shader %p stub!\n", iface
, index
, shader
);
5611 static HRESULT STDMETHODCALLTYPE
d3d10_effect_shader_variable_GetInputSignatureElementDesc(
5612 ID3D10EffectShaderVariable
*iface
, UINT shader_index
, UINT element_index
,
5613 D3D10_SIGNATURE_PARAMETER_DESC
*desc
)
5615 struct d3d10_effect_variable
*This
= (struct d3d10_effect_variable
*)iface
;
5616 struct d3d10_effect_shader_variable
*s
;
5617 D3D10_SIGNATURE_PARAMETER_DESC
*d
;
5619 TRACE("iface %p, shader_index %u, element_index %u, desc %p\n",
5620 iface
, shader_index
, element_index
, desc
);
5622 if (!iface
->lpVtbl
->IsValid(iface
))
5624 WARN("Null variable specified\n");
5628 /* Check shader_index, this crashes on W7/DX10 */
5629 if (shader_index
>= This
->effect
->used_shader_count
)
5631 WARN("This should crash on W7/DX10!\n");
5635 s
= This
->effect
->used_shaders
[shader_index
]->data
;
5636 if (!s
->input_signature
.signature
)
5638 WARN("No shader signature\n");
5639 return D3DERR_INVALIDCALL
;
5642 /* Check desc for NULL, this crashes on W7/DX10 */
5645 WARN("This should crash on W7/DX10!\n");
5649 if (element_index
>= s
->input_signature
.element_count
)
5651 WARN("Invalid element index specified\n");
5652 return E_INVALIDARG
;
5655 d
= &s
->input_signature
.elements
[element_index
];
5656 desc
->SemanticName
= d
->SemanticName
;
5657 desc
->SemanticIndex
= d
->SemanticIndex
;
5658 desc
->SystemValueType
= d
->SystemValueType
;
5659 desc
->ComponentType
= d
->ComponentType
;
5660 desc
->Register
= d
->Register
;
5661 desc
->ReadWriteMask
= d
->ReadWriteMask
;
5662 desc
->Mask
= d
->Mask
;
5667 static HRESULT STDMETHODCALLTYPE
d3d10_effect_shader_variable_GetOutputSignatureElementDesc(
5668 ID3D10EffectShaderVariable
*iface
, UINT shader_index
, UINT element_index
,
5669 D3D10_SIGNATURE_PARAMETER_DESC
*desc
)
5671 struct d3d10_effect_variable
*This
= (struct d3d10_effect_variable
*)iface
;
5672 struct d3d10_effect_shader_variable
*s
;
5673 D3D10_SIGNATURE_PARAMETER_DESC
*d
;
5675 TRACE("iface %p, shader_index %u, element_index %u, desc %p\n",
5676 iface
, shader_index
, element_index
, desc
);
5678 if (!iface
->lpVtbl
->IsValid(iface
))
5680 WARN("Null variable specified\n");
5684 /* Check shader_index, this crashes on W7/DX10 */
5685 if (shader_index
>= This
->effect
->used_shader_count
)
5687 WARN("This should crash on W7/DX10!\n");
5691 s
= This
->effect
->used_shaders
[shader_index
]->data
;
5692 if (!s
->output_signature
.signature
)
5694 WARN("No shader signature\n");
5695 return D3DERR_INVALIDCALL
;
5698 /* Check desc for NULL, this crashes on W7/DX10 */
5701 WARN("This should crash on W7/DX10!\n");
5705 if (element_index
>= s
->output_signature
.element_count
)
5707 WARN("Invalid element index specified\n");
5708 return E_INVALIDARG
;
5711 d
= &s
->output_signature
.elements
[element_index
];
5712 desc
->SemanticName
= d
->SemanticName
;
5713 desc
->SemanticIndex
= d
->SemanticIndex
;
5714 desc
->SystemValueType
= d
->SystemValueType
;
5715 desc
->ComponentType
= d
->ComponentType
;
5716 desc
->Register
= d
->Register
;
5717 desc
->ReadWriteMask
= d
->ReadWriteMask
;
5718 desc
->Mask
= d
->Mask
;
5724 static const struct ID3D10EffectShaderVariableVtbl d3d10_effect_shader_variable_vtbl
=
5726 /* ID3D10EffectVariable methods */
5727 d3d10_effect_shader_variable_IsValid
,
5728 d3d10_effect_shader_variable_GetType
,
5729 d3d10_effect_shader_variable_GetDesc
,
5730 d3d10_effect_shader_variable_GetAnnotationByIndex
,
5731 d3d10_effect_shader_variable_GetAnnotationByName
,
5732 d3d10_effect_shader_variable_GetMemberByIndex
,
5733 d3d10_effect_shader_variable_GetMemberByName
,
5734 d3d10_effect_shader_variable_GetMemberBySemantic
,
5735 d3d10_effect_shader_variable_GetElement
,
5736 d3d10_effect_shader_variable_GetParentConstantBuffer
,
5737 d3d10_effect_shader_variable_AsScalar
,
5738 d3d10_effect_shader_variable_AsVector
,
5739 d3d10_effect_shader_variable_AsMatrix
,
5740 d3d10_effect_shader_variable_AsString
,
5741 d3d10_effect_shader_variable_AsShaderResource
,
5742 d3d10_effect_shader_variable_AsRenderTargetView
,
5743 d3d10_effect_shader_variable_AsDepthStencilView
,
5744 d3d10_effect_shader_variable_AsConstantBuffer
,
5745 d3d10_effect_shader_variable_AsShader
,
5746 d3d10_effect_shader_variable_AsBlend
,
5747 d3d10_effect_shader_variable_AsDepthStencil
,
5748 d3d10_effect_shader_variable_AsRasterizer
,
5749 d3d10_effect_shader_variable_AsSampler
,
5750 d3d10_effect_shader_variable_SetRawValue
,
5751 d3d10_effect_shader_variable_GetRawValue
,
5752 /* ID3D10EffectShaderVariable methods */
5753 d3d10_effect_shader_variable_GetShaderDesc
,
5754 d3d10_effect_shader_variable_GetVertexShader
,
5755 d3d10_effect_shader_variable_GetGeometryShader
,
5756 d3d10_effect_shader_variable_GetPixelShader
,
5757 d3d10_effect_shader_variable_GetInputSignatureElementDesc
,
5758 d3d10_effect_shader_variable_GetOutputSignatureElementDesc
,
5761 /* ID3D10EffectVariable methods */
5763 static BOOL STDMETHODCALLTYPE
d3d10_effect_blend_variable_IsValid(ID3D10EffectBlendVariable
*iface
)
5765 TRACE("iface %p\n", iface
);
5767 return (struct d3d10_effect_variable
*)iface
!= &null_blend_variable
;
5770 static struct ID3D10EffectType
* STDMETHODCALLTYPE
d3d10_effect_blend_variable_GetType(
5771 ID3D10EffectBlendVariable
*iface
)
5773 return d3d10_effect_variable_GetType((ID3D10EffectVariable
*)iface
);
5776 static HRESULT STDMETHODCALLTYPE
d3d10_effect_blend_variable_GetDesc(ID3D10EffectBlendVariable
*iface
,
5777 D3D10_EFFECT_VARIABLE_DESC
*desc
)
5779 return d3d10_effect_variable_GetDesc((ID3D10EffectVariable
*)iface
, desc
);
5782 static struct ID3D10EffectVariable
* STDMETHODCALLTYPE
d3d10_effect_blend_variable_GetAnnotationByIndex(
5783 ID3D10EffectBlendVariable
*iface
, UINT index
)
5785 return d3d10_effect_variable_GetAnnotationByIndex((ID3D10EffectVariable
*)iface
, index
);
5788 static struct ID3D10EffectVariable
* STDMETHODCALLTYPE
d3d10_effect_blend_variable_GetAnnotationByName(
5789 ID3D10EffectBlendVariable
*iface
, LPCSTR name
)
5791 return d3d10_effect_variable_GetAnnotationByName((ID3D10EffectVariable
*)iface
, name
);
5794 static struct ID3D10EffectVariable
* STDMETHODCALLTYPE
d3d10_effect_blend_variable_GetMemberByIndex(
5795 ID3D10EffectBlendVariable
*iface
, UINT index
)
5797 return d3d10_effect_variable_GetMemberByIndex((ID3D10EffectVariable
*)iface
, index
);
5800 static struct ID3D10EffectVariable
* STDMETHODCALLTYPE
d3d10_effect_blend_variable_GetMemberByName(
5801 ID3D10EffectBlendVariable
*iface
, LPCSTR name
)
5803 return d3d10_effect_variable_GetMemberByName((ID3D10EffectVariable
*)iface
, name
);
5806 static struct ID3D10EffectVariable
* STDMETHODCALLTYPE
d3d10_effect_blend_variable_GetMemberBySemantic(
5807 ID3D10EffectBlendVariable
*iface
, LPCSTR semantic
)
5809 return d3d10_effect_variable_GetMemberBySemantic((ID3D10EffectVariable
*)iface
, semantic
);
5812 static struct ID3D10EffectVariable
* STDMETHODCALLTYPE
d3d10_effect_blend_variable_GetElement(
5813 ID3D10EffectBlendVariable
*iface
, UINT index
)
5815 return d3d10_effect_variable_GetElement((ID3D10EffectVariable
*)iface
, index
);
5818 static struct ID3D10EffectConstantBuffer
* STDMETHODCALLTYPE
d3d10_effect_blend_variable_GetParentConstantBuffer(
5819 ID3D10EffectBlendVariable
*iface
)
5821 return d3d10_effect_variable_GetParentConstantBuffer((ID3D10EffectVariable
*)iface
);
5824 static struct ID3D10EffectScalarVariable
* STDMETHODCALLTYPE
d3d10_effect_blend_variable_AsScalar(
5825 ID3D10EffectBlendVariable
*iface
)
5827 return d3d10_effect_variable_AsScalar((ID3D10EffectVariable
*)iface
);
5830 static struct ID3D10EffectVectorVariable
* STDMETHODCALLTYPE
d3d10_effect_blend_variable_AsVector(
5831 ID3D10EffectBlendVariable
*iface
)
5833 return d3d10_effect_variable_AsVector((ID3D10EffectVariable
*)iface
);
5836 static struct ID3D10EffectMatrixVariable
* STDMETHODCALLTYPE
d3d10_effect_blend_variable_AsMatrix(
5837 ID3D10EffectBlendVariable
*iface
)
5839 return d3d10_effect_variable_AsMatrix((ID3D10EffectVariable
*)iface
);
5842 static struct ID3D10EffectStringVariable
* STDMETHODCALLTYPE
d3d10_effect_blend_variable_AsString(
5843 ID3D10EffectBlendVariable
*iface
)
5845 return d3d10_effect_variable_AsString((ID3D10EffectVariable
*)iface
);
5848 static struct ID3D10EffectShaderResourceVariable
* STDMETHODCALLTYPE
d3d10_effect_blend_variable_AsShaderResource(
5849 ID3D10EffectBlendVariable
*iface
)
5851 return d3d10_effect_variable_AsShaderResource((ID3D10EffectVariable
*)iface
);
5854 static struct ID3D10EffectRenderTargetViewVariable
* STDMETHODCALLTYPE
d3d10_effect_blend_variable_AsRenderTargetView(
5855 ID3D10EffectBlendVariable
*iface
)
5857 return d3d10_effect_variable_AsRenderTargetView((ID3D10EffectVariable
*)iface
);
5860 static struct ID3D10EffectDepthStencilViewVariable
* STDMETHODCALLTYPE
d3d10_effect_blend_variable_AsDepthStencilView(
5861 ID3D10EffectBlendVariable
*iface
)
5863 return d3d10_effect_variable_AsDepthStencilView((ID3D10EffectVariable
*)iface
);
5866 static struct ID3D10EffectConstantBuffer
* STDMETHODCALLTYPE
d3d10_effect_blend_variable_AsConstantBuffer(
5867 ID3D10EffectBlendVariable
*iface
)
5869 return d3d10_effect_variable_AsConstantBuffer((ID3D10EffectVariable
*)iface
);
5872 static struct ID3D10EffectShaderVariable
* STDMETHODCALLTYPE
d3d10_effect_blend_variable_AsShader(
5873 ID3D10EffectBlendVariable
*iface
)
5875 return d3d10_effect_variable_AsShader((ID3D10EffectVariable
*)iface
);
5878 static struct ID3D10EffectBlendVariable
* STDMETHODCALLTYPE
d3d10_effect_blend_variable_AsBlend(
5879 ID3D10EffectBlendVariable
*iface
)
5881 return d3d10_effect_variable_AsBlend((ID3D10EffectVariable
*)iface
);
5884 static struct ID3D10EffectDepthStencilVariable
* STDMETHODCALLTYPE
d3d10_effect_blend_variable_AsDepthStencil(
5885 ID3D10EffectBlendVariable
*iface
)
5887 return d3d10_effect_variable_AsDepthStencil((ID3D10EffectVariable
*)iface
);
5890 static struct ID3D10EffectRasterizerVariable
* STDMETHODCALLTYPE
d3d10_effect_blend_variable_AsRasterizer(
5891 ID3D10EffectBlendVariable
*iface
)
5893 return d3d10_effect_variable_AsRasterizer((ID3D10EffectVariable
*)iface
);
5896 static struct ID3D10EffectSamplerVariable
* STDMETHODCALLTYPE
d3d10_effect_blend_variable_AsSampler(
5897 ID3D10EffectBlendVariable
*iface
)
5899 return d3d10_effect_variable_AsSampler((ID3D10EffectVariable
*)iface
);
5902 static HRESULT STDMETHODCALLTYPE
d3d10_effect_blend_variable_SetRawValue(ID3D10EffectBlendVariable
*iface
,
5903 void *data
, UINT offset
, UINT count
)
5905 return d3d10_effect_variable_SetRawValue((ID3D10EffectVariable
*)iface
, data
, offset
, count
);
5908 static HRESULT STDMETHODCALLTYPE
d3d10_effect_blend_variable_GetRawValue(ID3D10EffectBlendVariable
*iface
,
5909 void *data
, UINT offset
, UINT count
)
5911 return d3d10_effect_variable_GetRawValue((ID3D10EffectVariable
*)iface
, data
, offset
, count
);
5914 /* ID3D10EffectBlendVariable methods */
5916 static HRESULT STDMETHODCALLTYPE
d3d10_effect_blend_variable_GetBlendState(ID3D10EffectBlendVariable
*iface
,
5917 UINT index
, ID3D10BlendState
**blend_state
)
5919 FIXME("iface %p, index %u, blend_state %p stub!\n", iface
, index
, blend_state
);
5924 static HRESULT STDMETHODCALLTYPE
d3d10_effect_blend_variable_GetBackingStore(ID3D10EffectBlendVariable
*iface
,
5925 UINT index
, D3D10_BLEND_DESC
*desc
)
5927 struct d3d10_effect_variable
*v
= impl_from_ID3D10EffectVariable((ID3D10EffectVariable
*)iface
);
5929 TRACE("iface %p, index %u, desc %p.\n", iface
, index
, desc
);
5931 if (index
>= max(v
->type
->element_count
, 1))
5933 WARN("Invalid index %u.\n", index
);
5937 *desc
= ((D3D10_BLEND_DESC
*)v
->data
)[index
];
5943 static const struct ID3D10EffectBlendVariableVtbl d3d10_effect_blend_variable_vtbl
=
5945 /* ID3D10EffectVariable methods */
5946 d3d10_effect_blend_variable_IsValid
,
5947 d3d10_effect_blend_variable_GetType
,
5948 d3d10_effect_blend_variable_GetDesc
,
5949 d3d10_effect_blend_variable_GetAnnotationByIndex
,
5950 d3d10_effect_blend_variable_GetAnnotationByName
,
5951 d3d10_effect_blend_variable_GetMemberByIndex
,
5952 d3d10_effect_blend_variable_GetMemberByName
,
5953 d3d10_effect_blend_variable_GetMemberBySemantic
,
5954 d3d10_effect_blend_variable_GetElement
,
5955 d3d10_effect_blend_variable_GetParentConstantBuffer
,
5956 d3d10_effect_blend_variable_AsScalar
,
5957 d3d10_effect_blend_variable_AsVector
,
5958 d3d10_effect_blend_variable_AsMatrix
,
5959 d3d10_effect_blend_variable_AsString
,
5960 d3d10_effect_blend_variable_AsShaderResource
,
5961 d3d10_effect_blend_variable_AsRenderTargetView
,
5962 d3d10_effect_blend_variable_AsDepthStencilView
,
5963 d3d10_effect_blend_variable_AsConstantBuffer
,
5964 d3d10_effect_blend_variable_AsShader
,
5965 d3d10_effect_blend_variable_AsBlend
,
5966 d3d10_effect_blend_variable_AsDepthStencil
,
5967 d3d10_effect_blend_variable_AsRasterizer
,
5968 d3d10_effect_blend_variable_AsSampler
,
5969 d3d10_effect_blend_variable_SetRawValue
,
5970 d3d10_effect_blend_variable_GetRawValue
,
5971 /* ID3D10EffectBlendVariable methods */
5972 d3d10_effect_blend_variable_GetBlendState
,
5973 d3d10_effect_blend_variable_GetBackingStore
,
5976 /* ID3D10EffectVariable methods */
5978 static BOOL STDMETHODCALLTYPE
d3d10_effect_depth_stencil_variable_IsValid(ID3D10EffectDepthStencilVariable
*iface
)
5980 TRACE("iface %p\n", iface
);
5982 return (struct d3d10_effect_variable
*)iface
!= &null_depth_stencil_variable
;
5985 static struct ID3D10EffectType
* STDMETHODCALLTYPE
d3d10_effect_depth_stencil_variable_GetType(
5986 ID3D10EffectDepthStencilVariable
*iface
)
5988 return d3d10_effect_variable_GetType((ID3D10EffectVariable
*)iface
);
5991 static HRESULT STDMETHODCALLTYPE
d3d10_effect_depth_stencil_variable_GetDesc(ID3D10EffectDepthStencilVariable
*iface
,
5992 D3D10_EFFECT_VARIABLE_DESC
*desc
)
5994 return d3d10_effect_variable_GetDesc((ID3D10EffectVariable
*)iface
, desc
);
5997 static struct ID3D10EffectVariable
* STDMETHODCALLTYPE
d3d10_effect_depth_stencil_variable_GetAnnotationByIndex(
5998 ID3D10EffectDepthStencilVariable
*iface
, UINT index
)
6000 return d3d10_effect_variable_GetAnnotationByIndex((ID3D10EffectVariable
*)iface
, index
);
6003 static struct ID3D10EffectVariable
* STDMETHODCALLTYPE
d3d10_effect_depth_stencil_variable_GetAnnotationByName(
6004 ID3D10EffectDepthStencilVariable
*iface
, LPCSTR name
)
6006 return d3d10_effect_variable_GetAnnotationByName((ID3D10EffectVariable
*)iface
, name
);
6009 static struct ID3D10EffectVariable
* STDMETHODCALLTYPE
d3d10_effect_depth_stencil_variable_GetMemberByIndex(
6010 ID3D10EffectDepthStencilVariable
*iface
, UINT index
)
6012 return d3d10_effect_variable_GetMemberByIndex((ID3D10EffectVariable
*)iface
, index
);
6015 static struct ID3D10EffectVariable
* STDMETHODCALLTYPE
d3d10_effect_depth_stencil_variable_GetMemberByName(
6016 ID3D10EffectDepthStencilVariable
*iface
, LPCSTR name
)
6018 return d3d10_effect_variable_GetMemberByName((ID3D10EffectVariable
*)iface
, name
);
6021 static struct ID3D10EffectVariable
* STDMETHODCALLTYPE
d3d10_effect_depth_stencil_variable_GetMemberBySemantic(
6022 ID3D10EffectDepthStencilVariable
*iface
, LPCSTR semantic
)
6024 return d3d10_effect_variable_GetMemberBySemantic((ID3D10EffectVariable
*)iface
, semantic
);
6027 static struct ID3D10EffectVariable
* STDMETHODCALLTYPE
d3d10_effect_depth_stencil_variable_GetElement(
6028 ID3D10EffectDepthStencilVariable
*iface
, UINT index
)
6030 return d3d10_effect_variable_GetElement((ID3D10EffectVariable
*)iface
, index
);
6033 static struct ID3D10EffectConstantBuffer
* STDMETHODCALLTYPE
d3d10_effect_depth_stencil_variable_GetParentConstantBuffer(
6034 ID3D10EffectDepthStencilVariable
*iface
)
6036 return d3d10_effect_variable_GetParentConstantBuffer((ID3D10EffectVariable
*)iface
);
6039 static struct ID3D10EffectScalarVariable
* STDMETHODCALLTYPE
d3d10_effect_depth_stencil_variable_AsScalar(
6040 ID3D10EffectDepthStencilVariable
*iface
)
6042 return d3d10_effect_variable_AsScalar((ID3D10EffectVariable
*)iface
);
6045 static struct ID3D10EffectVectorVariable
* STDMETHODCALLTYPE
d3d10_effect_depth_stencil_variable_AsVector(
6046 ID3D10EffectDepthStencilVariable
*iface
)
6048 return d3d10_effect_variable_AsVector((ID3D10EffectVariable
*)iface
);
6051 static struct ID3D10EffectMatrixVariable
* STDMETHODCALLTYPE
d3d10_effect_depth_stencil_variable_AsMatrix(
6052 ID3D10EffectDepthStencilVariable
*iface
)
6054 return d3d10_effect_variable_AsMatrix((ID3D10EffectVariable
*)iface
);
6057 static struct ID3D10EffectStringVariable
* STDMETHODCALLTYPE
d3d10_effect_depth_stencil_variable_AsString(
6058 ID3D10EffectDepthStencilVariable
*iface
)
6060 return d3d10_effect_variable_AsString((ID3D10EffectVariable
*)iface
);
6063 static struct ID3D10EffectShaderResourceVariable
* STDMETHODCALLTYPE
d3d10_effect_depth_stencil_variable_AsShaderResource(
6064 ID3D10EffectDepthStencilVariable
*iface
)
6066 return d3d10_effect_variable_AsShaderResource((ID3D10EffectVariable
*)iface
);
6069 static struct ID3D10EffectRenderTargetViewVariable
* STDMETHODCALLTYPE
d3d10_effect_depth_stencil_variable_AsRenderTargetView(
6070 ID3D10EffectDepthStencilVariable
*iface
)
6072 return d3d10_effect_variable_AsRenderTargetView((ID3D10EffectVariable
*)iface
);
6075 static struct ID3D10EffectDepthStencilViewVariable
* STDMETHODCALLTYPE
d3d10_effect_depth_stencil_variable_AsDepthStencilView(
6076 ID3D10EffectDepthStencilVariable
*iface
)
6078 return d3d10_effect_variable_AsDepthStencilView((ID3D10EffectVariable
*)iface
);
6081 static struct ID3D10EffectConstantBuffer
* STDMETHODCALLTYPE
d3d10_effect_depth_stencil_variable_AsConstantBuffer(
6082 ID3D10EffectDepthStencilVariable
*iface
)
6084 return d3d10_effect_variable_AsConstantBuffer((ID3D10EffectVariable
*)iface
);
6087 static struct ID3D10EffectShaderVariable
* STDMETHODCALLTYPE
d3d10_effect_depth_stencil_variable_AsShader(
6088 ID3D10EffectDepthStencilVariable
*iface
)
6090 return d3d10_effect_variable_AsShader((ID3D10EffectVariable
*)iface
);
6093 static struct ID3D10EffectBlendVariable
* STDMETHODCALLTYPE
d3d10_effect_depth_stencil_variable_AsBlend(
6094 ID3D10EffectDepthStencilVariable
*iface
)
6096 return d3d10_effect_variable_AsBlend((ID3D10EffectVariable
*)iface
);
6099 static struct ID3D10EffectDepthStencilVariable
* STDMETHODCALLTYPE
d3d10_effect_depth_stencil_variable_AsDepthStencil(
6100 ID3D10EffectDepthStencilVariable
*iface
)
6102 return d3d10_effect_variable_AsDepthStencil((ID3D10EffectVariable
*)iface
);
6105 static struct ID3D10EffectRasterizerVariable
* STDMETHODCALLTYPE
d3d10_effect_depth_stencil_variable_AsRasterizer(
6106 ID3D10EffectDepthStencilVariable
*iface
)
6108 return d3d10_effect_variable_AsRasterizer((ID3D10EffectVariable
*)iface
);
6111 static struct ID3D10EffectSamplerVariable
* STDMETHODCALLTYPE
d3d10_effect_depth_stencil_variable_AsSampler(
6112 ID3D10EffectDepthStencilVariable
*iface
)
6114 return d3d10_effect_variable_AsSampler((ID3D10EffectVariable
*)iface
);
6117 static HRESULT STDMETHODCALLTYPE
d3d10_effect_depth_stencil_variable_SetRawValue(ID3D10EffectDepthStencilVariable
*iface
,
6118 void *data
, UINT offset
, UINT count
)
6120 return d3d10_effect_variable_SetRawValue((ID3D10EffectVariable
*)iface
, data
, offset
, count
);
6123 static HRESULT STDMETHODCALLTYPE
d3d10_effect_depth_stencil_variable_GetRawValue(ID3D10EffectDepthStencilVariable
*iface
,
6124 void *data
, UINT offset
, UINT count
)
6126 return d3d10_effect_variable_GetRawValue((ID3D10EffectVariable
*)iface
, data
, offset
, count
);
6129 /* ID3D10EffectDepthStencilVariable methods */
6131 static HRESULT STDMETHODCALLTYPE
d3d10_effect_depth_stencil_variable_GetDepthStencilState(ID3D10EffectDepthStencilVariable
*iface
,
6132 UINT index
, ID3D10DepthStencilState
**depth_stencil_state
)
6134 FIXME("iface %p, index %u, depth_stencil_state %p stub!\n", iface
, index
, depth_stencil_state
);
6139 static HRESULT STDMETHODCALLTYPE
d3d10_effect_depth_stencil_variable_GetBackingStore(ID3D10EffectDepthStencilVariable
*iface
,
6140 UINT index
, D3D10_DEPTH_STENCIL_DESC
*desc
)
6142 struct d3d10_effect_variable
*v
= impl_from_ID3D10EffectVariable((ID3D10EffectVariable
*)iface
);
6144 TRACE("iface %p, index %u, desc %p.\n", iface
, index
, desc
);
6146 if (index
>= max(v
->type
->element_count
, 1))
6148 WARN("Invalid index %u.\n", index
);
6152 *desc
= ((D3D10_DEPTH_STENCIL_DESC
*)v
->data
)[index
];
6158 static const struct ID3D10EffectDepthStencilVariableVtbl d3d10_effect_depth_stencil_variable_vtbl
=
6160 /* ID3D10EffectVariable methods */
6161 d3d10_effect_depth_stencil_variable_IsValid
,
6162 d3d10_effect_depth_stencil_variable_GetType
,
6163 d3d10_effect_depth_stencil_variable_GetDesc
,
6164 d3d10_effect_depth_stencil_variable_GetAnnotationByIndex
,
6165 d3d10_effect_depth_stencil_variable_GetAnnotationByName
,
6166 d3d10_effect_depth_stencil_variable_GetMemberByIndex
,
6167 d3d10_effect_depth_stencil_variable_GetMemberByName
,
6168 d3d10_effect_depth_stencil_variable_GetMemberBySemantic
,
6169 d3d10_effect_depth_stencil_variable_GetElement
,
6170 d3d10_effect_depth_stencil_variable_GetParentConstantBuffer
,
6171 d3d10_effect_depth_stencil_variable_AsScalar
,
6172 d3d10_effect_depth_stencil_variable_AsVector
,
6173 d3d10_effect_depth_stencil_variable_AsMatrix
,
6174 d3d10_effect_depth_stencil_variable_AsString
,
6175 d3d10_effect_depth_stencil_variable_AsShaderResource
,
6176 d3d10_effect_depth_stencil_variable_AsRenderTargetView
,
6177 d3d10_effect_depth_stencil_variable_AsDepthStencilView
,
6178 d3d10_effect_depth_stencil_variable_AsConstantBuffer
,
6179 d3d10_effect_depth_stencil_variable_AsShader
,
6180 d3d10_effect_depth_stencil_variable_AsBlend
,
6181 d3d10_effect_depth_stencil_variable_AsDepthStencil
,
6182 d3d10_effect_depth_stencil_variable_AsRasterizer
,
6183 d3d10_effect_depth_stencil_variable_AsSampler
,
6184 d3d10_effect_depth_stencil_variable_SetRawValue
,
6185 d3d10_effect_depth_stencil_variable_GetRawValue
,
6186 /* ID3D10EffectDepthStencilVariable methods */
6187 d3d10_effect_depth_stencil_variable_GetDepthStencilState
,
6188 d3d10_effect_depth_stencil_variable_GetBackingStore
,
6191 /* ID3D10EffectVariable methods */
6193 static BOOL STDMETHODCALLTYPE
d3d10_effect_rasterizer_variable_IsValid(ID3D10EffectRasterizerVariable
*iface
)
6195 TRACE("iface %p\n", iface
);
6197 return (struct d3d10_effect_variable
*)iface
!= &null_rasterizer_variable
;
6200 static struct ID3D10EffectType
* STDMETHODCALLTYPE
d3d10_effect_rasterizer_variable_GetType(
6201 ID3D10EffectRasterizerVariable
*iface
)
6203 return d3d10_effect_variable_GetType((ID3D10EffectVariable
*)iface
);
6206 static HRESULT STDMETHODCALLTYPE
d3d10_effect_rasterizer_variable_GetDesc(ID3D10EffectRasterizerVariable
*iface
,
6207 D3D10_EFFECT_VARIABLE_DESC
*desc
)
6209 return d3d10_effect_variable_GetDesc((ID3D10EffectVariable
*)iface
, desc
);
6212 static struct ID3D10EffectVariable
* STDMETHODCALLTYPE
d3d10_effect_rasterizer_variable_GetAnnotationByIndex(
6213 ID3D10EffectRasterizerVariable
*iface
, UINT index
)
6215 return d3d10_effect_variable_GetAnnotationByIndex((ID3D10EffectVariable
*)iface
, index
);
6218 static struct ID3D10EffectVariable
* STDMETHODCALLTYPE
d3d10_effect_rasterizer_variable_GetAnnotationByName(
6219 ID3D10EffectRasterizerVariable
*iface
, LPCSTR name
)
6221 return d3d10_effect_variable_GetAnnotationByName((ID3D10EffectVariable
*)iface
, name
);
6224 static struct ID3D10EffectVariable
* STDMETHODCALLTYPE
d3d10_effect_rasterizer_variable_GetMemberByIndex(
6225 ID3D10EffectRasterizerVariable
*iface
, UINT index
)
6227 return d3d10_effect_variable_GetMemberByIndex((ID3D10EffectVariable
*)iface
, index
);
6230 static struct ID3D10EffectVariable
* STDMETHODCALLTYPE
d3d10_effect_rasterizer_variable_GetMemberByName(
6231 ID3D10EffectRasterizerVariable
*iface
, LPCSTR name
)
6233 return d3d10_effect_variable_GetMemberByName((ID3D10EffectVariable
*)iface
, name
);
6236 static struct ID3D10EffectVariable
* STDMETHODCALLTYPE
d3d10_effect_rasterizer_variable_GetMemberBySemantic(
6237 ID3D10EffectRasterizerVariable
*iface
, LPCSTR semantic
)
6239 return d3d10_effect_variable_GetMemberBySemantic((ID3D10EffectVariable
*)iface
, semantic
);
6242 static struct ID3D10EffectVariable
* STDMETHODCALLTYPE
d3d10_effect_rasterizer_variable_GetElement(
6243 ID3D10EffectRasterizerVariable
*iface
, UINT index
)
6245 return d3d10_effect_variable_GetElement((ID3D10EffectVariable
*)iface
, index
);
6248 static struct ID3D10EffectConstantBuffer
* STDMETHODCALLTYPE
d3d10_effect_rasterizer_variable_GetParentConstantBuffer(
6249 ID3D10EffectRasterizerVariable
*iface
)
6251 return d3d10_effect_variable_GetParentConstantBuffer((ID3D10EffectVariable
*)iface
);
6254 static struct ID3D10EffectScalarVariable
* STDMETHODCALLTYPE
d3d10_effect_rasterizer_variable_AsScalar(
6255 ID3D10EffectRasterizerVariable
*iface
)
6257 return d3d10_effect_variable_AsScalar((ID3D10EffectVariable
*)iface
);
6260 static struct ID3D10EffectVectorVariable
* STDMETHODCALLTYPE
d3d10_effect_rasterizer_variable_AsVector(
6261 ID3D10EffectRasterizerVariable
*iface
)
6263 return d3d10_effect_variable_AsVector((ID3D10EffectVariable
*)iface
);
6266 static struct ID3D10EffectMatrixVariable
* STDMETHODCALLTYPE
d3d10_effect_rasterizer_variable_AsMatrix(
6267 ID3D10EffectRasterizerVariable
*iface
)
6269 return d3d10_effect_variable_AsMatrix((ID3D10EffectVariable
*)iface
);
6272 static struct ID3D10EffectStringVariable
* STDMETHODCALLTYPE
d3d10_effect_rasterizer_variable_AsString(
6273 ID3D10EffectRasterizerVariable
*iface
)
6275 return d3d10_effect_variable_AsString((ID3D10EffectVariable
*)iface
);
6278 static struct ID3D10EffectShaderResourceVariable
* STDMETHODCALLTYPE
d3d10_effect_rasterizer_variable_AsShaderResource(
6279 ID3D10EffectRasterizerVariable
*iface
)
6281 return d3d10_effect_variable_AsShaderResource((ID3D10EffectVariable
*)iface
);
6284 static struct ID3D10EffectRenderTargetViewVariable
* STDMETHODCALLTYPE
d3d10_effect_rasterizer_variable_AsRenderTargetView(
6285 ID3D10EffectRasterizerVariable
*iface
)
6287 return d3d10_effect_variable_AsRenderTargetView((ID3D10EffectVariable
*)iface
);
6290 static struct ID3D10EffectDepthStencilViewVariable
* STDMETHODCALLTYPE
d3d10_effect_rasterizer_variable_AsDepthStencilView(
6291 ID3D10EffectRasterizerVariable
*iface
)
6293 return d3d10_effect_variable_AsDepthStencilView((ID3D10EffectVariable
*)iface
);
6296 static struct ID3D10EffectConstantBuffer
* STDMETHODCALLTYPE
d3d10_effect_rasterizer_variable_AsConstantBuffer(
6297 ID3D10EffectRasterizerVariable
*iface
)
6299 return d3d10_effect_variable_AsConstantBuffer((ID3D10EffectVariable
*)iface
);
6302 static struct ID3D10EffectShaderVariable
* STDMETHODCALLTYPE
d3d10_effect_rasterizer_variable_AsShader(
6303 ID3D10EffectRasterizerVariable
*iface
)
6305 return d3d10_effect_variable_AsShader((ID3D10EffectVariable
*)iface
);
6308 static struct ID3D10EffectBlendVariable
* STDMETHODCALLTYPE
d3d10_effect_rasterizer_variable_AsBlend(
6309 ID3D10EffectRasterizerVariable
*iface
)
6311 return d3d10_effect_variable_AsBlend((ID3D10EffectVariable
*)iface
);
6314 static struct ID3D10EffectDepthStencilVariable
* STDMETHODCALLTYPE
d3d10_effect_rasterizer_variable_AsDepthStencil(
6315 ID3D10EffectRasterizerVariable
*iface
)
6317 return d3d10_effect_variable_AsDepthStencil((ID3D10EffectVariable
*)iface
);
6320 static struct ID3D10EffectRasterizerVariable
* STDMETHODCALLTYPE
d3d10_effect_rasterizer_variable_AsRasterizer(
6321 ID3D10EffectRasterizerVariable
*iface
)
6323 return d3d10_effect_variable_AsRasterizer((ID3D10EffectVariable
*)iface
);
6326 static struct ID3D10EffectSamplerVariable
* STDMETHODCALLTYPE
d3d10_effect_rasterizer_variable_AsSampler(
6327 ID3D10EffectRasterizerVariable
*iface
)
6329 return d3d10_effect_variable_AsSampler((ID3D10EffectVariable
*)iface
);
6332 static HRESULT STDMETHODCALLTYPE
d3d10_effect_rasterizer_variable_SetRawValue(ID3D10EffectRasterizerVariable
*iface
,
6333 void *data
, UINT offset
, UINT count
)
6335 return d3d10_effect_variable_SetRawValue((ID3D10EffectVariable
*)iface
, data
, offset
, count
);
6338 static HRESULT STDMETHODCALLTYPE
d3d10_effect_rasterizer_variable_GetRawValue(ID3D10EffectRasterizerVariable
*iface
,
6339 void *data
, UINT offset
, UINT count
)
6341 return d3d10_effect_variable_GetRawValue((ID3D10EffectVariable
*)iface
, data
, offset
, count
);
6344 /* ID3D10EffectRasterizerVariable methods */
6346 static HRESULT STDMETHODCALLTYPE
d3d10_effect_rasterizer_variable_GetRasterizerState(ID3D10EffectRasterizerVariable
*iface
,
6347 UINT index
, ID3D10RasterizerState
**rasterizer_state
)
6349 FIXME("iface %p, index %u, rasterizer_state %p stub!\n", iface
, index
, rasterizer_state
);
6354 static HRESULT STDMETHODCALLTYPE
d3d10_effect_rasterizer_variable_GetBackingStore(ID3D10EffectRasterizerVariable
*iface
,
6355 UINT index
, D3D10_RASTERIZER_DESC
*desc
)
6357 struct d3d10_effect_variable
*v
= impl_from_ID3D10EffectVariable((ID3D10EffectVariable
*)iface
);
6359 TRACE("iface %p, index %u, desc %p.\n", iface
, index
, desc
);
6361 if (index
>= max(v
->type
->element_count
, 1))
6363 WARN("Invalid index %u.\n", index
);
6367 *desc
= ((D3D10_RASTERIZER_DESC
*)v
->data
)[index
];
6373 static const struct ID3D10EffectRasterizerVariableVtbl d3d10_effect_rasterizer_variable_vtbl
=
6375 /* ID3D10EffectVariable methods */
6376 d3d10_effect_rasterizer_variable_IsValid
,
6377 d3d10_effect_rasterizer_variable_GetType
,
6378 d3d10_effect_rasterizer_variable_GetDesc
,
6379 d3d10_effect_rasterizer_variable_GetAnnotationByIndex
,
6380 d3d10_effect_rasterizer_variable_GetAnnotationByName
,
6381 d3d10_effect_rasterizer_variable_GetMemberByIndex
,
6382 d3d10_effect_rasterizer_variable_GetMemberByName
,
6383 d3d10_effect_rasterizer_variable_GetMemberBySemantic
,
6384 d3d10_effect_rasterizer_variable_GetElement
,
6385 d3d10_effect_rasterizer_variable_GetParentConstantBuffer
,
6386 d3d10_effect_rasterizer_variable_AsScalar
,
6387 d3d10_effect_rasterizer_variable_AsVector
,
6388 d3d10_effect_rasterizer_variable_AsMatrix
,
6389 d3d10_effect_rasterizer_variable_AsString
,
6390 d3d10_effect_rasterizer_variable_AsShaderResource
,
6391 d3d10_effect_rasterizer_variable_AsRenderTargetView
,
6392 d3d10_effect_rasterizer_variable_AsDepthStencilView
,
6393 d3d10_effect_rasterizer_variable_AsConstantBuffer
,
6394 d3d10_effect_rasterizer_variable_AsShader
,
6395 d3d10_effect_rasterizer_variable_AsBlend
,
6396 d3d10_effect_rasterizer_variable_AsDepthStencil
,
6397 d3d10_effect_rasterizer_variable_AsRasterizer
,
6398 d3d10_effect_rasterizer_variable_AsSampler
,
6399 d3d10_effect_rasterizer_variable_SetRawValue
,
6400 d3d10_effect_rasterizer_variable_GetRawValue
,
6401 /* ID3D10EffectRasterizerVariable methods */
6402 d3d10_effect_rasterizer_variable_GetRasterizerState
,
6403 d3d10_effect_rasterizer_variable_GetBackingStore
,
6406 /* ID3D10EffectVariable methods */
6408 static BOOL STDMETHODCALLTYPE
d3d10_effect_sampler_variable_IsValid(ID3D10EffectSamplerVariable
*iface
)
6410 TRACE("iface %p\n", iface
);
6412 return (struct d3d10_effect_variable
*)iface
!= &null_sampler_variable
;
6415 static struct ID3D10EffectType
* STDMETHODCALLTYPE
d3d10_effect_sampler_variable_GetType(
6416 ID3D10EffectSamplerVariable
*iface
)
6418 return d3d10_effect_variable_GetType((ID3D10EffectVariable
*)iface
);
6421 static HRESULT STDMETHODCALLTYPE
d3d10_effect_sampler_variable_GetDesc(ID3D10EffectSamplerVariable
*iface
,
6422 D3D10_EFFECT_VARIABLE_DESC
*desc
)
6424 return d3d10_effect_variable_GetDesc((ID3D10EffectVariable
*)iface
, desc
);
6427 static struct ID3D10EffectVariable
* STDMETHODCALLTYPE
d3d10_effect_sampler_variable_GetAnnotationByIndex(
6428 ID3D10EffectSamplerVariable
*iface
, UINT index
)
6430 return d3d10_effect_variable_GetAnnotationByIndex((ID3D10EffectVariable
*)iface
, index
);
6433 static struct ID3D10EffectVariable
* STDMETHODCALLTYPE
d3d10_effect_sampler_variable_GetAnnotationByName(
6434 ID3D10EffectSamplerVariable
*iface
, LPCSTR name
)
6436 return d3d10_effect_variable_GetAnnotationByName((ID3D10EffectVariable
*)iface
, name
);
6439 static struct ID3D10EffectVariable
* STDMETHODCALLTYPE
d3d10_effect_sampler_variable_GetMemberByIndex(
6440 ID3D10EffectSamplerVariable
*iface
, UINT index
)
6442 return d3d10_effect_variable_GetMemberByIndex((ID3D10EffectVariable
*)iface
, index
);
6445 static struct ID3D10EffectVariable
* STDMETHODCALLTYPE
d3d10_effect_sampler_variable_GetMemberByName(
6446 ID3D10EffectSamplerVariable
*iface
, LPCSTR name
)
6448 return d3d10_effect_variable_GetMemberByName((ID3D10EffectVariable
*)iface
, name
);
6451 static struct ID3D10EffectVariable
* STDMETHODCALLTYPE
d3d10_effect_sampler_variable_GetMemberBySemantic(
6452 ID3D10EffectSamplerVariable
*iface
, LPCSTR semantic
)
6454 return d3d10_effect_variable_GetMemberBySemantic((ID3D10EffectVariable
*)iface
, semantic
);
6457 static struct ID3D10EffectVariable
* STDMETHODCALLTYPE
d3d10_effect_sampler_variable_GetElement(
6458 ID3D10EffectSamplerVariable
*iface
, UINT index
)
6460 return d3d10_effect_variable_GetElement((ID3D10EffectVariable
*)iface
, index
);
6463 static struct ID3D10EffectConstantBuffer
* STDMETHODCALLTYPE
d3d10_effect_sampler_variable_GetParentConstantBuffer(
6464 ID3D10EffectSamplerVariable
*iface
)
6466 return d3d10_effect_variable_GetParentConstantBuffer((ID3D10EffectVariable
*)iface
);
6469 static struct ID3D10EffectScalarVariable
* STDMETHODCALLTYPE
d3d10_effect_sampler_variable_AsScalar(
6470 ID3D10EffectSamplerVariable
*iface
)
6472 return d3d10_effect_variable_AsScalar((ID3D10EffectVariable
*)iface
);
6475 static struct ID3D10EffectVectorVariable
* STDMETHODCALLTYPE
d3d10_effect_sampler_variable_AsVector(
6476 ID3D10EffectSamplerVariable
*iface
)
6478 return d3d10_effect_variable_AsVector((ID3D10EffectVariable
*)iface
);
6481 static struct ID3D10EffectMatrixVariable
* STDMETHODCALLTYPE
d3d10_effect_sampler_variable_AsMatrix(
6482 ID3D10EffectSamplerVariable
*iface
)
6484 return d3d10_effect_variable_AsMatrix((ID3D10EffectVariable
*)iface
);
6487 static struct ID3D10EffectStringVariable
* STDMETHODCALLTYPE
d3d10_effect_sampler_variable_AsString(
6488 ID3D10EffectSamplerVariable
*iface
)
6490 return d3d10_effect_variable_AsString((ID3D10EffectVariable
*)iface
);
6493 static struct ID3D10EffectShaderResourceVariable
* STDMETHODCALLTYPE
d3d10_effect_sampler_variable_AsShaderResource(
6494 ID3D10EffectSamplerVariable
*iface
)
6496 return d3d10_effect_variable_AsShaderResource((ID3D10EffectVariable
*)iface
);
6499 static struct ID3D10EffectRenderTargetViewVariable
* STDMETHODCALLTYPE
d3d10_effect_sampler_variable_AsRenderTargetView(
6500 ID3D10EffectSamplerVariable
*iface
)
6502 return d3d10_effect_variable_AsRenderTargetView((ID3D10EffectVariable
*)iface
);
6505 static struct ID3D10EffectDepthStencilViewVariable
* STDMETHODCALLTYPE
d3d10_effect_sampler_variable_AsDepthStencilView(
6506 ID3D10EffectSamplerVariable
*iface
)
6508 return d3d10_effect_variable_AsDepthStencilView((ID3D10EffectVariable
*)iface
);
6511 static struct ID3D10EffectConstantBuffer
* STDMETHODCALLTYPE
d3d10_effect_sampler_variable_AsConstantBuffer(
6512 ID3D10EffectSamplerVariable
*iface
)
6514 return d3d10_effect_variable_AsConstantBuffer((ID3D10EffectVariable
*)iface
);
6517 static struct ID3D10EffectShaderVariable
* STDMETHODCALLTYPE
d3d10_effect_sampler_variable_AsShader(
6518 ID3D10EffectSamplerVariable
*iface
)
6520 return d3d10_effect_variable_AsShader((ID3D10EffectVariable
*)iface
);
6523 static struct ID3D10EffectBlendVariable
* STDMETHODCALLTYPE
d3d10_effect_sampler_variable_AsBlend(
6524 ID3D10EffectSamplerVariable
*iface
)
6526 return d3d10_effect_variable_AsBlend((ID3D10EffectVariable
*)iface
);
6529 static struct ID3D10EffectDepthStencilVariable
* STDMETHODCALLTYPE
d3d10_effect_sampler_variable_AsDepthStencil(
6530 ID3D10EffectSamplerVariable
*iface
)
6532 return d3d10_effect_variable_AsDepthStencil((ID3D10EffectVariable
*)iface
);
6535 static struct ID3D10EffectRasterizerVariable
* STDMETHODCALLTYPE
d3d10_effect_sampler_variable_AsRasterizer(
6536 ID3D10EffectSamplerVariable
*iface
)
6538 return d3d10_effect_variable_AsRasterizer((ID3D10EffectVariable
*)iface
);
6541 static struct ID3D10EffectSamplerVariable
* STDMETHODCALLTYPE
d3d10_effect_sampler_variable_AsSampler(
6542 ID3D10EffectSamplerVariable
*iface
)
6544 return d3d10_effect_variable_AsSampler((ID3D10EffectVariable
*)iface
);
6547 static HRESULT STDMETHODCALLTYPE
d3d10_effect_sampler_variable_SetRawValue(ID3D10EffectSamplerVariable
*iface
,
6548 void *data
, UINT offset
, UINT count
)
6550 return d3d10_effect_variable_SetRawValue((ID3D10EffectVariable
*)iface
, data
, offset
, count
);
6553 static HRESULT STDMETHODCALLTYPE
d3d10_effect_sampler_variable_GetRawValue(ID3D10EffectSamplerVariable
*iface
,
6554 void *data
, UINT offset
, UINT count
)
6556 return d3d10_effect_variable_GetRawValue((ID3D10EffectVariable
*)iface
, data
, offset
, count
);
6559 /* ID3D10EffectSamplerVariable methods */
6561 static HRESULT STDMETHODCALLTYPE
d3d10_effect_sampler_variable_GetSampler(ID3D10EffectSamplerVariable
*iface
,
6562 UINT index
, ID3D10SamplerState
**sampler
)
6564 FIXME("iface %p, index %u, sampler %p stub!\n", iface
, index
, sampler
);
6569 static HRESULT STDMETHODCALLTYPE
d3d10_effect_sampler_variable_GetBackingStore(ID3D10EffectSamplerVariable
*iface
,
6570 UINT index
, D3D10_SAMPLER_DESC
*desc
)
6572 FIXME("iface %p, index %u, desc %p stub!\n", iface
, index
, desc
);
6578 static const struct ID3D10EffectSamplerVariableVtbl d3d10_effect_sampler_variable_vtbl
=
6580 /* ID3D10EffectVariable methods */
6581 d3d10_effect_sampler_variable_IsValid
,
6582 d3d10_effect_sampler_variable_GetType
,
6583 d3d10_effect_sampler_variable_GetDesc
,
6584 d3d10_effect_sampler_variable_GetAnnotationByIndex
,
6585 d3d10_effect_sampler_variable_GetAnnotationByName
,
6586 d3d10_effect_sampler_variable_GetMemberByIndex
,
6587 d3d10_effect_sampler_variable_GetMemberByName
,
6588 d3d10_effect_sampler_variable_GetMemberBySemantic
,
6589 d3d10_effect_sampler_variable_GetElement
,
6590 d3d10_effect_sampler_variable_GetParentConstantBuffer
,
6591 d3d10_effect_sampler_variable_AsScalar
,
6592 d3d10_effect_sampler_variable_AsVector
,
6593 d3d10_effect_sampler_variable_AsMatrix
,
6594 d3d10_effect_sampler_variable_AsString
,
6595 d3d10_effect_sampler_variable_AsShaderResource
,
6596 d3d10_effect_sampler_variable_AsRenderTargetView
,
6597 d3d10_effect_sampler_variable_AsDepthStencilView
,
6598 d3d10_effect_sampler_variable_AsConstantBuffer
,
6599 d3d10_effect_sampler_variable_AsShader
,
6600 d3d10_effect_sampler_variable_AsBlend
,
6601 d3d10_effect_sampler_variable_AsDepthStencil
,
6602 d3d10_effect_sampler_variable_AsRasterizer
,
6603 d3d10_effect_sampler_variable_AsSampler
,
6604 d3d10_effect_sampler_variable_SetRawValue
,
6605 d3d10_effect_sampler_variable_GetRawValue
,
6606 /* ID3D10EffectSamplerVariable methods */
6607 d3d10_effect_sampler_variable_GetSampler
,
6608 d3d10_effect_sampler_variable_GetBackingStore
,
6611 /* ID3D10EffectType methods */
6613 static inline struct d3d10_effect_type
*impl_from_ID3D10EffectType(ID3D10EffectType
*iface
)
6615 return CONTAINING_RECORD(iface
, struct d3d10_effect_type
, ID3D10EffectType_iface
);
6618 static BOOL STDMETHODCALLTYPE
d3d10_effect_type_IsValid(ID3D10EffectType
*iface
)
6620 struct d3d10_effect_type
*This
= impl_from_ID3D10EffectType(iface
);
6622 TRACE("iface %p\n", iface
);
6624 return This
!= &null_type
;
6627 static HRESULT STDMETHODCALLTYPE
d3d10_effect_type_GetDesc(ID3D10EffectType
*iface
, D3D10_EFFECT_TYPE_DESC
*desc
)
6629 struct d3d10_effect_type
*This
= impl_from_ID3D10EffectType(iface
);
6631 TRACE("iface %p, desc %p\n", iface
, desc
);
6633 if (This
== &null_type
)
6635 WARN("Null type specified\n");
6641 WARN("Invalid argument specified\n");
6642 return E_INVALIDARG
;
6645 desc
->TypeName
= This
->name
;
6646 desc
->Class
= This
->type_class
;
6647 desc
->Type
= This
->basetype
;
6648 desc
->Elements
= This
->element_count
;
6649 desc
->Members
= This
->member_count
;
6650 desc
->Rows
= This
->row_count
;
6651 desc
->Columns
= This
->column_count
;
6652 desc
->PackedSize
= This
->size_packed
;
6653 desc
->UnpackedSize
= This
->size_unpacked
;
6654 desc
->Stride
= This
->stride
;
6659 static struct ID3D10EffectType
* STDMETHODCALLTYPE
d3d10_effect_type_GetMemberTypeByIndex(ID3D10EffectType
*iface
,
6662 struct d3d10_effect_type
*This
= impl_from_ID3D10EffectType(iface
);
6663 struct d3d10_effect_type
*t
;
6665 TRACE("iface %p, index %u\n", iface
, index
);
6667 if (index
>= This
->member_count
)
6669 WARN("Invalid index specified\n");
6670 return &null_type
.ID3D10EffectType_iface
;
6673 t
= (&This
->members
[index
])->type
;
6675 TRACE("Returning member %p, %s\n", t
, debugstr_a(t
->name
));
6677 return &t
->ID3D10EffectType_iface
;
6680 static struct ID3D10EffectType
* STDMETHODCALLTYPE
d3d10_effect_type_GetMemberTypeByName(ID3D10EffectType
*iface
,
6683 struct d3d10_effect_type
*This
= impl_from_ID3D10EffectType(iface
);
6686 TRACE("iface %p, name %s\n", iface
, debugstr_a(name
));
6690 WARN("Invalid name specified\n");
6691 return &null_type
.ID3D10EffectType_iface
;
6694 for (i
= 0; i
< This
->member_count
; ++i
)
6696 struct d3d10_effect_type_member
*typem
= &This
->members
[i
];
6700 if (!strcmp(typem
->name
, name
))
6702 TRACE("Returning type %p.\n", typem
->type
);
6703 return &typem
->type
->ID3D10EffectType_iface
;
6708 WARN("Invalid name specified\n");
6710 return &null_type
.ID3D10EffectType_iface
;
6713 static struct ID3D10EffectType
* STDMETHODCALLTYPE
d3d10_effect_type_GetMemberTypeBySemantic(ID3D10EffectType
*iface
,
6716 struct d3d10_effect_type
*This
= impl_from_ID3D10EffectType(iface
);
6719 TRACE("iface %p, semantic %s\n", iface
, debugstr_a(semantic
));
6723 WARN("Invalid semantic specified\n");
6724 return &null_type
.ID3D10EffectType_iface
;
6727 for (i
= 0; i
< This
->member_count
; ++i
)
6729 struct d3d10_effect_type_member
*typem
= &This
->members
[i
];
6731 if (typem
->semantic
)
6733 if (!strcmp(typem
->semantic
, semantic
))
6735 TRACE("Returning type %p.\n", typem
->type
);
6736 return &typem
->type
->ID3D10EffectType_iface
;
6741 WARN("Invalid semantic specified\n");
6743 return &null_type
.ID3D10EffectType_iface
;
6746 static LPCSTR STDMETHODCALLTYPE
d3d10_effect_type_GetMemberName(ID3D10EffectType
*iface
, UINT index
)
6748 struct d3d10_effect_type
*This
= impl_from_ID3D10EffectType(iface
);
6749 struct d3d10_effect_type_member
*typem
;
6751 TRACE("iface %p, index %u\n", iface
, index
);
6753 if (index
>= This
->member_count
)
6755 WARN("Invalid index specified\n");
6759 typem
= &This
->members
[index
];
6761 TRACE("Returning name %s\n", debugstr_a(typem
->name
));
6766 static LPCSTR STDMETHODCALLTYPE
d3d10_effect_type_GetMemberSemantic(ID3D10EffectType
*iface
, UINT index
)
6768 struct d3d10_effect_type
*This
= impl_from_ID3D10EffectType(iface
);
6769 struct d3d10_effect_type_member
*typem
;
6771 TRACE("iface %p, index %u\n", iface
, index
);
6773 if (index
>= This
->member_count
)
6775 WARN("Invalid index specified\n");
6779 typem
= &This
->members
[index
];
6781 TRACE("Returning semantic %s\n", debugstr_a(typem
->semantic
));
6783 return typem
->semantic
;
6786 static const struct ID3D10EffectTypeVtbl d3d10_effect_type_vtbl
=
6788 /* ID3D10EffectType */
6789 d3d10_effect_type_IsValid
,
6790 d3d10_effect_type_GetDesc
,
6791 d3d10_effect_type_GetMemberTypeByIndex
,
6792 d3d10_effect_type_GetMemberTypeByName
,
6793 d3d10_effect_type_GetMemberTypeBySemantic
,
6794 d3d10_effect_type_GetMemberName
,
6795 d3d10_effect_type_GetMemberSemantic
,