Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
VideoCommon/ShaderGenCommon: Convert helper functions over to fmt where applicable #8532
These helper functions are fairly trivial to convert over: no fancy formatting, just simple renaming
While we're in the same area, we can also convert several template functions into normal functions, given the type of their argument is always the same type (
I've separated the formatting changes and the changes that migrate the template functions to regular functions to make reviewing the two changes nicer on the reader.
A very trivial conversion, this simply converts calls to Write over to WriteFmt and adjusts the formatting specifiers as necessary. This also allows the const char* parameters to become std::string_view instances, allowing for ease of use with other string types.
These are only ever used with ShaderCode instances and nothing else. Given that, we can convert these helper functions to expect that type of object as an argument and remove the need for templates, improving compiler throughput a marginal amount, as the template instantiation process doesn't need to be performed. We can also move the definitions of these functions into the cpp file, which allows us to remove a few inclusions from the ShaderGenCommon header. This uncovered a few instances of indirect inclusions being relied upon in other source files. One other benefit is this allows changes to be made to the definitions of the functions without needing to recompile all translation units that make use of these functions, making change testing a little quicker. Moving the definitions into the cpp file also allows us to completely hide DefineOutputMember() from external view, given it's only ever used inside of GenerateVSOutputMembers().