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/PixelShaderGen: Make look-up table arrays immutable where applicable #8139

Merged
merged 3 commits into from Jun 8, 2019

Conversation

3 participants
@lioncash
Copy link
Member

commented May 30, 2019

Previously many of the arrays were left as mutable, which can prevent the compiler from storing the data in the read-only segment (as well as make it possible to unintentionally modify an entry). This simply makes those arrays fully immutable.

lioncash added some commits May 30, 2019

VideoCommon/PixelShaderGen: Brace control structures that travel more…
… than one line

Them's the code formatting rules.
VideoCommon/PixelShaderGen: Make arrays immutable
Many of the arrays defined within this file weren't declared as
immutable, which can inhibit the strings being put into the read-only
segment. We can declare them constexpr to make them immutable.

While we're at it, we can use std::array, to allow bounds conditional
bounds checking with standard libraries. The declarations can also be
shortened in the future when all platform toolchain versions we use
support std::array deduction guides. Currently macOS and FreeBSD
builders fail on them.
VideoCommon/PixelShaderGen: Fix up wonky comment formatting
This is likely a remnant of the initial transition to clang-format.

@lioncash lioncash force-pushed the lioncash:const branch from f1f7843 to 8537f8e May 30, 2019

@stenzek

This comment has been minimized.

Copy link
Contributor

commented May 30, 2019

Code changes seem fine, but might be wise to wait for fifoci in case.

@BhaaLseN
Copy link
Member

left a comment

Code seems fine; otherwise: what stenzek said.

@stenzek

This comment has been minimized.

Copy link
Contributor

commented Jun 8, 2019

@stenzek stenzek merged commit 6b4ca31 into dolphin-emu:master Jun 8, 2019

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:const branch Jun 8, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.