WebGPUSampler.js 480 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.texture = texture;
  7. this.type = GPUBindingType.Sampler;
  8. this.visibility = GPUShaderStage.FRAGMENT;
  9. this.samplerGPU = null; // set by the renderer
  10. }
  11. getTexture() {
  12. return this.texture;
  13. }
  14. }
  15. WebGPUSampler.prototype.isSampler = true;
  16. export default WebGPUSampler;