[PATCH 4/7] d3d10/effect: Handle static variable assignments for object fields in state objects.

Matteo Bruni matteo.mystral at gmail.com
Wed Oct 13 06:48:34 CDT 2021


On Fri, Oct 8, 2021 at 7:13 AM Nikolay Sivov <nsivov at codeweavers.com> wrote:
>
> Signed-off-by: Nikolay Sivov <nsivov at codeweavers.com>
> ---
>  dlls/d3d10/effect.c       |  95 +++++++++++++++++++++++++++-
>  dlls/d3d10/tests/effect.c | 128 +++++++++++++++++++++++++++-----------
>  2 files changed, 182 insertions(+), 41 deletions(-)
>
> diff --git a/dlls/d3d10/effect.c b/dlls/d3d10/effect.c
> index 6cc51aa00e3..1e144bb1c56 100644
> --- a/dlls/d3d10/effect.c
> +++ b/dlls/d3d10/effect.c
> @@ -1669,13 +1669,59 @@ static BOOL read_value_list(const char *data, size_t data_size, DWORD offset,
>      return TRUE;
>  }
>
> +static BOOL is_object_property(const struct d3d10_effect_state_property_info *property_info)
> +{
> +    switch (property_info->type)
> +    {
> +        case D3D10_SVT_RASTERIZER:
> +        case D3D10_SVT_DEPTHSTENCIL:
> +        case D3D10_SVT_BLEND:
> +        case D3D10_SVT_RENDERTARGETVIEW:
> +        case D3D10_SVT_DEPTHSTENCILVIEW:
> +        case D3D10_SVT_VERTEXSHADER:
> +        case D3D10_SVT_PIXELSHADER:
> +        case D3D10_SVT_GEOMETRYSHADER:
> +        case D3D10_SVT_TEXTURE:
> +            return TRUE;
> +        default:
> +            return FALSE;
> +    }
> +}

I don't know if, or how much, this list of object types is going to
grow but it might be easier to list the numeric types instead.

> @@ -2329,7 +2418,7 @@ static HRESULT parse_fx10_object_variable(const char *data, size_t data_size,
>
>                      memcpy(&var->u.state.desc, storage_info->default_state, storage_info->size);
>                      if (!parse_fx10_state_group(data, data_size, ptr, get_var_container_type(var),
> -                            &var->u.state.desc))
> +                            var->effect, &var->u.state.desc))

Probably at some point we should introduce an explicit variable field
in struct d3d10_effect_state_object_variable instead of abusing the
other fields of the desc union.



More information about the wine-devel mailing list