X Tutup
Skip to content

Remove extraneous includes from texture.h.#111481

Merged
Repiteo merged 1 commit intogodotengine:masterfrom
Ivorforce:texture-less-includes
Oct 13, 2025
Merged

Remove extraneous includes from texture.h.#111481
Repiteo merged 1 commit intogodotengine:masterfrom
Ivorforce:texture-less-includes

Conversation

@Ivorforce
Copy link
Member

@Ivorforce Ivorforce commented Oct 10, 2025

One of the top contributors to compile time is texture.h, through its extraneous includes that lead to e.g. rendering_server.h, os.h, engine.h, and camera_server.h.

Almost all of them can be removed without trade-off, because texture.h wasn't actually using them.
By removing them, both the fresh compile cost should go down, as should recompile cost when changing in any areas related to the files above.

The main cascading changes are:

  • Adding explicit rendering_server.h includes to texture source files
  • Adding gradient.h includes to texture header files
  • Some random includes of other headers to source files.
  • A change to display_server.h which is required because of a shadowing warning in SCU builds.... (maybe we should disable shadowing warnings in SCU builds?)

@Ivorforce Ivorforce added this to the 4.x milestone Oct 10, 2025
@Ivorforce Ivorforce requested review from a team as code owners October 10, 2025 15:18
@Ivorforce Ivorforce requested review from a team as code owners October 10, 2025 15:18
@Ivorforce Ivorforce requested a review from a team as a code owner October 10, 2025 15:18
@Ivorforce Ivorforce requested review from a team and removed request for a team October 10, 2025 15:18
@Ivorforce Ivorforce force-pushed the texture-less-includes branch 2 times, most recently from 0d995cb to 7c4c5ef Compare October 10, 2025 15:24
@Ivorforce Ivorforce force-pushed the texture-less-includes branch from 7c4c5ef to 985e617 Compare October 10, 2025 16:39
virtual int screen_get_dpi(int p_screen = SCREEN_OF_MAIN_WINDOW) const = 0;
virtual float screen_get_scale(int p_screen = SCREEN_OF_MAIN_WINDOW) const;
virtual float screen_get_max_scale() const {
float scale = 1.f;
Copy link
Member

Choose a reason for hiding this comment

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

That seems unrelated to the include change.

Copy link
Member

Choose a reason for hiding this comment

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

Ah well I just read the OP :P

A change to rendering_server.h which is required because of a shadowing warning in SCU builds.... (maybe we should disable shadowing warnings in SCU builds?)

You meant display_server.h, and yeah that makes sense.

Copy link
Member

Choose a reason for hiding this comment

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

For historical purposes I took the liberty to edit the PR's description to match.


#include "editor/inspector/editor_inspector.h"
#include "editor/plugins/editor_plugin.h"
#include "scene/resources/gradient.h"
Copy link
Member

Choose a reason for hiding this comment

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

Why the missing includes are added to the header, instead of forward-declared?

Copy link
Member Author

Choose a reason for hiding this comment

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

Because they were also fully included previously (i think), and adding them as forward declarations might require more includes elsewhere. I'm trying to keep efforts focused on removing the most impactful includes.

Copy link
Member

@Mickeon Mickeon left a comment

Choose a reason for hiding this comment

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

I looked at every file here, just checking if the new includes made sense.

@Repiteo Repiteo modified the milestones: 4.x, 4.6 Oct 13, 2025
@Repiteo Repiteo merged commit c9b72fc into godotengine:master Oct 13, 2025
20 checks passed
@Repiteo
Copy link
Contributor

Repiteo commented Oct 13, 2025

Thanks!

@Ivorforce Ivorforce deleted the texture-less-includes branch October 13, 2025 17:41
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.

5 participants

X Tutup