WebGPUSampler.js 463 B

1234567891011121314151617181920212223242526272829
  1. import WebGPUBinding from './WebGPUBinding.js';
  2. import { GPUBindingType } from './constants.js';
  3. class WebGPUSampler extends WebGPUBinding {
  4. constructor( name, texture ) {
  5. super( name );
  6. this.isSampler = true;
  7. this.texture = texture;
  8. this.type = GPUBindingType.Sampler;
  9. this.visibility = GPUShaderStage.FRAGMENT;
  10. this.samplerGPU = null; // set by the renderer
  11. }
  12. getTexture() {
  13. return this.texture;
  14. }
  15. }
  16. export default WebGPUSampler;