On Sun, 1 May 2022 at 20:39, Stefan Dösinger stefan@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.)