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

SCons: Add method to generate raw cstrings #94995

Merged
merged 1 commit into from
Aug 27, 2024

Conversation

Repiteo
Copy link
Contributor

@Repiteo Repiteo commented Jul 31, 2024

Through the use of raw strings, generated text that was previously handled as binary can now be displayed without compromise. This not only significantly decreases filesize of generated files, but it makes debugging quite a bit easier thanks to the ease in which this information can be parsed. Currently only applied to the shader/svg generators, but this has the potential to be expanded to more core files if desired.

Copy link
Member

@Calinou Calinou left a comment

Choose a reason for hiding this comment

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

Tested locally, it works as expected.

Note that while the generated source files are smaller, the resulting binary size is mostly unaffected (-32 bytes for an optimized stripped Linux x86_64 editor build with this PR).

@akien-mga akien-mga modified the milestones: 4.x, 4.4 Aug 27, 2024
@akien-mga akien-mga merged commit db24ed4 into godotengine:master Aug 27, 2024
18 checks passed
@akien-mga
Copy link
Member

Thanks!

@Repiteo Repiteo deleted the scons/raw-cstrings branch August 27, 2024 23:48
@TheSofox
Copy link
Contributor

TheSofox commented Sep 7, 2024

I've been having build errors that originated from this PR. Essentially build would fail with repeated error: .\servers/rendering/renderer_rd/shaders/effects/fsr2/fsr2_accumulate_pass.glsl.gen.h(13): fatal error C1091: compiler limit: string exceeds 65535 bytes in length

With the help of other Godot developers, I was able to locate and finally fix this issue.

I was on Windows 10, using Microsoft Visual Studio Community 2019 Version 16.10.2 as the compiler (via scons) when I had the problem. Simply updating Visual Studio fixed it. (Help -> Check for Updates in Visual Studio). It's now on Version 16.11.39 and Godot is compiling fine.

Leaving this message for anyone else who may be encountering a similar issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants