[PATCH 2/9] wined3d: Prepare wined3d_format_convert_from_float for > 32bpp formats.
Henri Verbeet
hverbeet at gmail.com
Mon May 2 10:36:25 CDT 2022
On Sun, 1 May 2022 at 20:39, Stefan Dösinger <stefan at codeweavers.com> wrote:
> @@ -3689,7 +3690,8 @@ static HRESULT process_vertices_strided(const struct wined3d_device *device, DWO
> diffuse_colour = material_diffuse;
> }
> wined3d_color_clamp(&diffuse_colour, &diffuse_colour, 0.0f, 1.0f);
> - *((DWORD *)dest_ptr) = wined3d_format_convert_from_float(output_colour_format, &diffuse_colour);
> + wined3d_format_convert_from_float(output_colour_format, &diffuse_colour, argb_color);
> + *((DWORD *)dest_ptr) = argb_color[0];
> dest_ptr += sizeof(DWORD);
> }
Why not "wined3d_format_convert_from_float(output_colour_format,
&diffuse_colour, (uint32_t *)dest_ptr);"? This patch always writes 4
uint32_t's in wined3d_format_convert_from_float(), but that could
easily be avoided. And arguably, if we're going to write to an output
pointer in wined3d_format_convert_from_float(), that doesn't need to
be a pointer to a 32-bit value either. (I.e., compare the
upload/download/decompress operations from struct wined3d_format.)
More information about the wine-devel
mailing list