Matteo Bruni (@Mystral) commented about dlls/d3dx9_36/surface.c:
+ color_key_out->color_key_min[i] = color_key_out->color_key_max[i] = 0xff; + continue; + } + + /* + * If the source format channel can represent all unique channel + * values in the color key, no extra processing is necessary. + */ + if (src_ctype == CTYPE_FLOAT || (src_ctype == CTYPE_SNORM && channel_bits > 8) + || (src_ctype != CTYPE_SNORM && channel_bits >= 8)) + { + color_key_out->color_key_min[i] = color_key_out->color_key_max[i] = ck_channel; + continue; + } + + channel_conv = ((float)ck_channel) / 255.0f; The explicit cast is unnecessary: `ck_channel` is already going to be promoted to float to divide it by the float constant.
-- https://gitlab.winehq.org/wine/wine/-/merge_requests/7711#note_102878