123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566 |
- import WebGPUBinding from './WebGPUBinding.js';
- import { GPUBindingType, GPUTextureViewDimension } from './constants.js';
- class WebGPUSampledTexture extends WebGPUBinding {
- constructor( name ) {
- super( name );
- this.dimension = GPUTextureViewDimension.TwoD;
- this.type = GPUBindingType.SampledTexture;
- this.visibility = GPUShaderStage.FRAGMENT;
- this.textureGPU = null; // set by the renderer
- Object.defineProperty( this, 'isSampledTexture', { value: true } );
- }
- }
- class WebGPUSampledArrayTexture extends WebGPUSampledTexture {
- constructor( name ) {
- super( name );
- this.dimension = GPUTextureViewDimension.TwoDArray;
- Object.defineProperty( this, 'isSampledArrayTexture', { value: true } );
- }
- }
- class WebGPUSampled3DTexture extends WebGPUSampledTexture {
- constructor( name ) {
- super( name );
- this.dimension = GPUTextureViewDimension.ThreeD;
- Object.defineProperty( this, 'isSampled3DTexture', { value: true } );
- }
- }
- class WebGPUSampledCubeTexture extends WebGPUSampledTexture {
- constructor( name ) {
- super( name );
- this.dimension = GPUTextureViewDimension.Cube;
- Object.defineProperty( this, 'isSampledCubeTexture', { value: true } );
- }
- }
- export { WebGPUSampledTexture, WebGPUSampledArrayTexture, WebGPUSampled3DTexture, WebGPUSampledCubeTexture };
|