@luma.gl/shadertools 9.1.0-beta.8 → 9.1.0-beta.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/dist.dev.js CHANGED
@@ -707,6 +707,7 @@ ${DECLARATION_INJECT_MARKER}
707
707
  }
708
708
  function assembleShaderGLSL(platformInfo, options) {
709
709
  const {
710
+ id,
710
711
  source,
711
712
  stage,
712
713
  language = "glsl",
@@ -736,6 +737,7 @@ ${DECLARATION_INJECT_MARKER}
736
737
  assembledSource = prologue ? `${sourceVersionDirective}
737
738
 
738
739
  // ----- PROLOGUE -------------------------
740
+ ${getShaderNameDefine({ id, source, stage })}
739
741
  ${`#define SHADER_TYPE_${stage.toUpperCase()}`}
740
742
 
741
743
  ${getPlatformShaderDefines(platformInfo)}
@@ -813,6 +815,12 @@ ${getApplicationDefines(allDefines)}
813
815
  return uniforms;
814
816
  };
815
817
  }
818
+ function getShaderNameDefine(options) {
819
+ const { id, source, stage } = options;
820
+ const injectShaderName = id && source.indexOf("SHADER_NAME") === -1;
821
+ return injectShaderName ? `
822
+ #define SHADER_NAME ${id}_${stage}` : "";
823
+ }
816
824
  function getApplicationDefines(defines = {}) {
817
825
  let sourceText = "";
818
826
  for (const define in defines) {