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

WebGPURenderer: Fix depth/stencil format out-of-sync bug. (#32731)

Michael Herzog 3 месяцев назад
Родитель
Сommit
3fddc5cec7
1 измененных файлов с 10 добавлено и 6 удалено
  1. 10 6
      src/renderers/webgpu/utils/WebGPUUtils.js

+ 10 - 6
src/renderers/webgpu/utils/WebGPUUtils.js

@@ -34,17 +34,21 @@ class WebGPUUtils {
 
 		let format;
 
-		if ( renderContext.depthTexture !== null ) {
+		if ( renderContext.depth ) {
 
-			format = this.getTextureFormatGPU( renderContext.depthTexture );
+			if ( renderContext.depthTexture !== null ) {
 
-		} else if ( renderContext.depth && renderContext.stencil ) {
+				format = this.getTextureFormatGPU( renderContext.depthTexture );
 
-			format = GPUTextureFormat.Depth24PlusStencil8;
+			} else if ( renderContext.stencil ) {
 
-		} else if ( renderContext.depth ) {
+				format = GPUTextureFormat.Depth24PlusStencil8;
 
-			format = GPUTextureFormat.Depth24Plus;
+			} else {
+
+				format = GPUTextureFormat.Depth24Plus;
+
+			}
 
 		}
 

粤ICP备19079148号