On Fri Jul 29 18:39:02 2022 +0000, **** wrote:
Zebediah Figura (she/her) replied on the mailing list:
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(). _______________________________________________ wine-gitlab mailing list -- wine-gitlab@winehq.org To unsubscribe send an email to wine-gitlab-leave@winehq.org
It was introduced some time ago by commit 8a5b6df483fcd02734df77046b757957bbcbbbfc. I think at the time 16 bpp and 32 bpp formats were the only other reported formats.
Note that d3d9 has similar checks in the callers; only reporting these two formats for d3d8 and d3d9 is probably correct, but the comment has become confusing.