瀏覽代碼

WebGPURenderer: Set label to WebGPU textures (#25785)

Takahiro 2 年之前
父節點
當前提交
435bcc6386
共有 1 個文件被更改,包括 4 次插入0 次删除
  1. 4 0
      examples/jsm/renderers/webgpu/WebGPUTextures.js

+ 4 - 0
examples/jsm/renderers/webgpu/WebGPUTextures.js

@@ -239,8 +239,10 @@ class WebGPUTextures {
 			const width = renderTarget.width;
 			const width = renderTarget.width;
 			const height = renderTarget.height;
 			const height = renderTarget.height;
 			const colorTextureFormat = this._getFormat( renderTarget.texture );
 			const colorTextureFormat = this._getFormat( renderTarget.texture );
+			const label = renderTarget.texture.name ? '_' + renderTarget.texture.name : '';
 
 
 			const colorTextureGPU = device.createTexture( {
 			const colorTextureGPU = device.createTexture( {
+				label: 'renderTarget' + label,
 				size: {
 				size: {
 					width: width,
 					width: width,
 					height: height,
 					height: height,
@@ -269,6 +271,7 @@ class WebGPUTextures {
 				const depthTextureFormat = renderTarget.depthTexture !== null ? this._getFormat( renderTarget.depthTexture ) : GPUTextureFormat.Depth24PlusStencil8;
 				const depthTextureFormat = renderTarget.depthTexture !== null ? this._getFormat( renderTarget.depthTexture ) : GPUTextureFormat.Depth24PlusStencil8;
 
 
 				const depthTextureGPU = device.createTexture( {
 				const depthTextureGPU = device.createTexture( {
+					label: 'renderTarget' + label + '_depthBuffer',
 					size: {
 					size: {
 						width: width,
 						width: width,
 						height: height,
 						height: height,
@@ -389,6 +392,7 @@ class WebGPUTextures {
 		}
 		}
 
 
 		const textureGPUDescriptor = {
 		const textureGPUDescriptor = {
+			label: texture.name,
 			size: {
 			size: {
 				width: width,
 				width: width,
 				height: height,
 				height: height,