WebGPUSampledTexture.js 627 B

12345678910111213141516171819202122232425262728293031323334353637
  1. import WebGPUBinding from './WebGPUBinding.js';
  2. class WebGPUSampledTexture extends WebGPUBinding {
  3. constructor() {
  4. super();
  5. this.dimension = '2d';
  6. this.type = 'sampled-texture';
  7. this.visibility = GPUShaderStage.FRAGMENT;
  8. this.textureGPU = null; // set by the renderer
  9. Object.defineProperty( this, 'isSampledTexture', { value: true } );
  10. }
  11. }
  12. class WebGPUSampledCubeTexture extends WebGPUSampledTexture {
  13. constructor() {
  14. super();
  15. this.dimension = 'cube';
  16. Object.defineProperty( this, 'isSampledCubeTexture', { value: true } );
  17. }
  18. }
  19. export { WebGPUSampledTexture, WebGPUSampledCubeTexture };