소스 검색

Fix typo in webgpu/constants.js (#22795)

Takahiro 3 년 전
부모
커밋
e683d1910b
2개의 변경된 파일6개의 추가작업 그리고 6개의 파일을 삭제
  1. 4 4
      examples/jsm/renderers/webgpu/WebGPURenderer.js
  2. 2 2
      examples/jsm/renderers/webgpu/constants.js

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

@@ -168,7 +168,7 @@ class WebGPURenderer {
 
 		const swapChain = context.configure( {
 			device: device,
-			format: GPUTextureFormat.BRGA8Unorm // this is the only valid swap chain format right now (r121)
+			format: GPUTextureFormat.BGRA8Unorm // this is the only valid swap chain format right now (r121)
 		} );
 
 		this._adapter = adapter;
@@ -489,7 +489,7 @@ class WebGPURenderer {
 
 		} else {
 
-			format = GPUTextureFormat.BRGA8Unorm; // default swap chain format
+			format = GPUTextureFormat.BGRA8Unorm; // default swap chain format
 
 		}
 
@@ -896,7 +896,7 @@ class WebGPURenderer {
 					depthOrArrayLayers: 1
 				},
 				sampleCount: this._parameters.sampleCount,
-				format: GPUTextureFormat.BRGA8Unorm,
+				format: GPUTextureFormat.BGRA8Unorm,
 				usage: GPUTextureUsage.RENDER_ATTACHMENT
 			} );
 
@@ -935,7 +935,7 @@ class WebGPURenderer {
 
 			this._context.configure( {
 				device: device,
-				format: GPUTextureFormat.BRGA8Unorm,
+				format: GPUTextureFormat.BGRA8Unorm,
 				usage: GPUTextureUsage.RENDER_ATTACHMENT,
 				size: {
 					width: Math.floor( this._width * this._pixelRatio ),

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

@@ -107,8 +107,8 @@ export const GPUTextureFormat = {
 	RGBA8Snorm: 'rgba8snorm',
 	RGBA8Uint: 'rgba8uint',
 	RGBA8Sint: 'rgba8sint',
-	BRGA8Unorm: 'bgra8unorm',
-	BRGA8UnormSRGB: 'bgra8unorm-srgb',
+	BGRA8Unorm: 'bgra8unorm',
+	BGRA8UnormSRGB: 'bgra8unorm-srgb',
 	// Packed 32-bit formats
 	RGB9E5UFloat: 'rgb9e5ufloat',
 	RGB10A2Unorm: 'rgb10a2unorm',