This ultimately deserves a test, even if out of tree one. I made some ad-hoc one [1] and in confirms (tested on Windows / AMD) that the formats with missing flags do not appear in the list (i. e., the change is correct). It also conforms to spec [2] where flags are listed as exact match criteria.
The only thing here ``` for (i = 0; i < nb_pixel_formats; ++i) - if (pixel_formats[i].fmt_id == fmt_id) + if (pixel_formats[i].fmt_id == fmt_id && (pixel_formats[i].dwFlags & dwFlags) == dwFlags) break; ``` The loop just searches for fmt_id in our format list, it makes no sense to continue searching once format is found, the flag check should probably go after the loop. I don't recall the details now (my patch is from almost 2 years ago) but that's probably how I lost that flags check back then.
1. [test.patch](/uploads/b3ae677c8a7072b069d8dfc779cd8002/test.patch) 2. https://registry.khronos.org/OpenGL/extensions/ARB/WGL_ARB_pixel_format.txt