Skip to content

Add more options to shader bundler#131

Merged
kunitoki merged 1 commit into
mainfrom
dev/improved_shader_bundler
Jul 9, 2026
Merged

Add more options to shader bundler#131
kunitoki merged 1 commit into
mainfrom
dev/improved_shader_bundler

Conversation

@kunitoki

@kunitoki kunitoki commented Jul 9, 2026

Copy link
Copy Markdown
Owner

This pull request introduces significant enhancements and flexibility to the shader bundling and transpilation system, mainly focusing on improving the yup_shader_bundler tool and its integration with CMake. The changes add support for new command-line options, enable advanced SPIR-V compilation controls, and allow for more complex shader bundle configurations, including multi-stage pipelines and custom include paths.

Key changes include:

Shader Bundler Tool Enhancements

  • Refactored yup_shader_bundler to support multiple pipeline stages (vertex, fragment, compute, etc.) via a new --stage <stage> <path> option, and improved CLI usage documentation. Also added support for specifying source and target languages, SPIR-V options, preprocessor defines, and include directories. [1] [2] [3]
  • Implemented the getPrefixedValues helper to collect -D and -I style flags for preprocessor defines and include paths.

SPIR-V Compilation Controls

  • Introduced a new SpvOptimizationMode enum and corresponding spirvOptimization field in TranspileOptions, enabling explicit control over SPIR-V optimization (none, size, performance), validation, and debug info emission. Updated the transpiler to use these options. [1] [2] [3]
  • Added support for passing include search paths to the GLSL parser, enabling #include resolution during shader compilation. [1] [2]

CMake Integration Improvements

  • Enhanced the yup_add_shader_bundle() CMake helper to accept an OPTIONS argument, allowing arbitrary flags to be forwarded to yup_shader_bundler (e.g., --spirv-opt, --target-langs, -D, -I). Updated documentation accordingly. [1] [2] [3]
  • Updated the main logic to support the new CLI options and improved detection of compile mode invocation.

Internal Consistency

  • Updated all internal uses of TranspileOptions to use the new spirvOptimization field instead of the old spirvOptimize boolean.

These changes collectively make the shader bundling pipeline more robust, configurable, and suitable for advanced rendering workflows.

@kunitoki kunitoki added the enhancement New feature or request label Jul 9, 2026
@codecov

codecov Bot commented Jul 9, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 97.05882% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 79.48%. Comparing base (21a4276) to head (5b982c0).
⚠️ Report is 4 commits behind head on main.

Files with missing lines Patch % Lines
...dules/yup_shading/shading/yup_ShaderTranspiler.cpp 96.15% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #131      +/-   ##
==========================================
+ Coverage   79.44%   79.48%   +0.04%     
==========================================
  Files         703      703              
  Lines       69666    69695      +29     
==========================================
+ Hits        55348    55399      +51     
+ Misses      14318    14296      -22     
Files with missing lines Coverage Δ
modules/yup_graphics/rhi/yup_GpuPipeline.cpp 65.99% <100.00%> (ø)
modules/yup_shading/shading/yup_ShaderTranspiler.h 100.00% <100.00%> (+4.76%) ⬆️
...dules/yup_shading/shading/yup_ShaderTranspiler.cpp 78.58% <96.15%> (+0.47%) ⬆️

... and 6 files with indirect coverage changes


Continue to review full report in Codecov by Harness.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5246dbd...5b982c0. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@kunitoki kunitoki merged commit 341e8de into main Jul 9, 2026
40 checks passed
@kunitoki kunitoki deleted the dev/improved_shader_bundler branch July 9, 2026 15:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant