WebGPUSampledTexture.js 783 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. import WebGPUBinding from './WebGPUBinding.js';
  2. import { GPUBindingType, GPUTextureViewDimension } from './constants.js';
  3. class WebGPUSampledTexture extends WebGPUBinding {
  4. constructor( name ) {
  5. super( name );
  6. this.dimension = GPUTextureViewDimension.TwoD;
  7. this.type = GPUBindingType.SampledTexture;
  8. this.visibility = GPUShaderStage.FRAGMENT;
  9. this.textureGPU = null; // set by the renderer
  10. Object.defineProperty( this, 'isSampledTexture', { value: true } );
  11. }
  12. }
  13. class WebGPUSampledCubeTexture extends WebGPUSampledTexture {
  14. constructor( name ) {
  15. super( name );
  16. this.dimension = GPUTextureViewDimension.Cube;
  17. Object.defineProperty( this, 'isSampledCubeTexture', { value: true } );
  18. }
  19. }
  20. export { WebGPUSampledTexture, WebGPUSampledCubeTexture };