Просмотр исходного кода

WebGPURenderer: Set label to WebGPU textures (#25785)

Takahiro 2 лет назад
Родитель
Сommit
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 height = renderTarget.height;
 			const colorTextureFormat = this._getFormat( renderTarget.texture );
+			const label = renderTarget.texture.name ? '_' + renderTarget.texture.name : '';
 
 			const colorTextureGPU = device.createTexture( {
+				label: 'renderTarget' + label,
 				size: {
 					width: width,
 					height: height,
@@ -269,6 +271,7 @@ class WebGPUTextures {
 				const depthTextureFormat = renderTarget.depthTexture !== null ? this._getFormat( renderTarget.depthTexture ) : GPUTextureFormat.Depth24PlusStencil8;
 
 				const depthTextureGPU = device.createTexture( {
+					label: 'renderTarget' + label + '_depthBuffer',
 					size: {
 						width: width,
 						height: height,
@@ -389,6 +392,7 @@ class WebGPUTextures {
 		}
 
 		const textureGPUDescriptor = {
+			label: texture.name,
 			size: {
 				width: width,
 				height: height,