[PATCH 06/10] d3d10/effect: Use destination index when setting array property element.
Matteo Bruni
matteo.mystral at gmail.com
Fri Oct 15 04:50:18 CDT 2021
On Thu, Oct 14, 2021 at 8:42 AM Nikolay Sivov <nsivov at codeweavers.com> wrote:
>
> Signed-off-by: Nikolay Sivov <nsivov at codeweavers.com>
> ---
>
> This is useful for render target views array, but is worth to do for all properties for consistency.
>
> dlls/d3d10/effect.c | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/dlls/d3d10/effect.c b/dlls/d3d10/effect.c
> index 4b2319e1529..9094e83efca 100644
> --- a/dlls/d3d10/effect.c
> +++ b/dlls/d3d10/effect.c
> @@ -1830,7 +1830,7 @@ static HRESULT parse_fx10_property_assignment(const char *data, size_t data_size
> return E_FAIL;
> }
>
> - *(void **)dst = variable;
> + ((void **)dst)[idx] = variable;
> }
> else
> {
> @@ -1888,11 +1888,11 @@ static HRESULT parse_fx10_property_assignment(const char *data, size_t data_size
> case D3D10_SVT_VERTEXSHADER:
> case D3D10_SVT_PIXELSHADER:
> case D3D10_SVT_GEOMETRYSHADER:
> - *(void **)dst = variable;
> + ((void **)dst)[idx] = variable;
> *dst_index = variable_idx;
> break;
> default:
> - *(void **)dst = &variable->elements[variable_idx];
> + ((void **)dst)[idx] = &variable->elements[variable_idx];
> }
> }
> else
> @@ -1957,7 +1957,7 @@ static HRESULT parse_fx10_property_assignment(const char *data, size_t data_size
> return E_FAIL;
> }
>
> - *(void **)dst = variable;
> + ((void **)dst)[idx] = variable;
>
> break;
Okay, I guess I see what you meant earlier. It does still seem a bit
"crude", storing the variable pointers right in "dst", although I
should probably wait for the rest of this to get a better picture of
it.
More information about the wine-devel
mailing list