We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The tgpu.resolve function generates a WGSL code string that is representative of all inputs (+ extra dependencies).
tgpu.resolve
Expected signature:
function resolve( input: string | TgpuResolvable | (string | TgpuResolvable)[], extraDependencies?: Record<string, TgpuResolvable> ): string;
const Gradient = struct({ from: vec3f, to: vec3f, }); const foo0 = tgpu.resolve('fn foo() { var v: Gradient; }', { Gradient }); console.log(foo0); // struct Gradient_1 { from: vec3f, to: vec3f, } fn foo() { var v: Gradient_1; }
const { intensity } = tgpu .bindGroupLayout({ intensity: { uniform: f32 }, }).bound; const vertex = tgpu .vertexFn({}, {}) .does(() => { const v = intensity.value; }); const fragment = tgpu .fragmentFn({}, vec4f) .does(() => vec4f(intensity.value, 0, 0, 1)); // Deduplicates dependencies const foo0 = tgpu.resolve([vertex, fragment]); console.log(foo0); // @group(0) @binding(0) var<uniform> intensity_1: f32; // // @vertex // fn vertex_main() { // let v = intensity_1; // } // // @fragment // fn fragment_main() { // return vec4f(intensity_1, 0.0, 0.0, 1.0); // }
The text was updated successfully, but these errors were encountered:
reczkok
No branches or pull requests
The
tgpu.resolve
function generates a WGSL code string that is representative of all inputs (+ extra dependencies).Expected signature:
Example uses
Adding dependencies to a plain code string.
Resolving two entry functions to get one shader code string
The text was updated successfully, but these errors were encountered: