瀏覽代碼

WebGPURenderer: Update to latest API. (#21699)

Michael Herzog 4 年之前
父節點
當前提交
392fee6113

+ 2 - 2
examples/jsm/renderers/webgpu/WebGPUComputePipelines.js

@@ -41,13 +41,13 @@ class WebGPUComputePipelines {
 
 			//
 
-			const computeStage = {
+			const compute = {
 				module: moduleCompute,
 				entryPoint: 'main'
 			};
 
 			pipeline = device.createComputePipeline( {
-				computeStage: computeStage
+				compute: compute
 			} );
 
 			this.pipelines.set( param, pipeline );

+ 7 - 7
examples/jsm/renderers/webgpu/WebGPURenderer.js

@@ -189,10 +189,10 @@ class WebGPURenderer {
 
 		this._renderPassDescriptor = {
 			colorAttachments: [ {
-				attachment: null
+				view: null
 			} ],
 			 depthStencilAttachment: {
-				attachment: null,
+				view: null,
 				depthStoreOp: GPUStoreOp.Store,
 				stencilStoreOp: GPUStoreOp.Store
 			}
@@ -246,24 +246,24 @@ class WebGPURenderer {
 
 			const renderTargetProperties = this._properties.get( renderTarget );
 
-			colorAttachment.attachment = renderTargetProperties.colorTextureGPU.createView();
-			depthStencilAttachment.attachment = renderTargetProperties.depthTextureGPU.createView();
+			colorAttachment.view = renderTargetProperties.colorTextureGPU.createView();
+			depthStencilAttachment.view = renderTargetProperties.depthTextureGPU.createView();
 
 		} else {
 
 			if ( this._parameters.antialias === true ) {
 
-				colorAttachment.attachment = this._colorBuffer.createView();
+				colorAttachment.view = this._colorBuffer.createView();
 				colorAttachment.resolveTarget = this._swapChain.getCurrentTexture().createView();
 
 			} else {
 
-				colorAttachment.attachment = this._swapChain.getCurrentTexture().createView();
+				colorAttachment.view = this._swapChain.getCurrentTexture().createView();
 				colorAttachment.resolveTarget = undefined;
 
 			}
 
-			depthStencilAttachment.attachment = this._depthBuffer.createView();
+			depthStencilAttachment.view = this._depthBuffer.createView();
 
 		}
 

+ 1 - 1
examples/jsm/renderers/webgpu/WebGPUTextureUtils.js

@@ -111,7 +111,7 @@ class WebGPUTextureUtils {
 
 			const passEncoder = commandEncoder.beginRenderPass( {
 				colorAttachments: [ {
-					attachment: dstView,
+					view: dstView,
 					loadValue: [ 0, 0, 0, 0 ],
 				} ],
 			} );