Disable shader baker when exporting as dedicated server#112361
Disable shader baker when exporting as dedicated server#112361akien-mga merged 1 commit intogodotengine:masterfrom
Conversation
Dedicated server exports don't perform any rendering, so there's no point in including baked shaders. Doing so saves a few MBs in PCK size if the shader baker was enabled in the export options.
clayjohn
left a comment
There was a problem hiding this comment.
Shouldn't this just force disable "shader_baker/enabled" when using a dedicated server so that we don't have to add checks in multiple places?
Do you mean switching the export mode should automatically uncheck the If we can figure out a consistent way to do it, then it's probably a better idea. |
I think Clay was suggesting to replace: if (p_preset->get("shader_baker/enabled")) {with: if (p_preset->get("shader_baker/enabled") && !p_preset->is_dedicated_server()) {to always force skipping it without changing the configuration. CC @dsnopek |
This seems to be already what the PR is doing, except I think Clay was referring to a different location in the code (not sure which one). |
|
You could turn off the baker setting in Though you could make the condition less repetitive by adding |
akien-mga
left a comment
There was a problem hiding this comment.
I think it's good enough as is.
|
Thanks! |
|
Cherry-picked for 4.5.2. |
Dedicated server exports don't perform any rendering, so there's no point in including baked shaders. Doing so saves a few MBs in PCK size if the shader baker was enabled in the export options.
Testing project: test_export_dedicated_server.zip
Preview
File sizes in bytes for ZIP main packs before and after this PR:
I exported as ZIP so it's easy to inspect, but you get similar savings in PCK too.
client_master.zip
client_pr.zip
server_master.zip
server_pr.zip