[PATCH 3/4] d3d10: Implement ShaderResource effect variable set method.

Matteo Bruni matteo.mystral at gmail.com
Tue Mar 24 08:12:23 CDT 2020


On Sat, Mar 21, 2020 at 7:31 PM Connor McAdams <conmanx360 at gmail.com> wrote:

> @@ -5908,8 +5961,24 @@ static const struct ID3D10EffectStringVariableVtbl d3d10_effect_string_variable_
>      d3d10_effect_string_variable_GetStringArray,
>  };
>
> +static void set_shader_resource_variable(ID3D10ShaderResourceView **src, ID3D10ShaderResourceView **dst)
> +{
> +    if (*dst)
> +        ID3D10ShaderResourceView_Release(*dst);
> +    if (*src)
> +        ID3D10ShaderResourceView_AddRef(*src);
> +
> +    *dst = *src;
> +}

When we have to handle something like this in other places we usually
check that *dst != *src first, as an optimization. Also, can either of
them be NULL?



More information about the wine-devel mailing list