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_UINT
:
1088 case D3D10_SVT_BOOL
:
1089 out_data
[idx
] = value
;
1093 FIXME("Unhandled in_type %#x.\n", in_type
);
1098 static BOOL
read_int8_value(DWORD value
, D3D_SHADER_VARIABLE_TYPE in_type
, INT8
*out_data
, UINT idx
)
1103 case D3D10_SVT_UINT
:
1104 out_data
[idx
] = value
;
1108 FIXME("Unhandled in_type %#x.\n", in_type
);
1113 static BOOL
read_value_list(const char *ptr
, D3D_SHADER_VARIABLE_TYPE out_type
,
1114 UINT out_base
, UINT out_size
, void *out_data
)
1116 D3D_SHADER_VARIABLE_TYPE in_type
;
1120 read_dword(&ptr
, &count
);
1121 if (count
!= out_size
)
1124 TRACE("%u values:\n", count
);
1125 for (i
= 0; i
< count
; ++i
)
1127 UINT out_idx
= out_base
* out_size
+ i
;
1129 read_dword(&ptr
, &t
);
1130 read_dword(&ptr
, &value
);
1132 in_type
= d3d10_variable_type(t
, FALSE
);
1133 TRACE("\t%s: %#x.\n", debug_d3d10_shader_variable_type(in_type
), value
);
1137 case D3D10_SVT_FLOAT
:
1138 if (!read_float_value(value
, in_type
, out_data
, out_idx
))
1143 case D3D10_SVT_UINT
:
1144 case D3D10_SVT_BOOL
:
1145 if (!read_int32_value(value
, in_type
, out_data
, out_idx
))
1149 case D3D10_SVT_UINT8
:
1150 if (!read_int8_value(value
, in_type
, out_data
, out_idx
))
1155 FIXME("Unhandled out_type %#x.\n", out_type
);
1163 static BOOL
parse_fx10_state_group(const char **ptr
, const char *data
,
1164 D3D_SHADER_VARIABLE_TYPE container_type
, void *container
)
1166 const struct d3d10_effect_state_property_info
*property_info
;
1173 read_dword(ptr
, &count
);
1174 TRACE("Property count: %#x.\n", count
);
1176 for (i
= 0; i
< count
; ++i
)
1178 read_dword(ptr
, &id
);
1179 read_dword(ptr
, &idx
);
1180 skip_dword_unknown("read property", ptr
, 1);
1181 read_dword(ptr
, &value_offset
);
1183 if (!(property_info
= get_property_info(id
)))
1185 FIXME("Failed to find property info for property %#x.\n", id
);
1189 TRACE("Property %s[%#x] = value list @ offset %#x.\n",
1190 property_info
->name
, idx
, value_offset
);
1192 if (property_info
->container_type
!= container_type
)
1198 if (idx
>= property_info
->count
)
1204 if (!read_value_list(data
+ value_offset
, property_info
->type
, idx
,
1205 property_info
->size
, (char *)container
+ property_info
->offset
))
1215 static HRESULT
parse_fx10_object(struct d3d10_effect_object
*o
, const char **ptr
, const char *data
)
1217 const char *data_ptr
= NULL
;
1219 enum d3d10_effect_object_operation operation
;
1221 struct d3d10_effect
*effect
= o
->pass
->technique
->effect
;
1222 ID3D10Effect
*e
= &effect
->ID3D10Effect_iface
;
1224 read_dword(ptr
, &o
->type
);
1225 TRACE("Effect object is of type %#x.\n", o
->type
);
1227 read_dword(ptr
, &o
->index
);
1228 TRACE("Effect object index %#x.\n", o
->index
);
1230 read_dword(ptr
, &operation
);
1231 TRACE("Effect object operation %#x.\n", operation
);
1233 read_dword(ptr
, &offset
);
1234 TRACE("Effect object idx is at offset %#x.\n", offset
);
1238 case D3D10_EOO_VALUE
:
1239 TRACE("Copy variable values\n");
1243 case D3D10_EOT_VERTEXSHADER
:
1244 TRACE("Vertex shader\n");
1245 o
->data
= &anonymous_vs
;
1249 case D3D10_EOT_PIXELSHADER
:
1250 TRACE("Pixel shader\n");
1251 o
->data
= &anonymous_ps
;
1255 case D3D10_EOT_GEOMETRYSHADER
:
1256 TRACE("Geometry shader\n");
1257 o
->data
= &anonymous_gs
;
1261 case D3D10_EOT_STENCIL_REF
:
1262 if (!read_value_list(data
+ offset
, D3D10_SVT_UINT
, 0, 1, &o
->pass
->stencil_ref
))
1264 ERR("Failed to read stencil ref.\n");
1271 case D3D10_EOT_SAMPLE_MASK
:
1272 if (!read_value_list(data
+ offset
, D3D10_SVT_UINT
, 0, 1, &o
->pass
->sample_mask
))
1274 FIXME("Failed to read sample mask.\n");
1281 case D3D10_EOT_BLEND_FACTOR
:
1282 if (!read_value_list(data
+ offset
, D3D10_SVT_FLOAT
, 0, 4, &o
->pass
->blend_factor
[0]))
1284 FIXME("Failed to read blend factor.\n");
1292 FIXME("Unhandled object type %#x\n", o
->type
);
1298 case D3D10_EOO_PARSED_OBJECT
:
1299 /* This is a local object, we've parsed in parse_fx10_local_object. */
1300 TRACE("Shader = %s.\n", data
+ offset
);
1302 o
->data
= e
->lpVtbl
->GetVariableByName(e
, data
+ offset
);
1306 case D3D10_EOO_PARSED_OBJECT_INDEX
:
1307 /* This is a local object, we've parsed in parse_fx10_local_object, which has an array index. */
1308 data_ptr
= data
+ offset
;
1309 read_dword(&data_ptr
, &offset
);
1310 read_dword(&data_ptr
, &o
->index
);
1311 TRACE("Shader = %s[%u].\n", data
+ offset
, o
->index
);
1313 o
->data
= e
->lpVtbl
->GetVariableByName(e
, data
+ offset
);
1317 case D3D10_EOO_ANONYMOUS_SHADER
:
1318 TRACE("Anonymous shader\n");
1320 /* check anonymous_shader_current for validity */
1321 if (effect
->anonymous_shader_current
>= effect
->anonymous_shader_count
)
1323 ERR("Anonymous shader count is wrong!\n");
1327 data_ptr
= data
+ offset
;
1328 read_dword(&data_ptr
, &offset
);
1329 TRACE("Effect object starts at offset %#x.\n", offset
);
1331 data_ptr
= data
+ offset
;
1333 hr
= parse_fx10_anonymous_shader(effect
, &effect
->anonymous_shaders
[effect
->anonymous_shader_current
], o
->type
);
1334 if (FAILED(hr
)) return hr
;
1336 o
->data
= &effect
->anonymous_shaders
[effect
->anonymous_shader_current
].shader
;
1337 ++effect
->anonymous_shader_current
;
1341 case D3D10_EOT_VERTEXSHADER
:
1342 TRACE("Vertex shader\n");
1343 hr
= parse_shader(o
->data
, data_ptr
);
1346 case D3D10_EOT_PIXELSHADER
:
1347 TRACE("Pixel shader\n");
1348 hr
= parse_shader(o
->data
, data_ptr
);
1351 case D3D10_EOT_GEOMETRYSHADER
:
1352 TRACE("Geometry shader\n");
1353 hr
= parse_shader(o
->data
, data_ptr
);
1357 FIXME("Unhandled object type %#x\n", o
->type
);
1365 FIXME("Unhandled operation %#x.\n", operation
);
1372 static HRESULT
parse_fx10_pass(struct d3d10_effect_pass
*p
, const char **ptr
, const char *data
)
1378 read_dword(ptr
, &offset
);
1379 TRACE("Pass name at offset %#x.\n", offset
);
1381 if (!copy_name(data
+ offset
, &p
->name
))
1383 ERR("Failed to copy name.\n");
1384 return E_OUTOFMEMORY
;
1386 TRACE("Pass name: %s.\n", debugstr_a(p
->name
));
1388 read_dword(ptr
, &p
->object_count
);
1389 TRACE("Pass has %u effect objects.\n", p
->object_count
);
1391 read_dword(ptr
, &p
->annotation_count
);
1392 TRACE("Pass has %u annotations.\n", p
->annotation_count
);
1394 p
->annotations
= HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY
, p
->annotation_count
* sizeof(*p
->annotations
));
1395 if (!p
->annotations
)
1397 ERR("Failed to allocate pass annotations memory.\n");
1398 return E_OUTOFMEMORY
;
1401 for (i
= 0; i
< p
->annotation_count
; ++i
)
1403 struct d3d10_effect_variable
*a
= &p
->annotations
[i
];
1405 a
->effect
= p
->technique
->effect
;
1406 a
->buffer
= &null_local_buffer
;
1408 hr
= parse_fx10_annotation(a
, ptr
, data
);
1409 if (FAILED(hr
)) return hr
;
1412 p
->objects
= HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY
, p
->object_count
* sizeof(*p
->objects
));
1415 ERR("Failed to allocate effect objects memory.\n");
1416 return E_OUTOFMEMORY
;
1419 for (i
= 0; i
< p
->object_count
; ++i
)
1421 struct d3d10_effect_object
*o
= &p
->objects
[i
];
1425 hr
= parse_fx10_object(o
, ptr
, data
);
1426 if (FAILED(hr
)) return hr
;
1432 static HRESULT
parse_fx10_technique(struct d3d10_effect_technique
*t
, const char **ptr
, const char *data
)
1438 read_dword(ptr
, &offset
);
1439 TRACE("Technique name at offset %#x.\n", offset
);
1441 if (!copy_name(data
+ offset
, &t
->name
))
1443 ERR("Failed to copy name.\n");
1444 return E_OUTOFMEMORY
;
1446 TRACE("Technique name: %s.\n", debugstr_a(t
->name
));
1448 read_dword(ptr
, &t
->pass_count
);
1449 TRACE("Technique has %u passes\n", t
->pass_count
);
1451 read_dword(ptr
, &t
->annotation_count
);
1452 TRACE("Technique has %u annotations.\n", t
->annotation_count
);
1454 t
->annotations
= HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY
, t
->annotation_count
* sizeof(*t
->annotations
));
1455 if (!t
->annotations
)
1457 ERR("Failed to allocate technique annotations memory.\n");
1458 return E_OUTOFMEMORY
;
1461 for (i
= 0; i
< t
->annotation_count
; ++i
)
1463 struct d3d10_effect_variable
*a
= &t
->annotations
[i
];
1465 a
->effect
= t
->effect
;
1466 a
->buffer
= &null_local_buffer
;
1468 hr
= parse_fx10_annotation(a
, ptr
, data
);
1469 if (FAILED(hr
)) return hr
;
1472 t
->passes
= HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY
, t
->pass_count
* sizeof(*t
->passes
));
1475 ERR("Failed to allocate passes memory\n");
1476 return E_OUTOFMEMORY
;
1479 for (i
= 0; i
< t
->pass_count
; ++i
)
1481 struct d3d10_effect_pass
*p
= &t
->passes
[i
];
1483 p
->ID3D10EffectPass_iface
.lpVtbl
= &d3d10_effect_pass_vtbl
;
1486 hr
= parse_fx10_pass(p
, ptr
, data
);
1487 if (FAILED(hr
)) return hr
;
1493 static HRESULT
parse_fx10_variable(struct d3d10_effect_variable
*v
, const char **ptr
, const char *data
)
1499 hr
= parse_fx10_variable_head(v
, ptr
, data
);
1500 if (FAILED(hr
)) return hr
;
1502 read_dword(ptr
, &offset
);
1503 TRACE("Variable semantic at offset %#x.\n", offset
);
1505 if (!copy_name(data
+ offset
, &v
->semantic
))
1507 ERR("Failed to copy semantic.\n");
1508 return E_OUTOFMEMORY
;
1510 TRACE("Variable semantic: %s.\n", debugstr_a(v
->semantic
));
1512 read_dword(ptr
, &v
->buffer_offset
);
1513 TRACE("Variable offset in buffer: %#x.\n", v
->buffer_offset
);
1515 skip_dword_unknown("variable", ptr
, 1);
1517 read_dword(ptr
, &v
->flag
);
1518 TRACE("Variable flag: %#x.\n", v
->flag
);
1520 read_dword(ptr
, &v
->annotation_count
);
1521 TRACE("Variable has %u annotations.\n", v
->annotation_count
);
1523 v
->annotations
= HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY
, v
->annotation_count
* sizeof(*v
->annotations
));
1524 if (!v
->annotations
)
1526 ERR("Failed to allocate variable annotations memory.\n");
1527 return E_OUTOFMEMORY
;
1530 for (i
= 0; i
< v
->annotation_count
; ++i
)
1532 struct d3d10_effect_variable
*a
= &v
->annotations
[i
];
1534 a
->effect
= v
->effect
;
1535 a
->buffer
= &null_local_buffer
;
1537 hr
= parse_fx10_annotation(a
, ptr
, data
);
1538 if (FAILED(hr
)) return hr
;
1544 static HRESULT
parse_fx10_local_variable(struct d3d10_effect_variable
*v
, const char **ptr
, const char *data
)
1550 hr
= parse_fx10_variable_head(v
, ptr
, data
);
1551 if (FAILED(hr
)) return hr
;
1553 read_dword(ptr
, &offset
);
1554 TRACE("Variable semantic at offset %#x.\n", offset
);
1556 if (!copy_name(data
+ offset
, &v
->semantic
))
1558 ERR("Failed to copy semantic.\n");
1559 return E_OUTOFMEMORY
;
1561 TRACE("Variable semantic: %s.\n", debugstr_a(v
->semantic
));
1563 skip_dword_unknown("local variable", ptr
, 1);
1565 switch (v
->type
->basetype
)
1567 case D3D10_SVT_TEXTURE1D
:
1568 case D3D10_SVT_TEXTURE1DARRAY
:
1569 case D3D10_SVT_TEXTURE2D
:
1570 case D3D10_SVT_TEXTURE2DARRAY
:
1571 case D3D10_SVT_TEXTURE2DMS
:
1572 case D3D10_SVT_TEXTURE2DMSARRAY
:
1573 case D3D10_SVT_TEXTURE3D
:
1574 case D3D10_SVT_TEXTURECUBE
:
1575 case D3D10_SVT_RENDERTARGETVIEW
:
1576 case D3D10_SVT_DEPTHSTENCILVIEW
:
1577 case D3D10_SVT_BUFFER
:
1578 TRACE("SVT could not have elements.\n");
1581 case D3D10_SVT_VERTEXSHADER
:
1582 case D3D10_SVT_PIXELSHADER
:
1583 case D3D10_SVT_GEOMETRYSHADER
:
1584 TRACE("Shader type is %s\n", debug_d3d10_shader_variable_type(v
->type
->basetype
));
1585 for (i
= 0; i
< max(v
->type
->element_count
, 1); ++i
)
1587 DWORD shader_offset
;
1588 struct d3d10_effect_variable
*var
;
1590 if (!v
->type
->element_count
)
1596 var
= &v
->elements
[i
];
1599 read_dword(ptr
, &shader_offset
);
1600 TRACE("Shader offset: %#x.\n", shader_offset
);
1602 hr
= parse_shader(var
, data
+ shader_offset
);
1603 if (FAILED(hr
)) return hr
;
1607 case D3D10_SVT_DEPTHSTENCIL
:
1608 case D3D10_SVT_BLEND
:
1609 case D3D10_SVT_RASTERIZER
:
1610 case D3D10_SVT_SAMPLER
:
1612 const struct d3d10_effect_state_storage_info
*storage_info
;
1613 unsigned int count
= max(v
->type
->element_count
, 1);
1614 unsigned char *desc
;
1616 if (!(storage_info
= get_storage_info(v
->type
->basetype
)))
1618 FIXME("Failed to get backing store info for type %s.\n",
1619 debug_d3d10_shader_variable_type(v
->type
->basetype
));
1623 if (!(desc
= HeapAlloc(GetProcessHeap(), 0, count
* storage_info
->size
)))
1625 ERR("Failed to allocate backing store memory.\n");
1626 return E_OUTOFMEMORY
;
1629 for (i
= 0; i
< count
; ++i
)
1631 memcpy(&desc
[i
* storage_info
->size
], storage_info
->default_state
, storage_info
->size
);
1633 if (!parse_fx10_state_group(ptr
, data
, v
->type
->basetype
, &desc
[i
* storage_info
->size
]))
1635 ERR("Failed to read property list.\n");
1636 HeapFree(GetProcessHeap(), 0, desc
);
1646 FIXME("Unhandled case %s.\n", debug_d3d10_shader_variable_type(v
->type
->basetype
));
1650 read_dword(ptr
, &v
->annotation_count
);
1651 TRACE("Variable has %u annotations.\n", v
->annotation_count
);
1653 v
->annotations
= HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY
, v
->annotation_count
* sizeof(*v
->annotations
));
1654 if (!v
->annotations
)
1656 ERR("Failed to allocate variable annotations memory.\n");
1657 return E_OUTOFMEMORY
;
1660 for (i
= 0; i
< v
->annotation_count
; ++i
)
1662 struct d3d10_effect_variable
*a
= &v
->annotations
[i
];
1664 a
->effect
= v
->effect
;
1665 a
->buffer
= &null_local_buffer
;
1667 hr
= parse_fx10_annotation(a
, ptr
, data
);
1668 if (FAILED(hr
)) return hr
;
1674 static HRESULT
parse_fx10_local_buffer(struct d3d10_effect_variable
*l
, const char **ptr
, const char *data
)
1678 D3D10_CBUFFER_TYPE d3d10_cbuffer_type
;
1680 unsigned int stride
= 0;
1682 /* Generate our own type, it isn't in the fx blob. */
1683 l
->type
= HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY
, sizeof(*l
->type
));
1686 ERR("Failed to allocate local buffer type memory.\n");
1687 return E_OUTOFMEMORY
;
1689 l
->type
->ID3D10EffectType_iface
.lpVtbl
= &d3d10_effect_type_vtbl
;
1690 l
->type
->type_class
= D3D10_SVC_OBJECT
;
1691 l
->type
->effect
= l
->effect
;
1693 read_dword(ptr
, &offset
);
1694 TRACE("Local buffer name at offset %#x.\n", offset
);
1696 if (!copy_name(data
+ offset
, &l
->name
))
1698 ERR("Failed to copy name.\n");
1699 return E_OUTOFMEMORY
;
1701 TRACE("Local buffer name: %s.\n", debugstr_a(l
->name
));
1703 read_dword(ptr
, &l
->data_size
);
1704 TRACE("Local buffer data size: %#x.\n", l
->data_size
);
1706 read_dword(ptr
, &d3d10_cbuffer_type
);
1707 TRACE("Local buffer type: %#x.\n", d3d10_cbuffer_type
);
1709 switch(d3d10_cbuffer_type
)
1711 case D3D10_CT_CBUFFER
:
1712 l
->type
->basetype
= D3D10_SVT_CBUFFER
;
1713 if (!copy_name("cbuffer", &l
->type
->name
))
1715 ERR("Failed to copy name.\n");
1716 return E_OUTOFMEMORY
;
1720 case D3D10_CT_TBUFFER
:
1721 l
->type
->basetype
= D3D10_SVT_TBUFFER
;
1722 if (!copy_name("tbuffer", &l
->type
->name
))
1724 ERR("Failed to copy name.\n");
1725 return E_OUTOFMEMORY
;
1730 ERR("Unexpected D3D10_CBUFFER_TYPE %#x!\n", d3d10_cbuffer_type
);
1734 read_dword(ptr
, &l
->type
->member_count
);
1735 TRACE("Local buffer member count: %#x.\n", l
->type
->member_count
);
1737 skip_dword_unknown("local buffer", ptr
, 1);
1739 read_dword(ptr
, &l
->annotation_count
);
1740 TRACE("Local buffer has %u annotations.\n", l
->annotation_count
);
1742 l
->annotations
= HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY
, l
->annotation_count
* sizeof(*l
->annotations
));
1743 if (!l
->annotations
)
1745 ERR("Failed to allocate local buffer annotations memory.\n");
1746 return E_OUTOFMEMORY
;
1749 for (i
= 0; i
< l
->annotation_count
; ++i
)
1751 struct d3d10_effect_variable
*a
= &l
->annotations
[i
];
1753 a
->effect
= l
->effect
;
1754 a
->buffer
= &null_local_buffer
;
1756 hr
= parse_fx10_annotation(a
, ptr
, data
);
1757 if (FAILED(hr
)) return hr
;
1760 l
->members
= HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY
, l
->type
->member_count
* sizeof(*l
->members
));
1763 ERR("Failed to allocate members memory.\n");
1764 return E_OUTOFMEMORY
;
1767 l
->type
->members
= HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY
, l
->type
->member_count
* sizeof(*l
->type
->members
));
1768 if (!l
->type
->members
)
1770 ERR("Failed to allocate type members memory.\n");
1771 return E_OUTOFMEMORY
;
1774 for (i
= 0; i
< l
->type
->member_count
; ++i
)
1776 struct d3d10_effect_variable
*v
= &l
->members
[i
];
1777 struct d3d10_effect_type_member
*typem
= &l
->type
->members
[i
];
1780 v
->effect
= l
->effect
;
1782 hr
= parse_fx10_variable(v
, ptr
, data
);
1783 if (FAILED(hr
)) return hr
;
1786 * Copy the values from the variable type to the constant buffers type
1787 * members structure, because it is our own generated type.
1789 typem
->type
= v
->type
;
1791 if (!copy_name(v
->name
, &typem
->name
))
1793 ERR("Failed to copy name.\n");
1794 return E_OUTOFMEMORY
;
1796 TRACE("Variable name: %s.\n", debugstr_a(typem
->name
));
1798 if (!copy_name(v
->semantic
, &typem
->semantic
))
1800 ERR("Failed to copy name.\n");
1801 return E_OUTOFMEMORY
;
1803 TRACE("Variable semantic: %s.\n", debugstr_a(typem
->semantic
));
1805 typem
->buffer_offset
= v
->buffer_offset
;
1806 TRACE("Variable buffer offset: %u.\n", typem
->buffer_offset
);
1808 l
->type
->size_packed
+= v
->type
->size_packed
;
1811 * For the complete constantbuffer the size_unpacked = stride,
1812 * the stride is calculated like this:
1814 * 1) if the constant buffer variables are packed with packoffset
1815 * - stride = the highest used constant
1816 * - the complete stride has to be a multiple of 0x10
1818 * 2) if the constant buffer variables are NOT packed with packoffset
1819 * - sum of unpacked size for all variables which fit in a 0x10 part
1820 * - if the size exceeds a 0x10 part, the rest of the old part is skipped
1821 * and a new part is started
1822 * - if the variable is a struct it is always used a new part
1823 * - the complete stride has to be a multiple of 0x10
1826 * 0x4, 0x4, 0x4, 0x8, 0x4, 0x14, 0x4
1827 * part 0x10 0x10 0x20 -> 0x40
1829 if (v
->flag
& D3D10_EFFECT_VARIABLE_EXPLICIT_BIND_POINT
)
1831 if ((v
->type
->size_unpacked
+ v
->buffer_offset
) > stride
)
1833 stride
= v
->type
->size_unpacked
+ v
->buffer_offset
;
1838 if (v
->type
->type_class
== D3D10_SVC_STRUCT
)
1840 stride
= (stride
+ 0xf) & ~0xf;
1843 if ( ((stride
& 0xf) + v
->type
->size_unpacked
) > 0x10)
1845 stride
= (stride
+ 0xf) & ~0xf;
1848 stride
+= v
->type
->size_unpacked
;
1851 l
->type
->stride
= l
->type
->size_unpacked
= (stride
+ 0xf) & ~0xf;
1853 TRACE("Constant buffer:\n");
1854 TRACE("\tType name: %s.\n", debugstr_a(l
->type
->name
));
1855 TRACE("\tElement count: %u.\n", l
->type
->element_count
);
1856 TRACE("\tMember count: %u.\n", l
->type
->member_count
);
1857 TRACE("\tUnpacked size: %#x.\n", l
->type
->size_unpacked
);
1858 TRACE("\tStride: %#x.\n", l
->type
->stride
);
1859 TRACE("\tPacked size %#x.\n", l
->type
->size_packed
);
1860 TRACE("\tBasetype: %s.\n", debug_d3d10_shader_variable_type(l
->type
->basetype
));
1861 TRACE("\tTypeclass: %s.\n", debug_d3d10_shader_variable_class(l
->type
->type_class
));
1866 static int d3d10_effect_type_compare(const void *key
, const struct wine_rb_entry
*entry
)
1868 const struct d3d10_effect_type
*t
= WINE_RB_ENTRY_VALUE(entry
, const struct d3d10_effect_type
, entry
);
1869 const DWORD
*id
= key
;
1874 static void d3d10_effect_type_member_destroy(struct d3d10_effect_type_member
*typem
)
1876 TRACE("effect type member %p.\n", typem
);
1878 /* Do not release typem->type, it will be covered by d3d10_effect_type_destroy(). */
1879 HeapFree(GetProcessHeap(), 0, typem
->semantic
);
1880 HeapFree(GetProcessHeap(), 0, typem
->name
);
1883 static void d3d10_effect_type_destroy(struct wine_rb_entry
*entry
, void *context
)
1885 struct d3d10_effect_type
*t
= WINE_RB_ENTRY_VALUE(entry
, struct d3d10_effect_type
, entry
);
1887 TRACE("effect type %p.\n", t
);
1891 HeapFree(GetProcessHeap(), 0, t
->elementtype
->name
);
1892 HeapFree(GetProcessHeap(), 0, t
->elementtype
);
1899 for (i
= 0; i
< t
->member_count
; ++i
)
1901 d3d10_effect_type_member_destroy(&t
->members
[i
]);
1903 HeapFree(GetProcessHeap(), 0, t
->members
);
1906 HeapFree(GetProcessHeap(), 0, t
->name
);
1907 HeapFree(GetProcessHeap(), 0, t
);
1910 static const struct wine_rb_functions d3d10_effect_type_rb_functions
=
1915 d3d10_effect_type_compare
,
1918 static HRESULT
parse_fx10_body(struct d3d10_effect
*e
, const char *data
, DWORD data_size
)
1920 const char *ptr
= data
+ e
->index_offset
;
1924 if (wine_rb_init(&e
->types
, &d3d10_effect_type_rb_functions
) == -1)
1926 ERR("Failed to initialize type rbtree.\n");
1930 e
->local_buffers
= HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY
, e
->local_buffer_count
* sizeof(*e
->local_buffers
));
1931 if (!e
->local_buffers
)
1933 ERR("Failed to allocate local buffer memory.\n");
1934 return E_OUTOFMEMORY
;
1937 e
->local_variables
= HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY
, e
->local_variable_count
* sizeof(*e
->local_variables
));
1938 if (!e
->local_variables
)
1940 ERR("Failed to allocate local variable memory.\n");
1941 return E_OUTOFMEMORY
;
1944 e
->anonymous_shaders
= HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY
, e
->anonymous_shader_count
* sizeof(*e
->anonymous_shaders
));
1945 if (!e
->anonymous_shaders
)
1947 ERR("Failed to allocate anonymous shaders memory\n");
1948 return E_OUTOFMEMORY
;
1951 e
->used_shaders
= HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY
, e
->used_shader_count
* sizeof(*e
->used_shaders
));
1952 if (!e
->used_shaders
)
1954 ERR("Failed to allocate used shaders memory\n");
1955 return E_OUTOFMEMORY
;
1958 e
->techniques
= HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY
, e
->technique_count
* sizeof(*e
->techniques
));
1961 ERR("Failed to allocate techniques memory\n");
1962 return E_OUTOFMEMORY
;
1965 for (i
= 0; i
< e
->local_buffer_count
; ++i
)
1967 struct d3d10_effect_variable
*l
= &e
->local_buffers
[i
];
1968 l
->ID3D10EffectVariable_iface
.lpVtbl
= (const ID3D10EffectVariableVtbl
*)&d3d10_effect_constant_buffer_vtbl
;
1970 l
->buffer
= &null_local_buffer
;
1972 hr
= parse_fx10_local_buffer(l
, &ptr
, data
);
1973 if (FAILED(hr
)) return hr
;
1976 for (i
= 0; i
< e
->local_variable_count
; ++i
)
1978 struct d3d10_effect_variable
*v
= &e
->local_variables
[i
];
1981 v
->ID3D10EffectVariable_iface
.lpVtbl
= &d3d10_effect_variable_vtbl
;
1982 v
->buffer
= &null_local_buffer
;
1984 hr
= parse_fx10_local_variable(v
, &ptr
, data
);
1985 if (FAILED(hr
)) return hr
;
1988 for (i
= 0; i
< e
->technique_count
; ++i
)
1990 struct d3d10_effect_technique
*t
= &e
->techniques
[i
];
1992 t
->ID3D10EffectTechnique_iface
.lpVtbl
= &d3d10_effect_technique_vtbl
;
1995 hr
= parse_fx10_technique(t
, &ptr
, data
);
1996 if (FAILED(hr
)) return hr
;
2002 static HRESULT
parse_fx10(struct d3d10_effect
*e
, const char *data
, DWORD data_size
)
2004 const char *ptr
= data
;
2007 /* Compiled target version (e.g. fx_4_0=0xfeff1001, fx_4_1=0xfeff1011). */
2008 read_dword(&ptr
, &e
->version
);
2009 TRACE("Target: %#x\n", e
->version
);
2011 read_dword(&ptr
, &e
->local_buffer_count
);
2012 TRACE("Local buffer count: %u.\n", e
->local_buffer_count
);
2014 read_dword(&ptr
, &e
->variable_count
);
2015 TRACE("Variable count: %u\n", e
->variable_count
);
2017 read_dword(&ptr
, &e
->local_variable_count
);
2018 TRACE("Object count: %u\n", e
->local_variable_count
);
2020 read_dword(&ptr
, &e
->sharedbuffers_count
);
2021 TRACE("Sharedbuffers count: %u\n", e
->sharedbuffers_count
);
2023 /* Number of variables in shared buffers? */
2024 read_dword(&ptr
, &unknown
);
2025 FIXME("Unknown 0: %u\n", unknown
);
2027 read_dword(&ptr
, &e
->sharedobjects_count
);
2028 TRACE("Sharedobjects count: %u\n", e
->sharedobjects_count
);
2030 read_dword(&ptr
, &e
->technique_count
);
2031 TRACE("Technique count: %u\n", e
->technique_count
);
2033 read_dword(&ptr
, &e
->index_offset
);
2034 TRACE("Index offset: %#x\n", e
->index_offset
);
2036 read_dword(&ptr
, &unknown
);
2037 FIXME("Unknown 1: %u\n", unknown
);
2039 read_dword(&ptr
, &e
->texture_count
);
2040 TRACE("Texture count: %u\n", e
->texture_count
);
2042 read_dword(&ptr
, &e
->dephstencilstate_count
);
2043 TRACE("Depthstencilstate count: %u\n", e
->dephstencilstate_count
);
2045 read_dword(&ptr
, &e
->blendstate_count
);
2046 TRACE("Blendstate count: %u\n", e
->blendstate_count
);
2048 read_dword(&ptr
, &e
->rasterizerstate_count
);
2049 TRACE("Rasterizerstate count: %u\n", e
->rasterizerstate_count
);
2051 read_dword(&ptr
, &e
->samplerstate_count
);
2052 TRACE("Samplerstate count: %u\n", e
->samplerstate_count
);
2054 read_dword(&ptr
, &e
->rendertargetview_count
);
2055 TRACE("Rendertargetview count: %u\n", e
->rendertargetview_count
);
2057 read_dword(&ptr
, &e
->depthstencilview_count
);
2058 TRACE("Depthstencilview count: %u\n", e
->depthstencilview_count
);
2060 read_dword(&ptr
, &e
->used_shader_count
);
2061 TRACE("Used shader count: %u\n", e
->used_shader_count
);
2063 read_dword(&ptr
, &e
->anonymous_shader_count
);
2064 TRACE("Anonymous shader count: %u\n", e
->anonymous_shader_count
);
2066 return parse_fx10_body(e
, ptr
, data_size
- (ptr
- data
));
2069 static HRESULT
fx10_chunk_handler(const char *data
, DWORD data_size
, DWORD tag
, void *ctx
)
2071 struct d3d10_effect
*e
= ctx
;
2073 TRACE("tag: %s.\n", debugstr_an((const char *)&tag
, 4));
2075 TRACE("chunk size: %#x\n", data_size
);
2080 return parse_fx10(e
, data
, data_size
);
2083 FIXME("Unhandled chunk %s.\n", debugstr_an((const char *)&tag
, 4));
2088 HRESULT
d3d10_effect_parse(struct d3d10_effect
*This
, const void *data
, SIZE_T data_size
)
2090 return parse_dxbc(data
, data_size
, fx10_chunk_handler
, This
);
2093 static HRESULT
d3d10_effect_object_apply(struct d3d10_effect_object
*o
)
2095 ID3D10Device
*device
= o
->pass
->technique
->effect
->device
;
2096 struct d3d10_effect_variable
*v
= (struct d3d10_effect_variable
*) o
->data
;
2098 TRACE("effect object %p, type %#x.\n", o
, o
->type
);
2102 case D3D10_EOT_VERTEXSHADER
:
2103 ID3D10Device_VSSetShader(device
, ((struct d3d10_effect_shader_variable
*)v
->data
)->shader
.vs
);
2106 case D3D10_EOT_PIXELSHADER
:
2107 ID3D10Device_PSSetShader(device
, ((struct d3d10_effect_shader_variable
*)v
->data
)->shader
.ps
);
2110 case D3D10_EOT_GEOMETRYSHADER
:
2111 ID3D10Device_GSSetShader(device
, ((struct d3d10_effect_shader_variable
*)v
->data
)->shader
.gs
);
2115 FIXME("Unhandled effect object type %#x.\n", o
->type
);
2120 static void d3d10_effect_variable_destroy(struct d3d10_effect_variable
*v
)
2124 TRACE("variable %p.\n", v
);
2126 HeapFree(GetProcessHeap(), 0, v
->name
);
2127 HeapFree(GetProcessHeap(), 0, v
->semantic
);
2130 for (i
= 0; i
< v
->annotation_count
; ++i
)
2132 d3d10_effect_variable_destroy(&v
->annotations
[i
]);
2134 HeapFree(GetProcessHeap(), 0, v
->annotations
);
2139 for (i
= 0; i
< v
->type
->member_count
; ++i
)
2141 d3d10_effect_variable_destroy(&v
->members
[i
]);
2143 HeapFree(GetProcessHeap(), 0, v
->members
);
2148 for (i
= 0; i
< v
->type
->element_count
; ++i
)
2150 d3d10_effect_variable_destroy(&v
->elements
[i
]);
2152 HeapFree(GetProcessHeap(), 0, v
->elements
);
2157 switch(v
->type
->basetype
)
2159 case D3D10_SVT_VERTEXSHADER
:
2160 case D3D10_SVT_PIXELSHADER
:
2161 case D3D10_SVT_GEOMETRYSHADER
:
2162 shader_free_signature(&((struct d3d10_effect_shader_variable
*)v
->data
)->input_signature
);
2163 shader_free_signature(&((struct d3d10_effect_shader_variable
*)v
->data
)->output_signature
);
2169 HeapFree(GetProcessHeap(), 0, v
->data
);
2173 static void d3d10_effect_pass_destroy(struct d3d10_effect_pass
*p
)
2177 TRACE("pass %p\n", p
);
2179 HeapFree(GetProcessHeap(), 0, p
->name
);
2180 HeapFree(GetProcessHeap(), 0, p
->objects
);
2184 for (i
= 0; i
< p
->annotation_count
; ++i
)
2186 d3d10_effect_variable_destroy(&p
->annotations
[i
]);
2188 HeapFree(GetProcessHeap(), 0, p
->annotations
);
2192 static void d3d10_effect_technique_destroy(struct d3d10_effect_technique
*t
)
2196 TRACE("technique %p\n", t
);
2198 HeapFree(GetProcessHeap(), 0, t
->name
);
2201 for (i
= 0; i
< t
->pass_count
; ++i
)
2203 d3d10_effect_pass_destroy(&t
->passes
[i
]);
2205 HeapFree(GetProcessHeap(), 0, t
->passes
);
2210 for (i
= 0; i
< t
->annotation_count
; ++i
)
2212 d3d10_effect_variable_destroy(&t
->annotations
[i
]);
2214 HeapFree(GetProcessHeap(), 0, t
->annotations
);
2218 static void d3d10_effect_local_buffer_destroy(struct d3d10_effect_variable
*l
)
2222 TRACE("local buffer %p.\n", l
);
2224 HeapFree(GetProcessHeap(), 0, l
->name
);
2227 for (i
= 0; i
< l
->type
->member_count
; ++i
)
2229 d3d10_effect_variable_destroy(&l
->members
[i
]);
2231 HeapFree(GetProcessHeap(), 0, l
->members
);
2234 if (l
->type
->members
)
2236 for (i
= 0; i
< l
->type
->member_count
; ++i
)
2238 /* Do not release l->type->members[i].type, it will be covered by d3d10_effect_type_destroy(). */
2239 HeapFree(GetProcessHeap(), 0, l
->type
->members
[i
].semantic
);
2240 HeapFree(GetProcessHeap(), 0, l
->type
->members
[i
].name
);
2242 HeapFree(GetProcessHeap(), 0, l
->type
->members
);
2244 HeapFree(GetProcessHeap(), 0, l
->type
->name
);
2245 HeapFree(GetProcessHeap(), 0, l
->type
);
2249 for (i
= 0; i
< l
->annotation_count
; ++i
)
2251 d3d10_effect_variable_destroy(&l
->annotations
[i
]);
2253 HeapFree(GetProcessHeap(), 0, l
->annotations
);
2257 /* IUnknown methods */
2259 static inline struct d3d10_effect
*impl_from_ID3D10Effect(ID3D10Effect
*iface
)
2261 return CONTAINING_RECORD(iface
, struct d3d10_effect
, ID3D10Effect_iface
);
2264 static HRESULT STDMETHODCALLTYPE
d3d10_effect_QueryInterface(ID3D10Effect
*iface
, REFIID riid
, void **object
)
2266 TRACE("iface %p, riid %s, object %p\n", iface
, debugstr_guid(riid
), object
);
2268 if (IsEqualGUID(riid
, &IID_ID3D10Effect
)
2269 || IsEqualGUID(riid
, &IID_IUnknown
))
2271 IUnknown_AddRef(iface
);
2276 WARN("%s not implemented, returning E_NOINTERFACE\n", debugstr_guid(riid
));
2279 return E_NOINTERFACE
;
2282 static ULONG STDMETHODCALLTYPE
d3d10_effect_AddRef(ID3D10Effect
*iface
)
2284 struct d3d10_effect
*This
= impl_from_ID3D10Effect(iface
);
2285 ULONG refcount
= InterlockedIncrement(&This
->refcount
);
2287 TRACE("%p increasing refcount to %u\n", This
, refcount
);
2292 static ULONG STDMETHODCALLTYPE
d3d10_effect_Release(ID3D10Effect
*iface
)
2294 struct d3d10_effect
*This
= impl_from_ID3D10Effect(iface
);
2295 ULONG refcount
= InterlockedDecrement(&This
->refcount
);
2297 TRACE("%p decreasing refcount to %u\n", This
, refcount
);
2303 if (This
->techniques
)
2305 for (i
= 0; i
< This
->technique_count
; ++i
)
2307 d3d10_effect_technique_destroy(&This
->techniques
[i
]);
2309 HeapFree(GetProcessHeap(), 0, This
->techniques
);
2312 if (This
->local_variables
)
2314 for (i
= 0; i
< This
->local_variable_count
; ++i
)
2316 d3d10_effect_variable_destroy(&This
->local_variables
[i
]);
2318 HeapFree(GetProcessHeap(), 0, This
->local_variables
);
2321 if (This
->local_buffers
)
2323 for (i
= 0; i
< This
->local_buffer_count
; ++i
)
2325 d3d10_effect_local_buffer_destroy(&This
->local_buffers
[i
]);
2327 HeapFree(GetProcessHeap(), 0, This
->local_buffers
);
2330 if (This
->anonymous_shaders
)
2332 for (i
= 0; i
< This
->anonymous_shader_count
; ++i
)
2334 d3d10_effect_variable_destroy(&This
->anonymous_shaders
[i
].shader
);
2335 HeapFree(GetProcessHeap(), 0, This
->anonymous_shaders
[i
].type
.name
);
2337 HeapFree(GetProcessHeap(), 0, This
->anonymous_shaders
);
2340 HeapFree(GetProcessHeap(), 0, This
->used_shaders
);
2342 wine_rb_destroy(&This
->types
, d3d10_effect_type_destroy
, NULL
);
2344 ID3D10Device_Release(This
->device
);
2345 HeapFree(GetProcessHeap(), 0, This
);
2351 /* ID3D10Effect methods */
2353 static BOOL STDMETHODCALLTYPE
d3d10_effect_IsValid(ID3D10Effect
*iface
)
2355 FIXME("iface %p stub!\n", iface
);
2360 static BOOL STDMETHODCALLTYPE
d3d10_effect_IsPool(ID3D10Effect
*iface
)
2362 FIXME("iface %p stub!\n", iface
);
2367 static HRESULT STDMETHODCALLTYPE
d3d10_effect_GetDevice(ID3D10Effect
*iface
, ID3D10Device
**device
)
2369 struct d3d10_effect
*This
= impl_from_ID3D10Effect(iface
);
2371 TRACE("iface %p, device %p\n", iface
, device
);
2373 ID3D10Device_AddRef(This
->device
);
2374 *device
= This
->device
;
2379 static HRESULT STDMETHODCALLTYPE
d3d10_effect_GetDesc(ID3D10Effect
*iface
, D3D10_EFFECT_DESC
*desc
)
2381 FIXME("iface %p, desc %p stub!\n", iface
, desc
);
2386 static struct ID3D10EffectConstantBuffer
* STDMETHODCALLTYPE
d3d10_effect_GetConstantBufferByIndex(ID3D10Effect
*iface
,
2389 struct d3d10_effect
*This
= impl_from_ID3D10Effect(iface
);
2390 struct d3d10_effect_variable
*l
;
2392 TRACE("iface %p, index %u\n", iface
, index
);
2394 if (index
>= This
->local_buffer_count
)
2396 WARN("Invalid index specified\n");
2397 return (ID3D10EffectConstantBuffer
*)&null_local_buffer
;
2400 l
= &This
->local_buffers
[index
];
2402 TRACE("Returning buffer %p, %s.\n", l
, debugstr_a(l
->name
));
2404 return (ID3D10EffectConstantBuffer
*)l
;
2407 static struct ID3D10EffectConstantBuffer
* STDMETHODCALLTYPE
d3d10_effect_GetConstantBufferByName(ID3D10Effect
*iface
,
2410 struct d3d10_effect
*This
= impl_from_ID3D10Effect(iface
);
2413 TRACE("iface %p, name %s.\n", iface
, debugstr_a(name
));
2415 for (i
= 0; i
< This
->local_buffer_count
; ++i
)
2417 struct d3d10_effect_variable
*l
= &This
->local_buffers
[i
];
2419 if (!strcmp(l
->name
, name
))
2421 TRACE("Returning buffer %p.\n", l
);
2422 return (ID3D10EffectConstantBuffer
*)l
;
2426 WARN("Invalid name specified\n");
2428 return (ID3D10EffectConstantBuffer
*)&null_local_buffer
;
2431 static struct ID3D10EffectVariable
* STDMETHODCALLTYPE
d3d10_effect_GetVariableByIndex(ID3D10Effect
*iface
, UINT index
)
2433 struct d3d10_effect
*This
= impl_from_ID3D10Effect(iface
);
2436 TRACE("iface %p, index %u\n", iface
, index
);
2438 for (i
= 0; i
< This
->local_buffer_count
; ++i
)
2440 struct d3d10_effect_variable
*l
= &This
->local_buffers
[i
];
2442 if (index
< l
->type
->member_count
)
2444 struct d3d10_effect_variable
*v
= &l
->members
[index
];
2446 TRACE("Returning variable %p.\n", v
);
2447 return &v
->ID3D10EffectVariable_iface
;
2449 index
-= l
->type
->member_count
;
2452 if (index
< This
->local_variable_count
)
2454 struct d3d10_effect_variable
*v
= &This
->local_variables
[index
];
2456 TRACE("Returning variable %p.\n", v
);
2457 return &v
->ID3D10EffectVariable_iface
;
2460 WARN("Invalid index specified\n");
2462 return &null_variable
.ID3D10EffectVariable_iface
;
2465 static struct ID3D10EffectVariable
* STDMETHODCALLTYPE
d3d10_effect_GetVariableByName(ID3D10Effect
*iface
, LPCSTR name
)
2467 struct d3d10_effect
*This
= impl_from_ID3D10Effect(iface
);
2470 TRACE("iface %p, name %s.\n", iface
, debugstr_a(name
));
2474 WARN("Invalid name specified\n");
2475 return &null_variable
.ID3D10EffectVariable_iface
;
2478 for (i
= 0; i
< This
->local_buffer_count
; ++i
)
2480 struct d3d10_effect_variable
*l
= &This
->local_buffers
[i
];
2483 for (j
= 0; j
< l
->type
->member_count
; ++j
)
2485 struct d3d10_effect_variable
*v
= &l
->members
[j
];
2487 if (!strcmp(v
->name
, name
))
2489 TRACE("Returning variable %p.\n", v
);
2490 return &v
->ID3D10EffectVariable_iface
;
2495 for (i
= 0; i
< This
->local_variable_count
; ++i
)
2497 struct d3d10_effect_variable
*v
= &This
->local_variables
[i
];
2499 if (!strcmp(v
->name
, name
))
2501 TRACE("Returning variable %p.\n", v
);
2502 return &v
->ID3D10EffectVariable_iface
;
2506 WARN("Invalid name specified\n");
2508 return &null_variable
.ID3D10EffectVariable_iface
;
2511 static struct ID3D10EffectVariable
* STDMETHODCALLTYPE
d3d10_effect_GetVariableBySemantic(ID3D10Effect
*iface
,
2514 struct d3d10_effect
*This
= impl_from_ID3D10Effect(iface
);
2517 TRACE("iface %p, semantic %s\n", iface
, debugstr_a(semantic
));
2521 WARN("Invalid semantic specified\n");
2522 return &null_variable
.ID3D10EffectVariable_iface
;
2525 for (i
= 0; i
< This
->local_buffer_count
; ++i
)
2527 struct d3d10_effect_variable
*l
= &This
->local_buffers
[i
];
2530 for (j
= 0; j
< l
->type
->member_count
; ++j
)
2532 struct d3d10_effect_variable
*v
= &l
->members
[j
];
2534 if (!strcmp(v
->semantic
, semantic
))
2536 TRACE("Returning variable %p.\n", v
);
2537 return &v
->ID3D10EffectVariable_iface
;
2542 for (i
= 0; i
< This
->local_variable_count
; ++i
)
2544 struct d3d10_effect_variable
*v
= &This
->local_variables
[i
];
2546 if (!strcmp(v
->semantic
, semantic
))
2548 TRACE("Returning variable %p.\n", v
);
2549 return &v
->ID3D10EffectVariable_iface
;
2553 WARN("Invalid semantic specified\n");
2555 return &null_variable
.ID3D10EffectVariable_iface
;
2558 static struct ID3D10EffectTechnique
* STDMETHODCALLTYPE
d3d10_effect_GetTechniqueByIndex(ID3D10Effect
*iface
,
2561 struct d3d10_effect
*This
= impl_from_ID3D10Effect(iface
);
2562 struct d3d10_effect_technique
*t
;
2564 TRACE("iface %p, index %u\n", iface
, index
);
2566 if (index
>= This
->technique_count
)
2568 WARN("Invalid index specified\n");
2569 return &null_technique
.ID3D10EffectTechnique_iface
;
2572 t
= &This
->techniques
[index
];
2574 TRACE("Returning technique %p, %s.\n", t
, debugstr_a(t
->name
));
2576 return &t
->ID3D10EffectTechnique_iface
;
2579 static struct ID3D10EffectTechnique
* STDMETHODCALLTYPE
d3d10_effect_GetTechniqueByName(ID3D10Effect
*iface
,
2582 struct d3d10_effect
*This
= impl_from_ID3D10Effect(iface
);
2585 TRACE("iface %p, name %s.\n", iface
, debugstr_a(name
));
2589 WARN("Invalid name specified\n");
2590 return &null_technique
.ID3D10EffectTechnique_iface
;
2593 for (i
= 0; i
< This
->technique_count
; ++i
)
2595 struct d3d10_effect_technique
*t
= &This
->techniques
[i
];
2596 if (!strcmp(t
->name
, name
))
2598 TRACE("Returning technique %p\n", t
);
2599 return &t
->ID3D10EffectTechnique_iface
;
2603 WARN("Invalid name specified\n");
2605 return &null_technique
.ID3D10EffectTechnique_iface
;
2608 static HRESULT STDMETHODCALLTYPE
d3d10_effect_Optimize(ID3D10Effect
*iface
)
2610 FIXME("iface %p stub!\n", iface
);
2615 static BOOL STDMETHODCALLTYPE
d3d10_effect_IsOptimized(ID3D10Effect
*iface
)
2617 FIXME("iface %p stub!\n", iface
);
2622 const struct ID3D10EffectVtbl d3d10_effect_vtbl
=
2624 /* IUnknown methods */
2625 d3d10_effect_QueryInterface
,
2626 d3d10_effect_AddRef
,
2627 d3d10_effect_Release
,
2628 /* ID3D10Effect methods */
2629 d3d10_effect_IsValid
,
2630 d3d10_effect_IsPool
,
2631 d3d10_effect_GetDevice
,
2632 d3d10_effect_GetDesc
,
2633 d3d10_effect_GetConstantBufferByIndex
,
2634 d3d10_effect_GetConstantBufferByName
,
2635 d3d10_effect_GetVariableByIndex
,
2636 d3d10_effect_GetVariableByName
,
2637 d3d10_effect_GetVariableBySemantic
,
2638 d3d10_effect_GetTechniqueByIndex
,
2639 d3d10_effect_GetTechniqueByName
,
2640 d3d10_effect_Optimize
,
2641 d3d10_effect_IsOptimized
,
2644 /* ID3D10EffectTechnique methods */
2646 static inline struct d3d10_effect_technique
*impl_from_ID3D10EffectTechnique(ID3D10EffectTechnique
*iface
)
2648 return CONTAINING_RECORD(iface
, struct d3d10_effect_technique
, ID3D10EffectTechnique_iface
);
2651 static BOOL STDMETHODCALLTYPE
d3d10_effect_technique_IsValid(ID3D10EffectTechnique
*iface
)
2653 struct d3d10_effect_technique
*This
= impl_from_ID3D10EffectTechnique(iface
);
2655 TRACE("iface %p\n", iface
);
2657 return This
!= &null_technique
;
2660 static HRESULT STDMETHODCALLTYPE
d3d10_effect_technique_GetDesc(ID3D10EffectTechnique
*iface
,
2661 D3D10_TECHNIQUE_DESC
*desc
)
2663 struct d3d10_effect_technique
*This
= impl_from_ID3D10EffectTechnique(iface
);
2665 TRACE("iface %p, desc %p\n", iface
, desc
);
2667 if(This
== &null_technique
)
2669 WARN("Null technique specified\n");
2675 WARN("Invalid argument specified\n");
2676 return E_INVALIDARG
;
2679 desc
->Name
= This
->name
;
2680 desc
->Passes
= This
->pass_count
;
2681 desc
->Annotations
= This
->annotation_count
;
2686 static struct ID3D10EffectVariable
* STDMETHODCALLTYPE
d3d10_effect_technique_GetAnnotationByIndex(
2687 ID3D10EffectTechnique
*iface
, UINT index
)
2689 struct d3d10_effect_technique
*This
= impl_from_ID3D10EffectTechnique(iface
);
2690 struct d3d10_effect_variable
*a
;
2692 TRACE("iface %p, index %u\n", iface
, index
);
2694 if (index
>= This
->annotation_count
)
2696 WARN("Invalid index specified\n");
2697 return &null_variable
.ID3D10EffectVariable_iface
;
2700 a
= &This
->annotations
[index
];
2702 TRACE("Returning annotation %p, %s\n", a
, debugstr_a(a
->name
));
2704 return &a
->ID3D10EffectVariable_iface
;
2707 static struct ID3D10EffectVariable
* STDMETHODCALLTYPE
d3d10_effect_technique_GetAnnotationByName(
2708 ID3D10EffectTechnique
*iface
, LPCSTR name
)
2710 struct d3d10_effect_technique
*This
= impl_from_ID3D10EffectTechnique(iface
);
2713 TRACE("iface %p, name %s.\n", iface
, debugstr_a(name
));
2715 for (i
= 0; i
< This
->annotation_count
; ++i
)
2717 struct d3d10_effect_variable
*a
= &This
->annotations
[i
];
2718 if (!strcmp(a
->name
, name
))
2720 TRACE("Returning annotation %p\n", a
);
2721 return &a
->ID3D10EffectVariable_iface
;
2725 WARN("Invalid name specified\n");
2727 return &null_variable
.ID3D10EffectVariable_iface
;
2730 static struct ID3D10EffectPass
* STDMETHODCALLTYPE
d3d10_effect_technique_GetPassByIndex(ID3D10EffectTechnique
*iface
,
2733 struct d3d10_effect_technique
*This
= impl_from_ID3D10EffectTechnique(iface
);
2734 struct d3d10_effect_pass
*p
;
2736 TRACE("iface %p, index %u\n", iface
, index
);
2738 if (index
>= This
->pass_count
)
2740 WARN("Invalid index specified\n");
2741 return &null_pass
.ID3D10EffectPass_iface
;
2744 p
= &This
->passes
[index
];
2746 TRACE("Returning pass %p, %s.\n", p
, debugstr_a(p
->name
));
2748 return &p
->ID3D10EffectPass_iface
;
2751 static struct ID3D10EffectPass
* STDMETHODCALLTYPE
d3d10_effect_technique_GetPassByName(ID3D10EffectTechnique
*iface
,
2754 struct d3d10_effect_technique
*This
= impl_from_ID3D10EffectTechnique(iface
);
2757 TRACE("iface %p, name %s.\n", iface
, debugstr_a(name
));
2759 /* Do not check for name==NULL, W7/DX10 crashes in that case. */
2761 for (i
= 0; i
< This
->pass_count
; ++i
)
2763 struct d3d10_effect_pass
*p
= &This
->passes
[i
];
2764 if (!strcmp(p
->name
, name
))
2766 TRACE("Returning pass %p\n", p
);
2767 return &p
->ID3D10EffectPass_iface
;
2771 WARN("Invalid name specified\n");
2773 return &null_pass
.ID3D10EffectPass_iface
;
2776 static HRESULT STDMETHODCALLTYPE
d3d10_effect_technique_ComputeStateBlockMask(ID3D10EffectTechnique
*iface
,
2777 D3D10_STATE_BLOCK_MASK
*mask
)
2779 FIXME("iface %p,mask %p stub!\n", iface
, mask
);
2784 static const struct ID3D10EffectTechniqueVtbl d3d10_effect_technique_vtbl
=
2786 /* ID3D10EffectTechnique methods */
2787 d3d10_effect_technique_IsValid
,
2788 d3d10_effect_technique_GetDesc
,
2789 d3d10_effect_technique_GetAnnotationByIndex
,
2790 d3d10_effect_technique_GetAnnotationByName
,
2791 d3d10_effect_technique_GetPassByIndex
,
2792 d3d10_effect_technique_GetPassByName
,
2793 d3d10_effect_technique_ComputeStateBlockMask
,
2796 /* ID3D10EffectPass methods */
2798 static inline struct d3d10_effect_pass
*impl_from_ID3D10EffectPass(ID3D10EffectPass
*iface
)
2800 return CONTAINING_RECORD(iface
, struct d3d10_effect_pass
, ID3D10EffectPass_iface
);
2803 static BOOL STDMETHODCALLTYPE
d3d10_effect_pass_IsValid(ID3D10EffectPass
*iface
)
2805 struct d3d10_effect_pass
*This
= impl_from_ID3D10EffectPass(iface
);
2807 TRACE("iface %p\n", iface
);
2809 return This
!= &null_pass
;
2812 static HRESULT STDMETHODCALLTYPE
d3d10_effect_pass_GetDesc(ID3D10EffectPass
*iface
,
2813 D3D10_PASS_DESC
*desc
)
2815 struct d3d10_effect_pass
*This
= impl_from_ID3D10EffectPass(iface
);
2818 FIXME("iface %p, desc %p partial stub!\n", iface
, desc
);
2820 if(This
== &null_pass
)
2822 WARN("Null pass specified\n");
2828 WARN("Invalid argument specified\n");
2829 return E_INVALIDARG
;
2832 memset(desc
, 0, sizeof(*desc
));
2833 desc
->Name
= This
->name
;
2834 for (i
= 0; i
< This
->object_count
; ++i
)
2836 struct d3d10_effect_object
*o
= &This
->objects
[i
];
2837 if (o
->type
== D3D10_EOT_VERTEXSHADER
)
2839 struct d3d10_effect_variable
*v
= o
->data
;
2840 struct d3d10_effect_shader_variable
*s
= v
->data
;
2841 desc
->pIAInputSignature
= (BYTE
*)s
->input_signature
.signature
;
2842 desc
->IAInputSignatureSize
= s
->input_signature
.signature_size
;
2847 desc
->StencilRef
= This
->stencil_ref
;
2848 desc
->SampleMask
= This
->sample_mask
;
2849 memcpy(desc
->BlendFactor
, This
->blend_factor
, 4 * sizeof(float));
2854 static HRESULT STDMETHODCALLTYPE
d3d10_effect_pass_GetVertexShaderDesc(ID3D10EffectPass
*iface
,
2855 D3D10_PASS_SHADER_DESC
*desc
)
2857 struct d3d10_effect_pass
*This
= impl_from_ID3D10EffectPass(iface
);
2860 TRACE("iface %p, desc %p\n", iface
, desc
);
2862 if (This
== &null_pass
)
2864 WARN("Null pass specified\n");
2870 WARN("Invalid argument specified\n");
2871 return E_INVALIDARG
;
2874 for (i
= 0; i
< This
->object_count
; ++i
)
2876 struct d3d10_effect_object
*o
= &This
->objects
[i
];
2878 if (o
->type
== D3D10_EOT_VERTEXSHADER
)
2880 desc
->pShaderVariable
= o
->data
;
2881 desc
->ShaderIndex
= o
->index
;
2886 TRACE("Returning null_shader_variable\n");
2887 desc
->pShaderVariable
= (ID3D10EffectShaderVariable
*)&null_shader_variable
;
2888 desc
->ShaderIndex
= 0;
2893 static HRESULT STDMETHODCALLTYPE
d3d10_effect_pass_GetGeometryShaderDesc(ID3D10EffectPass
*iface
,
2894 D3D10_PASS_SHADER_DESC
*desc
)
2896 struct d3d10_effect_pass
*This
= impl_from_ID3D10EffectPass(iface
);
2899 TRACE("iface %p, desc %p\n", iface
, desc
);
2901 if (This
== &null_pass
)
2903 WARN("Null pass specified\n");
2909 WARN("Invalid argument specified\n");
2910 return E_INVALIDARG
;
2913 for (i
= 0; i
< This
->object_count
; ++i
)
2915 struct d3d10_effect_object
*o
= &This
->objects
[i
];
2917 if (o
->type
== D3D10_EOT_GEOMETRYSHADER
)
2919 desc
->pShaderVariable
= o
->data
;
2920 desc
->ShaderIndex
= o
->index
;
2925 TRACE("Returning null_shader_variable\n");
2926 desc
->pShaderVariable
= (ID3D10EffectShaderVariable
*)&null_shader_variable
;
2927 desc
->ShaderIndex
= 0;
2932 static HRESULT STDMETHODCALLTYPE
d3d10_effect_pass_GetPixelShaderDesc(ID3D10EffectPass
*iface
,
2933 D3D10_PASS_SHADER_DESC
*desc
)
2935 struct d3d10_effect_pass
*This
= impl_from_ID3D10EffectPass(iface
);
2938 TRACE("iface %p, desc %p\n", iface
, desc
);
2940 if (This
== &null_pass
)
2942 WARN("Null pass specified\n");
2948 WARN("Invalid argument specified\n");
2949 return E_INVALIDARG
;
2952 for (i
= 0; i
< This
->object_count
; ++i
)
2954 struct d3d10_effect_object
*o
= &This
->objects
[i
];
2956 if (o
->type
== D3D10_EOT_PIXELSHADER
)
2958 desc
->pShaderVariable
= o
->data
;
2959 desc
->ShaderIndex
= o
->index
;
2964 TRACE("Returning null_shader_variable\n");
2965 desc
->pShaderVariable
= (ID3D10EffectShaderVariable
*)&null_shader_variable
;
2966 desc
->ShaderIndex
= 0;
2971 static struct ID3D10EffectVariable
* STDMETHODCALLTYPE
d3d10_effect_pass_GetAnnotationByIndex(ID3D10EffectPass
*iface
,
2974 struct d3d10_effect_pass
*This
= impl_from_ID3D10EffectPass(iface
);
2975 struct d3d10_effect_variable
*a
;
2977 TRACE("iface %p, index %u\n", iface
, index
);
2979 if (index
>= This
->annotation_count
)
2981 WARN("Invalid index specified\n");
2982 return &null_variable
.ID3D10EffectVariable_iface
;
2985 a
= &This
->annotations
[index
];
2987 TRACE("Returning annotation %p, %s\n", a
, debugstr_a(a
->name
));
2989 return &a
->ID3D10EffectVariable_iface
;
2992 static struct ID3D10EffectVariable
* STDMETHODCALLTYPE
d3d10_effect_pass_GetAnnotationByName(ID3D10EffectPass
*iface
,
2995 struct d3d10_effect_pass
*This
= impl_from_ID3D10EffectPass(iface
);
2998 TRACE("iface %p, name %s.\n", iface
, debugstr_a(name
));
3000 for (i
= 0; i
< This
->annotation_count
; ++i
)
3002 struct d3d10_effect_variable
*a
= &This
->annotations
[i
];
3003 if (!strcmp(a
->name
, name
))
3005 TRACE("Returning annotation %p\n", a
);
3006 return &a
->ID3D10EffectVariable_iface
;
3010 WARN("Invalid name specified\n");
3012 return &null_variable
.ID3D10EffectVariable_iface
;
3015 static HRESULT STDMETHODCALLTYPE
d3d10_effect_pass_Apply(ID3D10EffectPass
*iface
, UINT flags
)
3017 struct d3d10_effect_pass
*This
= impl_from_ID3D10EffectPass(iface
);
3021 TRACE("iface %p, flags %#x\n", iface
, flags
);
3023 if (flags
) FIXME("Ignoring flags (%#x)\n", flags
);
3025 for (i
= 0; i
< This
->object_count
; ++i
)
3027 hr
= d3d10_effect_object_apply(&This
->objects
[i
]);
3028 if (FAILED(hr
)) break;
3034 static HRESULT STDMETHODCALLTYPE
d3d10_effect_pass_ComputeStateBlockMask(ID3D10EffectPass
*iface
,
3035 D3D10_STATE_BLOCK_MASK
*mask
)
3037 FIXME("iface %p, mask %p stub!\n", iface
, mask
);
3042 static const struct ID3D10EffectPassVtbl d3d10_effect_pass_vtbl
=
3044 /* ID3D10EffectPass methods */
3045 d3d10_effect_pass_IsValid
,
3046 d3d10_effect_pass_GetDesc
,
3047 d3d10_effect_pass_GetVertexShaderDesc
,
3048 d3d10_effect_pass_GetGeometryShaderDesc
,
3049 d3d10_effect_pass_GetPixelShaderDesc
,
3050 d3d10_effect_pass_GetAnnotationByIndex
,
3051 d3d10_effect_pass_GetAnnotationByName
,
3052 d3d10_effect_pass_Apply
,
3053 d3d10_effect_pass_ComputeStateBlockMask
,
3056 /* ID3D10EffectVariable methods */
3058 static BOOL STDMETHODCALLTYPE
d3d10_effect_variable_IsValid(ID3D10EffectVariable
*iface
)
3060 TRACE("iface %p\n", iface
);
3062 return impl_from_ID3D10EffectVariable(iface
) != &null_variable
;
3065 static struct ID3D10EffectType
* STDMETHODCALLTYPE
d3d10_effect_variable_GetType(ID3D10EffectVariable
*iface
)
3067 struct d3d10_effect_variable
*This
= impl_from_ID3D10EffectVariable(iface
);
3069 TRACE("iface %p\n", iface
);
3071 return &This
->type
->ID3D10EffectType_iface
;
3074 static HRESULT STDMETHODCALLTYPE
d3d10_effect_variable_GetDesc(ID3D10EffectVariable
*iface
,
3075 D3D10_EFFECT_VARIABLE_DESC
*desc
)
3077 struct d3d10_effect_variable
*This
= impl_from_ID3D10EffectVariable(iface
);
3079 TRACE("iface %p, desc %p\n", iface
, desc
);
3081 if (!iface
->lpVtbl
->IsValid(iface
))
3083 WARN("Null variable specified\n");
3089 WARN("Invalid argument specified\n");
3090 return E_INVALIDARG
;
3093 /* FIXME: This isn't correct. Anonymous shaders let desc->ExplicitBindPoint untouched, but normal shaders set it! */
3094 memset(desc
, 0, sizeof(*desc
));
3095 desc
->Name
= This
->name
;
3096 desc
->Semantic
= This
->semantic
;
3097 desc
->Flags
= This
->flag
;
3098 desc
->Annotations
= This
->annotation_count
;
3099 desc
->BufferOffset
= This
->buffer_offset
;
3101 if (This
->flag
& D3D10_EFFECT_VARIABLE_EXPLICIT_BIND_POINT
)
3103 desc
->ExplicitBindPoint
= This
->buffer_offset
;
3109 static struct ID3D10EffectVariable
* STDMETHODCALLTYPE
d3d10_effect_variable_GetAnnotationByIndex(
3110 ID3D10EffectVariable
*iface
, UINT index
)
3112 struct d3d10_effect_variable
*This
= impl_from_ID3D10EffectVariable(iface
);
3113 struct d3d10_effect_variable
*a
;
3115 TRACE("iface %p, index %u\n", iface
, index
);
3117 if (index
>= This
->annotation_count
)
3119 WARN("Invalid index specified\n");
3120 return &null_variable
.ID3D10EffectVariable_iface
;
3123 a
= &This
->annotations
[index
];
3125 TRACE("Returning annotation %p, %s\n", a
, debugstr_a(a
->name
));
3127 return &a
->ID3D10EffectVariable_iface
;
3130 static struct ID3D10EffectVariable
* STDMETHODCALLTYPE
d3d10_effect_variable_GetAnnotationByName(
3131 ID3D10EffectVariable
*iface
, LPCSTR name
)
3133 struct d3d10_effect_variable
*This
= impl_from_ID3D10EffectVariable(iface
);
3136 TRACE("iface %p, name %s.\n", iface
, debugstr_a(name
));
3138 for (i
= 0; i
< This
->annotation_count
; ++i
)
3140 struct d3d10_effect_variable
*a
= &This
->annotations
[i
];
3141 if (!strcmp(a
->name
, name
))
3143 TRACE("Returning annotation %p\n", a
);
3144 return &a
->ID3D10EffectVariable_iface
;
3148 WARN("Invalid name specified\n");
3150 return &null_variable
.ID3D10EffectVariable_iface
;
3153 static struct ID3D10EffectVariable
* STDMETHODCALLTYPE
d3d10_effect_variable_GetMemberByIndex(
3154 ID3D10EffectVariable
*iface
, UINT index
)
3156 struct d3d10_effect_variable
*This
= impl_from_ID3D10EffectVariable(iface
);
3157 struct d3d10_effect_variable
*m
;
3159 TRACE("iface %p, index %u\n", iface
, index
);
3161 if (index
>= This
->type
->member_count
)
3163 WARN("Invalid index specified\n");
3164 return &null_variable
.ID3D10EffectVariable_iface
;
3167 m
= &This
->members
[index
];
3169 TRACE("Returning member %p, %s\n", m
, debugstr_a(m
->name
));
3171 return &m
->ID3D10EffectVariable_iface
;
3174 static struct ID3D10EffectVariable
* STDMETHODCALLTYPE
d3d10_effect_variable_GetMemberByName(
3175 ID3D10EffectVariable
*iface
, LPCSTR name
)
3177 struct d3d10_effect_variable
*This
= impl_from_ID3D10EffectVariable(iface
);
3180 TRACE("iface %p, name %s.\n", iface
, debugstr_a(name
));
3184 WARN("Invalid name specified\n");
3185 return &null_variable
.ID3D10EffectVariable_iface
;
3188 for (i
= 0; i
< This
->type
->member_count
; ++i
)
3190 struct d3d10_effect_variable
*m
= &This
->members
[i
];
3194 if (!strcmp(m
->name
, name
))
3196 TRACE("Returning member %p\n", m
);
3197 return &m
->ID3D10EffectVariable_iface
;
3202 WARN("Invalid name specified\n");
3204 return &null_variable
.ID3D10EffectVariable_iface
;
3207 static struct ID3D10EffectVariable
* STDMETHODCALLTYPE
d3d10_effect_variable_GetMemberBySemantic(
3208 ID3D10EffectVariable
*iface
, LPCSTR semantic
)
3210 struct d3d10_effect_variable
*This
= impl_from_ID3D10EffectVariable(iface
);
3213 TRACE("iface %p, semantic %s.\n", iface
, debugstr_a(semantic
));
3217 WARN("Invalid semantic specified\n");
3218 return &null_variable
.ID3D10EffectVariable_iface
;
3221 for (i
= 0; i
< This
->type
->member_count
; ++i
)
3223 struct d3d10_effect_variable
*m
= &This
->members
[i
];
3227 if (!strcmp(m
->semantic
, semantic
))
3229 TRACE("Returning member %p\n", m
);
3230 return &m
->ID3D10EffectVariable_iface
;
3235 WARN("Invalid semantic specified\n");
3237 return &null_variable
.ID3D10EffectVariable_iface
;
3240 static struct ID3D10EffectVariable
* STDMETHODCALLTYPE
d3d10_effect_variable_GetElement(
3241 ID3D10EffectVariable
*iface
, UINT index
)
3243 struct d3d10_effect_variable
*This
= impl_from_ID3D10EffectVariable(iface
);
3244 struct d3d10_effect_variable
*v
;
3246 TRACE("iface %p, index %u\n", iface
, index
);
3248 if (index
>= This
->type
->element_count
)
3250 WARN("Invalid index specified\n");
3251 return &null_variable
.ID3D10EffectVariable_iface
;
3254 v
= &This
->elements
[index
];
3256 TRACE("Returning element %p, %s\n", v
, debugstr_a(v
->name
));
3258 return &v
->ID3D10EffectVariable_iface
;
3261 static struct ID3D10EffectConstantBuffer
* STDMETHODCALLTYPE
d3d10_effect_variable_GetParentConstantBuffer(
3262 ID3D10EffectVariable
*iface
)
3264 struct d3d10_effect_variable
*This
= impl_from_ID3D10EffectVariable(iface
);
3266 TRACE("iface %p\n", iface
);
3268 return (ID3D10EffectConstantBuffer
*)This
->buffer
;
3271 static struct ID3D10EffectScalarVariable
* STDMETHODCALLTYPE
d3d10_effect_variable_AsScalar(
3272 ID3D10EffectVariable
*iface
)
3274 struct d3d10_effect_variable
*This
= impl_from_ID3D10EffectVariable(iface
);
3276 TRACE("iface %p\n", iface
);
3278 if (This
->ID3D10EffectVariable_iface
.lpVtbl
== (const ID3D10EffectVariableVtbl
*)&d3d10_effect_scalar_variable_vtbl
)
3279 return (ID3D10EffectScalarVariable
*)&This
->ID3D10EffectVariable_iface
;
3281 return (ID3D10EffectScalarVariable
*)&null_scalar_variable
.ID3D10EffectVariable_iface
;
3284 static struct ID3D10EffectVectorVariable
* STDMETHODCALLTYPE
d3d10_effect_variable_AsVector(
3285 ID3D10EffectVariable
*iface
)
3287 struct d3d10_effect_variable
*This
= impl_from_ID3D10EffectVariable(iface
);
3289 TRACE("iface %p\n", iface
);
3291 if (This
->ID3D10EffectVariable_iface
.lpVtbl
== (const ID3D10EffectVariableVtbl
*)&d3d10_effect_vector_variable_vtbl
)
3292 return (ID3D10EffectVectorVariable
*)&This
->ID3D10EffectVariable_iface
;
3294 return (ID3D10EffectVectorVariable
*)&null_vector_variable
.ID3D10EffectVariable_iface
;
3297 static struct ID3D10EffectMatrixVariable
* STDMETHODCALLTYPE
d3d10_effect_variable_AsMatrix(
3298 ID3D10EffectVariable
*iface
)
3300 struct d3d10_effect_variable
*This
= impl_from_ID3D10EffectVariable(iface
);
3302 TRACE("iface %p\n", iface
);
3304 if (This
->ID3D10EffectVariable_iface
.lpVtbl
== (const ID3D10EffectVariableVtbl
*)&d3d10_effect_matrix_variable_vtbl
)
3305 return (ID3D10EffectMatrixVariable
*)&This
->ID3D10EffectVariable_iface
;
3307 return (ID3D10EffectMatrixVariable
*)&null_matrix_variable
.ID3D10EffectVariable_iface
;
3310 static struct ID3D10EffectStringVariable
* STDMETHODCALLTYPE
d3d10_effect_variable_AsString(
3311 ID3D10EffectVariable
*iface
)
3313 struct d3d10_effect_variable
*This
= impl_from_ID3D10EffectVariable(iface
);
3315 TRACE("iface %p\n", iface
);
3317 if (This
->ID3D10EffectVariable_iface
.lpVtbl
== (const ID3D10EffectVariableVtbl
*)&d3d10_effect_string_variable_vtbl
)
3318 return (ID3D10EffectStringVariable
*)&This
->ID3D10EffectVariable_iface
;
3320 return (ID3D10EffectStringVariable
*)&null_string_variable
.ID3D10EffectVariable_iface
;
3323 static struct ID3D10EffectShaderResourceVariable
* STDMETHODCALLTYPE
d3d10_effect_variable_AsShaderResource(
3324 ID3D10EffectVariable
*iface
)
3326 struct d3d10_effect_variable
*This
= impl_from_ID3D10EffectVariable(iface
);
3328 TRACE("iface %p\n", iface
);
3330 if (This
->ID3D10EffectVariable_iface
.lpVtbl
== (const ID3D10EffectVariableVtbl
*)&d3d10_effect_shader_resource_variable_vtbl
)
3331 return (ID3D10EffectShaderResourceVariable
*)&This
->ID3D10EffectVariable_iface
;
3333 return (ID3D10EffectShaderResourceVariable
*)&null_shader_resource_variable
.ID3D10EffectVariable_iface
;
3336 static struct ID3D10EffectRenderTargetViewVariable
* STDMETHODCALLTYPE
d3d10_effect_variable_AsRenderTargetView(
3337 ID3D10EffectVariable
*iface
)
3339 struct d3d10_effect_variable
*This
= impl_from_ID3D10EffectVariable(iface
);
3341 TRACE("iface %p\n", iface
);
3343 if (This
->ID3D10EffectVariable_iface
.lpVtbl
== (const ID3D10EffectVariableVtbl
*)&d3d10_effect_render_target_view_variable_vtbl
)
3344 return (ID3D10EffectRenderTargetViewVariable
*)&This
->ID3D10EffectVariable_iface
;
3346 return (ID3D10EffectRenderTargetViewVariable
*)&null_render_target_view_variable
.ID3D10EffectVariable_iface
;
3349 static struct ID3D10EffectDepthStencilViewVariable
* STDMETHODCALLTYPE
d3d10_effect_variable_AsDepthStencilView(
3350 ID3D10EffectVariable
*iface
)
3352 struct d3d10_effect_variable
*This
= impl_from_ID3D10EffectVariable(iface
);
3354 TRACE("iface %p\n", iface
);
3356 if (This
->ID3D10EffectVariable_iface
.lpVtbl
== (const ID3D10EffectVariableVtbl
*)&d3d10_effect_depth_stencil_view_variable_vtbl
)
3357 return (ID3D10EffectDepthStencilViewVariable
*)&This
->ID3D10EffectVariable_iface
;
3359 return (ID3D10EffectDepthStencilViewVariable
*)&null_depth_stencil_view_variable
.ID3D10EffectVariable_iface
;
3362 static struct ID3D10EffectConstantBuffer
* STDMETHODCALLTYPE
d3d10_effect_variable_AsConstantBuffer(
3363 ID3D10EffectVariable
*iface
)
3365 struct d3d10_effect_variable
*This
= impl_from_ID3D10EffectVariable(iface
);
3367 TRACE("iface %p\n", iface
);
3369 if (This
->ID3D10EffectVariable_iface
.lpVtbl
== (const ID3D10EffectVariableVtbl
*)&d3d10_effect_constant_buffer_vtbl
)
3370 return (ID3D10EffectConstantBuffer
*)&This
->ID3D10EffectVariable_iface
;
3372 return (ID3D10EffectConstantBuffer
*)&null_local_buffer
.ID3D10EffectVariable_iface
;
3375 static struct ID3D10EffectShaderVariable
* STDMETHODCALLTYPE
d3d10_effect_variable_AsShader(
3376 ID3D10EffectVariable
*iface
)
3378 struct d3d10_effect_variable
*This
= impl_from_ID3D10EffectVariable(iface
);
3380 TRACE("iface %p\n", iface
);
3382 if (This
->ID3D10EffectVariable_iface
.lpVtbl
== (const ID3D10EffectVariableVtbl
*)&d3d10_effect_shader_variable_vtbl
)
3383 return (ID3D10EffectShaderVariable
*)&This
->ID3D10EffectVariable_iface
;
3385 return (ID3D10EffectShaderVariable
*)&null_shader_variable
.ID3D10EffectVariable_iface
;
3388 static struct ID3D10EffectBlendVariable
* STDMETHODCALLTYPE
d3d10_effect_variable_AsBlend(ID3D10EffectVariable
*iface
)
3390 struct d3d10_effect_variable
*This
= impl_from_ID3D10EffectVariable(iface
);
3392 TRACE("iface %p\n", iface
);
3394 if (This
->ID3D10EffectVariable_iface
.lpVtbl
== (const ID3D10EffectVariableVtbl
*)&d3d10_effect_blend_variable_vtbl
)
3395 return (ID3D10EffectBlendVariable
*)&This
->ID3D10EffectVariable_iface
;
3397 return (ID3D10EffectBlendVariable
*)&null_blend_variable
.ID3D10EffectVariable_iface
;
3400 static struct ID3D10EffectDepthStencilVariable
* STDMETHODCALLTYPE
d3d10_effect_variable_AsDepthStencil(
3401 ID3D10EffectVariable
*iface
)
3403 struct d3d10_effect_variable
*This
= impl_from_ID3D10EffectVariable(iface
);
3405 TRACE("iface %p\n", iface
);
3407 if (This
->ID3D10EffectVariable_iface
.lpVtbl
== (const ID3D10EffectVariableVtbl
*)&d3d10_effect_depth_stencil_variable_vtbl
)
3408 return (ID3D10EffectDepthStencilVariable
*)&This
->ID3D10EffectVariable_iface
;
3410 return (ID3D10EffectDepthStencilVariable
*)&null_depth_stencil_variable
.ID3D10EffectVariable_iface
;
3413 static struct ID3D10EffectRasterizerVariable
* STDMETHODCALLTYPE
d3d10_effect_variable_AsRasterizer(
3414 ID3D10EffectVariable
*iface
)
3416 struct d3d10_effect_variable
*This
= impl_from_ID3D10EffectVariable(iface
);
3418 TRACE("iface %p\n", iface
);
3420 if (This
->ID3D10EffectVariable_iface
.lpVtbl
== (const ID3D10EffectVariableVtbl
*)&d3d10_effect_rasterizer_variable_vtbl
)
3421 return (ID3D10EffectRasterizerVariable
*)&This
->ID3D10EffectVariable_iface
;
3423 return (ID3D10EffectRasterizerVariable
*)&null_rasterizer_variable
.ID3D10EffectVariable_iface
;
3426 static struct ID3D10EffectSamplerVariable
* STDMETHODCALLTYPE
d3d10_effect_variable_AsSampler(
3427 ID3D10EffectVariable
*iface
)
3429 struct d3d10_effect_variable
*This
= impl_from_ID3D10EffectVariable(iface
);
3431 TRACE("iface %p\n", iface
);
3433 if (This
->ID3D10EffectVariable_iface
.lpVtbl
== (const ID3D10EffectVariableVtbl
*)&d3d10_effect_sampler_variable_vtbl
)
3434 return (ID3D10EffectSamplerVariable
*)&This
->ID3D10EffectVariable_iface
;
3436 return (ID3D10EffectSamplerVariable
*)&null_sampler_variable
.ID3D10EffectVariable_iface
;
3439 static HRESULT STDMETHODCALLTYPE
d3d10_effect_variable_SetRawValue(ID3D10EffectVariable
*iface
,
3440 void *data
, UINT offset
, UINT count
)
3442 FIXME("iface %p, data %p, offset %u, count %u stub!\n", iface
, data
, offset
, count
);
3447 static HRESULT STDMETHODCALLTYPE
d3d10_effect_variable_GetRawValue(ID3D10EffectVariable
*iface
,
3448 void *data
, UINT offset
, UINT count
)
3450 FIXME("iface %p, data %p, offset %u, count %u stub!\n", iface
, data
, offset
, count
);
3455 static const struct ID3D10EffectVariableVtbl d3d10_effect_variable_vtbl
=
3457 /* ID3D10EffectVariable methods */
3458 d3d10_effect_variable_IsValid
,
3459 d3d10_effect_variable_GetType
,
3460 d3d10_effect_variable_GetDesc
,
3461 d3d10_effect_variable_GetAnnotationByIndex
,
3462 d3d10_effect_variable_GetAnnotationByName
,
3463 d3d10_effect_variable_GetMemberByIndex
,
3464 d3d10_effect_variable_GetMemberByName
,
3465 d3d10_effect_variable_GetMemberBySemantic
,
3466 d3d10_effect_variable_GetElement
,
3467 d3d10_effect_variable_GetParentConstantBuffer
,
3468 d3d10_effect_variable_AsScalar
,
3469 d3d10_effect_variable_AsVector
,
3470 d3d10_effect_variable_AsMatrix
,
3471 d3d10_effect_variable_AsString
,
3472 d3d10_effect_variable_AsShaderResource
,
3473 d3d10_effect_variable_AsRenderTargetView
,
3474 d3d10_effect_variable_AsDepthStencilView
,
3475 d3d10_effect_variable_AsConstantBuffer
,
3476 d3d10_effect_variable_AsShader
,
3477 d3d10_effect_variable_AsBlend
,
3478 d3d10_effect_variable_AsDepthStencil
,
3479 d3d10_effect_variable_AsRasterizer
,
3480 d3d10_effect_variable_AsSampler
,
3481 d3d10_effect_variable_SetRawValue
,
3482 d3d10_effect_variable_GetRawValue
,
3485 /* ID3D10EffectVariable methods */
3486 static BOOL STDMETHODCALLTYPE
d3d10_effect_constant_buffer_IsValid(ID3D10EffectConstantBuffer
*iface
)
3488 TRACE("iface %p\n", iface
);
3490 return (struct d3d10_effect_variable
*)iface
!= &null_local_buffer
;
3493 static struct ID3D10EffectType
* STDMETHODCALLTYPE
d3d10_effect_constant_buffer_GetType(ID3D10EffectConstantBuffer
*iface
)
3495 return d3d10_effect_variable_GetType((ID3D10EffectVariable
*)iface
);
3498 static HRESULT STDMETHODCALLTYPE
d3d10_effect_constant_buffer_GetDesc(ID3D10EffectConstantBuffer
*iface
,
3499 D3D10_EFFECT_VARIABLE_DESC
*desc
)
3501 return d3d10_effect_variable_GetDesc((ID3D10EffectVariable
*)iface
, desc
);
3504 static struct ID3D10EffectVariable
* STDMETHODCALLTYPE
d3d10_effect_constant_buffer_GetAnnotationByIndex(
3505 ID3D10EffectConstantBuffer
*iface
, UINT index
)
3507 return d3d10_effect_variable_GetAnnotationByIndex((ID3D10EffectVariable
*)iface
, index
);
3510 static struct ID3D10EffectVariable
* STDMETHODCALLTYPE
d3d10_effect_constant_buffer_GetAnnotationByName(
3511 ID3D10EffectConstantBuffer
*iface
, LPCSTR name
)
3513 return d3d10_effect_variable_GetAnnotationByName((ID3D10EffectVariable
*)iface
, name
);
3516 static struct ID3D10EffectVariable
* STDMETHODCALLTYPE
d3d10_effect_constant_buffer_GetMemberByIndex(
3517 ID3D10EffectConstantBuffer
*iface
, UINT index
)
3519 return d3d10_effect_variable_GetMemberByIndex((ID3D10EffectVariable
*)iface
, index
);
3522 static struct ID3D10EffectVariable
* STDMETHODCALLTYPE
d3d10_effect_constant_buffer_GetMemberByName(
3523 ID3D10EffectConstantBuffer
*iface
, LPCSTR name
)
3525 return d3d10_effect_variable_GetMemberByName((ID3D10EffectVariable
*)iface
, name
);
3528 static struct ID3D10EffectVariable
* STDMETHODCALLTYPE
d3d10_effect_constant_buffer_GetMemberBySemantic(
3529 ID3D10EffectConstantBuffer
*iface
, LPCSTR semantic
)
3531 return d3d10_effect_variable_GetMemberBySemantic((ID3D10EffectVariable
*)iface
, semantic
);
3534 static struct ID3D10EffectVariable
* STDMETHODCALLTYPE
d3d10_effect_constant_buffer_GetElement(
3535 ID3D10EffectConstantBuffer
*iface
, UINT index
)
3537 return d3d10_effect_variable_GetElement((ID3D10EffectVariable
*)iface
, index
);
3540 static struct ID3D10EffectConstantBuffer
* STDMETHODCALLTYPE
d3d10_effect_constant_buffer_GetParentConstantBuffer(
3541 ID3D10EffectConstantBuffer
*iface
)
3543 return d3d10_effect_variable_GetParentConstantBuffer((ID3D10EffectVariable
*)iface
);
3546 static struct ID3D10EffectScalarVariable
* STDMETHODCALLTYPE
d3d10_effect_constant_buffer_AsScalar(
3547 ID3D10EffectConstantBuffer
*iface
)
3549 return d3d10_effect_variable_AsScalar((ID3D10EffectVariable
*)iface
);
3552 static struct ID3D10EffectVectorVariable
* STDMETHODCALLTYPE
d3d10_effect_constant_buffer_AsVector(
3553 ID3D10EffectConstantBuffer
*iface
)
3555 return d3d10_effect_variable_AsVector((ID3D10EffectVariable
*)iface
);
3558 static struct ID3D10EffectMatrixVariable
* STDMETHODCALLTYPE
d3d10_effect_constant_buffer_AsMatrix(
3559 ID3D10EffectConstantBuffer
*iface
)
3561 return d3d10_effect_variable_AsMatrix((ID3D10EffectVariable
*)iface
);
3564 static struct ID3D10EffectStringVariable
* STDMETHODCALLTYPE
d3d10_effect_constant_buffer_AsString(
3565 ID3D10EffectConstantBuffer
*iface
)
3567 return d3d10_effect_variable_AsString((ID3D10EffectVariable
*)iface
);
3570 static struct ID3D10EffectShaderResourceVariable
* STDMETHODCALLTYPE
d3d10_effect_constant_buffer_AsShaderResource(
3571 ID3D10EffectConstantBuffer
*iface
)
3573 return d3d10_effect_variable_AsShaderResource((ID3D10EffectVariable
*)iface
);
3576 static struct ID3D10EffectRenderTargetViewVariable
* STDMETHODCALLTYPE
d3d10_effect_constant_buffer_AsRenderTargetView(
3577 ID3D10EffectConstantBuffer
*iface
)
3579 return d3d10_effect_variable_AsRenderTargetView((ID3D10EffectVariable
*)iface
);
3582 static struct ID3D10EffectDepthStencilViewVariable
* STDMETHODCALLTYPE
d3d10_effect_constant_buffer_AsDepthStencilView(
3583 ID3D10EffectConstantBuffer
*iface
)
3585 return d3d10_effect_variable_AsDepthStencilView((ID3D10EffectVariable
*)iface
);
3588 static struct ID3D10EffectConstantBuffer
* STDMETHODCALLTYPE
d3d10_effect_constant_buffer_AsConstantBuffer(
3589 ID3D10EffectConstantBuffer
*iface
)
3591 return d3d10_effect_variable_AsConstantBuffer((ID3D10EffectVariable
*)iface
);
3594 static struct ID3D10EffectShaderVariable
* STDMETHODCALLTYPE
d3d10_effect_constant_buffer_AsShader(
3595 ID3D10EffectConstantBuffer
*iface
)
3597 return d3d10_effect_variable_AsShader((ID3D10EffectVariable
*)iface
);
3600 static struct ID3D10EffectBlendVariable
* STDMETHODCALLTYPE
d3d10_effect_constant_buffer_AsBlend(ID3D10EffectConstantBuffer
*iface
)
3602 return d3d10_effect_variable_AsBlend((ID3D10EffectVariable
*)iface
);
3605 static struct ID3D10EffectDepthStencilVariable
* STDMETHODCALLTYPE
d3d10_effect_constant_buffer_AsDepthStencil(
3606 ID3D10EffectConstantBuffer
*iface
)
3608 return d3d10_effect_variable_AsDepthStencil((ID3D10EffectVariable
*)iface
);
3611 static struct ID3D10EffectRasterizerVariable
* STDMETHODCALLTYPE
d3d10_effect_constant_buffer_AsRasterizer(
3612 ID3D10EffectConstantBuffer
*iface
)
3614 return d3d10_effect_variable_AsRasterizer((ID3D10EffectVariable
*)iface
);
3617 static struct ID3D10EffectSamplerVariable
* STDMETHODCALLTYPE
d3d10_effect_constant_buffer_AsSampler(
3618 ID3D10EffectConstantBuffer
*iface
)
3620 return d3d10_effect_variable_AsSampler((ID3D10EffectVariable
*)iface
);
3623 static HRESULT STDMETHODCALLTYPE
d3d10_effect_constant_buffer_SetRawValue(ID3D10EffectConstantBuffer
*iface
,
3624 void *data
, UINT offset
, UINT count
)
3626 return d3d10_effect_variable_SetRawValue((ID3D10EffectVariable
*)iface
, data
, offset
, count
);
3629 static HRESULT STDMETHODCALLTYPE
d3d10_effect_constant_buffer_GetRawValue(ID3D10EffectConstantBuffer
*iface
,
3630 void *data
, UINT offset
, UINT count
)
3632 return d3d10_effect_variable_GetRawValue((ID3D10EffectVariable
*)iface
, data
, offset
, count
);
3635 /* ID3D10EffectConstantBuffer methods */
3636 static HRESULT STDMETHODCALLTYPE
d3d10_effect_constant_buffer_SetConstantBuffer(ID3D10EffectConstantBuffer
*iface
,
3637 ID3D10Buffer
*buffer
)
3639 FIXME("iface %p, buffer %p stub!\n", iface
, buffer
);
3644 static HRESULT STDMETHODCALLTYPE
d3d10_effect_constant_buffer_GetConstantBuffer(ID3D10EffectConstantBuffer
*iface
,
3645 ID3D10Buffer
**buffer
)
3647 FIXME("iface %p, buffer %p stub!\n", iface
, buffer
);
3652 static HRESULT STDMETHODCALLTYPE
d3d10_effect_constant_buffer_SetTextureBuffer(ID3D10EffectConstantBuffer
*iface
,
3653 ID3D10ShaderResourceView
*view
)
3655 FIXME("iface %p, view %p stub!\n", iface
, view
);
3660 static HRESULT STDMETHODCALLTYPE
d3d10_effect_constant_buffer_GetTextureBuffer(ID3D10EffectConstantBuffer
*iface
,
3661 ID3D10ShaderResourceView
**view
)
3663 FIXME("iface %p, view %p stub!\n", iface
, view
);
3668 static const struct ID3D10EffectConstantBufferVtbl d3d10_effect_constant_buffer_vtbl
=
3670 /* ID3D10EffectVariable methods */
3671 d3d10_effect_constant_buffer_IsValid
,
3672 d3d10_effect_constant_buffer_GetType
,
3673 d3d10_effect_constant_buffer_GetDesc
,
3674 d3d10_effect_constant_buffer_GetAnnotationByIndex
,
3675 d3d10_effect_constant_buffer_GetAnnotationByName
,
3676 d3d10_effect_constant_buffer_GetMemberByIndex
,
3677 d3d10_effect_constant_buffer_GetMemberByName
,
3678 d3d10_effect_constant_buffer_GetMemberBySemantic
,
3679 d3d10_effect_constant_buffer_GetElement
,
3680 d3d10_effect_constant_buffer_GetParentConstantBuffer
,
3681 d3d10_effect_constant_buffer_AsScalar
,
3682 d3d10_effect_constant_buffer_AsVector
,
3683 d3d10_effect_constant_buffer_AsMatrix
,
3684 d3d10_effect_constant_buffer_AsString
,
3685 d3d10_effect_constant_buffer_AsShaderResource
,
3686 d3d10_effect_constant_buffer_AsRenderTargetView
,
3687 d3d10_effect_constant_buffer_AsDepthStencilView
,
3688 d3d10_effect_constant_buffer_AsConstantBuffer
,
3689 d3d10_effect_constant_buffer_AsShader
,
3690 d3d10_effect_constant_buffer_AsBlend
,
3691 d3d10_effect_constant_buffer_AsDepthStencil
,
3692 d3d10_effect_constant_buffer_AsRasterizer
,
3693 d3d10_effect_constant_buffer_AsSampler
,
3694 d3d10_effect_constant_buffer_SetRawValue
,
3695 d3d10_effect_constant_buffer_GetRawValue
,
3696 /* ID3D10EffectConstantBuffer methods */
3697 d3d10_effect_constant_buffer_SetConstantBuffer
,
3698 d3d10_effect_constant_buffer_GetConstantBuffer
,
3699 d3d10_effect_constant_buffer_SetTextureBuffer
,
3700 d3d10_effect_constant_buffer_GetTextureBuffer
,
3703 /* ID3D10EffectVariable methods */
3705 static BOOL STDMETHODCALLTYPE
d3d10_effect_scalar_variable_IsValid(ID3D10EffectScalarVariable
*iface
)
3707 TRACE("iface %p\n", iface
);
3709 return (struct d3d10_effect_variable
*)iface
!= &null_scalar_variable
;
3712 static struct ID3D10EffectType
* STDMETHODCALLTYPE
d3d10_effect_scalar_variable_GetType(
3713 ID3D10EffectScalarVariable
*iface
)
3715 return d3d10_effect_variable_GetType((ID3D10EffectVariable
*)iface
);
3718 static HRESULT STDMETHODCALLTYPE
d3d10_effect_scalar_variable_GetDesc(ID3D10EffectScalarVariable
*iface
,
3719 D3D10_EFFECT_VARIABLE_DESC
*desc
)
3721 return d3d10_effect_variable_GetDesc((ID3D10EffectVariable
*)iface
, desc
);
3724 static struct ID3D10EffectVariable
* STDMETHODCALLTYPE
d3d10_effect_scalar_variable_GetAnnotationByIndex(
3725 ID3D10EffectScalarVariable
*iface
, UINT index
)
3727 return d3d10_effect_variable_GetAnnotationByIndex((ID3D10EffectVariable
*)iface
, index
);
3730 static struct ID3D10EffectVariable
* STDMETHODCALLTYPE
d3d10_effect_scalar_variable_GetAnnotationByName(
3731 ID3D10EffectScalarVariable
*iface
, LPCSTR name
)
3733 return d3d10_effect_variable_GetAnnotationByName((ID3D10EffectVariable
*)iface
, name
);
3736 static struct ID3D10EffectVariable
* STDMETHODCALLTYPE
d3d10_effect_scalar_variable_GetMemberByIndex(
3737 ID3D10EffectScalarVariable
*iface
, UINT index
)
3739 return d3d10_effect_variable_GetMemberByIndex((ID3D10EffectVariable
*)iface
, index
);
3742 static struct ID3D10EffectVariable
* STDMETHODCALLTYPE
d3d10_effect_scalar_variable_GetMemberByName(
3743 ID3D10EffectScalarVariable
*iface
, LPCSTR name
)
3745 return d3d10_effect_variable_GetMemberByName((ID3D10EffectVariable
*)iface
, name
);
3748 static struct ID3D10EffectVariable
* STDMETHODCALLTYPE
d3d10_effect_scalar_variable_GetMemberBySemantic(
3749 ID3D10EffectScalarVariable
*iface
, LPCSTR semantic
)
3751 return d3d10_effect_variable_GetMemberBySemantic((ID3D10EffectVariable
*)iface
, semantic
);
3754 static struct ID3D10EffectVariable
* STDMETHODCALLTYPE
d3d10_effect_scalar_variable_GetElement(
3755 ID3D10EffectScalarVariable
*iface
, UINT index
)
3757 return d3d10_effect_variable_GetElement((ID3D10EffectVariable
*)iface
, index
);
3760 static struct ID3D10EffectConstantBuffer
* STDMETHODCALLTYPE
d3d10_effect_scalar_variable_GetParentConstantBuffer(
3761 ID3D10EffectScalarVariable
*iface
)
3763 return d3d10_effect_variable_GetParentConstantBuffer((ID3D10EffectVariable
*)iface
);
3766 static struct ID3D10EffectScalarVariable
* STDMETHODCALLTYPE
d3d10_effect_scalar_variable_AsScalar(
3767 ID3D10EffectScalarVariable
*iface
)
3769 return d3d10_effect_variable_AsScalar((ID3D10EffectVariable
*)iface
);
3772 static struct ID3D10EffectVectorVariable
* STDMETHODCALLTYPE
d3d10_effect_scalar_variable_AsVector(
3773 ID3D10EffectScalarVariable
*iface
)
3775 return d3d10_effect_variable_AsVector((ID3D10EffectVariable
*)iface
);
3778 static struct ID3D10EffectMatrixVariable
* STDMETHODCALLTYPE
d3d10_effect_scalar_variable_AsMatrix(
3779 ID3D10EffectScalarVariable
*iface
)
3781 return d3d10_effect_variable_AsMatrix((ID3D10EffectVariable
*)iface
);
3784 static struct ID3D10EffectStringVariable
* STDMETHODCALLTYPE
d3d10_effect_scalar_variable_AsString(
3785 ID3D10EffectScalarVariable
*iface
)
3787 return d3d10_effect_variable_AsString((ID3D10EffectVariable
*)iface
);
3790 static struct ID3D10EffectShaderResourceVariable
* STDMETHODCALLTYPE
d3d10_effect_scalar_variable_AsShaderResource(
3791 ID3D10EffectScalarVariable
*iface
)
3793 return d3d10_effect_variable_AsShaderResource((ID3D10EffectVariable
*)iface
);
3796 static struct ID3D10EffectRenderTargetViewVariable
* STDMETHODCALLTYPE
d3d10_effect_scalar_variable_AsRenderTargetView(
3797 ID3D10EffectScalarVariable
*iface
)
3799 return d3d10_effect_variable_AsRenderTargetView((ID3D10EffectVariable
*)iface
);
3802 static struct ID3D10EffectDepthStencilViewVariable
* STDMETHODCALLTYPE
d3d10_effect_scalar_variable_AsDepthStencilView(
3803 ID3D10EffectScalarVariable
*iface
)
3805 return d3d10_effect_variable_AsDepthStencilView((ID3D10EffectVariable
*)iface
);
3808 static struct ID3D10EffectConstantBuffer
* STDMETHODCALLTYPE
d3d10_effect_scalar_variable_AsConstantBuffer(
3809 ID3D10EffectScalarVariable
*iface
)
3811 return d3d10_effect_variable_AsConstantBuffer((ID3D10EffectVariable
*)iface
);
3814 static struct ID3D10EffectShaderVariable
* STDMETHODCALLTYPE
d3d10_effect_scalar_variable_AsShader(
3815 ID3D10EffectScalarVariable
*iface
)
3817 return d3d10_effect_variable_AsShader((ID3D10EffectVariable
*)iface
);
3820 static struct ID3D10EffectBlendVariable
* STDMETHODCALLTYPE
d3d10_effect_scalar_variable_AsBlend(
3821 ID3D10EffectScalarVariable
*iface
)
3823 return d3d10_effect_variable_AsBlend((ID3D10EffectVariable
*)iface
);
3826 static struct ID3D10EffectDepthStencilVariable
* STDMETHODCALLTYPE
d3d10_effect_scalar_variable_AsDepthStencil(
3827 ID3D10EffectScalarVariable
*iface
)
3829 return d3d10_effect_variable_AsDepthStencil((ID3D10EffectVariable
*)iface
);
3832 static struct ID3D10EffectRasterizerVariable
* STDMETHODCALLTYPE
d3d10_effect_scalar_variable_AsRasterizer(
3833 ID3D10EffectScalarVariable
*iface
)
3835 return d3d10_effect_variable_AsRasterizer((ID3D10EffectVariable
*)iface
);
3838 static struct ID3D10EffectSamplerVariable
* STDMETHODCALLTYPE
d3d10_effect_scalar_variable_AsSampler(
3839 ID3D10EffectScalarVariable
*iface
)
3841 return d3d10_effect_variable_AsSampler((ID3D10EffectVariable
*)iface
);
3844 static HRESULT STDMETHODCALLTYPE
d3d10_effect_scalar_variable_SetRawValue(ID3D10EffectScalarVariable
*iface
,
3845 void *data
, UINT offset
, UINT count
)
3847 return d3d10_effect_variable_SetRawValue((ID3D10EffectVariable
*)iface
, data
, offset
, count
);
3850 static HRESULT STDMETHODCALLTYPE
d3d10_effect_scalar_variable_GetRawValue(ID3D10EffectScalarVariable
*iface
,
3851 void *data
, UINT offset
, UINT count
)
3853 return d3d10_effect_variable_GetRawValue((ID3D10EffectVariable
*)iface
, data
, offset
, count
);
3856 /* ID3D10EffectScalarVariable methods */
3858 static HRESULT STDMETHODCALLTYPE
d3d10_effect_scalar_variable_SetFloat(ID3D10EffectScalarVariable
*iface
,
3861 FIXME("iface %p, value %.8e stub!\n", iface
, value
);
3866 static HRESULT STDMETHODCALLTYPE
d3d10_effect_scalar_variable_GetFloat(ID3D10EffectScalarVariable
*iface
,
3869 FIXME("iface %p, value %p stub!\n", iface
, value
);
3874 static HRESULT STDMETHODCALLTYPE
d3d10_effect_scalar_variable_SetFloatArray(ID3D10EffectScalarVariable
*iface
,
3875 float *values
, UINT offset
, UINT count
)
3877 FIXME("iface %p, values %p, offset %u, count %u stub!\n", iface
, values
, offset
, count
);
3882 static HRESULT STDMETHODCALLTYPE
d3d10_effect_scalar_variable_GetFloatArray(ID3D10EffectScalarVariable
*iface
,
3883 float *values
, UINT offset
, UINT count
)
3885 FIXME("iface %p, values %p, offset %u, count %u stub!\n", iface
, values
, offset
, count
);
3890 static HRESULT STDMETHODCALLTYPE
d3d10_effect_scalar_variable_SetInt(ID3D10EffectScalarVariable
*iface
,
3893 FIXME("iface %p, value %d stub!\n", iface
, value
);
3898 static HRESULT STDMETHODCALLTYPE
d3d10_effect_scalar_variable_GetInt(ID3D10EffectScalarVariable
*iface
,
3901 FIXME("iface %p, value %p stub!\n", iface
, value
);
3906 static HRESULT STDMETHODCALLTYPE
d3d10_effect_scalar_variable_SetIntArray(ID3D10EffectScalarVariable
*iface
,
3907 int *values
, UINT offset
, UINT count
)
3909 FIXME("iface %p, values %p, offset %u, count %u stub!\n", iface
, values
, offset
, count
);
3914 static HRESULT STDMETHODCALLTYPE
d3d10_effect_scalar_variable_GetIntArray(ID3D10EffectScalarVariable
*iface
,
3915 int *values
, UINT offset
, UINT count
)
3917 FIXME("iface %p, values %p, offset %u, count %u stub!\n", iface
, values
, offset
, count
);
3922 static HRESULT STDMETHODCALLTYPE
d3d10_effect_scalar_variable_SetBool(ID3D10EffectScalarVariable
*iface
,
3925 FIXME("iface %p, value %d stub!\n", iface
, value
);
3930 static HRESULT STDMETHODCALLTYPE
d3d10_effect_scalar_variable_GetBool(ID3D10EffectScalarVariable
*iface
,
3933 FIXME("iface %p, value %p stub!\n", iface
, value
);
3938 static HRESULT STDMETHODCALLTYPE
d3d10_effect_scalar_variable_SetBoolArray(ID3D10EffectScalarVariable
*iface
,
3939 BOOL
*values
, UINT offset
, UINT count
)
3941 FIXME("iface %p, values %p, offset %u, count %u stub!\n", iface
, values
, offset
, count
);
3946 static HRESULT STDMETHODCALLTYPE
d3d10_effect_scalar_variable_GetBoolArray(ID3D10EffectScalarVariable
*iface
,
3947 BOOL
*values
, UINT offset
, UINT count
)
3949 FIXME("iface %p, values %p, offset %u, count %u stub!\n", iface
, values
, offset
, count
);
3954 static const struct ID3D10EffectScalarVariableVtbl d3d10_effect_scalar_variable_vtbl
=
3956 /* ID3D10EffectVariable methods */
3957 d3d10_effect_scalar_variable_IsValid
,
3958 d3d10_effect_scalar_variable_GetType
,
3959 d3d10_effect_scalar_variable_GetDesc
,
3960 d3d10_effect_scalar_variable_GetAnnotationByIndex
,
3961 d3d10_effect_scalar_variable_GetAnnotationByName
,
3962 d3d10_effect_scalar_variable_GetMemberByIndex
,
3963 d3d10_effect_scalar_variable_GetMemberByName
,
3964 d3d10_effect_scalar_variable_GetMemberBySemantic
,
3965 d3d10_effect_scalar_variable_GetElement
,
3966 d3d10_effect_scalar_variable_GetParentConstantBuffer
,
3967 d3d10_effect_scalar_variable_AsScalar
,
3968 d3d10_effect_scalar_variable_AsVector
,
3969 d3d10_effect_scalar_variable_AsMatrix
,
3970 d3d10_effect_scalar_variable_AsString
,
3971 d3d10_effect_scalar_variable_AsShaderResource
,
3972 d3d10_effect_scalar_variable_AsRenderTargetView
,
3973 d3d10_effect_scalar_variable_AsDepthStencilView
,
3974 d3d10_effect_scalar_variable_AsConstantBuffer
,
3975 d3d10_effect_scalar_variable_AsShader
,
3976 d3d10_effect_scalar_variable_AsBlend
,
3977 d3d10_effect_scalar_variable_AsDepthStencil
,
3978 d3d10_effect_scalar_variable_AsRasterizer
,
3979 d3d10_effect_scalar_variable_AsSampler
,
3980 d3d10_effect_scalar_variable_SetRawValue
,
3981 d3d10_effect_scalar_variable_GetRawValue
,
3982 /* ID3D10EffectScalarVariable methods */
3983 d3d10_effect_scalar_variable_SetFloat
,
3984 d3d10_effect_scalar_variable_GetFloat
,
3985 d3d10_effect_scalar_variable_SetFloatArray
,
3986 d3d10_effect_scalar_variable_GetFloatArray
,
3987 d3d10_effect_scalar_variable_SetInt
,
3988 d3d10_effect_scalar_variable_GetInt
,
3989 d3d10_effect_scalar_variable_SetIntArray
,
3990 d3d10_effect_scalar_variable_GetIntArray
,
3991 d3d10_effect_scalar_variable_SetBool
,
3992 d3d10_effect_scalar_variable_GetBool
,
3993 d3d10_effect_scalar_variable_SetBoolArray
,
3994 d3d10_effect_scalar_variable_GetBoolArray
,
3997 /* ID3D10EffectVariable methods */
3999 static BOOL STDMETHODCALLTYPE
d3d10_effect_vector_variable_IsValid(ID3D10EffectVectorVariable
*iface
)
4001 TRACE("iface %p\n", iface
);
4003 return (struct d3d10_effect_variable
*)iface
!= &null_vector_variable
;
4006 static struct ID3D10EffectType
* STDMETHODCALLTYPE
d3d10_effect_vector_variable_GetType(
4007 ID3D10EffectVectorVariable
*iface
)
4009 return d3d10_effect_variable_GetType((ID3D10EffectVariable
*)iface
);
4012 static HRESULT STDMETHODCALLTYPE
d3d10_effect_vector_variable_GetDesc(ID3D10EffectVectorVariable
*iface
,
4013 D3D10_EFFECT_VARIABLE_DESC
*desc
)
4015 return d3d10_effect_variable_GetDesc((ID3D10EffectVariable
*)iface
, desc
);
4018 static struct ID3D10EffectVariable
* STDMETHODCALLTYPE
d3d10_effect_vector_variable_GetAnnotationByIndex(
4019 ID3D10EffectVectorVariable
*iface
, UINT index
)
4021 return d3d10_effect_variable_GetAnnotationByIndex((ID3D10EffectVariable
*)iface
, index
);
4024 static struct ID3D10EffectVariable
* STDMETHODCALLTYPE
d3d10_effect_vector_variable_GetAnnotationByName(
4025 ID3D10EffectVectorVariable
*iface
, LPCSTR name
)
4027 return d3d10_effect_variable_GetAnnotationByName((ID3D10EffectVariable
*)iface
, name
);
4030 static struct ID3D10EffectVariable
* STDMETHODCALLTYPE
d3d10_effect_vector_variable_GetMemberByIndex(
4031 ID3D10EffectVectorVariable
*iface
, UINT index
)
4033 return d3d10_effect_variable_GetMemberByIndex((ID3D10EffectVariable
*)iface
, index
);
4036 static struct ID3D10EffectVariable
* STDMETHODCALLTYPE
d3d10_effect_vector_variable_GetMemberByName(
4037 ID3D10EffectVectorVariable
*iface
, LPCSTR name
)
4039 return d3d10_effect_variable_GetMemberByName((ID3D10EffectVariable
*)iface
, name
);
4042 static struct ID3D10EffectVariable
* STDMETHODCALLTYPE
d3d10_effect_vector_variable_GetMemberBySemantic(
4043 ID3D10EffectVectorVariable
*iface
, LPCSTR semantic
)
4045 return d3d10_effect_variable_GetMemberBySemantic((ID3D10EffectVariable
*)iface
, semantic
);
4048 static struct ID3D10EffectVariable
* STDMETHODCALLTYPE
d3d10_effect_vector_variable_GetElement(
4049 ID3D10EffectVectorVariable
*iface
, UINT index
)
4051 return d3d10_effect_variable_GetElement((ID3D10EffectVariable
*)iface
, index
);
4054 static struct ID3D10EffectConstantBuffer
* STDMETHODCALLTYPE
d3d10_effect_vector_variable_GetParentConstantBuffer(
4055 ID3D10EffectVectorVariable
*iface
)
4057 return d3d10_effect_variable_GetParentConstantBuffer((ID3D10EffectVariable
*)iface
);
4060 static struct ID3D10EffectScalarVariable
* STDMETHODCALLTYPE
d3d10_effect_vector_variable_AsScalar(
4061 ID3D10EffectVectorVariable
*iface
)
4063 return d3d10_effect_variable_AsScalar((ID3D10EffectVariable
*)iface
);
4066 static struct ID3D10EffectVectorVariable
* STDMETHODCALLTYPE
d3d10_effect_vector_variable_AsVector(
4067 ID3D10EffectVectorVariable
*iface
)
4069 return d3d10_effect_variable_AsVector((ID3D10EffectVariable
*)iface
);
4072 static struct ID3D10EffectMatrixVariable
* STDMETHODCALLTYPE
d3d10_effect_vector_variable_AsMatrix(
4073 ID3D10EffectVectorVariable
*iface
)
4075 return d3d10_effect_variable_AsMatrix((ID3D10EffectVariable
*)iface
);
4078 static struct ID3D10EffectStringVariable
* STDMETHODCALLTYPE
d3d10_effect_vector_variable_AsString(
4079 ID3D10EffectVectorVariable
*iface
)
4081 return d3d10_effect_variable_AsString((ID3D10EffectVariable
*)iface
);
4084 static struct ID3D10EffectShaderResourceVariable
* STDMETHODCALLTYPE
d3d10_effect_vector_variable_AsShaderResource(
4085 ID3D10EffectVectorVariable
*iface
)
4087 return d3d10_effect_variable_AsShaderResource((ID3D10EffectVariable
*)iface
);
4090 static struct ID3D10EffectRenderTargetViewVariable
* STDMETHODCALLTYPE
d3d10_effect_vector_variable_AsRenderTargetView(
4091 ID3D10EffectVectorVariable
*iface
)
4093 return d3d10_effect_variable_AsRenderTargetView((ID3D10EffectVariable
*)iface
);
4096 static struct ID3D10EffectDepthStencilViewVariable
* STDMETHODCALLTYPE
d3d10_effect_vector_variable_AsDepthStencilView(
4097 ID3D10EffectVectorVariable
*iface
)
4099 return d3d10_effect_variable_AsDepthStencilView((ID3D10EffectVariable
*)iface
);
4102 static struct ID3D10EffectConstantBuffer
* STDMETHODCALLTYPE
d3d10_effect_vector_variable_AsConstantBuffer(
4103 ID3D10EffectVectorVariable
*iface
)
4105 return d3d10_effect_variable_AsConstantBuffer((ID3D10EffectVariable
*)iface
);
4108 static struct ID3D10EffectShaderVariable
* STDMETHODCALLTYPE
d3d10_effect_vector_variable_AsShader(
4109 ID3D10EffectVectorVariable
*iface
)
4111 return d3d10_effect_variable_AsShader((ID3D10EffectVariable
*)iface
);
4114 static struct ID3D10EffectBlendVariable
* STDMETHODCALLTYPE
d3d10_effect_vector_variable_AsBlend(
4115 ID3D10EffectVectorVariable
*iface
)
4117 return d3d10_effect_variable_AsBlend((ID3D10EffectVariable
*)iface
);
4120 static struct ID3D10EffectDepthStencilVariable
* STDMETHODCALLTYPE
d3d10_effect_vector_variable_AsDepthStencil(
4121 ID3D10EffectVectorVariable
*iface
)
4123 return d3d10_effect_variable_AsDepthStencil((ID3D10EffectVariable
*)iface
);
4126 static struct ID3D10EffectRasterizerVariable
* STDMETHODCALLTYPE
d3d10_effect_vector_variable_AsRasterizer(
4127 ID3D10EffectVectorVariable
*iface
)
4129 return d3d10_effect_variable_AsRasterizer((ID3D10EffectVariable
*)iface
);
4132 static struct ID3D10EffectSamplerVariable
* STDMETHODCALLTYPE
d3d10_effect_vector_variable_AsSampler(
4133 ID3D10EffectVectorVariable
*iface
)
4135 return d3d10_effect_variable_AsSampler((ID3D10EffectVariable
*)iface
);
4138 static HRESULT STDMETHODCALLTYPE
d3d10_effect_vector_variable_SetRawValue(ID3D10EffectVectorVariable
*iface
,
4139 void *data
, UINT offset
, UINT count
)
4141 return d3d10_effect_variable_SetRawValue((ID3D10EffectVariable
*)iface
, data
, offset
, count
);
4144 static HRESULT STDMETHODCALLTYPE
d3d10_effect_vector_variable_GetRawValue(ID3D10EffectVectorVariable
*iface
,
4145 void *data
, UINT offset
, UINT count
)
4147 return d3d10_effect_variable_GetRawValue((ID3D10EffectVariable
*)iface
, data
, offset
, count
);
4150 /* ID3D10EffectVectorVariable methods */
4152 static HRESULT STDMETHODCALLTYPE
d3d10_effect_vector_variable_SetBoolVector(ID3D10EffectVectorVariable
*iface
,
4155 FIXME("iface %p, value %p stub!\n", iface
, value
);
4160 static HRESULT STDMETHODCALLTYPE
d3d10_effect_vector_variable_SetIntVector(ID3D10EffectVectorVariable
*iface
,
4163 FIXME("iface %p, value %p stub!\n", iface
, value
);
4168 static HRESULT STDMETHODCALLTYPE
d3d10_effect_vector_variable_SetFloatVector(ID3D10EffectVectorVariable
*iface
,
4171 FIXME("iface %p, value %p stub!\n", iface
, value
);
4176 static HRESULT STDMETHODCALLTYPE
d3d10_effect_vector_variable_GetBoolVector(ID3D10EffectVectorVariable
*iface
,
4179 FIXME("iface %p, value %p stub!\n", iface
, value
);
4184 static HRESULT STDMETHODCALLTYPE
d3d10_effect_vector_variable_GetIntVector(ID3D10EffectVectorVariable
*iface
,
4187 FIXME("iface %p, value %p stub!\n", iface
, value
);
4192 static HRESULT STDMETHODCALLTYPE
d3d10_effect_vector_variable_GetFloatVector(ID3D10EffectVectorVariable
*iface
,
4195 FIXME("iface %p, value %p stub!\n", iface
, value
);
4200 static HRESULT STDMETHODCALLTYPE
d3d10_effect_vector_variable_SetBoolVectorArray(ID3D10EffectVectorVariable
*iface
,
4201 BOOL
*values
, UINT offset
, UINT count
)
4203 FIXME("iface %p, values %p, offset %u, count %u stub!\n", iface
, values
, offset
, count
);
4208 static HRESULT STDMETHODCALLTYPE
d3d10_effect_vector_variable_SetIntVectorArray(ID3D10EffectVectorVariable
*iface
,
4209 int *values
, UINT offset
, UINT count
)
4211 FIXME("iface %p, values %p, offset %u, count %u stub!\n", iface
, values
, offset
, count
);
4216 static HRESULT STDMETHODCALLTYPE
d3d10_effect_vector_variable_SetFloatVectorArray(ID3D10EffectVectorVariable
*iface
,
4217 float *values
, UINT offset
, UINT count
)
4219 FIXME("iface %p, values %p, offset %u, count %u stub!\n", iface
, values
, offset
, count
);
4224 static HRESULT STDMETHODCALLTYPE
d3d10_effect_vector_variable_GetBoolVectorArray(ID3D10EffectVectorVariable
*iface
,
4225 BOOL
*values
, UINT offset
, UINT count
)
4227 FIXME("iface %p, values %p, offset %u, count %u stub!\n", iface
, values
, offset
, count
);
4232 static HRESULT STDMETHODCALLTYPE
d3d10_effect_vector_variable_GetIntVectorArray(ID3D10EffectVectorVariable
*iface
,
4233 int *values
, UINT offset
, UINT count
)
4235 FIXME("iface %p, values %p, offset %u, count %u stub!\n", iface
, values
, offset
, count
);
4240 static HRESULT STDMETHODCALLTYPE
d3d10_effect_vector_variable_GetFloatVectorArray(ID3D10EffectVectorVariable
*iface
,
4241 float *values
, UINT offset
, UINT count
)
4243 FIXME("iface %p, values %p, offset %u, count %u stub!\n", iface
, values
, offset
, count
);
4248 static const struct ID3D10EffectVectorVariableVtbl d3d10_effect_vector_variable_vtbl
=
4250 /* ID3D10EffectVariable methods */
4251 d3d10_effect_vector_variable_IsValid
,
4252 d3d10_effect_vector_variable_GetType
,
4253 d3d10_effect_vector_variable_GetDesc
,
4254 d3d10_effect_vector_variable_GetAnnotationByIndex
,
4255 d3d10_effect_vector_variable_GetAnnotationByName
,
4256 d3d10_effect_vector_variable_GetMemberByIndex
,
4257 d3d10_effect_vector_variable_GetMemberByName
,
4258 d3d10_effect_vector_variable_GetMemberBySemantic
,
4259 d3d10_effect_vector_variable_GetElement
,
4260 d3d10_effect_vector_variable_GetParentConstantBuffer
,
4261 d3d10_effect_vector_variable_AsScalar
,
4262 d3d10_effect_vector_variable_AsVector
,
4263 d3d10_effect_vector_variable_AsMatrix
,
4264 d3d10_effect_vector_variable_AsString
,
4265 d3d10_effect_vector_variable_AsShaderResource
,
4266 d3d10_effect_vector_variable_AsRenderTargetView
,
4267 d3d10_effect_vector_variable_AsDepthStencilView
,
4268 d3d10_effect_vector_variable_AsConstantBuffer
,
4269 d3d10_effect_vector_variable_AsShader
,
4270 d3d10_effect_vector_variable_AsBlend
,
4271 d3d10_effect_vector_variable_AsDepthStencil
,
4272 d3d10_effect_vector_variable_AsRasterizer
,
4273 d3d10_effect_vector_variable_AsSampler
,
4274 d3d10_effect_vector_variable_SetRawValue
,
4275 d3d10_effect_vector_variable_GetRawValue
,
4276 /* ID3D10EffectVectorVariable methods */
4277 d3d10_effect_vector_variable_SetBoolVector
,
4278 d3d10_effect_vector_variable_SetIntVector
,
4279 d3d10_effect_vector_variable_SetFloatVector
,
4280 d3d10_effect_vector_variable_GetBoolVector
,
4281 d3d10_effect_vector_variable_GetIntVector
,
4282 d3d10_effect_vector_variable_GetFloatVector
,
4283 d3d10_effect_vector_variable_SetBoolVectorArray
,
4284 d3d10_effect_vector_variable_SetIntVectorArray
,
4285 d3d10_effect_vector_variable_SetFloatVectorArray
,
4286 d3d10_effect_vector_variable_GetBoolVectorArray
,
4287 d3d10_effect_vector_variable_GetIntVectorArray
,
4288 d3d10_effect_vector_variable_GetFloatVectorArray
,
4291 /* ID3D10EffectVariable methods */
4293 static BOOL STDMETHODCALLTYPE
d3d10_effect_matrix_variable_IsValid(ID3D10EffectMatrixVariable
*iface
)
4295 TRACE("iface %p\n", iface
);
4297 return (struct d3d10_effect_variable
*)iface
!= &null_matrix_variable
;
4300 static struct ID3D10EffectType
* STDMETHODCALLTYPE
d3d10_effect_matrix_variable_GetType(
4301 ID3D10EffectMatrixVariable
*iface
)
4303 return d3d10_effect_variable_GetType((ID3D10EffectVariable
*)iface
);
4306 static HRESULT STDMETHODCALLTYPE
d3d10_effect_matrix_variable_GetDesc(ID3D10EffectMatrixVariable
*iface
,
4307 D3D10_EFFECT_VARIABLE_DESC
*desc
)
4309 return d3d10_effect_variable_GetDesc((ID3D10EffectVariable
*)iface
, desc
);
4312 static struct ID3D10EffectVariable
* STDMETHODCALLTYPE
d3d10_effect_matrix_variable_GetAnnotationByIndex(
4313 ID3D10EffectMatrixVariable
*iface
, UINT index
)
4315 return d3d10_effect_variable_GetAnnotationByIndex((ID3D10EffectVariable
*)iface
, index
);
4318 static struct ID3D10EffectVariable
* STDMETHODCALLTYPE
d3d10_effect_matrix_variable_GetAnnotationByName(
4319 ID3D10EffectMatrixVariable
*iface
, LPCSTR name
)
4321 return d3d10_effect_variable_GetAnnotationByName((ID3D10EffectVariable
*)iface
, name
);
4324 static struct ID3D10EffectVariable
* STDMETHODCALLTYPE
d3d10_effect_matrix_variable_GetMemberByIndex(
4325 ID3D10EffectMatrixVariable
*iface
, UINT index
)
4327 return d3d10_effect_variable_GetMemberByIndex((ID3D10EffectVariable
*)iface
, index
);
4330 static struct ID3D10EffectVariable
* STDMETHODCALLTYPE
d3d10_effect_matrix_variable_GetMemberByName(
4331 ID3D10EffectMatrixVariable
*iface
, LPCSTR name
)
4333 return d3d10_effect_variable_GetMemberByName((ID3D10EffectVariable
*)iface
, name
);
4336 static struct ID3D10EffectVariable
* STDMETHODCALLTYPE
d3d10_effect_matrix_variable_GetMemberBySemantic(
4337 ID3D10EffectMatrixVariable
*iface
, LPCSTR semantic
)
4339 return d3d10_effect_variable_GetMemberBySemantic((ID3D10EffectVariable
*)iface
, semantic
);
4342 static struct ID3D10EffectVariable
* STDMETHODCALLTYPE
d3d10_effect_matrix_variable_GetElement(
4343 ID3D10EffectMatrixVariable
*iface
, UINT index
)
4345 return d3d10_effect_variable_GetElement((ID3D10EffectVariable
*)iface
, index
);
4348 static struct ID3D10EffectConstantBuffer
* STDMETHODCALLTYPE
d3d10_effect_matrix_variable_GetParentConstantBuffer(
4349 ID3D10EffectMatrixVariable
*iface
)
4351 return d3d10_effect_variable_GetParentConstantBuffer((ID3D10EffectVariable
*)iface
);
4354 static struct ID3D10EffectScalarVariable
* STDMETHODCALLTYPE
d3d10_effect_matrix_variable_AsScalar(
4355 ID3D10EffectMatrixVariable
*iface
)
4357 return d3d10_effect_variable_AsScalar((ID3D10EffectVariable
*)iface
);
4360 static struct ID3D10EffectVectorVariable
* STDMETHODCALLTYPE
d3d10_effect_matrix_variable_AsVector(
4361 ID3D10EffectMatrixVariable
*iface
)
4363 return d3d10_effect_variable_AsVector((ID3D10EffectVariable
*)iface
);
4366 static struct ID3D10EffectMatrixVariable
* STDMETHODCALLTYPE
d3d10_effect_matrix_variable_AsMatrix(
4367 ID3D10EffectMatrixVariable
*iface
)
4369 return d3d10_effect_variable_AsMatrix((ID3D10EffectVariable
*)iface
);
4372 static struct ID3D10EffectStringVariable
* STDMETHODCALLTYPE
d3d10_effect_matrix_variable_AsString(
4373 ID3D10EffectMatrixVariable
*iface
)
4375 return d3d10_effect_variable_AsString((ID3D10EffectVariable
*)iface
);
4378 static struct ID3D10EffectShaderResourceVariable
* STDMETHODCALLTYPE
d3d10_effect_matrix_variable_AsShaderResource(
4379 ID3D10EffectMatrixVariable
*iface
)
4381 return d3d10_effect_variable_AsShaderResource((ID3D10EffectVariable
*)iface
);
4384 static struct ID3D10EffectRenderTargetViewVariable
* STDMETHODCALLTYPE
d3d10_effect_matrix_variable_AsRenderTargetView(
4385 ID3D10EffectMatrixVariable
*iface
)
4387 return d3d10_effect_variable_AsRenderTargetView((ID3D10EffectVariable
*)iface
);
4390 static struct ID3D10EffectDepthStencilViewVariable
* STDMETHODCALLTYPE
d3d10_effect_matrix_variable_AsDepthStencilView(
4391 ID3D10EffectMatrixVariable
*iface
)
4393 return d3d10_effect_variable_AsDepthStencilView((ID3D10EffectVariable
*)iface
);
4396 static struct ID3D10EffectConstantBuffer
* STDMETHODCALLTYPE
d3d10_effect_matrix_variable_AsConstantBuffer(
4397 ID3D10EffectMatrixVariable
*iface
)
4399 return d3d10_effect_variable_AsConstantBuffer((ID3D10EffectVariable
*)iface
);
4402 static struct ID3D10EffectShaderVariable
* STDMETHODCALLTYPE
d3d10_effect_matrix_variable_AsShader(
4403 ID3D10EffectMatrixVariable
*iface
)
4405 return d3d10_effect_variable_AsShader((ID3D10EffectVariable
*)iface
);
4408 static struct ID3D10EffectBlendVariable
* STDMETHODCALLTYPE
d3d10_effect_matrix_variable_AsBlend(
4409 ID3D10EffectMatrixVariable
*iface
)
4411 return d3d10_effect_variable_AsBlend((ID3D10EffectVariable
*)iface
);
4414 static struct ID3D10EffectDepthStencilVariable
* STDMETHODCALLTYPE
d3d10_effect_matrix_variable_AsDepthStencil(
4415 ID3D10EffectMatrixVariable
*iface
)
4417 return d3d10_effect_variable_AsDepthStencil((ID3D10EffectVariable
*)iface
);
4420 static struct ID3D10EffectRasterizerVariable
* STDMETHODCALLTYPE
d3d10_effect_matrix_variable_AsRasterizer(
4421 ID3D10EffectMatrixVariable
*iface
)
4423 return d3d10_effect_variable_AsRasterizer((ID3D10EffectVariable
*)iface
);
4426 static struct ID3D10EffectSamplerVariable
* STDMETHODCALLTYPE
d3d10_effect_matrix_variable_AsSampler(
4427 ID3D10EffectMatrixVariable
*iface
)
4429 return d3d10_effect_variable_AsSampler((ID3D10EffectVariable
*)iface
);
4432 static HRESULT STDMETHODCALLTYPE
d3d10_effect_matrix_variable_SetRawValue(ID3D10EffectMatrixVariable
*iface
,
4433 void *data
, UINT offset
, UINT count
)
4435 return d3d10_effect_variable_SetRawValue((ID3D10EffectVariable
*)iface
, data
, offset
, count
);
4438 static HRESULT STDMETHODCALLTYPE
d3d10_effect_matrix_variable_GetRawValue(ID3D10EffectMatrixVariable
*iface
,
4439 void *data
, UINT offset
, UINT count
)
4441 return d3d10_effect_variable_GetRawValue((ID3D10EffectVariable
*)iface
, data
, offset
, count
);
4444 /* ID3D10EffectMatrixVariable methods */
4446 static HRESULT STDMETHODCALLTYPE
d3d10_effect_matrix_variable_SetMatrix(ID3D10EffectMatrixVariable
*iface
,
4449 FIXME("iface %p, data %p stub!\n", iface
, data
);
4454 static HRESULT STDMETHODCALLTYPE
d3d10_effect_matrix_variable_GetMatrix(ID3D10EffectMatrixVariable
*iface
,
4457 FIXME("iface %p, data %p stub!\n", iface
, data
);
4462 static HRESULT STDMETHODCALLTYPE
d3d10_effect_matrix_variable_SetMatrixArray(ID3D10EffectMatrixVariable
*iface
,
4463 float *data
, UINT offset
, UINT count
)
4465 FIXME("iface %p, data %p, offset %u, count %u stub!\n", iface
, data
, offset
, count
);
4470 static HRESULT STDMETHODCALLTYPE
d3d10_effect_matrix_variable_GetMatrixArray(ID3D10EffectMatrixVariable
*iface
,
4471 float *data
, UINT offset
, UINT count
)
4473 FIXME("iface %p, data %p, offset %u, count %u stub!\n", iface
, data
, offset
, count
);
4478 static HRESULT STDMETHODCALLTYPE
d3d10_effect_matrix_variable_SetMatrixTranspose(ID3D10EffectMatrixVariable
*iface
,
4481 FIXME("iface %p, data %p stub!\n", iface
, data
);
4486 static HRESULT STDMETHODCALLTYPE
d3d10_effect_matrix_variable_GetMatrixTranspose(ID3D10EffectMatrixVariable
*iface
,
4489 FIXME("iface %p, data %p stub!\n", iface
, data
);
4494 static HRESULT STDMETHODCALLTYPE
d3d10_effect_matrix_variable_SetMatrixTransposeArray(ID3D10EffectMatrixVariable
*iface
,
4495 float *data
, UINT offset
, UINT count
)
4497 FIXME("iface %p, data %p, offset %u, count %u stub!\n", iface
, data
, offset
, count
);
4502 static HRESULT STDMETHODCALLTYPE
d3d10_effect_matrix_variable_GetMatrixTransposeArray(ID3D10EffectMatrixVariable
*iface
,
4503 float *data
, UINT offset
, UINT count
)
4505 FIXME("iface %p, data %p, offset %u, count %u stub!\n", iface
, data
, offset
, count
);
4511 static const struct ID3D10EffectMatrixVariableVtbl d3d10_effect_matrix_variable_vtbl
=
4513 /* ID3D10EffectVariable methods */
4514 d3d10_effect_matrix_variable_IsValid
,
4515 d3d10_effect_matrix_variable_GetType
,
4516 d3d10_effect_matrix_variable_GetDesc
,
4517 d3d10_effect_matrix_variable_GetAnnotationByIndex
,
4518 d3d10_effect_matrix_variable_GetAnnotationByName
,
4519 d3d10_effect_matrix_variable_GetMemberByIndex
,
4520 d3d10_effect_matrix_variable_GetMemberByName
,
4521 d3d10_effect_matrix_variable_GetMemberBySemantic
,
4522 d3d10_effect_matrix_variable_GetElement
,
4523 d3d10_effect_matrix_variable_GetParentConstantBuffer
,
4524 d3d10_effect_matrix_variable_AsScalar
,
4525 d3d10_effect_matrix_variable_AsVector
,
4526 d3d10_effect_matrix_variable_AsMatrix
,
4527 d3d10_effect_matrix_variable_AsString
,
4528 d3d10_effect_matrix_variable_AsShaderResource
,
4529 d3d10_effect_matrix_variable_AsRenderTargetView
,
4530 d3d10_effect_matrix_variable_AsDepthStencilView
,
4531 d3d10_effect_matrix_variable_AsConstantBuffer
,
4532 d3d10_effect_matrix_variable_AsShader
,
4533 d3d10_effect_matrix_variable_AsBlend
,
4534 d3d10_effect_matrix_variable_AsDepthStencil
,
4535 d3d10_effect_matrix_variable_AsRasterizer
,
4536 d3d10_effect_matrix_variable_AsSampler
,
4537 d3d10_effect_matrix_variable_SetRawValue
,
4538 d3d10_effect_matrix_variable_GetRawValue
,
4539 /* ID3D10EffectMatrixVariable methods */
4540 d3d10_effect_matrix_variable_SetMatrix
,
4541 d3d10_effect_matrix_variable_GetMatrix
,
4542 d3d10_effect_matrix_variable_SetMatrixArray
,
4543 d3d10_effect_matrix_variable_GetMatrixArray
,
4544 d3d10_effect_matrix_variable_SetMatrixTranspose
,
4545 d3d10_effect_matrix_variable_GetMatrixTranspose
,
4546 d3d10_effect_matrix_variable_SetMatrixTransposeArray
,
4547 d3d10_effect_matrix_variable_GetMatrixTransposeArray
,
4550 /* ID3D10EffectVariable methods */
4552 static BOOL STDMETHODCALLTYPE
d3d10_effect_string_variable_IsValid(ID3D10EffectStringVariable
*iface
)
4554 TRACE("iface %p\n", iface
);
4556 return (struct d3d10_effect_variable
*)iface
!= &null_string_variable
;
4559 static struct ID3D10EffectType
* STDMETHODCALLTYPE
d3d10_effect_string_variable_GetType(
4560 ID3D10EffectStringVariable
*iface
)
4562 return d3d10_effect_variable_GetType((ID3D10EffectVariable
*)iface
);
4565 static HRESULT STDMETHODCALLTYPE
d3d10_effect_string_variable_GetDesc(ID3D10EffectStringVariable
*iface
,
4566 D3D10_EFFECT_VARIABLE_DESC
*desc
)
4568 return d3d10_effect_variable_GetDesc((ID3D10EffectVariable
*)iface
, desc
);
4571 static struct ID3D10EffectVariable
* STDMETHODCALLTYPE
d3d10_effect_string_variable_GetAnnotationByIndex(
4572 ID3D10EffectStringVariable
*iface
, UINT index
)
4574 return d3d10_effect_variable_GetAnnotationByIndex((ID3D10EffectVariable
*)iface
, index
);
4577 static struct ID3D10EffectVariable
* STDMETHODCALLTYPE
d3d10_effect_string_variable_GetAnnotationByName(
4578 ID3D10EffectStringVariable
*iface
, LPCSTR name
)
4580 return d3d10_effect_variable_GetAnnotationByName((ID3D10EffectVariable
*)iface
, name
);
4583 static struct ID3D10EffectVariable
* STDMETHODCALLTYPE
d3d10_effect_string_variable_GetMemberByIndex(
4584 ID3D10EffectStringVariable
*iface
, UINT index
)
4586 return d3d10_effect_variable_GetMemberByIndex((ID3D10EffectVariable
*)iface
, index
);
4589 static struct ID3D10EffectVariable
* STDMETHODCALLTYPE
d3d10_effect_string_variable_GetMemberByName(
4590 ID3D10EffectStringVariable
*iface
, LPCSTR name
)
4592 return d3d10_effect_variable_GetMemberByName((ID3D10EffectVariable
*)iface
, name
);
4595 static struct ID3D10EffectVariable
* STDMETHODCALLTYPE
d3d10_effect_string_variable_GetMemberBySemantic(
4596 ID3D10EffectStringVariable
*iface
, LPCSTR semantic
)
4598 return d3d10_effect_variable_GetMemberBySemantic((ID3D10EffectVariable
*)iface
, semantic
);
4601 static struct ID3D10EffectVariable
* STDMETHODCALLTYPE
d3d10_effect_string_variable_GetElement(
4602 ID3D10EffectStringVariable
*iface
, UINT index
)
4604 return d3d10_effect_variable_GetElement((ID3D10EffectVariable
*)iface
, index
);
4607 static struct ID3D10EffectConstantBuffer
* STDMETHODCALLTYPE
d3d10_effect_string_variable_GetParentConstantBuffer(
4608 ID3D10EffectStringVariable
*iface
)
4610 return d3d10_effect_variable_GetParentConstantBuffer((ID3D10EffectVariable
*)iface
);
4613 static struct ID3D10EffectScalarVariable
* STDMETHODCALLTYPE
d3d10_effect_string_variable_AsScalar(
4614 ID3D10EffectStringVariable
*iface
)
4616 return d3d10_effect_variable_AsScalar((ID3D10EffectVariable
*)iface
);
4619 static struct ID3D10EffectVectorVariable
* STDMETHODCALLTYPE
d3d10_effect_string_variable_AsVector(
4620 ID3D10EffectStringVariable
*iface
)
4622 return d3d10_effect_variable_AsVector((ID3D10EffectVariable
*)iface
);
4625 static struct ID3D10EffectMatrixVariable
* STDMETHODCALLTYPE
d3d10_effect_string_variable_AsMatrix(
4626 ID3D10EffectStringVariable
*iface
)
4628 return d3d10_effect_variable_AsMatrix((ID3D10EffectVariable
*)iface
);
4631 static struct ID3D10EffectStringVariable
* STDMETHODCALLTYPE
d3d10_effect_string_variable_AsString(
4632 ID3D10EffectStringVariable
*iface
)
4634 return d3d10_effect_variable_AsString((ID3D10EffectVariable
*)iface
);
4637 static struct ID3D10EffectShaderResourceVariable
* STDMETHODCALLTYPE
d3d10_effect_string_variable_AsShaderResource(
4638 ID3D10EffectStringVariable
*iface
)
4640 return d3d10_effect_variable_AsShaderResource((ID3D10EffectVariable
*)iface
);
4643 static struct ID3D10EffectRenderTargetViewVariable
* STDMETHODCALLTYPE
d3d10_effect_string_variable_AsRenderTargetView(
4644 ID3D10EffectStringVariable
*iface
)
4646 return d3d10_effect_variable_AsRenderTargetView((ID3D10EffectVariable
*)iface
);
4649 static struct ID3D10EffectDepthStencilViewVariable
* STDMETHODCALLTYPE
d3d10_effect_string_variable_AsDepthStencilView(
4650 ID3D10EffectStringVariable
*iface
)
4652 return d3d10_effect_variable_AsDepthStencilView((ID3D10EffectVariable
*)iface
);
4655 static struct ID3D10EffectConstantBuffer
* STDMETHODCALLTYPE
d3d10_effect_string_variable_AsConstantBuffer(
4656 ID3D10EffectStringVariable
*iface
)
4658 return d3d10_effect_variable_AsConstantBuffer((ID3D10EffectVariable
*)iface
);
4661 static struct ID3D10EffectShaderVariable
* STDMETHODCALLTYPE
d3d10_effect_string_variable_AsShader(
4662 ID3D10EffectStringVariable
*iface
)
4664 return d3d10_effect_variable_AsShader((ID3D10EffectVariable
*)iface
);
4667 static struct ID3D10EffectBlendVariable
* STDMETHODCALLTYPE
d3d10_effect_string_variable_AsBlend(
4668 ID3D10EffectStringVariable
*iface
)
4670 return d3d10_effect_variable_AsBlend((ID3D10EffectVariable
*)iface
);
4673 static struct ID3D10EffectDepthStencilVariable
* STDMETHODCALLTYPE
d3d10_effect_string_variable_AsDepthStencil(
4674 ID3D10EffectStringVariable
*iface
)
4676 return d3d10_effect_variable_AsDepthStencil((ID3D10EffectVariable
*)iface
);
4679 static struct ID3D10EffectRasterizerVariable
* STDMETHODCALLTYPE
d3d10_effect_string_variable_AsRasterizer(
4680 ID3D10EffectStringVariable
*iface
)
4682 return d3d10_effect_variable_AsRasterizer((ID3D10EffectVariable
*)iface
);
4685 static struct ID3D10EffectSamplerVariable
* STDMETHODCALLTYPE
d3d10_effect_string_variable_AsSampler(
4686 ID3D10EffectStringVariable
*iface
)
4688 return d3d10_effect_variable_AsSampler((ID3D10EffectVariable
*)iface
);
4691 static HRESULT STDMETHODCALLTYPE
d3d10_effect_string_variable_SetRawValue(ID3D10EffectStringVariable
*iface
,
4692 void *data
, UINT offset
, UINT count
)
4694 return d3d10_effect_variable_SetRawValue((ID3D10EffectVariable
*)iface
, data
, offset
, count
);
4697 static HRESULT STDMETHODCALLTYPE
d3d10_effect_string_variable_GetRawValue(ID3D10EffectStringVariable
*iface
,
4698 void *data
, UINT offset
, UINT count
)
4700 return d3d10_effect_variable_GetRawValue((ID3D10EffectVariable
*)iface
, data
, offset
, count
);
4703 /* ID3D10EffectStringVariable methods */
4705 static HRESULT STDMETHODCALLTYPE
d3d10_effect_string_variable_GetString(ID3D10EffectStringVariable
*iface
,
4708 FIXME("iface %p, str %p stub!\n", iface
, str
);
4713 static HRESULT STDMETHODCALLTYPE
d3d10_effect_string_variable_GetStringArray(ID3D10EffectStringVariable
*iface
,
4714 LPCSTR
*strs
, UINT offset
, UINT count
)
4716 FIXME("iface %p, strs %p, offset %u, count %u stub!\n", iface
, strs
, offset
, count
);
4722 static const struct ID3D10EffectStringVariableVtbl d3d10_effect_string_variable_vtbl
=
4724 /* ID3D10EffectVariable methods */
4725 d3d10_effect_string_variable_IsValid
,
4726 d3d10_effect_string_variable_GetType
,
4727 d3d10_effect_string_variable_GetDesc
,
4728 d3d10_effect_string_variable_GetAnnotationByIndex
,
4729 d3d10_effect_string_variable_GetAnnotationByName
,
4730 d3d10_effect_string_variable_GetMemberByIndex
,
4731 d3d10_effect_string_variable_GetMemberByName
,
4732 d3d10_effect_string_variable_GetMemberBySemantic
,
4733 d3d10_effect_string_variable_GetElement
,
4734 d3d10_effect_string_variable_GetParentConstantBuffer
,
4735 d3d10_effect_string_variable_AsScalar
,
4736 d3d10_effect_string_variable_AsVector
,
4737 d3d10_effect_string_variable_AsMatrix
,
4738 d3d10_effect_string_variable_AsString
,
4739 d3d10_effect_string_variable_AsShaderResource
,
4740 d3d10_effect_string_variable_AsRenderTargetView
,
4741 d3d10_effect_string_variable_AsDepthStencilView
,
4742 d3d10_effect_string_variable_AsConstantBuffer
,
4743 d3d10_effect_string_variable_AsShader
,
4744 d3d10_effect_string_variable_AsBlend
,
4745 d3d10_effect_string_variable_AsDepthStencil
,
4746 d3d10_effect_string_variable_AsRasterizer
,
4747 d3d10_effect_string_variable_AsSampler
,
4748 d3d10_effect_string_variable_SetRawValue
,
4749 d3d10_effect_string_variable_GetRawValue
,
4750 /* ID3D10EffectStringVariable methods */
4751 d3d10_effect_string_variable_GetString
,
4752 d3d10_effect_string_variable_GetStringArray
,
4755 /* ID3D10EffectVariable methods */
4757 static BOOL STDMETHODCALLTYPE
d3d10_effect_shader_resource_variable_IsValid(ID3D10EffectShaderResourceVariable
*iface
)
4759 TRACE("iface %p\n", iface
);
4761 return (struct d3d10_effect_variable
*)iface
!= &null_shader_resource_variable
;
4764 static struct ID3D10EffectType
* STDMETHODCALLTYPE
d3d10_effect_shader_resource_variable_GetType(
4765 ID3D10EffectShaderResourceVariable
*iface
)
4767 return d3d10_effect_variable_GetType((ID3D10EffectVariable
*)iface
);
4770 static HRESULT STDMETHODCALLTYPE
d3d10_effect_shader_resource_variable_GetDesc(
4771 ID3D10EffectShaderResourceVariable
*iface
, D3D10_EFFECT_VARIABLE_DESC
*desc
)
4773 return d3d10_effect_variable_GetDesc((ID3D10EffectVariable
*)iface
, desc
);
4776 static struct ID3D10EffectVariable
* STDMETHODCALLTYPE
d3d10_effect_shader_resource_variable_GetAnnotationByIndex(
4777 ID3D10EffectShaderResourceVariable
*iface
, UINT index
)
4779 return d3d10_effect_variable_GetAnnotationByIndex((ID3D10EffectVariable
*)iface
, index
);
4782 static struct ID3D10EffectVariable
* STDMETHODCALLTYPE
d3d10_effect_shader_resource_variable_GetAnnotationByName(
4783 ID3D10EffectShaderResourceVariable
*iface
, LPCSTR name
)
4785 return d3d10_effect_variable_GetAnnotationByName((ID3D10EffectVariable
*)iface
, name
);
4788 static struct ID3D10EffectVariable
* STDMETHODCALLTYPE
d3d10_effect_shader_resource_variable_GetMemberByIndex(
4789 ID3D10EffectShaderResourceVariable
*iface
, UINT index
)
4791 return d3d10_effect_variable_GetMemberByIndex((ID3D10EffectVariable
*)iface
, index
);
4794 static struct ID3D10EffectVariable
* STDMETHODCALLTYPE
d3d10_effect_shader_resource_variable_GetMemberByName(
4795 ID3D10EffectShaderResourceVariable
*iface
, LPCSTR name
)
4797 return d3d10_effect_variable_GetMemberByName((ID3D10EffectVariable
*)iface
, name
);
4800 static struct ID3D10EffectVariable
* STDMETHODCALLTYPE
d3d10_effect_shader_resource_variable_GetMemberBySemantic(
4801 ID3D10EffectShaderResourceVariable
*iface
, LPCSTR semantic
)
4803 return d3d10_effect_variable_GetMemberBySemantic((ID3D10EffectVariable
*)iface
, semantic
);
4806 static struct ID3D10EffectVariable
* STDMETHODCALLTYPE
d3d10_effect_shader_resource_variable_GetElement(
4807 ID3D10EffectShaderResourceVariable
*iface
, UINT index
)
4809 return d3d10_effect_variable_GetElement((ID3D10EffectVariable
*)iface
, index
);
4812 static struct ID3D10EffectConstantBuffer
* STDMETHODCALLTYPE
d3d10_effect_shader_resource_variable_GetParentConstantBuffer(
4813 ID3D10EffectShaderResourceVariable
*iface
)
4815 return d3d10_effect_variable_GetParentConstantBuffer((ID3D10EffectVariable
*)iface
);
4818 static struct ID3D10EffectScalarVariable
* STDMETHODCALLTYPE
d3d10_effect_shader_resource_variable_AsScalar(
4819 ID3D10EffectShaderResourceVariable
*iface
)
4821 return d3d10_effect_variable_AsScalar((ID3D10EffectVariable
*)iface
);
4824 static struct ID3D10EffectVectorVariable
* STDMETHODCALLTYPE
d3d10_effect_shader_resource_variable_AsVector(
4825 ID3D10EffectShaderResourceVariable
*iface
)
4827 return d3d10_effect_variable_AsVector((ID3D10EffectVariable
*)iface
);
4830 static struct ID3D10EffectMatrixVariable
* STDMETHODCALLTYPE
d3d10_effect_shader_resource_variable_AsMatrix(
4831 ID3D10EffectShaderResourceVariable
*iface
)
4833 return d3d10_effect_variable_AsMatrix((ID3D10EffectVariable
*)iface
);
4836 static struct ID3D10EffectStringVariable
* STDMETHODCALLTYPE
d3d10_effect_shader_resource_variable_AsString(
4837 ID3D10EffectShaderResourceVariable
*iface
)
4839 return d3d10_effect_variable_AsString((ID3D10EffectVariable
*)iface
);
4842 static struct ID3D10EffectShaderResourceVariable
* STDMETHODCALLTYPE
d3d10_effect_shader_resource_variable_AsShaderResource(
4843 ID3D10EffectShaderResourceVariable
*iface
)
4845 return d3d10_effect_variable_AsShaderResource((ID3D10EffectVariable
*)iface
);
4848 static struct ID3D10EffectRenderTargetViewVariable
* STDMETHODCALLTYPE
d3d10_effect_shader_resource_variable_AsRenderTargetView(
4849 ID3D10EffectShaderResourceVariable
*iface
)
4851 return d3d10_effect_variable_AsRenderTargetView((ID3D10EffectVariable
*)iface
);
4854 static struct ID3D10EffectDepthStencilViewVariable
* STDMETHODCALLTYPE
d3d10_effect_shader_resource_variable_AsDepthStencilView(
4855 ID3D10EffectShaderResourceVariable
*iface
)
4857 return d3d10_effect_variable_AsDepthStencilView((ID3D10EffectVariable
*)iface
);
4860 static struct ID3D10EffectConstantBuffer
* STDMETHODCALLTYPE
d3d10_effect_shader_resource_variable_AsConstantBuffer(
4861 ID3D10EffectShaderResourceVariable
*iface
)
4863 return d3d10_effect_variable_AsConstantBuffer((ID3D10EffectVariable
*)iface
);
4866 static struct ID3D10EffectShaderVariable
* STDMETHODCALLTYPE
d3d10_effect_shader_resource_variable_AsShader(
4867 ID3D10EffectShaderResourceVariable
*iface
)
4869 return d3d10_effect_variable_AsShader((ID3D10EffectVariable
*)iface
);
4872 static struct ID3D10EffectBlendVariable
* STDMETHODCALLTYPE
d3d10_effect_shader_resource_variable_AsBlend(
4873 ID3D10EffectShaderResourceVariable
*iface
)
4875 return d3d10_effect_variable_AsBlend((ID3D10EffectVariable
*)iface
);
4878 static struct ID3D10EffectDepthStencilVariable
* STDMETHODCALLTYPE
d3d10_effect_shader_resource_variable_AsDepthStencil(
4879 ID3D10EffectShaderResourceVariable
*iface
)
4881 return d3d10_effect_variable_AsDepthStencil((ID3D10EffectVariable
*)iface
);
4884 static struct ID3D10EffectRasterizerVariable
* STDMETHODCALLTYPE
d3d10_effect_shader_resource_variable_AsRasterizer(
4885 ID3D10EffectShaderResourceVariable
*iface
)
4887 return d3d10_effect_variable_AsRasterizer((ID3D10EffectVariable
*)iface
);
4890 static struct ID3D10EffectSamplerVariable
* STDMETHODCALLTYPE
d3d10_effect_shader_resource_variable_AsSampler(
4891 ID3D10EffectShaderResourceVariable
*iface
)
4893 return d3d10_effect_variable_AsSampler((ID3D10EffectVariable
*)iface
);
4896 static HRESULT STDMETHODCALLTYPE
d3d10_effect_shader_resource_variable_SetRawValue(
4897 ID3D10EffectShaderResourceVariable
*iface
, void *data
, UINT offset
, UINT count
)
4899 return d3d10_effect_variable_SetRawValue((ID3D10EffectVariable
*)iface
, data
, offset
, count
);
4902 static HRESULT STDMETHODCALLTYPE
d3d10_effect_shader_resource_variable_GetRawValue(
4903 ID3D10EffectShaderResourceVariable
*iface
, void *data
, UINT offset
, UINT count
)
4905 return d3d10_effect_variable_GetRawValue((ID3D10EffectVariable
*)iface
, data
, offset
, count
);
4908 /* ID3D10EffectShaderResourceVariable methods */
4910 static HRESULT STDMETHODCALLTYPE
d3d10_effect_shader_resource_variable_SetResource(
4911 ID3D10EffectShaderResourceVariable
*iface
, ID3D10ShaderResourceView
*resource
)
4913 FIXME("iface %p, resource %p stub!\n", iface
, resource
);
4918 static HRESULT STDMETHODCALLTYPE
d3d10_effect_shader_resource_variable_GetResource(
4919 ID3D10EffectShaderResourceVariable
*iface
, ID3D10ShaderResourceView
**resource
)
4921 FIXME("iface %p, resource %p stub!\n", iface
, resource
);
4926 static HRESULT STDMETHODCALLTYPE
d3d10_effect_shader_resource_variable_SetResourceArray(
4927 ID3D10EffectShaderResourceVariable
*iface
, ID3D10ShaderResourceView
**resources
, UINT offset
, UINT count
)
4929 FIXME("iface %p, resources %p, offset %u, count %u stub!\n", iface
, resources
, offset
, count
);
4934 static HRESULT STDMETHODCALLTYPE
d3d10_effect_shader_resource_variable_GetResourceArray(
4935 ID3D10EffectShaderResourceVariable
*iface
, ID3D10ShaderResourceView
**resources
, UINT offset
, UINT count
)
4937 FIXME("iface %p, resources %p, offset %u, count %u stub!\n", iface
, resources
, offset
, count
);
4943 static const struct ID3D10EffectShaderResourceVariableVtbl d3d10_effect_shader_resource_variable_vtbl
=
4945 /* ID3D10EffectVariable methods */
4946 d3d10_effect_shader_resource_variable_IsValid
,
4947 d3d10_effect_shader_resource_variable_GetType
,
4948 d3d10_effect_shader_resource_variable_GetDesc
,
4949 d3d10_effect_shader_resource_variable_GetAnnotationByIndex
,
4950 d3d10_effect_shader_resource_variable_GetAnnotationByName
,
4951 d3d10_effect_shader_resource_variable_GetMemberByIndex
,
4952 d3d10_effect_shader_resource_variable_GetMemberByName
,
4953 d3d10_effect_shader_resource_variable_GetMemberBySemantic
,
4954 d3d10_effect_shader_resource_variable_GetElement
,
4955 d3d10_effect_shader_resource_variable_GetParentConstantBuffer
,
4956 d3d10_effect_shader_resource_variable_AsScalar
,
4957 d3d10_effect_shader_resource_variable_AsVector
,
4958 d3d10_effect_shader_resource_variable_AsMatrix
,
4959 d3d10_effect_shader_resource_variable_AsString
,
4960 d3d10_effect_shader_resource_variable_AsShaderResource
,
4961 d3d10_effect_shader_resource_variable_AsRenderTargetView
,
4962 d3d10_effect_shader_resource_variable_AsDepthStencilView
,
4963 d3d10_effect_shader_resource_variable_AsConstantBuffer
,
4964 d3d10_effect_shader_resource_variable_AsShader
,
4965 d3d10_effect_shader_resource_variable_AsBlend
,
4966 d3d10_effect_shader_resource_variable_AsDepthStencil
,
4967 d3d10_effect_shader_resource_variable_AsRasterizer
,
4968 d3d10_effect_shader_resource_variable_AsSampler
,
4969 d3d10_effect_shader_resource_variable_SetRawValue
,
4970 d3d10_effect_shader_resource_variable_GetRawValue
,
4971 /* ID3D10EffectShaderResourceVariable methods */
4972 d3d10_effect_shader_resource_variable_SetResource
,
4973 d3d10_effect_shader_resource_variable_GetResource
,
4974 d3d10_effect_shader_resource_variable_SetResourceArray
,
4975 d3d10_effect_shader_resource_variable_GetResourceArray
,
4978 /* ID3D10EffectVariable methods */
4980 static BOOL STDMETHODCALLTYPE
d3d10_effect_render_target_view_variable_IsValid(
4981 ID3D10EffectRenderTargetViewVariable
*iface
)
4983 TRACE("iface %p\n", iface
);
4985 return (struct d3d10_effect_variable
*)iface
!= &null_render_target_view_variable
;
4988 static struct ID3D10EffectType
* STDMETHODCALLTYPE
d3d10_effect_render_target_view_variable_GetType(
4989 ID3D10EffectRenderTargetViewVariable
*iface
)
4991 return d3d10_effect_variable_GetType((ID3D10EffectVariable
*)iface
);
4994 static HRESULT STDMETHODCALLTYPE
d3d10_effect_render_target_view_variable_GetDesc(
4995 ID3D10EffectRenderTargetViewVariable
*iface
, D3D10_EFFECT_VARIABLE_DESC
*desc
)
4997 return d3d10_effect_variable_GetDesc((ID3D10EffectVariable
*)iface
, desc
);
5000 static struct ID3D10EffectVariable
* STDMETHODCALLTYPE
d3d10_effect_render_target_view_variable_GetAnnotationByIndex(
5001 ID3D10EffectRenderTargetViewVariable
*iface
, UINT index
)
5003 return d3d10_effect_variable_GetAnnotationByIndex((ID3D10EffectVariable
*)iface
, index
);
5006 static struct ID3D10EffectVariable
* STDMETHODCALLTYPE
d3d10_effect_render_target_view_variable_GetAnnotationByName(
5007 ID3D10EffectRenderTargetViewVariable
*iface
, LPCSTR name
)
5009 return d3d10_effect_variable_GetAnnotationByName((ID3D10EffectVariable
*)iface
, name
);
5012 static struct ID3D10EffectVariable
* STDMETHODCALLTYPE
d3d10_effect_render_target_view_variable_GetMemberByIndex(
5013 ID3D10EffectRenderTargetViewVariable
*iface
, UINT index
)
5015 return d3d10_effect_variable_GetMemberByIndex((ID3D10EffectVariable
*)iface
, index
);
5018 static struct ID3D10EffectVariable
* STDMETHODCALLTYPE
d3d10_effect_render_target_view_variable_GetMemberByName(
5019 ID3D10EffectRenderTargetViewVariable
*iface
, LPCSTR name
)
5021 return d3d10_effect_variable_GetMemberByName((ID3D10EffectVariable
*)iface
, name
);
5024 static struct ID3D10EffectVariable
* STDMETHODCALLTYPE
d3d10_effect_render_target_view_variable_GetMemberBySemantic(
5025 ID3D10EffectRenderTargetViewVariable
*iface
, LPCSTR semantic
)
5027 return d3d10_effect_variable_GetMemberBySemantic((ID3D10EffectVariable
*)iface
, semantic
);
5030 static struct ID3D10EffectVariable
* STDMETHODCALLTYPE
d3d10_effect_render_target_view_variable_GetElement(
5031 ID3D10EffectRenderTargetViewVariable
*iface
, UINT index
)
5033 return d3d10_effect_variable_GetElement((ID3D10EffectVariable
*)iface
, index
);
5036 static struct ID3D10EffectConstantBuffer
* STDMETHODCALLTYPE
d3d10_effect_render_target_view_variable_GetParentConstantBuffer(
5037 ID3D10EffectRenderTargetViewVariable
*iface
)
5039 return d3d10_effect_variable_GetParentConstantBuffer((ID3D10EffectVariable
*)iface
);
5042 static struct ID3D10EffectScalarVariable
* STDMETHODCALLTYPE
d3d10_effect_render_target_view_variable_AsScalar(
5043 ID3D10EffectRenderTargetViewVariable
*iface
)
5045 return d3d10_effect_variable_AsScalar((ID3D10EffectVariable
*)iface
);
5048 static struct ID3D10EffectVectorVariable
* STDMETHODCALLTYPE
d3d10_effect_render_target_view_variable_AsVector(
5049 ID3D10EffectRenderTargetViewVariable
*iface
)
5051 return d3d10_effect_variable_AsVector((ID3D10EffectVariable
*)iface
);
5054 static struct ID3D10EffectMatrixVariable
* STDMETHODCALLTYPE
d3d10_effect_render_target_view_variable_AsMatrix(
5055 ID3D10EffectRenderTargetViewVariable
*iface
)
5057 return d3d10_effect_variable_AsMatrix((ID3D10EffectVariable
*)iface
);
5060 static struct ID3D10EffectStringVariable
* STDMETHODCALLTYPE
d3d10_effect_render_target_view_variable_AsString(
5061 ID3D10EffectRenderTargetViewVariable
*iface
)
5063 return d3d10_effect_variable_AsString((ID3D10EffectVariable
*)iface
);
5066 static struct ID3D10EffectShaderResourceVariable
* STDMETHODCALLTYPE
d3d10_effect_render_target_view_variable_AsShaderResource(
5067 ID3D10EffectRenderTargetViewVariable
*iface
)
5069 return d3d10_effect_variable_AsShaderResource((ID3D10EffectVariable
*)iface
);
5072 static struct ID3D10EffectRenderTargetViewVariable
* STDMETHODCALLTYPE
d3d10_effect_render_target_view_variable_AsRenderTargetView(
5073 ID3D10EffectRenderTargetViewVariable
*iface
)
5075 return d3d10_effect_variable_AsRenderTargetView((ID3D10EffectVariable
*)iface
);
5078 static struct ID3D10EffectDepthStencilViewVariable
* STDMETHODCALLTYPE
d3d10_effect_render_target_view_variable_AsDepthStencilView(
5079 ID3D10EffectRenderTargetViewVariable
*iface
)
5081 return d3d10_effect_variable_AsDepthStencilView((ID3D10EffectVariable
*)iface
);
5084 static struct ID3D10EffectConstantBuffer
* STDMETHODCALLTYPE
d3d10_effect_render_target_view_variable_AsConstantBuffer(
5085 ID3D10EffectRenderTargetViewVariable
*iface
)
5087 return d3d10_effect_variable_AsConstantBuffer((ID3D10EffectVariable
*)iface
);
5090 static struct ID3D10EffectShaderVariable
* STDMETHODCALLTYPE
d3d10_effect_render_target_view_variable_AsShader(
5091 ID3D10EffectRenderTargetViewVariable
*iface
)
5093 return d3d10_effect_variable_AsShader((ID3D10EffectVariable
*)iface
);
5096 static struct ID3D10EffectBlendVariable
* STDMETHODCALLTYPE
d3d10_effect_render_target_view_variable_AsBlend(
5097 ID3D10EffectRenderTargetViewVariable
*iface
)
5099 return d3d10_effect_variable_AsBlend((ID3D10EffectVariable
*)iface
);
5102 static struct ID3D10EffectDepthStencilVariable
* STDMETHODCALLTYPE
d3d10_effect_render_target_view_variable_AsDepthStencil(
5103 ID3D10EffectRenderTargetViewVariable
*iface
)
5105 return d3d10_effect_variable_AsDepthStencil((ID3D10EffectVariable
*)iface
);
5108 static struct ID3D10EffectRasterizerVariable
* STDMETHODCALLTYPE
d3d10_effect_render_target_view_variable_AsRasterizer(
5109 ID3D10EffectRenderTargetViewVariable
*iface
)
5111 return d3d10_effect_variable_AsRasterizer((ID3D10EffectVariable
*)iface
);
5114 static struct ID3D10EffectSamplerVariable
* STDMETHODCALLTYPE
d3d10_effect_render_target_view_variable_AsSampler(
5115 ID3D10EffectRenderTargetViewVariable
*iface
)
5117 return d3d10_effect_variable_AsSampler((ID3D10EffectVariable
*)iface
);
5120 static HRESULT STDMETHODCALLTYPE
d3d10_effect_render_target_view_variable_SetRawValue(
5121 ID3D10EffectRenderTargetViewVariable
*iface
, void *data
, UINT offset
, UINT count
)
5123 return d3d10_effect_variable_SetRawValue((ID3D10EffectVariable
*)iface
, data
, offset
, count
);
5126 static HRESULT STDMETHODCALLTYPE
d3d10_effect_render_target_view_variable_GetRawValue(
5127 ID3D10EffectRenderTargetViewVariable
*iface
, void *data
, UINT offset
, UINT count
)
5129 return d3d10_effect_variable_GetRawValue((ID3D10EffectVariable
*)iface
, data
, offset
, count
);
5132 /* ID3D10EffectRenderTargetViewVariable methods */
5134 static HRESULT STDMETHODCALLTYPE
d3d10_effect_render_target_view_variable_SetRenderTarget(
5135 ID3D10EffectRenderTargetViewVariable
*iface
, ID3D10RenderTargetView
*view
)
5137 FIXME("iface %p, view %p stub!\n", iface
, view
);
5142 static HRESULT STDMETHODCALLTYPE
d3d10_effect_render_target_view_variable_GetRenderTarget(
5143 ID3D10EffectRenderTargetViewVariable
*iface
, ID3D10RenderTargetView
**view
)
5145 FIXME("iface %p, view %p stub!\n", iface
, view
);
5150 static HRESULT STDMETHODCALLTYPE
d3d10_effect_render_target_view_variable_SetRenderTargetArray(
5151 ID3D10EffectRenderTargetViewVariable
*iface
, ID3D10RenderTargetView
**views
, UINT offset
, UINT count
)
5153 FIXME("iface %p, views %p, offset %u, count %u stub!\n", iface
, views
, offset
, count
);
5158 static HRESULT STDMETHODCALLTYPE
d3d10_effect_render_target_view_variable_GetRenderTargetArray(
5159 ID3D10EffectRenderTargetViewVariable
*iface
, ID3D10RenderTargetView
**views
, UINT offset
, UINT count
)
5161 FIXME("iface %p, views %p, offset %u, count %u stub!\n", iface
, views
, offset
, count
);
5167 static const struct ID3D10EffectRenderTargetViewVariableVtbl d3d10_effect_render_target_view_variable_vtbl
=
5169 /* ID3D10EffectVariable methods */
5170 d3d10_effect_render_target_view_variable_IsValid
,
5171 d3d10_effect_render_target_view_variable_GetType
,
5172 d3d10_effect_render_target_view_variable_GetDesc
,
5173 d3d10_effect_render_target_view_variable_GetAnnotationByIndex
,
5174 d3d10_effect_render_target_view_variable_GetAnnotationByName
,
5175 d3d10_effect_render_target_view_variable_GetMemberByIndex
,
5176 d3d10_effect_render_target_view_variable_GetMemberByName
,
5177 d3d10_effect_render_target_view_variable_GetMemberBySemantic
,
5178 d3d10_effect_render_target_view_variable_GetElement
,
5179 d3d10_effect_render_target_view_variable_GetParentConstantBuffer
,
5180 d3d10_effect_render_target_view_variable_AsScalar
,
5181 d3d10_effect_render_target_view_variable_AsVector
,
5182 d3d10_effect_render_target_view_variable_AsMatrix
,
5183 d3d10_effect_render_target_view_variable_AsString
,
5184 d3d10_effect_render_target_view_variable_AsShaderResource
,
5185 d3d10_effect_render_target_view_variable_AsRenderTargetView
,
5186 d3d10_effect_render_target_view_variable_AsDepthStencilView
,
5187 d3d10_effect_render_target_view_variable_AsConstantBuffer
,
5188 d3d10_effect_render_target_view_variable_AsShader
,
5189 d3d10_effect_render_target_view_variable_AsBlend
,
5190 d3d10_effect_render_target_view_variable_AsDepthStencil
,
5191 d3d10_effect_render_target_view_variable_AsRasterizer
,
5192 d3d10_effect_render_target_view_variable_AsSampler
,
5193 d3d10_effect_render_target_view_variable_SetRawValue
,
5194 d3d10_effect_render_target_view_variable_GetRawValue
,
5195 /* ID3D10EffectRenderTargetViewVariable methods */
5196 d3d10_effect_render_target_view_variable_SetRenderTarget
,
5197 d3d10_effect_render_target_view_variable_GetRenderTarget
,
5198 d3d10_effect_render_target_view_variable_SetRenderTargetArray
,
5199 d3d10_effect_render_target_view_variable_GetRenderTargetArray
,
5202 /* ID3D10EffectVariable methods */
5204 static BOOL STDMETHODCALLTYPE
d3d10_effect_depth_stencil_view_variable_IsValid(
5205 ID3D10EffectDepthStencilViewVariable
*iface
)
5207 TRACE("iface %p\n", iface
);
5209 return (struct d3d10_effect_variable
*)iface
!= &null_depth_stencil_view_variable
;
5212 static struct ID3D10EffectType
* STDMETHODCALLTYPE
d3d10_effect_depth_stencil_view_variable_GetType(
5213 ID3D10EffectDepthStencilViewVariable
*iface
)
5215 return d3d10_effect_variable_GetType((ID3D10EffectVariable
*)iface
);
5218 static HRESULT STDMETHODCALLTYPE
d3d10_effect_depth_stencil_view_variable_GetDesc(
5219 ID3D10EffectDepthStencilViewVariable
*iface
, D3D10_EFFECT_VARIABLE_DESC
*desc
)
5221 return d3d10_effect_variable_GetDesc((ID3D10EffectVariable
*)iface
, desc
);
5224 static struct ID3D10EffectVariable
* STDMETHODCALLTYPE
d3d10_effect_depth_stencil_view_variable_GetAnnotationByIndex(
5225 ID3D10EffectDepthStencilViewVariable
*iface
, UINT index
)
5227 return d3d10_effect_variable_GetAnnotationByIndex((ID3D10EffectVariable
*)iface
, index
);
5230 static struct ID3D10EffectVariable
* STDMETHODCALLTYPE
d3d10_effect_depth_stencil_view_variable_GetAnnotationByName(
5231 ID3D10EffectDepthStencilViewVariable
*iface
, LPCSTR name
)
5233 return d3d10_effect_variable_GetAnnotationByName((ID3D10EffectVariable
*)iface
, name
);
5236 static struct ID3D10EffectVariable
* STDMETHODCALLTYPE
d3d10_effect_depth_stencil_view_variable_GetMemberByIndex(
5237 ID3D10EffectDepthStencilViewVariable
*iface
, UINT index
)
5239 return d3d10_effect_variable_GetMemberByIndex((ID3D10EffectVariable
*)iface
, index
);
5242 static struct ID3D10EffectVariable
* STDMETHODCALLTYPE
d3d10_effect_depth_stencil_view_variable_GetMemberByName(
5243 ID3D10EffectDepthStencilViewVariable
*iface
, LPCSTR name
)
5245 return d3d10_effect_variable_GetMemberByName((ID3D10EffectVariable
*)iface
, name
);
5248 static struct ID3D10EffectVariable
* STDMETHODCALLTYPE
d3d10_effect_depth_stencil_view_variable_GetMemberBySemantic(
5249 ID3D10EffectDepthStencilViewVariable
*iface
, LPCSTR semantic
)
5251 return d3d10_effect_variable_GetMemberBySemantic((ID3D10EffectVariable
*)iface
, semantic
);
5254 static struct ID3D10EffectVariable
* STDMETHODCALLTYPE
d3d10_effect_depth_stencil_view_variable_GetElement(
5255 ID3D10EffectDepthStencilViewVariable
*iface
, UINT index
)
5257 return d3d10_effect_variable_GetElement((ID3D10EffectVariable
*)iface
, index
);
5260 static struct ID3D10EffectConstantBuffer
* STDMETHODCALLTYPE
d3d10_effect_depth_stencil_view_variable_GetParentConstantBuffer(
5261 ID3D10EffectDepthStencilViewVariable
*iface
)
5263 return d3d10_effect_variable_GetParentConstantBuffer((ID3D10EffectVariable
*)iface
);
5266 static struct ID3D10EffectScalarVariable
* STDMETHODCALLTYPE
d3d10_effect_depth_stencil_view_variable_AsScalar(
5267 ID3D10EffectDepthStencilViewVariable
*iface
)
5269 return d3d10_effect_variable_AsScalar((ID3D10EffectVariable
*)iface
);
5272 static struct ID3D10EffectVectorVariable
* STDMETHODCALLTYPE
d3d10_effect_depth_stencil_view_variable_AsVector(
5273 ID3D10EffectDepthStencilViewVariable
*iface
)
5275 return d3d10_effect_variable_AsVector((ID3D10EffectVariable
*)iface
);
5278 static struct ID3D10EffectMatrixVariable
* STDMETHODCALLTYPE
d3d10_effect_depth_stencil_view_variable_AsMatrix(
5279 ID3D10EffectDepthStencilViewVariable
*iface
)
5281 return d3d10_effect_variable_AsMatrix((ID3D10EffectVariable
*)iface
);
5284 static struct ID3D10EffectStringVariable
* STDMETHODCALLTYPE
d3d10_effect_depth_stencil_view_variable_AsString(
5285 ID3D10EffectDepthStencilViewVariable
*iface
)
5287 return d3d10_effect_variable_AsString((ID3D10EffectVariable
*)iface
);
5290 static struct ID3D10EffectShaderResourceVariable
* STDMETHODCALLTYPE
d3d10_effect_depth_stencil_view_variable_AsShaderResource(
5291 ID3D10EffectDepthStencilViewVariable
*iface
)
5293 return d3d10_effect_variable_AsShaderResource((ID3D10EffectVariable
*)iface
);
5296 static struct ID3D10EffectRenderTargetViewVariable
* STDMETHODCALLTYPE
d3d10_effect_depth_stencil_view_variable_AsRenderTargetView(
5297 ID3D10EffectDepthStencilViewVariable
*iface
)
5299 return d3d10_effect_variable_AsRenderTargetView((ID3D10EffectVariable
*)iface
);
5302 static struct ID3D10EffectDepthStencilViewVariable
* STDMETHODCALLTYPE
d3d10_effect_depth_stencil_view_variable_AsDepthStencilView(
5303 ID3D10EffectDepthStencilViewVariable
*iface
)
5305 return d3d10_effect_variable_AsDepthStencilView((ID3D10EffectVariable
*)iface
);
5308 static struct ID3D10EffectConstantBuffer
* STDMETHODCALLTYPE
d3d10_effect_depth_stencil_view_variable_AsConstantBuffer(
5309 ID3D10EffectDepthStencilViewVariable
*iface
)
5311 return d3d10_effect_variable_AsConstantBuffer((ID3D10EffectVariable
*)iface
);
5314 static struct ID3D10EffectShaderVariable
* STDMETHODCALLTYPE
d3d10_effect_depth_stencil_view_variable_AsShader(
5315 ID3D10EffectDepthStencilViewVariable
*iface
)
5317 return d3d10_effect_variable_AsShader((ID3D10EffectVariable
*)iface
);
5320 static struct ID3D10EffectBlendVariable
* STDMETHODCALLTYPE
d3d10_effect_depth_stencil_view_variable_AsBlend(
5321 ID3D10EffectDepthStencilViewVariable
*iface
)
5323 return d3d10_effect_variable_AsBlend((ID3D10EffectVariable
*)iface
);
5326 static struct ID3D10EffectDepthStencilVariable
* STDMETHODCALLTYPE
d3d10_effect_depth_stencil_view_variable_AsDepthStencil(
5327 ID3D10EffectDepthStencilViewVariable
*iface
)
5329 return d3d10_effect_variable_AsDepthStencil((ID3D10EffectVariable
*)iface
);
5332 static struct ID3D10EffectRasterizerVariable
* STDMETHODCALLTYPE
d3d10_effect_depth_stencil_view_variable_AsRasterizer(
5333 ID3D10EffectDepthStencilViewVariable
*iface
)
5335 return d3d10_effect_variable_AsRasterizer((ID3D10EffectVariable
*)iface
);
5338 static struct ID3D10EffectSamplerVariable
* STDMETHODCALLTYPE
d3d10_effect_depth_stencil_view_variable_AsSampler(
5339 ID3D10EffectDepthStencilViewVariable
*iface
)
5341 return d3d10_effect_variable_AsSampler((ID3D10EffectVariable
*)iface
);
5344 static HRESULT STDMETHODCALLTYPE
d3d10_effect_depth_stencil_view_variable_SetRawValue(
5345 ID3D10EffectDepthStencilViewVariable
*iface
, void *data
, UINT offset
, UINT count
)
5347 return d3d10_effect_variable_SetRawValue((ID3D10EffectVariable
*)iface
, data
, offset
, count
);
5350 static HRESULT STDMETHODCALLTYPE
d3d10_effect_depth_stencil_view_variable_GetRawValue(
5351 ID3D10EffectDepthStencilViewVariable
*iface
, void *data
, UINT offset
, UINT count
)
5353 return d3d10_effect_variable_GetRawValue((ID3D10EffectVariable
*)iface
, data
, offset
, count
);
5356 /* ID3D10EffectDepthStencilViewVariable methods */
5358 static HRESULT STDMETHODCALLTYPE
d3d10_effect_depth_stencil_view_variable_SetDepthStencil(
5359 ID3D10EffectDepthStencilViewVariable
*iface
, ID3D10DepthStencilView
*view
)
5361 FIXME("iface %p, view %p stub!\n", iface
, view
);
5366 static HRESULT STDMETHODCALLTYPE
d3d10_effect_depth_stencil_view_variable_GetDepthStencil(
5367 ID3D10EffectDepthStencilViewVariable
*iface
, ID3D10DepthStencilView
**view
)
5369 FIXME("iface %p, view %p stub!\n", iface
, view
);
5374 static HRESULT STDMETHODCALLTYPE
d3d10_effect_depth_stencil_view_variable_SetDepthStencilArray(
5375 ID3D10EffectDepthStencilViewVariable
*iface
, ID3D10DepthStencilView
**views
, UINT offset
, UINT count
)
5377 FIXME("iface %p, views %p, offset %u, count %u stub!\n", iface
, views
, offset
, count
);
5382 static HRESULT STDMETHODCALLTYPE
d3d10_effect_depth_stencil_view_variable_GetDepthStencilArray(
5383 ID3D10EffectDepthStencilViewVariable
*iface
, ID3D10DepthStencilView
**views
, UINT offset
, UINT count
)
5385 FIXME("iface %p, views %p, offset %u, count %u stub!\n", iface
, views
, offset
, count
);
5391 static const struct ID3D10EffectDepthStencilViewVariableVtbl d3d10_effect_depth_stencil_view_variable_vtbl
=
5393 /* ID3D10EffectVariable methods */
5394 d3d10_effect_depth_stencil_view_variable_IsValid
,
5395 d3d10_effect_depth_stencil_view_variable_GetType
,
5396 d3d10_effect_depth_stencil_view_variable_GetDesc
,
5397 d3d10_effect_depth_stencil_view_variable_GetAnnotationByIndex
,
5398 d3d10_effect_depth_stencil_view_variable_GetAnnotationByName
,
5399 d3d10_effect_depth_stencil_view_variable_GetMemberByIndex
,
5400 d3d10_effect_depth_stencil_view_variable_GetMemberByName
,
5401 d3d10_effect_depth_stencil_view_variable_GetMemberBySemantic
,
5402 d3d10_effect_depth_stencil_view_variable_GetElement
,
5403 d3d10_effect_depth_stencil_view_variable_GetParentConstantBuffer
,
5404 d3d10_effect_depth_stencil_view_variable_AsScalar
,
5405 d3d10_effect_depth_stencil_view_variable_AsVector
,
5406 d3d10_effect_depth_stencil_view_variable_AsMatrix
,
5407 d3d10_effect_depth_stencil_view_variable_AsString
,
5408 d3d10_effect_depth_stencil_view_variable_AsShaderResource
,
5409 d3d10_effect_depth_stencil_view_variable_AsRenderTargetView
,
5410 d3d10_effect_depth_stencil_view_variable_AsDepthStencilView
,
5411 d3d10_effect_depth_stencil_view_variable_AsConstantBuffer
,
5412 d3d10_effect_depth_stencil_view_variable_AsShader
,
5413 d3d10_effect_depth_stencil_view_variable_AsBlend
,
5414 d3d10_effect_depth_stencil_view_variable_AsDepthStencil
,
5415 d3d10_effect_depth_stencil_view_variable_AsRasterizer
,
5416 d3d10_effect_depth_stencil_view_variable_AsSampler
,
5417 d3d10_effect_depth_stencil_view_variable_SetRawValue
,
5418 d3d10_effect_depth_stencil_view_variable_GetRawValue
,
5419 /* ID3D10EffectDepthStencilViewVariable methods */
5420 d3d10_effect_depth_stencil_view_variable_SetDepthStencil
,
5421 d3d10_effect_depth_stencil_view_variable_GetDepthStencil
,
5422 d3d10_effect_depth_stencil_view_variable_SetDepthStencilArray
,
5423 d3d10_effect_depth_stencil_view_variable_GetDepthStencilArray
,
5426 /* ID3D10EffectVariable methods */
5428 static BOOL STDMETHODCALLTYPE
d3d10_effect_shader_variable_IsValid(ID3D10EffectShaderVariable
*iface
)
5430 TRACE("iface %p\n", iface
);
5432 return (struct d3d10_effect_variable
*)iface
!= &null_shader_variable
;
5435 static struct ID3D10EffectType
* STDMETHODCALLTYPE
d3d10_effect_shader_variable_GetType(
5436 ID3D10EffectShaderVariable
*iface
)
5438 return d3d10_effect_variable_GetType((ID3D10EffectVariable
*)iface
);
5441 static HRESULT STDMETHODCALLTYPE
d3d10_effect_shader_variable_GetDesc(ID3D10EffectShaderVariable
*iface
,
5442 D3D10_EFFECT_VARIABLE_DESC
*desc
)
5444 return d3d10_effect_variable_GetDesc((ID3D10EffectVariable
*)iface
, desc
);
5447 static struct ID3D10EffectVariable
* STDMETHODCALLTYPE
d3d10_effect_shader_variable_GetAnnotationByIndex(
5448 ID3D10EffectShaderVariable
*iface
, UINT index
)
5450 return d3d10_effect_variable_GetAnnotationByIndex((ID3D10EffectVariable
*)iface
, index
);
5453 static struct ID3D10EffectVariable
* STDMETHODCALLTYPE
d3d10_effect_shader_variable_GetAnnotationByName(
5454 ID3D10EffectShaderVariable
*iface
, LPCSTR name
)
5456 return d3d10_effect_variable_GetAnnotationByName((ID3D10EffectVariable
*)iface
, name
);
5459 static struct ID3D10EffectVariable
* STDMETHODCALLTYPE
d3d10_effect_shader_variable_GetMemberByIndex(
5460 ID3D10EffectShaderVariable
*iface
, UINT index
)
5462 return d3d10_effect_variable_GetMemberByIndex((ID3D10EffectVariable
*)iface
, index
);
5465 static struct ID3D10EffectVariable
* STDMETHODCALLTYPE
d3d10_effect_shader_variable_GetMemberByName(
5466 ID3D10EffectShaderVariable
*iface
, LPCSTR name
)
5468 return d3d10_effect_variable_GetMemberByName((ID3D10EffectVariable
*)iface
, name
);
5471 static struct ID3D10EffectVariable
* STDMETHODCALLTYPE
d3d10_effect_shader_variable_GetMemberBySemantic(
5472 ID3D10EffectShaderVariable
*iface
, LPCSTR semantic
)
5474 return d3d10_effect_variable_GetMemberBySemantic((ID3D10EffectVariable
*)iface
, semantic
);
5477 static struct ID3D10EffectVariable
* STDMETHODCALLTYPE
d3d10_effect_shader_variable_GetElement(
5478 ID3D10EffectShaderVariable
*iface
, UINT index
)
5480 return d3d10_effect_variable_GetElement((ID3D10EffectVariable
*)iface
, index
);
5483 static struct ID3D10EffectConstantBuffer
* STDMETHODCALLTYPE
d3d10_effect_shader_variable_GetParentConstantBuffer(
5484 ID3D10EffectShaderVariable
*iface
)
5486 return d3d10_effect_variable_GetParentConstantBuffer((ID3D10EffectVariable
*)iface
);
5489 static struct ID3D10EffectScalarVariable
* STDMETHODCALLTYPE
d3d10_effect_shader_variable_AsScalar(
5490 ID3D10EffectShaderVariable
*iface
)
5492 return d3d10_effect_variable_AsScalar((ID3D10EffectVariable
*)iface
);
5495 static struct ID3D10EffectVectorVariable
* STDMETHODCALLTYPE
d3d10_effect_shader_variable_AsVector(
5496 ID3D10EffectShaderVariable
*iface
)
5498 return d3d10_effect_variable_AsVector((ID3D10EffectVariable
*)iface
);
5501 static struct ID3D10EffectMatrixVariable
* STDMETHODCALLTYPE
d3d10_effect_shader_variable_AsMatrix(
5502 ID3D10EffectShaderVariable
*iface
)
5504 return d3d10_effect_variable_AsMatrix((ID3D10EffectVariable
*)iface
);
5507 static struct ID3D10EffectStringVariable
* STDMETHODCALLTYPE
d3d10_effect_shader_variable_AsString(
5508 ID3D10EffectShaderVariable
*iface
)
5510 return d3d10_effect_variable_AsString((ID3D10EffectVariable
*)iface
);
5513 static struct ID3D10EffectShaderResourceVariable
* STDMETHODCALLTYPE
d3d10_effect_shader_variable_AsShaderResource(
5514 ID3D10EffectShaderVariable
*iface
)
5516 return d3d10_effect_variable_AsShaderResource((ID3D10EffectVariable
*)iface
);
5519 static struct ID3D10EffectRenderTargetViewVariable
* STDMETHODCALLTYPE
d3d10_effect_shader_variable_AsRenderTargetView(
5520 ID3D10EffectShaderVariable
*iface
)
5522 return d3d10_effect_variable_AsRenderTargetView((ID3D10EffectVariable
*)iface
);
5525 static struct ID3D10EffectDepthStencilViewVariable
* STDMETHODCALLTYPE
d3d10_effect_shader_variable_AsDepthStencilView(
5526 ID3D10EffectShaderVariable
*iface
)
5528 return d3d10_effect_variable_AsDepthStencilView((ID3D10EffectVariable
*)iface
);
5531 static struct ID3D10EffectConstantBuffer
* STDMETHODCALLTYPE
d3d10_effect_shader_variable_AsConstantBuffer(
5532 ID3D10EffectShaderVariable
*iface
)
5534 return d3d10_effect_variable_AsConstantBuffer((ID3D10EffectVariable
*)iface
);
5537 static struct ID3D10EffectShaderVariable
* STDMETHODCALLTYPE
d3d10_effect_shader_variable_AsShader(
5538 ID3D10EffectShaderVariable
*iface
)
5540 return d3d10_effect_variable_AsShader((ID3D10EffectVariable
*)iface
);
5543 static struct ID3D10EffectBlendVariable
* STDMETHODCALLTYPE
d3d10_effect_shader_variable_AsBlend(
5544 ID3D10EffectShaderVariable
*iface
)
5546 return d3d10_effect_variable_AsBlend((ID3D10EffectVariable
*)iface
);
5549 static struct ID3D10EffectDepthStencilVariable
* STDMETHODCALLTYPE
d3d10_effect_shader_variable_AsDepthStencil(
5550 ID3D10EffectShaderVariable
*iface
)
5552 return d3d10_effect_variable_AsDepthStencil((ID3D10EffectVariable
*)iface
);
5555 static struct ID3D10EffectRasterizerVariable
* STDMETHODCALLTYPE
d3d10_effect_shader_variable_AsRasterizer(
5556 ID3D10EffectShaderVariable
*iface
)
5558 return d3d10_effect_variable_AsRasterizer((ID3D10EffectVariable
*)iface
);
5561 static struct ID3D10EffectSamplerVariable
* STDMETHODCALLTYPE
d3d10_effect_shader_variable_AsSampler(
5562 ID3D10EffectShaderVariable
*iface
)
5564 return d3d10_effect_variable_AsSampler((ID3D10EffectVariable
*)iface
);
5567 static HRESULT STDMETHODCALLTYPE
d3d10_effect_shader_variable_SetRawValue(
5568 ID3D10EffectShaderVariable
*iface
, void *data
, UINT offset
, UINT count
)
5570 return d3d10_effect_variable_SetRawValue((ID3D10EffectVariable
*)iface
, data
, offset
, count
);
5573 static HRESULT STDMETHODCALLTYPE
d3d10_effect_shader_variable_GetRawValue(
5574 ID3D10EffectShaderVariable
*iface
, void *data
, UINT offset
, UINT count
)
5576 return d3d10_effect_variable_GetRawValue((ID3D10EffectVariable
*)iface
, data
, offset
, count
);
5579 /* ID3D10EffectShaderVariable methods */
5581 static HRESULT STDMETHODCALLTYPE
d3d10_effect_shader_variable_GetShaderDesc(
5582 ID3D10EffectShaderVariable
*iface
, UINT index
, D3D10_EFFECT_SHADER_DESC
*desc
)
5584 FIXME("iface %p, index %u, desc %p stub!\n", iface
, index
, desc
);
5589 static HRESULT STDMETHODCALLTYPE
d3d10_effect_shader_variable_GetVertexShader(
5590 ID3D10EffectShaderVariable
*iface
, UINT index
, ID3D10VertexShader
**shader
)
5592 FIXME("iface %p, index %u, shader %p stub!\n", iface
, index
, shader
);
5597 static HRESULT STDMETHODCALLTYPE
d3d10_effect_shader_variable_GetGeometryShader(
5598 ID3D10EffectShaderVariable
*iface
, UINT index
, ID3D10GeometryShader
**shader
)
5600 FIXME("iface %p, index %u, shader %p stub!\n", iface
, index
, shader
);
5605 static HRESULT STDMETHODCALLTYPE
d3d10_effect_shader_variable_GetPixelShader(
5606 ID3D10EffectShaderVariable
*iface
, UINT index
, ID3D10PixelShader
**shader
)
5608 FIXME("iface %p, index %u, shader %p stub!\n", iface
, index
, shader
);
5613 static HRESULT STDMETHODCALLTYPE
d3d10_effect_shader_variable_GetInputSignatureElementDesc(
5614 ID3D10EffectShaderVariable
*iface
, UINT shader_index
, UINT element_index
,
5615 D3D10_SIGNATURE_PARAMETER_DESC
*desc
)
5617 struct d3d10_effect_variable
*This
= (struct d3d10_effect_variable
*)iface
;
5618 struct d3d10_effect_shader_variable
*s
;
5619 D3D10_SIGNATURE_PARAMETER_DESC
*d
;
5621 TRACE("iface %p, shader_index %u, element_index %u, desc %p\n",
5622 iface
, shader_index
, element_index
, desc
);
5624 if (!iface
->lpVtbl
->IsValid(iface
))
5626 WARN("Null variable specified\n");
5630 /* Check shader_index, this crashes on W7/DX10 */
5631 if (shader_index
>= This
->effect
->used_shader_count
)
5633 WARN("This should crash on W7/DX10!\n");
5637 s
= This
->effect
->used_shaders
[shader_index
]->data
;
5638 if (!s
->input_signature
.signature
)
5640 WARN("No shader signature\n");
5641 return D3DERR_INVALIDCALL
;
5644 /* Check desc for NULL, this crashes on W7/DX10 */
5647 WARN("This should crash on W7/DX10!\n");
5651 if (element_index
>= s
->input_signature
.element_count
)
5653 WARN("Invalid element index specified\n");
5654 return E_INVALIDARG
;
5657 d
= &s
->input_signature
.elements
[element_index
];
5658 desc
->SemanticName
= d
->SemanticName
;
5659 desc
->SemanticIndex
= d
->SemanticIndex
;
5660 desc
->SystemValueType
= d
->SystemValueType
;
5661 desc
->ComponentType
= d
->ComponentType
;
5662 desc
->Register
= d
->Register
;
5663 desc
->ReadWriteMask
= d
->ReadWriteMask
;
5664 desc
->Mask
= d
->Mask
;
5669 static HRESULT STDMETHODCALLTYPE
d3d10_effect_shader_variable_GetOutputSignatureElementDesc(
5670 ID3D10EffectShaderVariable
*iface
, UINT shader_index
, UINT element_index
,
5671 D3D10_SIGNATURE_PARAMETER_DESC
*desc
)
5673 struct d3d10_effect_variable
*This
= (struct d3d10_effect_variable
*)iface
;
5674 struct d3d10_effect_shader_variable
*s
;
5675 D3D10_SIGNATURE_PARAMETER_DESC
*d
;
5677 TRACE("iface %p, shader_index %u, element_index %u, desc %p\n",
5678 iface
, shader_index
, element_index
, desc
);
5680 if (!iface
->lpVtbl
->IsValid(iface
))
5682 WARN("Null variable specified\n");
5686 /* Check shader_index, this crashes on W7/DX10 */
5687 if (shader_index
>= This
->effect
->used_shader_count
)
5689 WARN("This should crash on W7/DX10!\n");
5693 s
= This
->effect
->used_shaders
[shader_index
]->data
;
5694 if (!s
->output_signature
.signature
)
5696 WARN("No shader signature\n");
5697 return D3DERR_INVALIDCALL
;
5700 /* Check desc for NULL, this crashes on W7/DX10 */
5703 WARN("This should crash on W7/DX10!\n");
5707 if (element_index
>= s
->output_signature
.element_count
)
5709 WARN("Invalid element index specified\n");
5710 return E_INVALIDARG
;
5713 d
= &s
->output_signature
.elements
[element_index
];
5714 desc
->SemanticName
= d
->SemanticName
;
5715 desc
->SemanticIndex
= d
->SemanticIndex
;
5716 desc
->SystemValueType
= d
->SystemValueType
;
5717 desc
->ComponentType
= d
->ComponentType
;
5718 desc
->Register
= d
->Register
;
5719 desc
->ReadWriteMask
= d
->ReadWriteMask
;
5720 desc
->Mask
= d
->Mask
;
5726 static const struct ID3D10EffectShaderVariableVtbl d3d10_effect_shader_variable_vtbl
=
5728 /* ID3D10EffectVariable methods */
5729 d3d10_effect_shader_variable_IsValid
,
5730 d3d10_effect_shader_variable_GetType
,
5731 d3d10_effect_shader_variable_GetDesc
,
5732 d3d10_effect_shader_variable_GetAnnotationByIndex
,
5733 d3d10_effect_shader_variable_GetAnnotationByName
,
5734 d3d10_effect_shader_variable_GetMemberByIndex
,
5735 d3d10_effect_shader_variable_GetMemberByName
,
5736 d3d10_effect_shader_variable_GetMemberBySemantic
,
5737 d3d10_effect_shader_variable_GetElement
,
5738 d3d10_effect_shader_variable_GetParentConstantBuffer
,
5739 d3d10_effect_shader_variable_AsScalar
,
5740 d3d10_effect_shader_variable_AsVector
,
5741 d3d10_effect_shader_variable_AsMatrix
,
5742 d3d10_effect_shader_variable_AsString
,
5743 d3d10_effect_shader_variable_AsShaderResource
,
5744 d3d10_effect_shader_variable_AsRenderTargetView
,
5745 d3d10_effect_shader_variable_AsDepthStencilView
,
5746 d3d10_effect_shader_variable_AsConstantBuffer
,
5747 d3d10_effect_shader_variable_AsShader
,
5748 d3d10_effect_shader_variable_AsBlend
,
5749 d3d10_effect_shader_variable_AsDepthStencil
,
5750 d3d10_effect_shader_variable_AsRasterizer
,
5751 d3d10_effect_shader_variable_AsSampler
,
5752 d3d10_effect_shader_variable_SetRawValue
,
5753 d3d10_effect_shader_variable_GetRawValue
,
5754 /* ID3D10EffectShaderVariable methods */
5755 d3d10_effect_shader_variable_GetShaderDesc
,
5756 d3d10_effect_shader_variable_GetVertexShader
,
5757 d3d10_effect_shader_variable_GetGeometryShader
,
5758 d3d10_effect_shader_variable_GetPixelShader
,
5759 d3d10_effect_shader_variable_GetInputSignatureElementDesc
,
5760 d3d10_effect_shader_variable_GetOutputSignatureElementDesc
,
5763 /* ID3D10EffectVariable methods */
5765 static BOOL STDMETHODCALLTYPE
d3d10_effect_blend_variable_IsValid(ID3D10EffectBlendVariable
*iface
)
5767 TRACE("iface %p\n", iface
);
5769 return (struct d3d10_effect_variable
*)iface
!= &null_blend_variable
;
5772 static struct ID3D10EffectType
* STDMETHODCALLTYPE
d3d10_effect_blend_variable_GetType(
5773 ID3D10EffectBlendVariable
*iface
)
5775 return d3d10_effect_variable_GetType((ID3D10EffectVariable
*)iface
);
5778 static HRESULT STDMETHODCALLTYPE
d3d10_effect_blend_variable_GetDesc(ID3D10EffectBlendVariable
*iface
,
5779 D3D10_EFFECT_VARIABLE_DESC
*desc
)
5781 return d3d10_effect_variable_GetDesc((ID3D10EffectVariable
*)iface
, desc
);
5784 static struct ID3D10EffectVariable
* STDMETHODCALLTYPE
d3d10_effect_blend_variable_GetAnnotationByIndex(
5785 ID3D10EffectBlendVariable
*iface
, UINT index
)
5787 return d3d10_effect_variable_GetAnnotationByIndex((ID3D10EffectVariable
*)iface
, index
);
5790 static struct ID3D10EffectVariable
* STDMETHODCALLTYPE
d3d10_effect_blend_variable_GetAnnotationByName(
5791 ID3D10EffectBlendVariable
*iface
, LPCSTR name
)
5793 return d3d10_effect_variable_GetAnnotationByName((ID3D10EffectVariable
*)iface
, name
);
5796 static struct ID3D10EffectVariable
* STDMETHODCALLTYPE
d3d10_effect_blend_variable_GetMemberByIndex(
5797 ID3D10EffectBlendVariable
*iface
, UINT index
)
5799 return d3d10_effect_variable_GetMemberByIndex((ID3D10EffectVariable
*)iface
, index
);
5802 static struct ID3D10EffectVariable
* STDMETHODCALLTYPE
d3d10_effect_blend_variable_GetMemberByName(
5803 ID3D10EffectBlendVariable
*iface
, LPCSTR name
)
5805 return d3d10_effect_variable_GetMemberByName((ID3D10EffectVariable
*)iface
, name
);
5808 static struct ID3D10EffectVariable
* STDMETHODCALLTYPE
d3d10_effect_blend_variable_GetMemberBySemantic(
5809 ID3D10EffectBlendVariable
*iface
, LPCSTR semantic
)
5811 return d3d10_effect_variable_GetMemberBySemantic((ID3D10EffectVariable
*)iface
, semantic
);
5814 static struct ID3D10EffectVariable
* STDMETHODCALLTYPE
d3d10_effect_blend_variable_GetElement(
5815 ID3D10EffectBlendVariable
*iface
, UINT index
)
5817 return d3d10_effect_variable_GetElement((ID3D10EffectVariable
*)iface
, index
);
5820 static struct ID3D10EffectConstantBuffer
* STDMETHODCALLTYPE
d3d10_effect_blend_variable_GetParentConstantBuffer(
5821 ID3D10EffectBlendVariable
*iface
)
5823 return d3d10_effect_variable_GetParentConstantBuffer((ID3D10EffectVariable
*)iface
);
5826 static struct ID3D10EffectScalarVariable
* STDMETHODCALLTYPE
d3d10_effect_blend_variable_AsScalar(
5827 ID3D10EffectBlendVariable
*iface
)
5829 return d3d10_effect_variable_AsScalar((ID3D10EffectVariable
*)iface
);
5832 static struct ID3D10EffectVectorVariable
* STDMETHODCALLTYPE
d3d10_effect_blend_variable_AsVector(
5833 ID3D10EffectBlendVariable
*iface
)
5835 return d3d10_effect_variable_AsVector((ID3D10EffectVariable
*)iface
);
5838 static struct ID3D10EffectMatrixVariable
* STDMETHODCALLTYPE
d3d10_effect_blend_variable_AsMatrix(
5839 ID3D10EffectBlendVariable
*iface
)
5841 return d3d10_effect_variable_AsMatrix((ID3D10EffectVariable
*)iface
);
5844 static struct ID3D10EffectStringVariable
* STDMETHODCALLTYPE
d3d10_effect_blend_variable_AsString(
5845 ID3D10EffectBlendVariable
*iface
)
5847 return d3d10_effect_variable_AsString((ID3D10EffectVariable
*)iface
);
5850 static struct ID3D10EffectShaderResourceVariable
* STDMETHODCALLTYPE
d3d10_effect_blend_variable_AsShaderResource(
5851 ID3D10EffectBlendVariable
*iface
)
5853 return d3d10_effect_variable_AsShaderResource((ID3D10EffectVariable
*)iface
);
5856 static struct ID3D10EffectRenderTargetViewVariable
* STDMETHODCALLTYPE
d3d10_effect_blend_variable_AsRenderTargetView(
5857 ID3D10EffectBlendVariable
*iface
)
5859 return d3d10_effect_variable_AsRenderTargetView((ID3D10EffectVariable
*)iface
);
5862 static struct ID3D10EffectDepthStencilViewVariable
* STDMETHODCALLTYPE
d3d10_effect_blend_variable_AsDepthStencilView(
5863 ID3D10EffectBlendVariable
*iface
)
5865 return d3d10_effect_variable_AsDepthStencilView((ID3D10EffectVariable
*)iface
);
5868 static struct ID3D10EffectConstantBuffer
* STDMETHODCALLTYPE
d3d10_effect_blend_variable_AsConstantBuffer(
5869 ID3D10EffectBlendVariable
*iface
)
5871 return d3d10_effect_variable_AsConstantBuffer((ID3D10EffectVariable
*)iface
);
5874 static struct ID3D10EffectShaderVariable
* STDMETHODCALLTYPE
d3d10_effect_blend_variable_AsShader(
5875 ID3D10EffectBlendVariable
*iface
)
5877 return d3d10_effect_variable_AsShader((ID3D10EffectVariable
*)iface
);
5880 static struct ID3D10EffectBlendVariable
* STDMETHODCALLTYPE
d3d10_effect_blend_variable_AsBlend(
5881 ID3D10EffectBlendVariable
*iface
)
5883 return d3d10_effect_variable_AsBlend((ID3D10EffectVariable
*)iface
);
5886 static struct ID3D10EffectDepthStencilVariable
* STDMETHODCALLTYPE
d3d10_effect_blend_variable_AsDepthStencil(
5887 ID3D10EffectBlendVariable
*iface
)
5889 return d3d10_effect_variable_AsDepthStencil((ID3D10EffectVariable
*)iface
);
5892 static struct ID3D10EffectRasterizerVariable
* STDMETHODCALLTYPE
d3d10_effect_blend_variable_AsRasterizer(
5893 ID3D10EffectBlendVariable
*iface
)
5895 return d3d10_effect_variable_AsRasterizer((ID3D10EffectVariable
*)iface
);
5898 static struct ID3D10EffectSamplerVariable
* STDMETHODCALLTYPE
d3d10_effect_blend_variable_AsSampler(
5899 ID3D10EffectBlendVariable
*iface
)
5901 return d3d10_effect_variable_AsSampler((ID3D10EffectVariable
*)iface
);
5904 static HRESULT STDMETHODCALLTYPE
d3d10_effect_blend_variable_SetRawValue(ID3D10EffectBlendVariable
*iface
,
5905 void *data
, UINT offset
, UINT count
)
5907 return d3d10_effect_variable_SetRawValue((ID3D10EffectVariable
*)iface
, data
, offset
, count
);
5910 static HRESULT STDMETHODCALLTYPE
d3d10_effect_blend_variable_GetRawValue(ID3D10EffectBlendVariable
*iface
,
5911 void *data
, UINT offset
, UINT count
)
5913 return d3d10_effect_variable_GetRawValue((ID3D10EffectVariable
*)iface
, data
, offset
, count
);
5916 /* ID3D10EffectBlendVariable methods */
5918 static HRESULT STDMETHODCALLTYPE
d3d10_effect_blend_variable_GetBlendState(ID3D10EffectBlendVariable
*iface
,
5919 UINT index
, ID3D10BlendState
**blend_state
)
5921 FIXME("iface %p, index %u, blend_state %p stub!\n", iface
, index
, blend_state
);
5926 static HRESULT STDMETHODCALLTYPE
d3d10_effect_blend_variable_GetBackingStore(ID3D10EffectBlendVariable
*iface
,
5927 UINT index
, D3D10_BLEND_DESC
*desc
)
5929 struct d3d10_effect_variable
*v
= impl_from_ID3D10EffectVariable((ID3D10EffectVariable
*)iface
);
5931 TRACE("iface %p, index %u, desc %p.\n", iface
, index
, desc
);
5933 if (index
>= max(v
->type
->element_count
, 1))
5935 WARN("Invalid index %u.\n", index
);
5939 *desc
= ((D3D10_BLEND_DESC
*)v
->data
)[index
];
5945 static const struct ID3D10EffectBlendVariableVtbl d3d10_effect_blend_variable_vtbl
=
5947 /* ID3D10EffectVariable methods */
5948 d3d10_effect_blend_variable_IsValid
,
5949 d3d10_effect_blend_variable_GetType
,
5950 d3d10_effect_blend_variable_GetDesc
,
5951 d3d10_effect_blend_variable_GetAnnotationByIndex
,
5952 d3d10_effect_blend_variable_GetAnnotationByName
,
5953 d3d10_effect_blend_variable_GetMemberByIndex
,
5954 d3d10_effect_blend_variable_GetMemberByName
,
5955 d3d10_effect_blend_variable_GetMemberBySemantic
,
5956 d3d10_effect_blend_variable_GetElement
,
5957 d3d10_effect_blend_variable_GetParentConstantBuffer
,
5958 d3d10_effect_blend_variable_AsScalar
,
5959 d3d10_effect_blend_variable_AsVector
,
5960 d3d10_effect_blend_variable_AsMatrix
,
5961 d3d10_effect_blend_variable_AsString
,
5962 d3d10_effect_blend_variable_AsShaderResource
,
5963 d3d10_effect_blend_variable_AsRenderTargetView
,
5964 d3d10_effect_blend_variable_AsDepthStencilView
,
5965 d3d10_effect_blend_variable_AsConstantBuffer
,
5966 d3d10_effect_blend_variable_AsShader
,
5967 d3d10_effect_blend_variable_AsBlend
,
5968 d3d10_effect_blend_variable_AsDepthStencil
,
5969 d3d10_effect_blend_variable_AsRasterizer
,
5970 d3d10_effect_blend_variable_AsSampler
,
5971 d3d10_effect_blend_variable_SetRawValue
,
5972 d3d10_effect_blend_variable_GetRawValue
,
5973 /* ID3D10EffectBlendVariable methods */
5974 d3d10_effect_blend_variable_GetBlendState
,
5975 d3d10_effect_blend_variable_GetBackingStore
,
5978 /* ID3D10EffectVariable methods */
5980 static BOOL STDMETHODCALLTYPE
d3d10_effect_depth_stencil_variable_IsValid(ID3D10EffectDepthStencilVariable
*iface
)
5982 TRACE("iface %p\n", iface
);
5984 return (struct d3d10_effect_variable
*)iface
!= &null_depth_stencil_variable
;
5987 static struct ID3D10EffectType
* STDMETHODCALLTYPE
d3d10_effect_depth_stencil_variable_GetType(
5988 ID3D10EffectDepthStencilVariable
*iface
)
5990 return d3d10_effect_variable_GetType((ID3D10EffectVariable
*)iface
);
5993 static HRESULT STDMETHODCALLTYPE
d3d10_effect_depth_stencil_variable_GetDesc(ID3D10EffectDepthStencilVariable
*iface
,
5994 D3D10_EFFECT_VARIABLE_DESC
*desc
)
5996 return d3d10_effect_variable_GetDesc((ID3D10EffectVariable
*)iface
, desc
);
5999 static struct ID3D10EffectVariable
* STDMETHODCALLTYPE
d3d10_effect_depth_stencil_variable_GetAnnotationByIndex(
6000 ID3D10EffectDepthStencilVariable
*iface
, UINT index
)
6002 return d3d10_effect_variable_GetAnnotationByIndex((ID3D10EffectVariable
*)iface
, index
);
6005 static struct ID3D10EffectVariable
* STDMETHODCALLTYPE
d3d10_effect_depth_stencil_variable_GetAnnotationByName(
6006 ID3D10EffectDepthStencilVariable
*iface
, LPCSTR name
)
6008 return d3d10_effect_variable_GetAnnotationByName((ID3D10EffectVariable
*)iface
, name
);
6011 static struct ID3D10EffectVariable
* STDMETHODCALLTYPE
d3d10_effect_depth_stencil_variable_GetMemberByIndex(
6012 ID3D10EffectDepthStencilVariable
*iface
, UINT index
)
6014 return d3d10_effect_variable_GetMemberByIndex((ID3D10EffectVariable
*)iface
, index
);
6017 static struct ID3D10EffectVariable
* STDMETHODCALLTYPE
d3d10_effect_depth_stencil_variable_GetMemberByName(
6018 ID3D10EffectDepthStencilVariable
*iface
, LPCSTR name
)
6020 return d3d10_effect_variable_GetMemberByName((ID3D10EffectVariable
*)iface
, name
);
6023 static struct ID3D10EffectVariable
* STDMETHODCALLTYPE
d3d10_effect_depth_stencil_variable_GetMemberBySemantic(
6024 ID3D10EffectDepthStencilVariable
*iface
, LPCSTR semantic
)
6026 return d3d10_effect_variable_GetMemberBySemantic((ID3D10EffectVariable
*)iface
, semantic
);
6029 static struct ID3D10EffectVariable
* STDMETHODCALLTYPE
d3d10_effect_depth_stencil_variable_GetElement(
6030 ID3D10EffectDepthStencilVariable
*iface
, UINT index
)
6032 return d3d10_effect_variable_GetElement((ID3D10EffectVariable
*)iface
, index
);
6035 static struct ID3D10EffectConstantBuffer
* STDMETHODCALLTYPE
d3d10_effect_depth_stencil_variable_GetParentConstantBuffer(
6036 ID3D10EffectDepthStencilVariable
*iface
)
6038 return d3d10_effect_variable_GetParentConstantBuffer((ID3D10EffectVariable
*)iface
);
6041 static struct ID3D10EffectScalarVariable
* STDMETHODCALLTYPE
d3d10_effect_depth_stencil_variable_AsScalar(
6042 ID3D10EffectDepthStencilVariable
*iface
)
6044 return d3d10_effect_variable_AsScalar((ID3D10EffectVariable
*)iface
);
6047 static struct ID3D10EffectVectorVariable
* STDMETHODCALLTYPE
d3d10_effect_depth_stencil_variable_AsVector(
6048 ID3D10EffectDepthStencilVariable
*iface
)
6050 return d3d10_effect_variable_AsVector((ID3D10EffectVariable
*)iface
);
6053 static struct ID3D10EffectMatrixVariable
* STDMETHODCALLTYPE
d3d10_effect_depth_stencil_variable_AsMatrix(
6054 ID3D10EffectDepthStencilVariable
*iface
)
6056 return d3d10_effect_variable_AsMatrix((ID3D10EffectVariable
*)iface
);
6059 static struct ID3D10EffectStringVariable
* STDMETHODCALLTYPE
d3d10_effect_depth_stencil_variable_AsString(
6060 ID3D10EffectDepthStencilVariable
*iface
)
6062 return d3d10_effect_variable_AsString((ID3D10EffectVariable
*)iface
);
6065 static struct ID3D10EffectShaderResourceVariable
* STDMETHODCALLTYPE
d3d10_effect_depth_stencil_variable_AsShaderResource(
6066 ID3D10EffectDepthStencilVariable
*iface
)
6068 return d3d10_effect_variable_AsShaderResource((ID3D10EffectVariable
*)iface
);
6071 static struct ID3D10EffectRenderTargetViewVariable
* STDMETHODCALLTYPE
d3d10_effect_depth_stencil_variable_AsRenderTargetView(
6072 ID3D10EffectDepthStencilVariable
*iface
)
6074 return d3d10_effect_variable_AsRenderTargetView((ID3D10EffectVariable
*)iface
);
6077 static struct ID3D10EffectDepthStencilViewVariable
* STDMETHODCALLTYPE
d3d10_effect_depth_stencil_variable_AsDepthStencilView(
6078 ID3D10EffectDepthStencilVariable
*iface
)
6080 return d3d10_effect_variable_AsDepthStencilView((ID3D10EffectVariable
*)iface
);
6083 static struct ID3D10EffectConstantBuffer
* STDMETHODCALLTYPE
d3d10_effect_depth_stencil_variable_AsConstantBuffer(
6084 ID3D10EffectDepthStencilVariable
*iface
)
6086 return d3d10_effect_variable_AsConstantBuffer((ID3D10EffectVariable
*)iface
);
6089 static struct ID3D10EffectShaderVariable
* STDMETHODCALLTYPE
d3d10_effect_depth_stencil_variable_AsShader(
6090 ID3D10EffectDepthStencilVariable
*iface
)
6092 return d3d10_effect_variable_AsShader((ID3D10EffectVariable
*)iface
);
6095 static struct ID3D10EffectBlendVariable
* STDMETHODCALLTYPE
d3d10_effect_depth_stencil_variable_AsBlend(
6096 ID3D10EffectDepthStencilVariable
*iface
)
6098 return d3d10_effect_variable_AsBlend((ID3D10EffectVariable
*)iface
);
6101 static struct ID3D10EffectDepthStencilVariable
* STDMETHODCALLTYPE
d3d10_effect_depth_stencil_variable_AsDepthStencil(
6102 ID3D10EffectDepthStencilVariable
*iface
)
6104 return d3d10_effect_variable_AsDepthStencil((ID3D10EffectVariable
*)iface
);
6107 static struct ID3D10EffectRasterizerVariable
* STDMETHODCALLTYPE
d3d10_effect_depth_stencil_variable_AsRasterizer(
6108 ID3D10EffectDepthStencilVariable
*iface
)
6110 return d3d10_effect_variable_AsRasterizer((ID3D10EffectVariable
*)iface
);
6113 static struct ID3D10EffectSamplerVariable
* STDMETHODCALLTYPE
d3d10_effect_depth_stencil_variable_AsSampler(
6114 ID3D10EffectDepthStencilVariable
*iface
)
6116 return d3d10_effect_variable_AsSampler((ID3D10EffectVariable
*)iface
);
6119 static HRESULT STDMETHODCALLTYPE
d3d10_effect_depth_stencil_variable_SetRawValue(ID3D10EffectDepthStencilVariable
*iface
,
6120 void *data
, UINT offset
, UINT count
)
6122 return d3d10_effect_variable_SetRawValue((ID3D10EffectVariable
*)iface
, data
, offset
, count
);
6125 static HRESULT STDMETHODCALLTYPE
d3d10_effect_depth_stencil_variable_GetRawValue(ID3D10EffectDepthStencilVariable
*iface
,
6126 void *data
, UINT offset
, UINT count
)
6128 return d3d10_effect_variable_GetRawValue((ID3D10EffectVariable
*)iface
, data
, offset
, count
);
6131 /* ID3D10EffectDepthStencilVariable methods */
6133 static HRESULT STDMETHODCALLTYPE
d3d10_effect_depth_stencil_variable_GetDepthStencilState(ID3D10EffectDepthStencilVariable
*iface
,
6134 UINT index
, ID3D10DepthStencilState
**depth_stencil_state
)
6136 FIXME("iface %p, index %u, depth_stencil_state %p stub!\n", iface
, index
, depth_stencil_state
);
6141 static HRESULT STDMETHODCALLTYPE
d3d10_effect_depth_stencil_variable_GetBackingStore(ID3D10EffectDepthStencilVariable
*iface
,
6142 UINT index
, D3D10_DEPTH_STENCIL_DESC
*desc
)
6144 struct d3d10_effect_variable
*v
= impl_from_ID3D10EffectVariable((ID3D10EffectVariable
*)iface
);
6146 TRACE("iface %p, index %u, desc %p.\n", iface
, index
, desc
);
6148 if (index
>= max(v
->type
->element_count
, 1))
6150 WARN("Invalid index %u.\n", index
);
6154 *desc
= ((D3D10_DEPTH_STENCIL_DESC
*)v
->data
)[index
];
6160 static const struct ID3D10EffectDepthStencilVariableVtbl d3d10_effect_depth_stencil_variable_vtbl
=
6162 /* ID3D10EffectVariable methods */
6163 d3d10_effect_depth_stencil_variable_IsValid
,
6164 d3d10_effect_depth_stencil_variable_GetType
,
6165 d3d10_effect_depth_stencil_variable_GetDesc
,
6166 d3d10_effect_depth_stencil_variable_GetAnnotationByIndex
,
6167 d3d10_effect_depth_stencil_variable_GetAnnotationByName
,
6168 d3d10_effect_depth_stencil_variable_GetMemberByIndex
,
6169 d3d10_effect_depth_stencil_variable_GetMemberByName
,
6170 d3d10_effect_depth_stencil_variable_GetMemberBySemantic
,
6171 d3d10_effect_depth_stencil_variable_GetElement
,
6172 d3d10_effect_depth_stencil_variable_GetParentConstantBuffer
,
6173 d3d10_effect_depth_stencil_variable_AsScalar
,
6174 d3d10_effect_depth_stencil_variable_AsVector
,
6175 d3d10_effect_depth_stencil_variable_AsMatrix
,
6176 d3d10_effect_depth_stencil_variable_AsString
,
6177 d3d10_effect_depth_stencil_variable_AsShaderResource
,
6178 d3d10_effect_depth_stencil_variable_AsRenderTargetView
,
6179 d3d10_effect_depth_stencil_variable_AsDepthStencilView
,
6180 d3d10_effect_depth_stencil_variable_AsConstantBuffer
,
6181 d3d10_effect_depth_stencil_variable_AsShader
,
6182 d3d10_effect_depth_stencil_variable_AsBlend
,
6183 d3d10_effect_depth_stencil_variable_AsDepthStencil
,
6184 d3d10_effect_depth_stencil_variable_AsRasterizer
,
6185 d3d10_effect_depth_stencil_variable_AsSampler
,
6186 d3d10_effect_depth_stencil_variable_SetRawValue
,
6187 d3d10_effect_depth_stencil_variable_GetRawValue
,
6188 /* ID3D10EffectDepthStencilVariable methods */
6189 d3d10_effect_depth_stencil_variable_GetDepthStencilState
,
6190 d3d10_effect_depth_stencil_variable_GetBackingStore
,
6193 /* ID3D10EffectVariable methods */
6195 static BOOL STDMETHODCALLTYPE
d3d10_effect_rasterizer_variable_IsValid(ID3D10EffectRasterizerVariable
*iface
)
6197 TRACE("iface %p\n", iface
);
6199 return (struct d3d10_effect_variable
*)iface
!= &null_rasterizer_variable
;
6202 static struct ID3D10EffectType
* STDMETHODCALLTYPE
d3d10_effect_rasterizer_variable_GetType(
6203 ID3D10EffectRasterizerVariable
*iface
)
6205 return d3d10_effect_variable_GetType((ID3D10EffectVariable
*)iface
);
6208 static HRESULT STDMETHODCALLTYPE
d3d10_effect_rasterizer_variable_GetDesc(ID3D10EffectRasterizerVariable
*iface
,
6209 D3D10_EFFECT_VARIABLE_DESC
*desc
)
6211 return d3d10_effect_variable_GetDesc((ID3D10EffectVariable
*)iface
, desc
);
6214 static struct ID3D10EffectVariable
* STDMETHODCALLTYPE
d3d10_effect_rasterizer_variable_GetAnnotationByIndex(
6215 ID3D10EffectRasterizerVariable
*iface
, UINT index
)
6217 return d3d10_effect_variable_GetAnnotationByIndex((ID3D10EffectVariable
*)iface
, index
);
6220 static struct ID3D10EffectVariable
* STDMETHODCALLTYPE
d3d10_effect_rasterizer_variable_GetAnnotationByName(
6221 ID3D10EffectRasterizerVariable
*iface
, LPCSTR name
)
6223 return d3d10_effect_variable_GetAnnotationByName((ID3D10EffectVariable
*)iface
, name
);
6226 static struct ID3D10EffectVariable
* STDMETHODCALLTYPE
d3d10_effect_rasterizer_variable_GetMemberByIndex(
6227 ID3D10EffectRasterizerVariable
*iface
, UINT index
)
6229 return d3d10_effect_variable_GetMemberByIndex((ID3D10EffectVariable
*)iface
, index
);
6232 static struct ID3D10EffectVariable
* STDMETHODCALLTYPE
d3d10_effect_rasterizer_variable_GetMemberByName(
6233 ID3D10EffectRasterizerVariable
*iface
, LPCSTR name
)
6235 return d3d10_effect_variable_GetMemberByName((ID3D10EffectVariable
*)iface
, name
);
6238 static struct ID3D10EffectVariable
* STDMETHODCALLTYPE
d3d10_effect_rasterizer_variable_GetMemberBySemantic(
6239 ID3D10EffectRasterizerVariable
*iface
, LPCSTR semantic
)
6241 return d3d10_effect_variable_GetMemberBySemantic((ID3D10EffectVariable
*)iface
, semantic
);
6244 static struct ID3D10EffectVariable
* STDMETHODCALLTYPE
d3d10_effect_rasterizer_variable_GetElement(
6245 ID3D10EffectRasterizerVariable
*iface
, UINT index
)
6247 return d3d10_effect_variable_GetElement((ID3D10EffectVariable
*)iface
, index
);
6250 static struct ID3D10EffectConstantBuffer
* STDMETHODCALLTYPE
d3d10_effect_rasterizer_variable_GetParentConstantBuffer(
6251 ID3D10EffectRasterizerVariable
*iface
)
6253 return d3d10_effect_variable_GetParentConstantBuffer((ID3D10EffectVariable
*)iface
);
6256 static struct ID3D10EffectScalarVariable
* STDMETHODCALLTYPE
d3d10_effect_rasterizer_variable_AsScalar(
6257 ID3D10EffectRasterizerVariable
*iface
)
6259 return d3d10_effect_variable_AsScalar((ID3D10EffectVariable
*)iface
);
6262 static struct ID3D10EffectVectorVariable
* STDMETHODCALLTYPE
d3d10_effect_rasterizer_variable_AsVector(
6263 ID3D10EffectRasterizerVariable
*iface
)
6265 return d3d10_effect_variable_AsVector((ID3D10EffectVariable
*)iface
);
6268 static struct ID3D10EffectMatrixVariable
* STDMETHODCALLTYPE
d3d10_effect_rasterizer_variable_AsMatrix(
6269 ID3D10EffectRasterizerVariable
*iface
)
6271 return d3d10_effect_variable_AsMatrix((ID3D10EffectVariable
*)iface
);
6274 static struct ID3D10EffectStringVariable
* STDMETHODCALLTYPE
d3d10_effect_rasterizer_variable_AsString(
6275 ID3D10EffectRasterizerVariable
*iface
)
6277 return d3d10_effect_variable_AsString((ID3D10EffectVariable
*)iface
);
6280 static struct ID3D10EffectShaderResourceVariable
* STDMETHODCALLTYPE
d3d10_effect_rasterizer_variable_AsShaderResource(
6281 ID3D10EffectRasterizerVariable
*iface
)
6283 return d3d10_effect_variable_AsShaderResource((ID3D10EffectVariable
*)iface
);
6286 static struct ID3D10EffectRenderTargetViewVariable
* STDMETHODCALLTYPE
d3d10_effect_rasterizer_variable_AsRenderTargetView(
6287 ID3D10EffectRasterizerVariable
*iface
)
6289 return d3d10_effect_variable_AsRenderTargetView((ID3D10EffectVariable
*)iface
);
6292 static struct ID3D10EffectDepthStencilViewVariable
* STDMETHODCALLTYPE
d3d10_effect_rasterizer_variable_AsDepthStencilView(
6293 ID3D10EffectRasterizerVariable
*iface
)
6295 return d3d10_effect_variable_AsDepthStencilView((ID3D10EffectVariable
*)iface
);
6298 static struct ID3D10EffectConstantBuffer
* STDMETHODCALLTYPE
d3d10_effect_rasterizer_variable_AsConstantBuffer(
6299 ID3D10EffectRasterizerVariable
*iface
)
6301 return d3d10_effect_variable_AsConstantBuffer((ID3D10EffectVariable
*)iface
);
6304 static struct ID3D10EffectShaderVariable
* STDMETHODCALLTYPE
d3d10_effect_rasterizer_variable_AsShader(
6305 ID3D10EffectRasterizerVariable
*iface
)
6307 return d3d10_effect_variable_AsShader((ID3D10EffectVariable
*)iface
);
6310 static struct ID3D10EffectBlendVariable
* STDMETHODCALLTYPE
d3d10_effect_rasterizer_variable_AsBlend(
6311 ID3D10EffectRasterizerVariable
*iface
)
6313 return d3d10_effect_variable_AsBlend((ID3D10EffectVariable
*)iface
);
6316 static struct ID3D10EffectDepthStencilVariable
* STDMETHODCALLTYPE
d3d10_effect_rasterizer_variable_AsDepthStencil(
6317 ID3D10EffectRasterizerVariable
*iface
)
6319 return d3d10_effect_variable_AsDepthStencil((ID3D10EffectVariable
*)iface
);
6322 static struct ID3D10EffectRasterizerVariable
* STDMETHODCALLTYPE
d3d10_effect_rasterizer_variable_AsRasterizer(
6323 ID3D10EffectRasterizerVariable
*iface
)
6325 return d3d10_effect_variable_AsRasterizer((ID3D10EffectVariable
*)iface
);
6328 static struct ID3D10EffectSamplerVariable
* STDMETHODCALLTYPE
d3d10_effect_rasterizer_variable_AsSampler(
6329 ID3D10EffectRasterizerVariable
*iface
)
6331 return d3d10_effect_variable_AsSampler((ID3D10EffectVariable
*)iface
);
6334 static HRESULT STDMETHODCALLTYPE
d3d10_effect_rasterizer_variable_SetRawValue(ID3D10EffectRasterizerVariable
*iface
,
6335 void *data
, UINT offset
, UINT count
)
6337 return d3d10_effect_variable_SetRawValue((ID3D10EffectVariable
*)iface
, data
, offset
, count
);
6340 static HRESULT STDMETHODCALLTYPE
d3d10_effect_rasterizer_variable_GetRawValue(ID3D10EffectRasterizerVariable
*iface
,
6341 void *data
, UINT offset
, UINT count
)
6343 return d3d10_effect_variable_GetRawValue((ID3D10EffectVariable
*)iface
, data
, offset
, count
);
6346 /* ID3D10EffectRasterizerVariable methods */
6348 static HRESULT STDMETHODCALLTYPE
d3d10_effect_rasterizer_variable_GetRasterizerState(ID3D10EffectRasterizerVariable
*iface
,
6349 UINT index
, ID3D10RasterizerState
**rasterizer_state
)
6351 FIXME("iface %p, index %u, rasterizer_state %p stub!\n", iface
, index
, rasterizer_state
);
6356 static HRESULT STDMETHODCALLTYPE
d3d10_effect_rasterizer_variable_GetBackingStore(ID3D10EffectRasterizerVariable
*iface
,
6357 UINT index
, D3D10_RASTERIZER_DESC
*desc
)
6359 struct d3d10_effect_variable
*v
= impl_from_ID3D10EffectVariable((ID3D10EffectVariable
*)iface
);
6361 TRACE("iface %p, index %u, desc %p.\n", iface
, index
, desc
);
6363 if (index
>= max(v
->type
->element_count
, 1))
6365 WARN("Invalid index %u.\n", index
);
6369 *desc
= ((D3D10_RASTERIZER_DESC
*)v
->data
)[index
];
6375 static const struct ID3D10EffectRasterizerVariableVtbl d3d10_effect_rasterizer_variable_vtbl
=
6377 /* ID3D10EffectVariable methods */
6378 d3d10_effect_rasterizer_variable_IsValid
,
6379 d3d10_effect_rasterizer_variable_GetType
,
6380 d3d10_effect_rasterizer_variable_GetDesc
,
6381 d3d10_effect_rasterizer_variable_GetAnnotationByIndex
,
6382 d3d10_effect_rasterizer_variable_GetAnnotationByName
,
6383 d3d10_effect_rasterizer_variable_GetMemberByIndex
,
6384 d3d10_effect_rasterizer_variable_GetMemberByName
,
6385 d3d10_effect_rasterizer_variable_GetMemberBySemantic
,
6386 d3d10_effect_rasterizer_variable_GetElement
,
6387 d3d10_effect_rasterizer_variable_GetParentConstantBuffer
,
6388 d3d10_effect_rasterizer_variable_AsScalar
,
6389 d3d10_effect_rasterizer_variable_AsVector
,
6390 d3d10_effect_rasterizer_variable_AsMatrix
,
6391 d3d10_effect_rasterizer_variable_AsString
,
6392 d3d10_effect_rasterizer_variable_AsShaderResource
,
6393 d3d10_effect_rasterizer_variable_AsRenderTargetView
,
6394 d3d10_effect_rasterizer_variable_AsDepthStencilView
,
6395 d3d10_effect_rasterizer_variable_AsConstantBuffer
,
6396 d3d10_effect_rasterizer_variable_AsShader
,
6397 d3d10_effect_rasterizer_variable_AsBlend
,
6398 d3d10_effect_rasterizer_variable_AsDepthStencil
,
6399 d3d10_effect_rasterizer_variable_AsRasterizer
,
6400 d3d10_effect_rasterizer_variable_AsSampler
,
6401 d3d10_effect_rasterizer_variable_SetRawValue
,
6402 d3d10_effect_rasterizer_variable_GetRawValue
,
6403 /* ID3D10EffectRasterizerVariable methods */
6404 d3d10_effect_rasterizer_variable_GetRasterizerState
,
6405 d3d10_effect_rasterizer_variable_GetBackingStore
,
6408 /* ID3D10EffectVariable methods */
6410 static BOOL STDMETHODCALLTYPE
d3d10_effect_sampler_variable_IsValid(ID3D10EffectSamplerVariable
*iface
)
6412 TRACE("iface %p\n", iface
);
6414 return (struct d3d10_effect_variable
*)iface
!= &null_sampler_variable
;
6417 static struct ID3D10EffectType
* STDMETHODCALLTYPE
d3d10_effect_sampler_variable_GetType(
6418 ID3D10EffectSamplerVariable
*iface
)
6420 return d3d10_effect_variable_GetType((ID3D10EffectVariable
*)iface
);
6423 static HRESULT STDMETHODCALLTYPE
d3d10_effect_sampler_variable_GetDesc(ID3D10EffectSamplerVariable
*iface
,
6424 D3D10_EFFECT_VARIABLE_DESC
*desc
)
6426 return d3d10_effect_variable_GetDesc((ID3D10EffectVariable
*)iface
, desc
);
6429 static struct ID3D10EffectVariable
* STDMETHODCALLTYPE
d3d10_effect_sampler_variable_GetAnnotationByIndex(
6430 ID3D10EffectSamplerVariable
*iface
, UINT index
)
6432 return d3d10_effect_variable_GetAnnotationByIndex((ID3D10EffectVariable
*)iface
, index
);
6435 static struct ID3D10EffectVariable
* STDMETHODCALLTYPE
d3d10_effect_sampler_variable_GetAnnotationByName(
6436 ID3D10EffectSamplerVariable
*iface
, LPCSTR name
)
6438 return d3d10_effect_variable_GetAnnotationByName((ID3D10EffectVariable
*)iface
, name
);
6441 static struct ID3D10EffectVariable
* STDMETHODCALLTYPE
d3d10_effect_sampler_variable_GetMemberByIndex(
6442 ID3D10EffectSamplerVariable
*iface
, UINT index
)
6444 return d3d10_effect_variable_GetMemberByIndex((ID3D10EffectVariable
*)iface
, index
);
6447 static struct ID3D10EffectVariable
* STDMETHODCALLTYPE
d3d10_effect_sampler_variable_GetMemberByName(
6448 ID3D10EffectSamplerVariable
*iface
, LPCSTR name
)
6450 return d3d10_effect_variable_GetMemberByName((ID3D10EffectVariable
*)iface
, name
);
6453 static struct ID3D10EffectVariable
* STDMETHODCALLTYPE
d3d10_effect_sampler_variable_GetMemberBySemantic(
6454 ID3D10EffectSamplerVariable
*iface
, LPCSTR semantic
)
6456 return d3d10_effect_variable_GetMemberBySemantic((ID3D10EffectVariable
*)iface
, semantic
);
6459 static struct ID3D10EffectVariable
* STDMETHODCALLTYPE
d3d10_effect_sampler_variable_GetElement(
6460 ID3D10EffectSamplerVariable
*iface
, UINT index
)
6462 return d3d10_effect_variable_GetElement((ID3D10EffectVariable
*)iface
, index
);
6465 static struct ID3D10EffectConstantBuffer
* STDMETHODCALLTYPE
d3d10_effect_sampler_variable_GetParentConstantBuffer(
6466 ID3D10EffectSamplerVariable
*iface
)
6468 return d3d10_effect_variable_GetParentConstantBuffer((ID3D10EffectVariable
*)iface
);
6471 static struct ID3D10EffectScalarVariable
* STDMETHODCALLTYPE
d3d10_effect_sampler_variable_AsScalar(
6472 ID3D10EffectSamplerVariable
*iface
)
6474 return d3d10_effect_variable_AsScalar((ID3D10EffectVariable
*)iface
);
6477 static struct ID3D10EffectVectorVariable
* STDMETHODCALLTYPE
d3d10_effect_sampler_variable_AsVector(
6478 ID3D10EffectSamplerVariable
*iface
)
6480 return d3d10_effect_variable_AsVector((ID3D10EffectVariable
*)iface
);
6483 static struct ID3D10EffectMatrixVariable
* STDMETHODCALLTYPE
d3d10_effect_sampler_variable_AsMatrix(
6484 ID3D10EffectSamplerVariable
*iface
)
6486 return d3d10_effect_variable_AsMatrix((ID3D10EffectVariable
*)iface
);
6489 static struct ID3D10EffectStringVariable
* STDMETHODCALLTYPE
d3d10_effect_sampler_variable_AsString(
6490 ID3D10EffectSamplerVariable
*iface
)
6492 return d3d10_effect_variable_AsString((ID3D10EffectVariable
*)iface
);
6495 static struct ID3D10EffectShaderResourceVariable
* STDMETHODCALLTYPE
d3d10_effect_sampler_variable_AsShaderResource(
6496 ID3D10EffectSamplerVariable
*iface
)
6498 return d3d10_effect_variable_AsShaderResource((ID3D10EffectVariable
*)iface
);
6501 static struct ID3D10EffectRenderTargetViewVariable
* STDMETHODCALLTYPE
d3d10_effect_sampler_variable_AsRenderTargetView(
6502 ID3D10EffectSamplerVariable
*iface
)
6504 return d3d10_effect_variable_AsRenderTargetView((ID3D10EffectVariable
*)iface
);
6507 static struct ID3D10EffectDepthStencilViewVariable
* STDMETHODCALLTYPE
d3d10_effect_sampler_variable_AsDepthStencilView(
6508 ID3D10EffectSamplerVariable
*iface
)
6510 return d3d10_effect_variable_AsDepthStencilView((ID3D10EffectVariable
*)iface
);
6513 static struct ID3D10EffectConstantBuffer
* STDMETHODCALLTYPE
d3d10_effect_sampler_variable_AsConstantBuffer(
6514 ID3D10EffectSamplerVariable
*iface
)
6516 return d3d10_effect_variable_AsConstantBuffer((ID3D10EffectVariable
*)iface
);
6519 static struct ID3D10EffectShaderVariable
* STDMETHODCALLTYPE
d3d10_effect_sampler_variable_AsShader(
6520 ID3D10EffectSamplerVariable
*iface
)
6522 return d3d10_effect_variable_AsShader((ID3D10EffectVariable
*)iface
);
6525 static struct ID3D10EffectBlendVariable
* STDMETHODCALLTYPE
d3d10_effect_sampler_variable_AsBlend(
6526 ID3D10EffectSamplerVariable
*iface
)
6528 return d3d10_effect_variable_AsBlend((ID3D10EffectVariable
*)iface
);
6531 static struct ID3D10EffectDepthStencilVariable
* STDMETHODCALLTYPE
d3d10_effect_sampler_variable_AsDepthStencil(
6532 ID3D10EffectSamplerVariable
*iface
)
6534 return d3d10_effect_variable_AsDepthStencil((ID3D10EffectVariable
*)iface
);
6537 static struct ID3D10EffectRasterizerVariable
* STDMETHODCALLTYPE
d3d10_effect_sampler_variable_AsRasterizer(
6538 ID3D10EffectSamplerVariable
*iface
)
6540 return d3d10_effect_variable_AsRasterizer((ID3D10EffectVariable
*)iface
);
6543 static struct ID3D10EffectSamplerVariable
* STDMETHODCALLTYPE
d3d10_effect_sampler_variable_AsSampler(
6544 ID3D10EffectSamplerVariable
*iface
)
6546 return d3d10_effect_variable_AsSampler((ID3D10EffectVariable
*)iface
);
6549 static HRESULT STDMETHODCALLTYPE
d3d10_effect_sampler_variable_SetRawValue(ID3D10EffectSamplerVariable
*iface
,
6550 void *data
, UINT offset
, UINT count
)
6552 return d3d10_effect_variable_SetRawValue((ID3D10EffectVariable
*)iface
, data
, offset
, count
);
6555 static HRESULT STDMETHODCALLTYPE
d3d10_effect_sampler_variable_GetRawValue(ID3D10EffectSamplerVariable
*iface
,
6556 void *data
, UINT offset
, UINT count
)
6558 return d3d10_effect_variable_GetRawValue((ID3D10EffectVariable
*)iface
, data
, offset
, count
);
6561 /* ID3D10EffectSamplerVariable methods */
6563 static HRESULT STDMETHODCALLTYPE
d3d10_effect_sampler_variable_GetSampler(ID3D10EffectSamplerVariable
*iface
,
6564 UINT index
, ID3D10SamplerState
**sampler
)
6566 FIXME("iface %p, index %u, sampler %p stub!\n", iface
, index
, sampler
);
6571 static HRESULT STDMETHODCALLTYPE
d3d10_effect_sampler_variable_GetBackingStore(ID3D10EffectSamplerVariable
*iface
,
6572 UINT index
, D3D10_SAMPLER_DESC
*desc
)
6574 struct d3d10_effect_variable
*v
= impl_from_ID3D10EffectVariable((ID3D10EffectVariable
*)iface
);
6576 TRACE("iface %p, index %u, desc %p.\n", iface
, index
, desc
);
6578 if (index
>= max(v
->type
->element_count
, 1))
6580 WARN("Invalid index %u.\n", index
);
6584 *desc
= ((D3D10_SAMPLER_DESC
*)v
->data
)[index
];
6590 static const struct ID3D10EffectSamplerVariableVtbl d3d10_effect_sampler_variable_vtbl
=
6592 /* ID3D10EffectVariable methods */
6593 d3d10_effect_sampler_variable_IsValid
,
6594 d3d10_effect_sampler_variable_GetType
,
6595 d3d10_effect_sampler_variable_GetDesc
,
6596 d3d10_effect_sampler_variable_GetAnnotationByIndex
,
6597 d3d10_effect_sampler_variable_GetAnnotationByName
,
6598 d3d10_effect_sampler_variable_GetMemberByIndex
,
6599 d3d10_effect_sampler_variable_GetMemberByName
,
6600 d3d10_effect_sampler_variable_GetMemberBySemantic
,
6601 d3d10_effect_sampler_variable_GetElement
,
6602 d3d10_effect_sampler_variable_GetParentConstantBuffer
,
6603 d3d10_effect_sampler_variable_AsScalar
,
6604 d3d10_effect_sampler_variable_AsVector
,
6605 d3d10_effect_sampler_variable_AsMatrix
,
6606 d3d10_effect_sampler_variable_AsString
,
6607 d3d10_effect_sampler_variable_AsShaderResource
,
6608 d3d10_effect_sampler_variable_AsRenderTargetView
,
6609 d3d10_effect_sampler_variable_AsDepthStencilView
,
6610 d3d10_effect_sampler_variable_AsConstantBuffer
,
6611 d3d10_effect_sampler_variable_AsShader
,
6612 d3d10_effect_sampler_variable_AsBlend
,
6613 d3d10_effect_sampler_variable_AsDepthStencil
,
6614 d3d10_effect_sampler_variable_AsRasterizer
,
6615 d3d10_effect_sampler_variable_AsSampler
,
6616 d3d10_effect_sampler_variable_SetRawValue
,
6617 d3d10_effect_sampler_variable_GetRawValue
,
6618 /* ID3D10EffectSamplerVariable methods */
6619 d3d10_effect_sampler_variable_GetSampler
,
6620 d3d10_effect_sampler_variable_GetBackingStore
,
6623 /* ID3D10EffectType methods */
6625 static inline struct d3d10_effect_type
*impl_from_ID3D10EffectType(ID3D10EffectType
*iface
)
6627 return CONTAINING_RECORD(iface
, struct d3d10_effect_type
, ID3D10EffectType_iface
);
6630 static BOOL STDMETHODCALLTYPE
d3d10_effect_type_IsValid(ID3D10EffectType
*iface
)
6632 struct d3d10_effect_type
*This
= impl_from_ID3D10EffectType(iface
);
6634 TRACE("iface %p\n", iface
);
6636 return This
!= &null_type
;
6639 static HRESULT STDMETHODCALLTYPE
d3d10_effect_type_GetDesc(ID3D10EffectType
*iface
, D3D10_EFFECT_TYPE_DESC
*desc
)
6641 struct d3d10_effect_type
*This
= impl_from_ID3D10EffectType(iface
);
6643 TRACE("iface %p, desc %p\n", iface
, desc
);
6645 if (This
== &null_type
)
6647 WARN("Null type specified\n");
6653 WARN("Invalid argument specified\n");
6654 return E_INVALIDARG
;
6657 desc
->TypeName
= This
->name
;
6658 desc
->Class
= This
->type_class
;
6659 desc
->Type
= This
->basetype
;
6660 desc
->Elements
= This
->element_count
;
6661 desc
->Members
= This
->member_count
;
6662 desc
->Rows
= This
->row_count
;
6663 desc
->Columns
= This
->column_count
;
6664 desc
->PackedSize
= This
->size_packed
;
6665 desc
->UnpackedSize
= This
->size_unpacked
;
6666 desc
->Stride
= This
->stride
;
6671 static struct ID3D10EffectType
* STDMETHODCALLTYPE
d3d10_effect_type_GetMemberTypeByIndex(ID3D10EffectType
*iface
,
6674 struct d3d10_effect_type
*This
= impl_from_ID3D10EffectType(iface
);
6675 struct d3d10_effect_type
*t
;
6677 TRACE("iface %p, index %u\n", iface
, index
);
6679 if (index
>= This
->member_count
)
6681 WARN("Invalid index specified\n");
6682 return &null_type
.ID3D10EffectType_iface
;
6685 t
= (&This
->members
[index
])->type
;
6687 TRACE("Returning member %p, %s\n", t
, debugstr_a(t
->name
));
6689 return &t
->ID3D10EffectType_iface
;
6692 static struct ID3D10EffectType
* STDMETHODCALLTYPE
d3d10_effect_type_GetMemberTypeByName(ID3D10EffectType
*iface
,
6695 struct d3d10_effect_type
*This
= impl_from_ID3D10EffectType(iface
);
6698 TRACE("iface %p, name %s\n", iface
, debugstr_a(name
));
6702 WARN("Invalid name specified\n");
6703 return &null_type
.ID3D10EffectType_iface
;
6706 for (i
= 0; i
< This
->member_count
; ++i
)
6708 struct d3d10_effect_type_member
*typem
= &This
->members
[i
];
6712 if (!strcmp(typem
->name
, name
))
6714 TRACE("Returning type %p.\n", typem
->type
);
6715 return &typem
->type
->ID3D10EffectType_iface
;
6720 WARN("Invalid name specified\n");
6722 return &null_type
.ID3D10EffectType_iface
;
6725 static struct ID3D10EffectType
* STDMETHODCALLTYPE
d3d10_effect_type_GetMemberTypeBySemantic(ID3D10EffectType
*iface
,
6728 struct d3d10_effect_type
*This
= impl_from_ID3D10EffectType(iface
);
6731 TRACE("iface %p, semantic %s\n", iface
, debugstr_a(semantic
));
6735 WARN("Invalid semantic specified\n");
6736 return &null_type
.ID3D10EffectType_iface
;
6739 for (i
= 0; i
< This
->member_count
; ++i
)
6741 struct d3d10_effect_type_member
*typem
= &This
->members
[i
];
6743 if (typem
->semantic
)
6745 if (!strcmp(typem
->semantic
, semantic
))
6747 TRACE("Returning type %p.\n", typem
->type
);
6748 return &typem
->type
->ID3D10EffectType_iface
;
6753 WARN("Invalid semantic specified\n");
6755 return &null_type
.ID3D10EffectType_iface
;
6758 static LPCSTR STDMETHODCALLTYPE
d3d10_effect_type_GetMemberName(ID3D10EffectType
*iface
, UINT index
)
6760 struct d3d10_effect_type
*This
= impl_from_ID3D10EffectType(iface
);
6761 struct d3d10_effect_type_member
*typem
;
6763 TRACE("iface %p, index %u\n", iface
, index
);
6765 if (index
>= This
->member_count
)
6767 WARN("Invalid index specified\n");
6771 typem
= &This
->members
[index
];
6773 TRACE("Returning name %s\n", debugstr_a(typem
->name
));
6778 static LPCSTR STDMETHODCALLTYPE
d3d10_effect_type_GetMemberSemantic(ID3D10EffectType
*iface
, UINT index
)
6780 struct d3d10_effect_type
*This
= impl_from_ID3D10EffectType(iface
);
6781 struct d3d10_effect_type_member
*typem
;
6783 TRACE("iface %p, index %u\n", iface
, index
);
6785 if (index
>= This
->member_count
)
6787 WARN("Invalid index specified\n");
6791 typem
= &This
->members
[index
];
6793 TRACE("Returning semantic %s\n", debugstr_a(typem
->semantic
));
6795 return typem
->semantic
;
6798 static const struct ID3D10EffectTypeVtbl d3d10_effect_type_vtbl
=
6800 /* ID3D10EffectType */
6801 d3d10_effect_type_IsValid
,
6802 d3d10_effect_type_GetDesc
,
6803 d3d10_effect_type_GetMemberTypeByIndex
,
6804 d3d10_effect_type_GetMemberTypeByName
,
6805 d3d10_effect_type_GetMemberTypeBySemantic
,
6806 d3d10_effect_type_GetMemberName
,
6807 d3d10_effect_type_GetMemberSemantic
,