(try2)[PATCH 1/2] d3d10: Add a function to initialize the null variables.

Alexandre Julliard julliard at winehq.org
Tue Jan 5 05:21:03 CST 2010


Rico Schüller <kgbricola at web.de> writes:

> +static void d3d10_null_effect_variable_init(struct d3d10_effect_variable *v, struct ID3D10EffectVariableVtbl *vtbl)
> +{
> +    v->vtbl = vtbl;
> +    v->buffer = &null_local_buffer;
> +    v->type = &null_type;
> +}
> +
> +void d3d10_null_effect_variable_init_all()
> +{
> +    d3d10_null_effect_variable_init(&null_local_buffer, (ID3D10EffectVariableVtbl *)&d3d10_effect_constant_buffer_vtbl);
> +    d3d10_null_effect_variable_init(&null_variable, (ID3D10EffectVariableVtbl *)&d3d10_effect_variable_vtbl);
> +    d3d10_null_effect_variable_init(&null_scalar_variable, (ID3D10EffectVariableVtbl *)&d3d10_effect_scalar_variable_vtbl);
> +    d3d10_null_effect_variable_init(&null_vector_variable, (ID3D10EffectVariableVtbl *)&d3d10_effect_vector_variable_vtbl);
> +    d3d10_null_effect_variable_init(&null_matrix_variable, (ID3D10EffectVariableVtbl *)&d3d10_effect_matrix_variable_vtbl);
> +    d3d10_null_effect_variable_init(&null_string_variable, (ID3D10EffectVariableVtbl *)&d3d10_effect_string_variable_vtbl);
> +    d3d10_null_effect_variable_init(&null_shader_resource_variable, (ID3D10EffectVariableVtbl *)&d3d10_effect_shader_resource_variable_vtbl);
> +    d3d10_null_effect_variable_init(&null_render_target_view_variable, (ID3D10EffectVariableVtbl *)&d3d10_effect_render_target_view_variable_vtbl);
> +    d3d10_null_effect_variable_init(&null_depth_stencil_view_variable, (ID3D10EffectVariableVtbl *)&d3d10_effect_depth_stencil_view_variable_vtbl);
> +    d3d10_null_effect_variable_init(&null_shader_variable, (ID3D10EffectVariableVtbl *)&d3d10_effect_shader_variable_vtbl);
> +    d3d10_null_effect_variable_init(&null_blend_variable, (ID3D10EffectVariableVtbl *)&d3d10_effect_blend_variable_vtbl);
> +    d3d10_null_effect_variable_init(&null_depth_stencil_variable, (ID3D10EffectVariableVtbl *)&d3d10_effect_depth_stencil_variable_vtbl);
> +    d3d10_null_effect_variable_init(&null_rasterizer_variable, (ID3D10EffectVariableVtbl *)&d3d10_effect_rasterizer_variable_vtbl);
> +    d3d10_null_effect_variable_init(&null_sampler_variable, (ID3D10EffectVariableVtbl *)&d3d10_effect_sampler_variable_vtbl);
> +}
> +

That's not much of an improvement, static initialization is nicer.

-- 
Alexandre Julliard
julliard at winehq.org



More information about the wine-devel mailing list