typegpu
Version:
A thin layer between JS and WebGPU/WGSL that improves development experience and allows for faster iteration.
23 lines (22 loc) • 565 B
JavaScript
import { $internal, $repr } from "../shared/symbols.js";
export function sampler() {
return {
[$internal]: {},
type: 'sampler',
[$repr]: undefined,
};
}
export function comparisonSampler() {
return {
[$internal]: {},
type: 'sampler_comparison',
[$repr]: undefined,
};
}
export function isWgslSampler(value) {
return !!value[$internal] && value.type === 'sampler';
}
export function isWgslComparisonSampler(value) {
return (!!value[$internal] &&
value.type === 'sampler_comparison');
}