These are the first steps towards code sharing, finally :)
Patch 4 is a bit big, but it's just copying code from various source files into a single source file. I can attempt to split if if that's preferable for review purposes.
--
v4: d3dx10: Use shared d3dx code in get_image_info when possible.
d3dx9: Don't include d3dx9 header in d3dx_helpers.
d3dx9: Get rid of ID3DXBuffer usage in d3dx_helpers.
d3dx9: Move functions intended for code sharing into a separate source file.
d3dx9: Introduce d3dx_image_file_format enumeration.
d3dx9: Introduce d3dx_resource_type enumeration.
d3dx9: Replace D3DFORMAT constants with enum d3dx_pixel_format_id constants.
https://gitlab.winehq.org/wine/wine/-/merge_requests/8490