AcademySoftwareFoundation / AcademySoftwareFoundation/MaterialX

Commenting of #include directives is not respected by shader generation

Open
#2,097 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C++
Stars
2.3k
Forks
464
Avg merge
4d 21h
Merged PRs (30d)
11

Description

While helping Masuo get the hex tiling PR working in MSL, I spent a long time being confused....

Commenting out #include lines does not stop them from being included.

//#include "mx_math.glsl"

The mx_math.glsl file was still being included, causing compile errors.

In this case we don't actually need to include this file, but in general we need shader generation to be robust, as its a bit of a blackbox for shader developers.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing shader generation with a commented #include directive such as //#include "mx_math.glsl", then trace how include lines are detected and processed. Done means commented directives no longer include the referenced file and the resulting shader avoids the reported compile errors.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
computer-graphics
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.