MCPcopy
hub / github.com/sparkjsdev/spark / constructor

Method constructor

src/dyno/util.ts:300–321  ·  view source on GitHub ↗
({ value }: { value: DynoVal<T> })

Source from the content-addressed store, hash-verified

298 implements HasDynoOut<"uvec4">
299{
300 constructor({ value }: { value: DynoVal<T> }) {
301 super({
302 inTypes: { value: valType(value) },
303 outTypes: { hash: "uvec4" },
304 inputs: { value },
305 construct: ({ value }) => {
306 if (!value) {
307 throw new Error("value is required");
308 }
309 let state = new PcgMix({ value: value }).outputs.state;
310 state = new PcgNext({ state }).outputs.state;
311 const x = new PcgHash({ state }).outputs.hash;
312 state = new PcgNext({ state }).outputs.state;
313 const y = new PcgHash({ state }).outputs.hash;
314 state = new PcgNext({ state }).outputs.state;
315 const z = new PcgHash({ state }).outputs.hash;
316 state = new PcgNext({ state }).outputs.state;
317 const w = new PcgHash({ state }).outputs.hash;
318 return { hash: combine({ vectorType: "uvec4", x, y, z, w }) };
319 },
320 });
321 }
322 dynoOut(): DynoValue<"uvec4"> {
323 return new DynoOutput(this, "hash");
324 }

Callers

nothing calls this directly

Calls 2

valTypeFunction · 0.90
combineFunction · 0.90

Tested by

no test coverage detected