Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VideoCommon/TextureConverterShaderGen: Convert over to fmt #8508

Merged
merged 2 commits into from Dec 8, 2019

Conversation

@lioncash
Copy link
Member

lioncash commented Dec 3, 2019

Begins the conversion of the shader generators over to using fmt formatting specifiers, starting with the easiest one.

This introduces the WriteFmt function as a transitional API until all of them are converted over, where the name will be changed back to Write

This also has a benefit over the older StringFromFormat-based API in that all formatted data is appended to the existing buffer rather than creating a completely separate string and then appending it to the internal string buffer.

lioncash added 2 commits Dec 3, 2019
Begins the conversion of the shader generators over to using fmt
formatting specifiers.

This also has a benefit over the older StringFromFormat-based API in
that all formatted data is appended to the existing buffer rather than
creating a completely separate string and then appending it to the
internal string buffer.
Easily the most straightforward to convert over, given the lack of
significant formatting arguments.
@lioncash lioncash force-pushed the lioncash:fmt-tex branch from 818d42b to 0f28f40 Dec 3, 2019
template <typename... Args>
void WriteFmt(std::string_view format, Args&&... args)
{
fmt::format_to(std::back_inserter(m_buffer), format, std::forward<Args>(args)...);

This comment has been minimized.

Copy link
@CookiePLMonster

CookiePLMonster Dec 3, 2019

Contributor

That looks so elegant, fmt is great.

@@ -101,6 +104,8 @@ class ShaderCode : public ShaderGeneratorInterface
public:
ShaderCode() { m_buffer.reserve(16384); }
const std::string& GetBuffer() const { return m_buffer; }

// Deprecated: Writes format strings using traditional printf format strings.

This comment has been minimized.

Copy link
@CookiePLMonster

CookiePLMonster Dec 3, 2019

Contributor

Can you mark this as [[deprecated]]? Or will it fail compilations due to "treat warnings as errors"?

This comment has been minimized.

Copy link
@lioncash

lioncash Dec 3, 2019

Author Member

Compilation will fail.

@phire
phire approved these changes Dec 4, 2019
@Helios747 Helios747 merged commit bac8c06 into dolphin-emu:master Dec 8, 2019
10 checks passed
10 checks passed
default Very basic checks passed, handed off to Buildbot.
Details
lint Build succeeded on builder lint
Details
pr-android Build succeeded on builder pr-android
Details
pr-deb-dbg-x64 Build succeeded on builder pr-deb-dbg-x64
Details
pr-deb-x64 Build succeeded on builder pr-deb-x64
Details
pr-freebsd-x64 Build succeeded on builder pr-freebsd-x64
Details
pr-osx-x64 Build succeeded on builder pr-osx-x64
Details
pr-ubu-x64 Build succeeded on builder pr-ubu-x64
Details
pr-win-dbg-x64 Build succeeded on builder pr-win-dbg-x64
Details
pr-win-x64 Build succeeded on builder pr-win-x64
Details
@lioncash lioncash deleted the lioncash:fmt-tex branch Dec 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
4 participants
You can’t perform that action at this time.