Skip to content

bug: unnecessary conversion to common type for << and >> operators #2266

@cieplypolar

Description

@cieplypolar

This code

const repro = () => {
  'use gpu';
  const x = d.i32(8);
  return x << d.u32(2);
};

console.log(tgpu.resolve([repro]));

resolves to

fn repro() -> i32 {
  const x = 8i;
  return (x << 2i);
}

which is invalid wgsl :((

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions