@luma.gl/shadertools 9.0.11 → 9.0.14

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.
@@ -1,6 +1,7 @@
1
1
  import { PropValidator } from "../filters/prop-types.js";
2
2
  import { ShaderModule, ShaderModuleDeprecation } from "./shader-module.js";
3
3
  import { ShaderInjection } from "../shader-assembly/shader-injections.js";
4
+ import { UniformFormat } from "../../types.js";
4
5
  /** An initialized ShaderModule, ready to use with `assembleShaders()` */
5
6
  export declare class ShaderModuleInstance {
6
7
  name: string;
@@ -15,7 +16,7 @@ export declare class ShaderModuleInstance {
15
16
  fragment: Record<string, ShaderInjection>;
16
17
  };
17
18
  uniforms: Record<string, PropValidator>;
18
- uniformTypes: Record<string, PropValidator>;
19
+ uniformTypes: Record<string, UniformFormat>;
19
20
  static instantiateModules(modules: (ShaderModule | ShaderModuleInstance)[]): ShaderModuleInstance[];
20
21
  constructor(props: ShaderModule);
21
22
  getModuleSource(stage: 'vertex' | 'fragment'): string;
@@ -1 +1 @@
1
- {"version":3,"file":"shader-module-instance.d.ts","sourceRoot":"","sources":["../../../src/lib/shader-module/shader-module-instance.ts"],"names":[],"mappings":"AAKA,OAAO,EAA6C,aAAa,EAAC,iCAA8B;AAChG,OAAO,EAAC,YAAY,EAAE,uBAAuB,EAAC,2BAAwB;AACtE,OAAO,EAAC,eAAe,EAAsB,gDAA6C;AAI1F,yEAAyE;AACzE,qBAAa,oBAAoB;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,iBAAiB,EAAE,QAAQ,CAAC;IAC5B,YAAY,EAAE,oBAAoB,EAAE,CAAC;IACrC,YAAY,EAAE,uBAAuB,EAAE,CAAC;IACxC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,CAAC;IACzC,UAAU,EAAE;QACV,MAAM,E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-34,7 +34,7 @@ export class ShaderModuleInstance {
34
34
  });
35
35
  }
36
36
  constructor(props) {
37
- const { name, vs, fs, dependencies = [], uniformPropTypes = {}, getUniforms, deprecations = [], defines = {}, inject = {} } = props;
37
+ const { name, vs, fs, dependencies = [], uniformTypes = {}, uniformPropTypes = {}, getUniforms, deprecations = [], defines = {}, inject = {} } = props;
38
38
  assert(typeof name === 'string');
39
39
  this.name = name;
40
40
  this.vs = vs;
@@ -44,6 +44,7 @@ export class ShaderModuleInstance {
44
44
  this.deprecations = this._parseDeprecationDefinitions(deprecations);
45
45
  this.defines = defines;
46
46
  this.injections = normalizeInjections(inject);
47
+ this.uniformTypes = uniformTypes;
47
48
  if (uniformPropTypes) {
48
49
  this.uniforms = makePropValidators(uniformPropTypes);
49
50
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@luma.gl/shadertools",
3
- "version": "9.0.11",
3
+ "version": "9.0.14",
4
4
  "description": "Shader module system for luma.gl",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -52,5 +52,5 @@
52
52
  "@math.gl/core": "^4.0.0",
53
53
  "@math.gl/types": "^4.0.0"
54
54
  },
55
- "gitHead": "82c56392f73c3f7b258e2928d687a4beca2e2838"
55
+ "gitHead": "0b466762e8255ed11b00c6bc518049d3b54c4009"
56
56
  }
@@ -6,6 +6,7 @@ import {assert} from '../utils/assert';
6
6
  import {makePropValidators, getValidatedProperties, PropValidator} from '../filters/prop-types';
7
7
  import {ShaderModule, ShaderModuleDeprecation} from './shader-module';
8
8
  import {ShaderInjection, normalizeInjections} from '../shader-assembly/shader-injections';
9
+ import {UniformFormat} from '../../types';
9
10
 
10
11
  let index = 1;
11
12
 
@@ -23,7 +24,7 @@ export class ShaderModuleInstance {
23
24
  fragment: Record<string, ShaderInjection>;
24
25
  };
25
26
  uniforms: Record<string, PropValidator> = {};
26
- uniformTypes: Record<string, PropValidator> = {};
27
+ uniformTypes: Record<string, UniformFormat> = {};
27
28
 
28
29
  static instantiateModules(
29
30
  modules: (ShaderModule | ShaderModuleInstance)[]
@@ -60,6 +61,7 @@ export class ShaderModuleInstance {
60
61
  vs,
61
62
  fs,
62
63
  dependencies = [],
64
+ uniformTypes = {},
63
65
  uniformPropTypes = {},
64
66
  getUniforms,
65
67
  deprecations = [],
@@ -76,6 +78,7 @@ export class ShaderModuleInstance {
76
78
  this.deprecations = this._parseDeprecationDefinitions(deprecations);
77
79
  this.defines = defines;
78
80
  this.injections = normalizeInjections(inject);
81
+ this.uniformTypes = uniformTypes;
79
82
 
80
83
  if (uniformPropTypes) {
81
84
  this.uniforms = makePropValidators(uniformPropTypes);