Skip to content

impr: Another approach to resolving externals #1875

@aleksanderkatan

Description

@aleksanderkatan

Right now, the following resolves to hello.bound.

const layout = tgpu.bindGroupLayout({
  count: { uniform: d.f32 }
});
const shader = tgpu.resolve({
  template: `
    hello.bound
  `,
  externals: {
    hello: layout,
  },
});

It is only after actually having a resolvable value like hello.bound.count, that the resolution works:

@group(0) @binding(0) var<uniform> count_0: f32;
    count_0

When the value is not resolvable, we should throw instead of ignoring it. It may be done by first searching for the external key, and then following the chain of property accesses.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions