Skip to content

Implement <system> include for the standalone wrapper#4154

Merged
dnovillo merged 8 commits intoKhronosGroup:mainfrom
mmmhj2:system-include
Mar 5, 2026
Merged

Implement <system> include for the standalone wrapper#4154
dnovillo merged 8 commits intoKhronosGroup:mainfrom
mmmhj2:system-include

Conversation

@mmmhj2
Copy link
Copy Markdown
Contributor

@mmmhj2 mmmhj2 commented Jan 19, 2026

This pull request adds #include <system> directive support for the standalone wrapper as specified in the ARB_shading_language_include extension.

The current spec seems to give the implementation a lot of liberties on how to resolve the inclusion paths, similar to the C/C++ standard. This PR implements this directive similar to the GCC preprocessor:

  • "local" inclusions will be searched first in the current source directory recursively, and then external directories specified by -I flag, in left-to-right order;
  • <system> inclusions will be searched in external directories in left-to-right order only.

@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Jan 19, 2026

CLA assistant check
All committers have signed the CLA.

Copy link
Copy Markdown
Contributor

@dneto0 dneto0 left a comment

Choose a reason for hiding this comment

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

This should be testable. Please add tests.

@mmmhj2
Copy link
Copy Markdown
Contributor Author

mmmhj2 commented Jan 23, 2026

I have added a test, please check if it is sufficient.

I'm not entirely sure about the local inclusion search algorithm currently implemented though. It will search in the directories of the includers if not found in current source directory (see Test/inc1/foo.h, which includes Test/parent.h). I doubt whether this is how C/C++ preprocessors work, but I have reused this algorithm for system inclusions.

Copy link
Copy Markdown
Collaborator

@dnovillo dnovillo left a comment

Choose a reason for hiding this comment

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

Thanks for the improvement! Some test suggestions:

  • A GLSL test
  • A negative test for unresolved system includes.

@mmmhj2
Copy link
Copy Markdown
Contributor Author

mmmhj2 commented Mar 5, 2026

Thanks for the improvement! Some test suggestions:

* A GLSL test

* A negative test for unresolved system includes.

Two more tests are added! Please tell me if more or more robust tests are needed.

Copy link
Copy Markdown
Collaborator

@dnovillo dnovillo left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks for the new tests.

@dnovillo dnovillo merged commit b11b038 into KhronosGroup:main Mar 5, 2026
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants