On Wed, 4 Mar 2020 at 11:37, Zhiyi Zhang zzhang@codeweavers.com wrote:
@@ -1107,7 +1110,9 @@ HRESULT CDECL wined3d_find_closest_matching_adapter_mode(const struct wined3d *w
for (i = 0; i < mode_count; ++i) {
if (FAILED(hr = wined3d_enum_adapter_modes(wined3d, adapter_idx,
/* TODO: Passing &wined3d->adapters[0]->outputs[0] is fine
* because adapter_idx is always zero currently */
if (FAILED(hr = wined3d_output_get_mode(&wined3d->adapters[0]->outputs[0], mode->format_id, WINED3D_SCANLINE_ORDERING_UNKNOWN, i, &modes[i])))
Sure, but it would still be better to use "adapter_idx".
More broadly, you can avoid this kind of thing by reimplementing wined3d_enum_adapter_modes() as "wined3d_output_get_mode(&wined3d->adapters[adapter_idx]->outputs[0], ...)", and keeping it around until no more callers that don't have an output are left.