> For example, I would find ideal to have `hlsl_codegen.c` splitted in a few pieces. The prepend/append copies and copy propagation sections could be easily moved to an independent file each one, keeping basically everything `static` except a handful of functions that are called by `hlsl_emit_bytecode()`. You have a small interface, but everything else you have to do in copy propagation doesn't need to interact with all the rest of `hlsl_codegen.c`, and splitting the file ensures that. If somebody wants to learn how copy propagation works, they can read `hlsl_copy_propagation.c` instead of having to potentially have to go through the whole of `hlsl_codegen.c`. This luckily already happened for `hlsl_constant_ops.c`. I wouldn't move each other pass in its own file because that would be too small, though. There is some sweet spot, which of course can change from person to person.
Mesa does this, and I suspect this is exactly the kind of thing that Henri finds distasteful. Personally it seems excessive to me as well, actually. There is a cost to having a lot of files, mostly in terms of slowing navigation a bit, and having to have more tabs open in one's editor.
--
https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/174#note_30882