On 7/28/22 09:21, Jan Sikorski (@jsikorski) wrote:
Jan Sikorski (@jsikorski) commented about dlls/wined3d/directx.c:
+ output->modes_valid = true; +} + +static bool mode_matches_filter(const struct wined3d_adapter *adapter, const struct wined3d_display_mode *mode, + const struct wined3d_format *format, enum wined3d_scanline_ordering scanline_ordering) +{ + if (scanline_ordering != WINED3D_SCANLINE_ORDERING_UNKNOWN + && mode->scanline_ordering != WINED3D_SCANLINE_ORDERING_UNKNOWN + && scanline_ordering != mode->scanline_ordering) + return false; + + if (format->id == WINED3DFMT_UNKNOWN) + { + /* This is for d3d8, do not enumerate P8 here. */ + if (mode->format_id != WINED3DFMT_B5G6R5_UNORM && mode->format_id != WINED3DFMT_B8G8R8X8_UNORM) + return false; Is this right, do we want only these 2 formats to pass the filter? It looks backwards, but if I'm wrong, it could use more explanation.
It definitely looks backwards and doesn't match the comment—obviously we'd expect "mode->format_id == WINED3DFMT_P8". As stated this skips 15- and 24-bit display formats. This is all retained from previous code, though, and I didn't want to change it in this comment (or without testing first). Note also the limited set of formats that can be returned from pixelformat_for_depth().