Sfoglia il codice sorgente

WebGPUBinding: Simplify code.

Mugen87 4 anni fa
parent
commit
7830fe3423

+ 7 - 0
examples/jsm/renderers/webgpu/WebGPUBinding.js

@@ -3,11 +3,18 @@ class WebGPUBinding {
 	constructor() {
 
 		this.bindingPoint = 0;
+		this.name = '';
 		this.type = null;
 		this.visibility = null;
 
 	}
 
+	setName( name ) {
+
+		this.name = name;
+
+	}
+
 }
 
 export default WebGPUBinding;

+ 0 - 8
examples/jsm/renderers/webgpu/WebGPUSampledTexture.js

@@ -6,8 +6,6 @@ class WebGPUSampledTexture extends WebGPUBinding {
 
 		super();
 
-		this.name = '';
-
 		this.type = 'sampled-texture';
 		this.visibility = GPUShaderStage.FRAGMENT;
 
@@ -17,12 +15,6 @@ class WebGPUSampledTexture extends WebGPUBinding {
 
 	}
 
-	setName( name ) {
-
-		this.name = name;
-
-	}
-
 }
 
 export default WebGPUSampledTexture;

+ 0 - 8
examples/jsm/renderers/webgpu/WebGPUSampler.js

@@ -6,8 +6,6 @@ class WebGPUSampler extends WebGPUBinding {
 
 		super();
 
-		this.name = '';
-
 		this.type = 'sampler';
 		this.visibility = GPUShaderStage.FRAGMENT;
 
@@ -17,12 +15,6 @@ class WebGPUSampler extends WebGPUBinding {
 
 	}
 
-	setName( name ) {
-
-		this.name = name;
-
-	}
-
 }
 
 export default WebGPUSampler;

+ 0 - 25
examples/jsm/renderers/webgpu/WebGPUUniformsGroup.js

@@ -6,8 +6,6 @@ class WebGPUUniformsGroup extends WebGPUBinding {
 
 		super();
 
-		this.name = '';
-
 		 // the order of uniforms in this array must match the order of uniforms in the shader
 
 		this.uniforms = [];
@@ -26,12 +24,6 @@ class WebGPUUniformsGroup extends WebGPUBinding {
 
 	}
 
-	setName( name ) {
-
-		this.name = name;
-
-	}
-
 	addUniform( uniform ) {
 
 		this.uniforms.push( uniform );
@@ -62,23 +54,6 @@ class WebGPUUniformsGroup extends WebGPUBinding {
 
 	}
 
-	copy( source ) {
-
-		this.name = source.name;
-
-		this.uniforms.length = 0;
-		this.uniforms.push( ...source.uniforms );
-
-		return this;
-
-	}
-
-	clone() {
-
-		return new this.constructor().copy( this );
-
-	}
-
 	getByteLength() {
 
 		let byteLength = 0;