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

LightingShaderGen: Make s_lighting_struct not inline #10281

Merged
merged 1 commit into from Dec 23, 2021

Conversation

Pokechu22
Copy link
Contributor

This generated warnings on the freebsd builder (example).

"\tfloat4 pos;\n"
"\tfloat4 dir;\n"
"};\n";
static constexpr inline char s_lighting_struct[] = "struct Light {\n"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can be simplified to:

Suggested change
static constexpr inline char s_lighting_struct[] = "struct Light {\n"
constexpr char s_lighting_struct[] = "struct Light {\n"

and it should also resolve the warnings

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess that also means it won't be inlined into each object file... but that's a good thing; there's no reason for it to be duplicated 4 times for each uber/specialized vertex/pixel shader (especially since each one only uses it as out.Write("{}", s_lighting_struct);)

@Pokechu22 Pokechu22 changed the title LightingShaderGen: Make s_lighting_struct static LightingShaderGen: Make s_lighting_struct not inline Dec 18, 2021
This generated warnings on the freebsd builder.
@iwubcode
Copy link
Contributor

Someday soon we can make this a string_view :)

@JMC47 JMC47 merged commit 6dae404 into dolphin-emu:master Dec 23, 2021
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
4 participants