Skip to content

Commit 1af248c

Browse files
committed
Implement initial integration with glslify (#1)
1 parent 2f98486 commit 1af248c

File tree

14 files changed

+3129
-28
lines changed

14 files changed

+3129
-28
lines changed

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,11 @@ With ``optimize: true`` (default) shaders will also be compiled to SPIR-V (openg
7979

8080
*\* Since SPIR-V has a single ``RelaxedPrecision`` decoration for 16-32bit precision. However most implementations now treat ``mediump`` and ``lowp`` equivalently, hence the lack of need for it in SPIR-V.*
8181

82+
### Support for glslify
83+
Specify ``glslify: true`` to process shader sources with [glslify](https://github.com/glslify/glslify) (a node.js-style module system for GLSL) prior to all preprocessing, validation and optimization.
84+
85+
*Install glslify in your devDependencies with ``npm i -D glslify``*
86+
8287
## Shader stages
8388

8489
The following shader stages are supported by the Khronos tools and recognized by file extension:
@@ -104,6 +109,8 @@ The following shader stages are supported by the Khronos tools and recognized by
104109
- ``emitLineDirectives`` : ``boolean`` (default false) Emit ``#line NN "original.file"`` directives for debugging - useful with ``#include``. Note this requires the ``GL_GOOGLE_cpp_style_line_directive`` extension so the shader will fail to run in drivers that lack support.
105110
- ``optimizerPreserveUnusedBindings`` : ``boolean`` (default true) Ensure that the optimizer preserves all declared bindings, even when those bindings are unused.
106111
- ``preamble`` : ``string`` (default undefined) Prepended to the shader source (after the #version directive, before the preprocessor runs)
112+
- ``glslify`` : ``boolean`` (default false) Process sources using glslify prior to all preprocessing, validation and optimization.
113+
- ``glslifyOptions`` (default undefined) When ``glslify`` enabled, pass these [additional options](https://github.com/glslify/glslify#module-api) to ``glslify.compile()``.
107114
### Advanced Options
108115
- ``optimizerDebugSkipOptimizer`` : ``boolean`` (default false) When ``optimize`` enabled, skip the SPIR-V optimizer - compiles to SPIR-V then cross-compiles back to GLSL immediately.
109116
- ``suppressLineExtensionDirective`` : ``boolean`` (default false) When `emitLineDirectives` enabled, suppress the ``GL_GOOGLE_cpp_style_line_directive`` directive.

0 commit comments

Comments
 (0)