introduce "resource_gl.c" and "resource_vk.c", and move most resource code to those functions. This collapses the separation between buffer, texture, sampler, and view code, though, and there may be some benefit in keeping those separate.
For what it's worth, in terms of terminology, resources, samplers and views are quite distinct. On the other hand, the separation between buffer, texture, surface, and resource code is largely just historic.
Sure. In a large sense it's not so much about separate components as about organization. There's a scant amount of backend-specific code for samplers; part of the goal is to avoid putting backend code in any file that isn't backend-specific, but for something like samplers that'd just result in tiny files. Basically I was afraid that having one file per small component wouldn't be received well by others—and that I'd rather see things divided by backend than by... object type, given that what is and isn't a backend function is a much clearer line to draw.
Maybe the whole effort is ultimately not worthwhile, I don't know. It certainly was nice for me to find wined3d_texture_set_lod(), at least, and I feel like new contributors will see it as more readable, but I'm also willing to be told this is pointless churn that's not clearly improving anything.
move other functions to backend-specific adapter or context functions, where it makes sense. Swapchain code mostly gets moved to context_*.c, though I'm not sure whether that makes the most sense or not.
Swapchains and contexts are somewhat tied together in the GL code, again largely for historic reasons, but I think the direction we've been moving in has largely been to try to separate them.
Part of the thing here is that "what is a context function?" is something I don't know how to answer. wined3d_context_gl_set_current(), sure, but then it's pretty much a "misc_gl.c" for anything that doesn't fit in another file. [For Vulkan the distinction is even worse, with code spread between adapter_vk.c, context_vk.c, and sometimes device_vk.c, with no clear pattern.]. So in lieu of creating swapchain_*.c I decided that code made more sense dumped in context_*.c.