[PATCH 1/5] wined3d: Prepare wined3d_format_convert_from_float for > 32bpp formats (v3).
Zebediah Figura
zfigura at codeweavers.com
Mon May 16 00:49:35 CDT 2022
On 5/15/22 07:29, Stefan Dösinger wrote:
> for (i = 0; i < ARRAY_SIZE(double_conv); ++i)
> {
> + uint32_t *ret_i;
> +
> if (format_id != double_conv[i].format_id)
> continue;
>
> - ret = ((DWORD)((color->r * double_conv[i].mul.x) + 0.5)) << double_conv[i].shift.x;
> - ret |= ((DWORD)((color->g * double_conv[i].mul.y) + 0.5)) << double_conv[i].shift.y;
> - ret |= ((DWORD)((color->b * double_conv[i].mul.z) + 0.5)) << double_conv[i].shift.z;
> - ret |= ((DWORD)((color->a * double_conv[i].mul.w) + 0.5)) << double_conv[i].shift.w;
> + idx.x = float_conv[i].shift.x / 32;
> + idx.y = float_conv[i].shift.y / 32;
> + idx.z = float_conv[i].shift.z / 32;
> + idx.w = float_conv[i].shift.w / 32;
> + shift.x = float_conv[i].shift.x % 32;
> + shift.y = float_conv[i].shift.y % 32;
> + shift.z = float_conv[i].shift.z % 32;
> + shift.w = float_conv[i].shift.w % 32;
> +
> + ret_i = ret;
> + ret_i[idx.x] = ((uint32_t)((color->r * double_conv[i].mul.x) + 0.5)) << double_conv[i].shift.x;
> + ret_i[idx.y] |= ((uint32_t)((color->g * double_conv[i].mul.y) + 0.5)) << double_conv[i].shift.y;
> + ret_i[idx.z] |= ((uint32_t)((color->b * double_conv[i].mul.z) + 0.5)) << double_conv[i].shift.z;
> + ret_i[idx.w] |= ((uint32_t)((color->a * double_conv[i].mul.w) + 0.5)) << double_conv[i].shift.w;
There seem to be some copy-paste (or failure-to-copy-paste) errors here.
I'll send a new revision.
More information about the wine-devel
mailing list