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

Shaderlab support #include macro and optimize glsl related syntax #1727

Merged
merged 106 commits into from
Sep 6, 2023

Conversation

Sway007
Copy link
Member

@Sway007 Sway007 commented Sep 4, 2023

Please check if the PR fulfills these requirements

  • The commit message follows our guidelines
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)

What kind of change does this PR introduce? (Bug fix, feature, docs update, ...)

  • Support include macro
...
VertexShader = vert;
FragmentShader = frag;

#include <test_common>

BlendState = blendState;
...
  • Add a custom shader segment registration interface for use by include macros
shaderLab.registerShaderFragment("test_common", commonSource);
#include <test_common>
  • Improved support for the glsl syntax standard

What is the current behavior? (You can also link to an open issue here)

What is the new behavior (if this is a feature change)?

Does this PR introduce a breaking change? (What changes might users need to make in their application due to this PR?)

Other information:

睿祺 and others added 30 commits June 18, 2023 19:45
* dev/1.1:
  Support ktx2 loader (galacean#1625)
  feat: add texture plugin to support ktx loader (galacean#1640)
  Fix blend shape bug due to buffer index errors (galacean#1632)
  Model Mesh supports two-way data synchronization (galacean#1588)
@Sway007 Sway007 self-assigned this Sep 4, 2023
@Sway007 Sway007 added the shader Shader related functions label Sep 4, 2023
@codecov
Copy link

codecov bot commented Sep 4, 2023

Codecov Report

Patch coverage: 86.69% and project coverage change: -2.75% ⚠️

Comparison is base (40f6ab4) 62.17% compared to head (bf5b027) 59.42%.
Report is 9 commits behind head on dev/1.1.

❗ Current head bf5b027 differs from pull request most recent head b7362be. Consider uploading reports for the commit b7362be to get more accurate results

Additional details and impacted files
@@             Coverage Diff             @@
##           dev/1.1    #1727      +/-   ##
===========================================
- Coverage    62.17%   59.42%   -2.75%     
===========================================
  Files          430      424       -6     
  Lines        22542    20248    -2294     
  Branches      3202     3274      +72     
===========================================
- Hits         14015    12032    -1983     
+ Misses        7300     7009     -291     
+ Partials      1227     1207      -20     
Files Changed Coverage Δ
packages/loader/src/SceneLoader.ts 6.00% <0.00%> (-1.15%) ⬇️
packages/shader-lab/src/parser/tokens/index.ts 100.00% <ø> (ø)
packages/core/src/shaderlib/ShaderFactory.ts 44.44% <50.00%> (-2.78%) ⬇️
packages/core/src/mesh/SkinnedMeshRenderer.ts 59.73% <71.42%> (+4.73%) ⬆️
packages/shader-lab/src/Ast2GLSLUtils.ts 58.33% <75.00%> (+0.75%) ⬆️
packages/shader-lab/src/ShaderVisitor.ts 76.61% <80.51%> (-3.03%) ⬇️
packages/shader-lab/src/RuntimeContext.ts 82.11% <86.36%> (+2.78%) ⬆️
packages/shader-lab/src/ast-node/AstNode.ts 75.57% <88.33%> (-1.14%) ⬇️
packages/shader-lab/src/AstNodeUtils.ts 77.27% <100.00%> (-0.28%) ⬇️
packages/shader-lab/src/parser/ShaderParser.ts 98.57% <100.00%> (-0.08%) ⬇️
... and 3 more

... and 304 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@Sway007 Sway007 linked an issue Sep 4, 2023 that may be closed by this pull request
@Sway007 Sway007 added this to the 1.1 milestone Sep 4, 2023
@Sway007 Sway007 marked this pull request as ready for review September 4, 2023 12:09
@GuoLei1990 GuoLei1990 added the enhancement New feature or request label Sep 5, 2023
@GuoLei1990
Copy link
Member

image
shaderInfo.diagnostics = context.diagnostics and shaderInfo.ast = ast; will delete later?

@Sway007
Copy link
Member Author

Sway007 commented Sep 6, 2023

image shaderInfo.diagnostics = context.diagnostics and shaderInfo.ast = ast; will delete later?

done

@GuoLei1990 GuoLei1990 merged commit 863a4a5 into galacean:dev/1.1 Sep 6, 2023
4 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request shader Shader related functions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Shader lab support include
2 participants