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

Nikolay Sivov nsivov at codeweavers.com
Thu Oct 14 03:56:03 CDT 2021



On 10/14/21 11:44 AM, Matteo Bruni wrote:
> On Thu, Oct 14, 2021 at 7:42 AM Nikolay Sivov <nsivov at codeweavers.com> wrote:
>>
>>
>> On 10/13/21 2:48 PM, Matteo Bruni wrote:
>>> 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.
>> It won't grow. But yes, there are ways to improve either size or
>> readability. It could list scalar types instead, or property ids.
>> Or properties could be marked in static table instead with some flag.
>>>> @@ -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.
>> I don't understand what you're suggesting. To have a separate storage to
>> write to, instead of a union?
> Not necessarily; what I was thinking is adding a new "struct
> d3d10_effect_variable *variable;" entry to the desc member of struct
> d3d10_effect_state_object_variable (or perhaps to a new union with
> desc as the other member). Assuming I understand how this is supposed
> to be used eventually.
>
> I see now that probably I should have put the comment right below the
> "*(void **)dst = variable;" line instead.
Right now for state objects, *dst = variable is only used for .Texture
field. Setting variable to a numeric field will fail, if you're talking
about this case, another single "variable" field won't make a
difference, because you can have multiple fields updated through
variables, or same array field elements updated through a number of
variables.



More information about the wine-devel mailing list