That helps Warhammer: Dark Omen (classic) which creates primary surface (without DDSDCAPS_3DDEVICE) and backbuffer (with DDSDCAPS_3DDEVICE) separately and then attaches back to front. Such creation of separate backbuffer and adding that to another surface is only supported on v1 surfaces. Then, once such attach is supported, the things get broken after \_Flip for 3d device because it primary surface doesn't have 3DDEVICE flag and backing wined3d texture is not suitable as RT (while Flip swaps underlying wined3d texture). The last patch fixes that part by assuming 3DDEVICE on v1 primary surfaces for wined3d texture creation. I spent some time trying to fit these (and some extra ad-hoc) tests in a different potentially more straightforward way. I considered getting rid of either complex_array (in favour of adding all possible surfaces to the 'next_attached' chain) as well as instead trying to keep only one complex_array or its analogue. I didn't find a way to reasonably do it, it looks like the current structure represents the specifics of flip chain and other attached surfaces rather well. E. g., trying to keep 'only AddAttachSurface to next_attached chain and keep complex_array for non-root generated surfaces) breaks various aspects, e. g.: * the search through that chain doesn't wrap back to the first element (and that looks correct as far as Z buffers are concerned); * EnumAttachedSurface() should enumerate only the next flip chain member (or rollback to the first), the surfaces from attached chain are enumerated / searched down the chain. So it looks most straightforward to keep the structure (which makes full sense on later ddraw as flip chain can only be auto-constructed and complex surface creation) and fit in AddAttachSurface for flip chain images into that. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/10992#note_141281